texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[7986] call \doublecolumnout in \balancecolumns if too much material


From: gavinsmith0123
Subject: [7986] call \doublecolumnout in \balancecolumns if too much material
Date: Thu, 16 Nov 2017 15:01:28 -0500 (EST)

Revision: 7986
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7986
Author:   gavin
Date:     2017-11-16 15:01:27 -0500 (Thu, 16 Nov 2017)
Log Message:
-----------
call \doublecolumnout in \balancecolumns if too much material

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/doc/texinfo.tex

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2017-11-16 17:14:18 UTC (rev 7985)
+++ trunk/ChangeLog     2017-11-16 20:01:27 UTC (rev 7986)
@@ -1,3 +1,21 @@
+2017-11-16  Gavin Smith  <address@hidden>
+
+       * doc/texinfo.tex (\balancecolumns): If it appears that we have
+       been called on to balance too much material for the final page 
+       of the double column material, output some of it using 
+       \doublecolumnout and leave remainder on current page.
+       Otherwise, two problems occurred with the output: first, that
+       the material on the last page of the index extended too low on 
+       the page (see "Final page of index hard to balance" case in
+       texinfo-tex-test.texi); and second, a blank page could occur 
+       before the final page of the index (report from Arnold Robbins) 
+       (this happened because of marks output in \savemarks and 
+       \restoremarks).
+       
+       (\enddoublecolumns): Only change the output routine back to the 
+       usual one and reset all the formatting variables if no extra 
+       material has been added to the current page.  Otherwise, repeat.
+
 2017-11-09  Gavin Smith  <address@hidden>
 
        * doc/texinfo.tex (\pagesizes): Add one inch to height and width 

Modified: trunk/doc/texinfo.tex
===================================================================
--- trunk/doc/texinfo.tex       2017-11-16 17:14:18 UTC (rev 7985)
+++ trunk/doc/texinfo.tex       2017-11-16 20:01:27 UTC (rev 7986)
@@ -3,7 +3,7 @@
 % Load plain if necessary, i.e., if running under initex.
 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
 %
-\def\texinfoversion{2017-11-09.18}
+\def\texinfoversion{2017-11-16.19}
 %
 % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
 % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
@@ -5969,24 +5969,30 @@
     % Split the last of the double-column material.
     \savemarks
     \balancecolumns
-    %
+  }%
+  \eject % call the \output just set
+  \if\ht\pagetotal=0pt
     % Having called \balancecolumns once, we do not
     % want to call it again.  Therefore, reset \output to its normal
     % definition right away.
     \global\output = {\onepageout{\pagecontents\PAGE}}%
-  }%
-  \eject
-  \endgroup % started in \begindoublecolumns
-  \restoremarks
-  % Leave the double-column material on the current page, no automatic
-  % page break.
-  \box\balancedcolumns
-  %
-  % \pagegoal was set to the doubled \vsize above, since we restarted
-  % the current page.  We're now back to normal single-column
-  % typesetting, so reset \pagegoal to the normal \vsize.
-  \global\vsize = \txipageheight %
-  \pagegoal = \txipageheight %
+    %
+    \endgroup % started in \begindoublecolumns
+    \restoremarks
+    % Leave the double-column material on the current page, no automatic
+    % page break.
+    \box\balancedcolumns
+    %
+    % \pagegoal was set to the doubled \vsize above, since we restarted
+    % the current page.  We're now back to normal single-column
+    % typesetting, so reset \pagegoal to the normal \vsize.
+    \global\vsize = \txipageheight %
+    \pagegoal = \txipageheight %
+  \else
+    % We had some left-over material.  This happens when \doublecolumnout
+    % was called in \balancecolumns.  Try again.
+    \expandafter\enddoublecolumns
+  \fi
 }
 \newbox\balancedcolumns
 \setbox\balancedcolumns=\vbox{shouldnt see this}%
@@ -6001,6 +6007,7 @@
   \ifdim\dimen@<5\baselineskip
     % Don't split a short final column in two.
     \setbox2=\vbox{}%
+    \global\setbox\balancedcolumns=\vbox{\pagesofar}%
   \else
     \divide\dimen@ by 2 % target to split to
     address@hidden = \dimen@
@@ -6016,15 +6023,15 @@
       \repeat
     }%
     % Now the left column is in box 1, and the right column in box 3.
+    %
     % Check whether the left column has come out higher than the page itself.  
     % (Note that we have doubled \vsize for the double columns, so
     % the actual height of the page is 0.5\vsize).
     \ifdim2\ht1>\vsize
-      % Just split the last of the double column material roughly in half.
-      \setbox2=\box0
-      \setbox0 = \vsplit2 to address@hidden
-      \setbox0=\vbox to address@hidden {\unvbox0\vfill}%
-      \setbox2=\vbox to address@hidden {\unvbox2\vfill}%
+      % It appears that we have been called upon to balance too much material.
+      % Output some of it with \doublecolumnout, leaving the rest on the page.
+      \setbox\PAGE=\box0
+      \doublecolumnout
     \else
       % Compare the heights of the two columns.
       \ifdim4\ht1>5\ht3
@@ -6037,10 +6044,10 @@
         \setbox2=\vbox to\ht1{\unvbox3\unskip}%
         \setbox0=\vbox to\ht1{\unvbox1\unskip}%
       \fi
+      \global\setbox\balancedcolumns=\vbox{\pagesofar}%
     \fi
   \fi
   %
-  \global\setbox\balancedcolumns=\vbox{\pagesofar}%
 }
 \catcode`\@ = \other
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]