1

I was given a template of a title page that uses minipage to position some text and logos. Unfortunately it throws Overfull \hbox warnings, that I can't get rid of.
I broke it down to the following MWE:

\documentclass{article}
\begin{document}
\parindent 0em
\LARGE\textbf{Long title of my thesis which will pro\-ba\-bly be a little bit more than one line}
\vspace{24pt}\\
by\\
My Name \\[1.5cm]
\begin{minipage}{0.4\textwidth}
    \begin{flushleft} \large
      \LARGE\textbf{A}\\
      \LARGE February
    \end{flushleft}
  \end{minipage}
  \begin{minipage}{0.6\textwidth}
    \begin{flushright}
      \LARGE\textbf{B}\\
      \LARGE March
    \end{flushright}
  \end{minipage}
\end{document}

I tried changing this using \sloppy and \fussy with no success. Also there is another overfull \hbox warning with my title. I tried getting rid of that one using hyphenation as shown in the MWE, but as you can see, I wasn't successfull here either.
Since I was given this template, I don't want to change the output significantly, but I don't want to keep getting this warning. Why is this snippet throwing the \hbox warning and how can I fix it?

6
  • Do you really have that piece of text before \begin{document}?
    – egreg
    Sep 10, 2019 at 15:59
  • @egreg sorry, I fixed it.
    – Max
    Sep 10, 2019 at 16:00
  • Add % after the first \end{minipage}.
    – egreg
    Sep 10, 2019 at 16:04
  • @egreg Interesting. It fixed the problem. What does that change?
    – Max
    Sep 10, 2019 at 16:06
  • 2
    @Max You're asking for a line consisting of 40% text, a space and 60% text: this is overfull. Where does the space come from? From the line break in the input, which produces a space; with % the endline is not seen.
    – egreg
    Sep 10, 2019 at 16:13

1 Answer 1

3

You can use \overfullrule=5pt to see where the overfull box is:

enter image description here

and the problem is that you have two minipages that sum \textwidth separated by 1 space (the new line at the end of the first). Just using a comment solve it:

\documentclass{article}
\overfullrule=5pt
\begin{document}
\parindent 0em
\LARGE\textbf{Long title of my thesis which will pro\-ba\-bly be a little bit more than one line}
\vspace{24pt}\\
by\\
My Name \\[1.5cm]
\begin{minipage}{0.4\textwidth}
    \begin{flushleft} \large
      \LARGE\textbf{A}\\
      \LARGE February
    \end{flushleft}
  \end{minipage}% <---- HERE 
  \begin{minipage}{0.6\textwidth}
    \begin{flushright}
      \LARGE\textbf{B}\\
      \LARGE March
    \end{flushright}
  \end{minipage}
\end{document}
3
  • Great, thanks. Is there something for detection of underfull boxes, too? Because, even though your fix fully did the work on my MWE, in my actual document the lines before the minipage are throwing an underfull hbox warning.
    – Max
    Sep 10, 2019 at 16:11
  • Much more difficult. Look at tex.stackexchange.com/questions/21139/…
    – Rmano
    Sep 10, 2019 at 16:14
  • alright, I'll look for it myself, thanks for the link.
    – Max
    Sep 10, 2019 at 16:15

You must log in to answer this question.

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