|
From: | Gavin Smith |
Subject: | Column balancing for short indices |
Date: | Fri, 21 Aug 2015 23:07:26 +0100 |
I noticed a disparity in a short index with only two initials in it. See the attached doub2.texi and doub2.dvi. See how the "bbb" line is slightly below the "aaa" line. I narrowed down the TeX control sequences that were causing input like this. See doub.texi and doub.dvi attachments. Through adding some \showbox control sequences to \balancecolumns, I was able to see how the output was being split: Index: texinfo.tex =================================================================== --- texinfo.tex (revision 6559) +++ texinfo.tex (working copy) @@ -5336,6 +5336,7 @@ %debug\message{final 2-column material height=\the\ht0, address@hidden \splittopskip = \topskip % Loop until we get a decent breakpoint. + \showbox0 {% \vbadness = 10000 \loop @@ -5345,7 +5346,9 @@ \global\advance\dimen@ by 1pt \repeat }% - %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% + \showbox1 + \showbox3 + %\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% \setbox0=\vbox address@hidden \setbox2=\vbox address@hidden % Box 0 is before splitting, split into boxes 1 and 3. See doub.log. I believe the problem is that the final element of the vbox for the first column is @glue 0.0 plus 39.59999 This glue can easily stretch, so the glue between the initial A and the "aaa" entry doesn't stretch as much. This glue results from the second line in the following, from \initial: % We like breaks before the index initials, so insert a bonus. \nobreak \vskip 0pt plus 3\baselineskip \penalty 0 \vskip 0pt plus -3\baselineskip There's no such glue in the second column, which could explain the difference in vertical spacing. I found these lines were introduced in this change: http://svn.savannah.gnu.org/viewvc?view=rev&root=texinfo&revision=1373 --- trunk/texinfo/doc/texinfo.tex 2004/08/20 13:12:54 1368 +++ trunk/texinfo/doc/texinfo.tex 2004/08/27 13:39:25 1373 @@ -3533,7 +3533,10 @@ \removelastskip % % We like breaks before the index initials, so insert a bonus. - \penalty -300 + \nobreak + \vskip 0pt plus 3\baselineskip + \penalty 0 + \vskip 0pt plus -3\baselineskip % % Typeset the initial. Making this add up to a whole number of % baselineskips increases the chance of the dots lining up from column @@ -3543,10 +3546,9 @@ % No shrink because it confuses \balancecolumns. \vskip 1.67\baselineskip plus .5\baselineskip \leftline{\secbf #1}% - \vskip .33\baselineskip plus .1\baselineskip - % % Do our best not to break after the initial. \nobreak + \vskip .33\baselineskip plus .1\baselineskip }} % \entry typesets a paragraph consisting of the text (#1), dot leaders, and on 2004-08-27 * doc/texinfo.tex (\initial): when breaking the column before the initial, allow for some space at the bottom of the column, so the baselineskip is preserved (more or less). Don't give negative penalty, it encouradges creating of underfull columns with stretched baselineskip. At the end, the \nobreak should be before \vskip, not after it. Changing it back to \penalty -300 produces better output, at least for this example. But I don't understand why the change was made in the first place.
doub2.dvi
Description: TeX dvi file
doub2.texi
Description: TeXInfo document
doub.dvi
Description: TeX dvi file
doub.texi
Description: TeXInfo document
doub.log
Description: Text Data
[Prev in Thread] | Current Thread | [Next in Thread] |