latex3 / latex2e

The LaTeX2e kernel
https://www.latex-project.org/
LaTeX Project Public License v1.3c
1.9k stars 263 forks source link

`multicol` documentation: dubious statements about `\sloppy` #1385

Open user227621 opened 3 months ago

user227621 commented 3 months ago

The multicol documentation states the following (from multicol.dtx):

% Paragraphing in \TeX{} is controlled by several parameters. One of
% the most important is called |\tolerance|: this controls the
% allowed `looseness' (i.e.\ the amount of blank space between words).
% Its default value is 200 (the \LaTeX{} |\fussy|) which is too
% small for narrow columns. On the other hand the |\sloppy|
% declaration (which sets |\tolerance| to $10000=\infty$) is too
% large, allowing really bad spacing.\footnote{Look at the next
% paragraph, it was set with the \cs{sloppy} declaration.}
%
% \begin{sloppypar}
% \DescribeMacro\multicoltolerance \DescribeMacro\multicolpretolerance
%  We therefore use a |\multicoltolerance| parameter for the
% |\tolerance| value inside the \mc{} environment.  Its default value
% is 9999 which is less than infinity but `bad' enough for most
% paragraphs in a multicolumn environment. Changing its value should
% be done outside the \mc{} environment.  Since |\tolerance| is set
% to |\multicoltolerance| at the beginning of every \textsf{multicols}
% environment one can locally overwrite this default by assigning
% \verb*+\tolerance = +\meta{desired value}. There also exists a
% |\multicolpretolerance| parameter holding the value for
% |\pretolerance| within a \mc{} environment. Both parameters are
% usually used only by package designers.
% \end{sloppypar}

\sloppy does not set \tolerance=10000, but \tolerance=9999 (was this different in very old LaTeX versions?), i. e. the same as \multicoltolerance. The statement On the other hand the |\sloppy| declaration (which sets |\tolerance| to $10000=\infty$) is too large, allowing really bad spacing is therefore not correct.

The following footnote suggests that the second paragraph, set with sloppypar, would look particularly bad. This is not the case; the two paragraphs to the left of it in the middle column look much worse. sloppypar does not change the \tolerance here (see above). (It does change, however, the value of \emergencystretch: \sloppy uses 3em=30pt, while multicol uses 4pt*⟨number of columns⟩=12pt. Re-typesetting the paragraph without sloppypar leads to different line breaks.)

Also, I wonder why the star form of \verb is used for \verb*+\tolerance = +\meta{desired value} in the second paragraph: The spaces around the = are not necessary, they could be omitted.

FrankMittelbach commented 3 months ago

Multicol is older than TeX3 and there was no \emergencystretch and yes LaTeX used 10000 back in the days. In LaTeX2e we changed that but that wasn't reflected in the multicol doc which is kind of layered and historic (and I never got around rewriting it).

As for using spaces around = signs in such cases: I liked and still like to do that as a sort of best practise and it is also a tiny bit faster if I recall correctly, because of the way the optional chars are handled in the scanner. So yes, they are optional but that doesn't mean I need or should change that statement.