For some tikepictures I use the default coordinate system.

Like the example below the coordinates (seem to) have a fixed default distance, such that the maximum y and xcoordinates is defined by the document size. This this example x is limited to about 11. Otherwise the tikzpicture exceeds the document bounds.

In the example the below, I get a Overfull \hbox (5.444pt too wide) in paragraph at lines 17--18 warning.

How much should I care about an Overfull \hbox warning?

Is there a better way to prevent an overful hbox other than adjusting the coordinates until everything fits?


  \begin{tikzpicture}[background rectangle/.style={fill=olive!45}, show background rectangle]

    \draw (0,0) -- (12,0);

  • Well, you can use the page parameters to avoid the problem. If you use \draw (0,0) -- (\textwidth-2ex,0); there won't be a problem. -2ex because /tikz/inner frame xsep is (initially) 1ex. Other than that you could use adjustbox to shrink the picture, or figure out by how much it overshoots and then shrink it. (This can be automatized.) – Schrödinger's cat Sep 29 at 20:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.