0

I am new to LaTeX and I am having trouble with a document.

I am working off a CV template on ShareLaTeX.

I understand that overfull and underfull in hbox is a problem having to do with text being too long or too short to spread horizontally.

As you can see in the picture [top right, education section], there is space on the rendered document for the text to simply break and continue on the second line, but it just runs off the screen.

The environment twenty for lists with descriptions is defined as follows:

\newenvironment{twenty}{%
    \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ll}
}{%
    \end{tabular*}
}

% \newcommand{\twentyitem}[5]{%
%   #1&\parbox[t]{0.83\textwidth}{%
%       \textbf{#2}% 
%       \hfill%
%       {\footnotesize#3}\\%
%         \ifblank{#4}{}{#4 \\}
%       #5\vspace{\parsep}%
%   }\\
% }

\newcommand{\twentyitem}[6]{%
    #1&\parbox[t]{0.83\textwidth}{%
        \textbf{#3}% 
        \hfill%
        {\footnotesize#4}%
        }\\%
    #2&\parbox[t]{0.83\textwidth}{%
        \ifblank{#5}{}{#5 \\}
        #6%
    }\\
}

Can someone please help? 473.5308pt seems like a lot for the overfull but the line simply won't break.

2
  • 2
    Please, add a minimal example that shows the issue. My impression is that you're trying to set the long item in a tabular cell marked as l.
    – egreg
    Aug 10, 2017 at 9:39
  • Have you tried to use \par to break a line, instead of `\`? Please, add a minimal example.
    – Andre
    Aug 16, 2017 at 18:37

1 Answer 1

2

TeX line-breaking algorithm is very sophisticated with many parameters which control the result. I'll do only rough simplification of it here in order to focus to your problem. TeX first tries to reach some aesthetic rules like not so very large spaces between words. These rules are set by default values of the parameters and they are somewhat rigid. If these rules cannot be reached then TeX resigns and makes overfull \hbox. And TeX does not distinguish between overfull by 2pt or by 400pt. It is only definitely bad result which is reported. And it is marked in typesetting output too: by black rectangle. This behaviour (black rectangle) is suppressed in LaTeX by setting the parameter \overullrule=0pt.

In your example, we cannot see the detail spelling of the word which is at the right edge of your typesetting area and which makes the problem (Economics?). But probably this word cannot be hyphenated (more about it is written in the log of TeX processing) and if it is moved to the next line then the spaces will be very large at the first line, so the aesthetic rules are exceeded: TeX decides to create overfull \hbox, so it is definitely bad result. User must intervene and solve this. If user is an author of the text he can find another words to express the same idea. If not then re-wording is impossible and user can set many of mentioned parameters to re-set the aesthetic rules (locally in one paragraph or globally in the whole document). First of all user must check if the word which makes the problem is hyphenable but TeX did not recognize this. If so then the hyphenation exception can be set (locally by \-, for example hy\-phen\-a\-tion) or globally by \hyphenation TeX primitive. Or user can set more soft aesthetic rules by setting another parameters. LaTeX provides the macro \sloppy for such settings. User can write simply \sloppy and he cannot understand the line-breaking algorithm and its parameters in detail.

Note that "underfull \hbox" is totally different sort of problem. User can set by parameters the "first aesthetic level" which can be exceeded and only this warning is reported and the result is more or less acceptable. The second aesthetic level (more weak) is set as critical: if it is exceeded then "overfull \hbox" is reported and the result is totally bad.

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.