1

I ran in to a underfull \hbox error in a proposal I am writing and am trying to understand if the error is in the caption or text. Also, it seems lipsum does not play nice with wrapfigure, but in my actual proposal the text and caption do not overlap.

Edit I see now that the underfull hbox is because the column of text is trying to write over the figure. Is there a better way to fix this besides \raggedright?

\documentclass[oneside,letterpaper,11pt]{article}
%\usepackage[square,numbers]{natbib}
\usepackage{longtable}
\usepackage{ulem}
\usepackage[top=1.0in, bottom=1.0in, left=1.0in, right=1.0in]{geometry}
\usepackage{multirow}
\usepackage{enumerate}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{lipsum}

\newenvironment{packed_enum}{
\begin{enumerate}
  \setlength{\itemsep}{6pt}
  \setlength{\parskip}{0pt}
  \setlength{\parsep}{0pt}
}{\end{enumerate}}

\begin{document}
\section*{Introduction}

\begin{wrapfigure}{R}{0.50\textwidth}
\begin{center}
\vspace{-15pt}
\includegraphics[width=0.49\textwidth]{example-image.png}
\end{center}
\vspace{-20pt}
\caption{\protect\raggedright\textit{(This diagram is taken from Ji, et al.) The degree of transparency $\eta = N_{left}/N_{total}$ vs normalized vector potential $a_0$ for three densities with radiation reaction ignored (black solid) and included (red solid); $n_0 = 10n_c$ (a); $n_0 = 15n_c$ (b); $n_0 = 20n_c$ (c).}}
\vspace{-5pt}
\label{Figure_transparency_vs_amplitude}
\end{wrapfigure}
\lipsum[1-3]
\newpage
%************************************************************
%\section*{References}
%\bibliographystyle{unsrt}
%\bibliography{EECS-598-Project}
\end{document}
| improve this question | | | | |
  • the underful box doesn't mean the text is over-writing the column on to the figure, that would be an over-full line. It just refers to a line where it has had to over-stretch the inter-word space in order to justify the margins. the warning message shows you the line so you can look visually if you find the white space excessive. – David Carlisle Nov 18 '19 at 23:06
2

There are two underfull lines reported:

Underfull \hbox (badness 1048) in paragraph at lines 34--34
\OT1/cmr/m/n/10.95 erat ac, adip-isc-ing vi-tae, fe-lis. Cur-abitur

Underfull \hbox (badness 1005) in paragraph at lines 34--34
\OT1/cmr/m/n/10.95 dic-tum gravida mau-ris. Nam arcu libero,

Now in the scheme of things, 1048 really isn't that bad. By default LaTeX accepts anything under 1000 without warning, and badness is in the range up to 10,000 so just being 48 over a fairly arbitrary limit of 1000 is not too much to worry about.

If this was normal text you could adjust the wording on that line, or add a thin space after the , or . just to help it out, but here with lipsum text you can't do that.

Hopefully your real document isn't lipsum, but it might be text that is unchangeable for other reasons.

If you change the document to

\hbadness=1050
\lipsum[1-3]
\newpage

Then the warnings go away (without changing the output) you might want to set it back to 1000 after this problematic bit of text.

| improve this answer | | | | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.