1

Is there a way to fix a main.tex:11: Underfull \hbox (badness 2409) (page 1) for the following main.tex file?

\documentclass[12pt]{article}
\usepackage{lipsum}
\begin{document}
\begin{figure}[!t]
  \centering
  \begin{minipage}[t]{.48\textwidth}
    \centering
    \caption[Top1 \emph{vs.}\ network]{
      \textbf{Top1 \emph{vs.}\ network.}
      \lipsum[1]
    }
    \label{fig:top1_vs_net}
  \end{minipage}\hfill
  \begin{minipage}[t]{.48\textwidth}
    \centering
    \caption[Top1 \emph{vs.}\ operations, size $\propto$ parameters]{
      \textbf{Top1 \emph{vs.}\ operations, size $\propto$ parameters.}
      \lipsum[1]
    }
    \label{fig:top1_vs_ops}
  \end{minipage}
\end{figure}
\end{document}

LaTeX output

I believe the warning is associated to the caption "title" of Figure 1. Anyways, how does one debug this stuff?

3
  • 1
    you can see the text is underfull just looking at your image where the white space in the first line of the caption is over-stretched. Justified text in narrow captions is tricky, you could just ignore the warning, or tell tex not to complain about that level of badness or you could change the formatting of the caption to ragged right Commented Jun 22, 2017 at 19:20
  • 1
    It is recommended to use raggedright option while typesetting in narrow columns. Also, don't forget to allow a lot of hyphenation to get not waved, but ragged edge. Commented Jun 22, 2017 at 19:30
  • Oh... what about adding a \newline for some specific lines? Or this highly not advisable, since it is going to create a mess, if I'm going to change layout?
    – Atcold
    Commented Jun 22, 2017 at 20:29

1 Answer 1

1

This is due to the small line width for captions. You can either help LaTeX to hyphenate words, or add to your preamble:

\usepackage{caption} 
\captionsetup[figure]{justification=RaggedRight}

so the caption lines will be ragged right when LaTeX can't find a correct break point:

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .