Loading the microtype
package should reduce the number of ("underfull hbox") warnings. Another (or an additional) option is to set the index \RaggedRight
(still allowing hyphenation) using my idxlayout
package (which internally uses ragged2e
).
\documentclass{article}
\usepackage{microtype}
\usepackage{makeidx}
\makeindex
\usepackage[justific=RaggedRight]{idxlayout}
\usepackage{lipsum}
\begin{document}
Some text.\index{\lipsum*[1]}
\printindex
\end{document}

EDIT: In your added example, the actual problem is an "overfull hbox" not prevented by microtype
. Using \RaggedRight
is still an option; as an alternative, you may set \emergencystretch
to a positive value (say, 1em) for the index.
\documentclass[draft]{scrbook}
\usepackage{microtype}
\usepackage{makeidx}
\makeindex
\begin{document}
\emph{automata learning}\index{Automata learning|see{Algorithmic learning}}
\begingroup
\emergencystretch=1em
\printindex
\endgroup
\end{document}
The following typesets with no warnings even if I comment out the block disabling warnings
%\hbadness=\maxdimen
%\vbadness=\maxdimen
%\vfuzz=30pt
%\hfuzz=30pt
In a column with a fixed with p{zz}
theer is no point in having a multicolumn{1}{p{yy}}` entry, if yy is less than xx it just forces the lines to break short and if it is more than zz then it forces the column to be wider, leaving the lines in every other entry breaking short. Also in columns specified to be less than an inch you want ragged setting.
\documentclass[
12pt,
a4paper,
twoside,
headinclude,
headsepline,
BCOR12mm,
DIV14,
parskip=half,
bibliography=totoc,
listof=totoc,
numbers=noenddot,
captions=tableheading,
appendixprefix,
abstracton,
pdftex
]{scrreprt}
%Testing to get rid of bad box warnings
%\hbadness=\maxdimen
%\vbadness=\maxdimen
%\vfuzz=30pt
%\hfuzz=30pt
\usepackage{pdflscape}
\usepackage{longtable, colortbl}
\usepackage{multicol, multirow}
\usepackage{tabularx}
\usepackage{array}
\usepackage{ragged2e}
\begin{document}
\begin{landscape}
% Change the footnote style to lowercase letters and ignore badness warnings
\renewcommand{\thefootnote}{\alph{footnote}}
\scriptsize
\begin{center}
X\dotfill X
\begin{longtable}{
>{\RaggedRight\arraybackslash}p{.7in}
>{\RaggedRight\arraybackslash}p{.7in}
>{\RaggedRight\arraybackslash}p{.7in}
>{\RaggedRight\arraybackslash}p{0.7in}
>{\RaggedRight\arraybackslash}p{0.5in}
>{\RaggedRight\arraybackslash}p{0.3in}
>{\RaggedRight\arraybackslash}p{0.7in}
>{\RaggedRight\arraybackslash}p{.7in}
>{\RaggedRight\arraybackslash}p{1in}
>{\RaggedRight\arraybackslash}p{1in}}
\caption[Table title]{Table title} \label{tab:market} \\
\hline \hline \\[-2ex]
\multicolumn{1}{c}{One} &
\multicolumn{1}{c}{Two} &
\multicolumn{1}{c}{Three} &
\multicolumn{1}{c}{Four$^a$} &
Five (some words)$^b$ &
\multicolumn{1}{c}{Six$^c$} &
\hspace*{0pt}Seven\-longer\-word &
Eight (some words)$^d$ &
\multicolumn{1}{c}{Nine} &
\multicolumn{1}{c}{Ten} \\[0.5ex] \hline \\[-1.8ex]
\endfirsthead
\multicolumn{10}{c}{{\tablename} \thetable{} -- continued} \\[0.5ex]
\hline \hline \\[-2ex]
\multicolumn{1}{c}{One} &
\multicolumn{1}{c}{Two} &
\multicolumn{1}{c}{Three} &
\multicolumn{1}{c}{Four$^a$} &
Five (some words)$^b$ &
\multicolumn{1}{c}{Six$^c$} &
\hspace*{0pt}Seven\-longer\-word &
Eight (some words)$^d$ &
\multicolumn{1}{c}{Nine} &
\multicolumn{1}{c}{Ten} \\[0.5ex] \hline \\[-1.8ex]
\endhead
\multicolumn{10}{l}{{See next page\ldots}} \\
\endfoot
\\[-1.8ex] \hline \hline
\endlastfoot
%Data starts here:
One (some words) & Two (some words) & Three (some words) & Four & Five & Six & Seven & Eight & Nine: Here comes a short text & Ten: Here comes a short text \\
One (some words) & Two (some words) & Three (some words) & Four & Five & Six & Seven & Eight & Nine: Here comes a short text & Ten: Here comes a short text \\
One (some words) & Two (some words) & Three (some words) & Four & Five & Six & Seven & Eight & Nine: Here comes a short text & Ten: Here comes a short text \\
%And a lot more data...
\end{longtable}
\end{center}
% footnote a:
\footnotetext[1]{Footnote one}
% footnote b:
\footnotetext[2]{Footnote two}
% footnote c:
\footnotetext[3]{Footnote three}
% footnote d:
\footnotetext[4]{Footnote four}
\normalsize
% Reset the footnotes and badness
\renewcommand{\thefootnote}{\arabic{footnote}}
\end{landscape}
\end{document}
Best Answer
It is worth noting that TeX doesn't make the value judgements here.
The user, or more likely, the class file on behalf of the user, has set constraints on the amount by which boxes may overflow, the amount of stretching allowed on short pages etc. TeX only warns if these user-set constraints are exceeded.
So if you are setting difficult material with lots of big unbreakable chunks, that means that the constraints are probably wrong. (They were designed mostly for copy that is mostly text that can be hyphenated and with enough interword stretch to get tight fitting boxes.)
Rather than TeX trying to meet un-achievable constraints and then complaining about failing to meet them, it is better to modify (relax) the constraints. But before doing that you should make sure that they really are un-achievable and it is not just user error preventing tex from finding a good layout.
Some general notes added as requested:
Settings that only affect warning messages.
There are several setting that only affect the messages that TeX sends out. For example if you know that some boxes will be overfull by 2pt (and you don't mind this) but you want to be warned for a box that is 1cm too full then set
this will make no difference to the typesetting, but will suppress warnings for boxes that are only slightly overfull.
is the same thing for vertical boxes.
Similar are
\hbadness
andvbadness
which are a measure of how bad a box is, typically how much white space has had to be stretched. the exact number is not usually that relevant but 0 is good and 10000 is infinitely bad (TeX's badness calculation arbitrarily forces any very bad boxes to this amount).The parameter
\tolerance
is what tells Tex how much stretching should be allowed. TeX tries to line-break a paragraph in such a way as to keep the badness below the specified tolerance.Good typographic quality would indicate that you shouldn't ignore (or turn off) these warnings, However sometimes it makes sense. The PDF version of the MathML recommendation for example is set automatically by LaTeX from sources primarily designed for the normative HTML version. Because it has many one or two line paragraphs and many indented tables and examples, the right hand margin is very uneven anyway and so allowing the occasional overlarge example to protrude isn't so bad, it is set with
Settings that don't affect the typesetting of good boxes
TeX3 introduced a parameter
\emergencystretch
which allows extra stretch to be more uniformly added to a paragraph if the default stretching does not produce a good break. Setting this to a non zero value can sometimes help.Settings that do affect the typesetting.
LaTeX has a command
\sloppy
that sets up looser typesettingThe setting of tolerance makes it rather more sloppy than is perhaps desirable, and it is probably worth experimenting with just setting
\emergencystretch
.The default fussy settings used by LaTeX are
For vertical page breaking, if you are getting underful boxes in the output routine you may prefer
\raggedbottom
rather than\flushbottom
as this adds stretchable space at the end of each page so no page will be underful (but short pages will be silently accepted). It is possible of course to have something between these two extremes, that adds glue that only extends a finite amount rather than fill glue.The above are the main global settings however every aspect of the document design affects this. In particular, if the space between display elements such as lists and displayed maths, and the space between paragraphs, is stretchy then it it is much easier for TeX fo find a "good" page break, however this means that there is no vertical alignment between lines on different pages. especially for book designs using two page spreads, designers often aim to keep text on a grid where text always aligns on fixed positions. This usually means that you have to make all the vertical spaces much more rigid, which increases the chance of Tex giving warnings about over or under-full vboxes.