How to Fix “\oval, \circle, or \line Size Unavailable” in LaTeX
At a glance
- 1. Find the drawing command
Check the log for the line that uses \oval, \circle, \line, or an oval box.
- 2. Load pict2e
Add \usepackage{pict2e} to support a wider range of picture sizes and line slopes.
- 3. Compile and check
Recompile, then verify the shape fits inside the picture environment’s dimensions.
The warning \oval, \circle, or \line size unavailable comes from LaTeX’s traditional picture drawing system. Its built-in commands rely on a limited collection of line slopes and shape sizes, so a requested shape may not be available. The document will often still compile, but the affected drawing may be missing or may not look as intended.
For many documents, loading the pict2e package is the simplest fix. It extends the picture commands so they can draw a wider range of sizes and line slopes.
Try pict2e
Add this to the preamble:
\usepackage{pict2e}
Here is a complete example using an oval, a circle, and a line with a slope that the traditional picture commands may not support:
\documentclass{article}
\usepackage{pict2e}
\setlength{\unitlength}{1mm}
\begin{document}
\begin{picture}(100,30)
\put(30,15){\oval(40,20)}
\put(70,15){\circle{10}}
\put(80,5){\line(1,7){2}}
\end{picture}
\end{document}
The picture dimensions and the coordinates are measured in units of \unitlength, set here to 1 mm. The oval is centered at (30,15) and measures 40 mm by 20 mm. The circle is centered at (70,15) with a 10 mm diameter. The line starts at (80,5) and rises as it moves right.
Why the warning appears
The original picture commands are not general-purpose vector drawing tools. In the standard system, only certain line slopes and certain circle or oval sizes are available. If a command asks for an unsupported value, LaTeX reports the warning rather than necessarily stopping the compilation.
For example, \line(1,7){2} asks for a slope of 7, which is not available with the traditional line fonts. Likewise, a circle with a requested diameter may not match a size supported by those fonts. The exact result depends on the command and the LaTeX setup.
If the warning comes from fancybox
The fancybox package provides framed-box commands, including \ovalbox. If the log points to a line containing \ovalbox rather than a direct \oval, inspect that command too: the warning may be triggered by how the rounded box is drawn. Try loading pict2e, update the relevant packages if they are old, or use a different box style. For a simple square-cornered frame, LaTeX’s \fbox{...} is a straightforward alternative.
If you need more control over colors, rounded corners, line widths, or positioning, consider drawing the shape with TikZ instead of relying on the traditional picture commands.
Common mistakes
- Treating the warning as a fatal error. It is a warning, so the document may produce a PDF. Still, inspect the output to confirm that the shape is present and correct.
- Changing only the requested dimensions. A different size might happen to be supported, but it does not expand the drawing system’s capabilities.
pict2eor TikZ is usually a better fix when you need arbitrary dimensions or slopes. - Assuming the color package caused it. Color commands can affect a drawing’s appearance, but this warning concerns the requested picture shape or line. Check the log location to identify which command triggered it.
- Forgetting the picture boundaries. A shape can be supported but extend outside the declared
picturedimensions. Increase those dimensions or adjust the coordinates if part of the drawing is clipped or overlaps nearby material.
References
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.