overfull boxes; was: Re: [OS X TeX] Suggestion for TeXShop

Roussanka Loukanova rloukano at stp.lingfil.uu.se
Tue Feb 27 20:43:08 CET 2007


On Tue, 27 Feb 2007, Bruno Voisin wrote:

...
> You may try using \linewidth instead of \textwidth. \linewidth is originally 
> \textwidth in single-column mode and \columnwidth in multi-column mode, and 
> then it is reduced in list-based environments (such as itemize, quote, etc.) 
> by \leftmargin and \rightmargin so as to adjust to list level (for imbricated 
> lists).

The trick \linewidth did excellent job: I've just fixed various overfull 
boxes in a beamer file with it. For example, by knowing that the size of 
the beamer pages is 12cm (or 12.5cm?), I used (the coefficient 0<k<=1 in
k\linewidth vary depending on the context):

\begin{frame}
\begin{columns}
   \begin{column}[T]{7cm}
     \includegraphics[width=0.65\linewidth]{Picture.jpg}
   \end{column}
   \begin{column}[T]{5cm}
Some text appropriately formatted and, \\
possibly, scaled down.
   \end{column}
\end{columns}
\end{frame}

Roussanka

>
> You may also want to look for trailing spaces and spurious line breaks (try 
> to comment them in the input text), yielding unwanted horizontal spaces in 
> the output.
>
> Other than that, I'm not sure space is added on the left and right of the 
> images. Except maybe:
>
> - In case you put \fbox around the image, to draw a frame around it. In this 
> case a space of \fboxsep is added between the frame and its content. Just 
> \setlength{\fboxsep}{0pt}.
>
> - In case you include several images within a tabular environment, just make 
> sure to remove the spaces on the left and right of the environment by using 
> the @{} coumn specifier, as in \begin{tabular}{@{}c@{\quad}c@{}}.
>
> - In case you put the image at the start of a paragraph. Make sure to use 
> \noindent, or \setlength{\parindent}{0pt}.
>
> For example, to verify you're catching all possibly unwanted spaces, imagine 
> you've got a graphics logo.pdf and try:
>
> \documentclass[draft]{article}
> \usepackage{graphicx}
> \setlength{\parindent}{0pt}
> \begin{document}
> \hrule
> \smallskip
> \newlength{\figwidth}
> \setlength{\figwidth}{\linewidth}
> \addtolength{\figwidth}{-1em}
> \divide\figwidth by2
> \begin{tabular}{@{}c@{\quad}c@{}}
> \includegraphics[width=\figwidth]{logo} &
> \includegraphics[width=\figwidth]{logo} \\
> \includegraphics[width=\figwidth]{logo} &
> \includegraphics[width=\figwidth]{logo}
> \end{tabular}
> \par
> \smallskip
> \hrule
> \end{document}
>
> In this case the width of each figure is set to be (\linewidth-1em)/2 (1em 
> being the width of \quad). The above yields no overfull \hbox on my setup.
>
> Finally, to catch all overfull \hboxes without referring to the log, you may 
> restore plain TeX's default which is to highlight such overfull boxes with 
> big black squares. Two possibilities:
>
> - Use the [draft] option. The figures won't be shown (a rectangle will be 
> drawn instead, with the name of the figure file inside), and overfull \hboxes 
> will be shown.
>
> - Redefine \overfullrule as in \setlength{\overfullrule}{5pt}.
>
> Hope this helps,
>
> Bruno Voisin
>
>
> ------------------------- Helpful Info -------------------------
> Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
> TeX FAQ: http://www.tex.ac.uk/faq
> List Archive: http://tug.org/pipermail/macostex-archives/
> List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/

------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/





More information about the macostex-archives mailing list