1

This question already has an answer here:

How can I make the minipage/framebox page justified, so it stop the badness underfull warnings?

enter image description here

The warnings are:

Bad Boxes:

D:\test2.tex:23: Underfull \hbox (badness 10000) in paragraph at lines 23--23[]\OT1/cmtt/m/n/10 Lembre-se: a ficha de identificao da obra elaborada
D:\test2.tex:23: Underfull \hbox (badness 10000) in paragraph at lines 23--23\OT1/cmtt/m/n/10 pelo autor deve constar no verso da folha de rosto
D:\test2.tex:23: Underfull \hbox (badness 10000) in paragraph at lines 23--23\OT1/cmtt/m/n/10 de teses e dissertaes de modo a possibilitar sua
D:\test2.tex:23: Underfull \hbox (badness 10000) in paragraph at lines 23--23\OT1/cmtt/m/n/10 representao precisa pelas informaes de autor, ttulo,

For the sample code:

\documentclass[10pt,openright,twoside,a5paper]{memoir}
\usepackage[showframe]{geometry}
\usepackage[brazil]{babel}

\begin{document}

\begin{center}

\hspace*{1cm}
{Catalogação na fonte pela Biblioteca Universitária da Universidade
Universitária da Universidade.}

\framebox[\textwidth]
{
    \begin{minipage}{\textwidth}

        \ttfamily

        Lembre-se: a ficha de identificação da obra elaborada pelo autor deve constar no
        verso da folha de rosto de teses e dissertações de modo a possibilitar sua
        representação precisa pelas informações de autor, título, local, data, número de
        folhas, assunto, etc.

    \end{minipage}
}

\end{center}

\end{document}

marked as duplicate by Skillmon, Stefan Pinnow, user, Mensch, Schweinebacke Aug 16 '17 at 13:59

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    LaTeX can't justify the contents of your minipage, because \ttfamily doesn't allow the spreadings necessary. Because of this, if you want to get rid of your badbox-warnings, insert a \raggedright after \ttfamily. – Skillmon Aug 16 '17 at 11:49
  • Inserting \raggedright does fixed the warning. But I would prefer an alternative to \ttfamily which allows the fully-justified text. – user Aug 16 '17 at 11:54
  • For a way to have correct justification with \ttfamily take a look here. – Skillmon Aug 16 '17 at 11:55
  • The text there is setup to be hyphenated. If the displayed example isn't hyphenated, it is because the algorithms of TeX determined that it is not necessary. The line allowing hyphenation in the linked answer is: \hyphenchar\font=`\-\relax – Skillmon Aug 16 '17 at 12:22
  • Sorry the above comment might be misleading. Not only this line is important (that's just the line allowing hyphenation), but the whole code block altering the \ttfamily macro. In particular, the other changes like \fontdimen4\font=.167em\relax and so on are important, too, because those allow the justification. And those changes have to be invoked after \ttfamily hence the usage of \origttfamily in the linked answer. – Skillmon Aug 16 '17 at 12:46