Jesteś w: Start / Przedsięwzięcia/Projects / TeX Pearls / 2005 Pearls / frank-mittelbach / bachotex2005-frank-mittelbach-pearl1.tex

bachotex2005-frank-mittelbach-pearl1.tex

TeX document icon bachotex2005-frank-mittelbach-pearl1.tex — TeX document, 1 KB (2040 bytes)

Zawartość pliku

%%% Frank Mittelbach: \looseness not so loose (LaTeX)

\begin{center}
\begin{minipage}{300pt}
\font\rm ecrm10 \rm
\begin{multicols}{2}

This paragraph was set twice in a two column multicols
environment. The first time it was set without any special
adjustments, the second time we used \texttt{-1} as the value for the
\texttt{\textbackslash looseness} parameter.  Can you explain why the
two paragraphs are differently broken into lines even though clearly
the use of the parameter \texttt{\textbackslash looseness} couldn't
shorten the paragraph at all?

\columnbreak

\looseness=-1
This paragraph was set twice in a two column multicols
environment. The first time it was set without any special
adjustments, the second time we used \texttt{-1} as the value for the
\texttt{\textbackslash looseness} parameter.  Can you explain why the
two paragraphs are differently broken into lines even though clearly
the use of the parameter \texttt{\textbackslash looseness} couldn't
shorten the paragraph at all?

\end{multicols}
\end{minipage}
\end{center}

\paragraph{Answer:} When \verb=\looseness= gets a non-zero value, \TeX{}
will always run through all paragraph passes (i.e., breaking without
hyphenation, with hyphenation and (if {\tt \string\emer\-gency\-stretch} is non-zero
as it is inside multicols) through the emergency-pass. But adding
\verb|\emergencystretch| to every line means that the line breaks chosen in
the first paragraph may fall in different fitting classes so that at
different places \verb|\adjdemerits| are charged, thus making the original
solution less attractive.

In fact the situation could even be worse: if a long paragraph can be
broken into lines by just using \verb|\pretolerance|, then a setting of
\verb|\looseness| to \verb|+1| might in fact result in a paragraph with one line
less---all that is required is that by breaking it using \verb|\tolerance|
we would get a default line count that would be 2 lines less than in
the case with \verb|\pretolerance| (a real life example is left to the
reader).