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?

Max
  • 438

1 Answers1

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}
Rmano
  • 40,848
  • 3
  • 64
  • 125
  • 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 '19 at 16:11
  • Much more difficult. Look at https://tex.stackexchange.com/questions/21139/how-to-visualize-the-underfull-box-in-final-output-pdf-files – Rmano Sep 10 '19 at 16:14
  • alright, I'll look for it myself, thanks for the link. – Max Sep 10 '19 at 16:15