texinfo-commits
[Top][All Lists]
Advanced

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

[6728] check length of entry correctly; reduce stretch into margin


From: Gavin D. Smith
Subject: [6728] check length of entry correctly; reduce stretch into margin
Date: Tue, 27 Oct 2015 10:17:15 +0000

Revision: 6728
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6728
Author:   gavin
Date:     2015-10-27 10:17:14 +0000 (Tue, 27 Oct 2015)
Log Message:
-----------
check length of entry correctly; reduce stretch into margin

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

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2015-10-26 15:01:55 UTC (rev 6727)
+++ trunk/ChangeLog     2015-10-27 10:17:14 UTC (rev 6728)
@@ -1,3 +1,10 @@
+2015-10-27  Gavin Smith  <address@hidden>
+
+       * doc/texinfo.tex (\entry): When deciding whether an entry will 
+       fit in a single line, don't include the left and right margins.  
+       Allow for \rightskip in arguments to \parshape.  Reduce 
+       allowable stretch into margin.  Formatting.
+
 2015-10-26  Gavin Smith  <address@hidden>
 
        * doc/texinfo.tex (\entry): Use a \vbox instead of a \vtop, for 

Modified: trunk/doc/texinfo.tex
===================================================================
--- trunk/doc/texinfo.tex       2015-10-26 15:01:55 UTC (rev 6727)
+++ trunk/doc/texinfo.tex       2015-10-27 10:17:14 UTC (rev 6728)
@@ -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{2015-10-26.15}
+\def\texinfoversion{2015-10-27.10}
 %
 % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
 % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
@@ -5262,54 +5262,64 @@
     \fi
     \egroup % end \boxA
     \ifdim\wd\boxB = 0pt
-    \global\setbox\entryindexbox=\box\boxA
+      \global\setbox\entryindexbox=\box\boxA
     \else
     \global\setbox\entryindexbox=\vbox\bgroup\noindent
-    % We want the text of the entries to be aligned to the left, and the
-    % page numbers to be aligned to the right.
-    %
-    \advance\leftskip by 0pt plus 1fil
-    \advance\leftskip by 0pt plus -1fill
-    \rightskip = 0pt plus -1fil
-    \advance\rightskip by 0pt plus 1fill
-    % Cause last line, which could consist of page numbers on their own if the 
-    % list of page numbers is long, to be aligned to the right.
-    \parfillskip=0pt plus -1fill
-    %
-    \hangindent=1em
-    %
-    \advance\rightskip by \entryrightmargin
-    % Determine how far we can stretch into the margin.
-    % This allows, e.g., "Appendix H  GNU Free Documentation License" to fit
-    % on one line.
-    \advance \parfillskip by 0pt minus .6\entryrightmargin
-    %
-    \ifdim\wd\boxA > \hsize % If the entry doesn't fit in one line
-    \ifdim\dimen@ > 0.9\hsize   % due to long index text
-      \dimen@ = 0.6\dimen@ % Try to split the text roughly evenly
+      % We want the text of the entries to be aligned to the left, and the
+      % page numbers to be aligned to the right.
+      %
+      \advance\leftskip by 0pt plus 1fil
+      \advance\leftskip by 0pt plus -1fill
+      \rightskip = 0pt plus -1fil
+      \advance\rightskip by 0pt plus 1fill
+      % Cause last line, which could consist of page numbers on their own
+      % if the list of page numbers is long, to be aligned to the right.
+      \parfillskip=0pt plus -1fill
+      %
+      \hangindent=1em
+      %
+      \advance\rightskip by \entryrightmargin
+      % Determine how far we can stretch into the margin.
+      % This allows, e.g., "Appendix H  GNU Free Documentation License" to
+      % fit on one line in @letterpaper format.
+      \ifdim\entryrightmargin>2.1em
+        address@hidden
+      \else
+        address@hidden
+      \fi
+      \advance \parfillskip by 0pt minus address@hidden
+      %
       address@hidden = \hsize
-      \advance address@hidden by -1em
-      \ifnum\dimen@>address@hidden
-        % If the entry is too long, use the whole line
-        \dimen@ = address@hidden
-      \fi
-      \advance\leftskip by 0pt plus 1fill % ragged right
-      \parshape = 2 0pt \dimen@ 1em address@hidden
-      % Ideally we'd add a finite glue at the end of the first line only, but
-      % TeX doesn't seem to provide a way to do such a thing.
-    \fi\fi
-    \unhbox\boxA
-    %
-    % Do not prefer a separate line ending with a hyphen to fewer lines.
-    \finalhyphendemerits = 0
-    %
-    % Word spacing - no stretch
-    \spaceskip=\fontdimen2\font minus \fontdimen4\font
-    %
-    \linepenalty=1000  % Discourage line breaks.
-    \hyphenpenalty=5000  % Discourage hyphenation.
-    %
-    \par % format the paragraph
+      address@hidden by -1\leftskip
+      address@hidden by -1\entryrightmargin
+      address@hidden by address@hidden
+      \ifdim\wd\boxA > address@hidden % If the entry doesn't fit in one line
+      \ifdim\dimen@ > address@hidden   % due to long index text
+        \dimen@ = 0.7\dimen@ % Try to split the text roughly evenly
+        address@hidden = \hsize
+        \advance address@hidden by -1em
+        \ifnum\dimen@>address@hidden
+          % If the entry is too long, use the whole line
+          \dimen@ = address@hidden
+        \fi
+        \advance\leftskip by 0pt plus 1fill % ragged right
+        \advance \dimen@ by 1\rightskip
+        \parshape = 2 0pt \dimen@ 1em address@hidden
+        % Ideally we'd add a finite glue at the end of the first line only, but
+        % TeX doesn't seem to provide a way to do such a thing.
+      \fi\fi
+      \unhbox\boxA
+      %
+      % Do not prefer a separate line ending with a hyphen to fewer lines.
+      \finalhyphendemerits = 0
+      %
+      % Word spacing - no stretch
+      \spaceskip=\fontdimen2\font minus \fontdimen4\font
+      %
+      \linepenalty=1000  % Discourage line breaks.
+      \hyphenpenalty=5000  % Discourage hyphenation.
+      %
+      \par % format the paragraph
     \egroup % The \vbox
     \fi
   \endgroup




reply via email to

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