bug-texinfo
[Top][All Lists]
Advanced

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

Re: Bad spacing between @subsection and @itemize


From: Karl Berry
Subject: Re: Bad spacing between @subsection and @itemize
Date: Sat, 17 Jan 2004 19:37:10 -0500

    In the attached example the spacing between @subsection and the
    following item is too narrow:

Thanks for the report.  Here's a patch (also updated texinfo.tex on
tug.org, berlios, etc.).  Please let me know if you find other cases
where spacing ends up being problematic.  This has been a source of
constant problems forever.

*** texinfo.tex.~1.21.~ Thu Jan 15 15:35:11 2004
--- texinfo.tex Sat Jan 17 16:30:33 2004
***************
*** 2314,2324 ****
  
  \newcount \itemno
  
! \envdef\itemize{%
!   \parsearg\itemizey
! }
  
! \def\itemizey#1{%
    \aboveenvbreak
    \itemmax=\itemindent
    \advance\itemmax by -\itemmargin
--- 2314,2322 ----
  
  \newcount \itemno
  
! \envdef\itemize{\parsearg\doitemize}
  
! \def\doitemize#1{%
    \aboveenvbreak
    \itemmax=\itemindent
    \advance\itemmax by -\itemmargin
***************
*** 2333,2338 ****
--- 2331,2357 ----
    \let\item=\itemizeitem
  }
  
+ % Definition of @item while inside @itemize and @enumerate.
+ %
+ \def\itemizeitem{%
+   \advance\itemno by 1  % for enumerations
+   {\let\par=\endgraf \smallbreak}% reasonable place to break
+   {%
+    % If the document has an @itemize directly after a section title, a
+    % \nobreak will be last on the list, and \sectionheading will have
+    % done a \vskip-\parskip.  In that case, we don't want to zero
+    % parskip, or the item text will crash with the heading.  On the
+    % other hand, when there is normal text preceding the item (as there
+    % usually is), we do want to zero parskip, or there would be too much
+    % space.  In that case, we won't have a \nobreak before.  At least
+    % that's the theory.
+    \ifnum\lastpenalty<10000 \parskip=0in \fi
+    \noindent
+    \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
+    \vadjust{\penalty 1200}}% not good to break after first line of item.
+   \flushcr
+ }
+ 
  % \splitoff TOKENS\endmark defines \first to be the first token in
  % TOKENS, and \rest to be the remainder.
  %
***************
*** 2414,2426 ****
    }%
  }
  
! % Call itemizey, adding a period to the first argument and supplying the
  % common last two arguments.  Also subtract one from the initial value in
  % \itemno, since @item increments \itemno.
  %
  \def\startenumeration#1{%
    \advance\itemno by -1
!   \itemizey{#1.}\flushcr
  }
  
  % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
--- 2433,2445 ----
    }%
  }
  
! % Call \doitemize, adding a period to the first argument and supplying the
  % common last two arguments.  Also subtract one from the initial value in
  % \itemno, since @item increments \itemno.
  %
  \def\startenumeration#1{%
    \advance\itemno by -1
!   \doitemize{#1.}\flushcr
  }
  
  % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
***************
*** 2431,2446 ****
  \def\Ealphaenumerate{\Eenumerate}
  \def\Ecapsenumerate{\Eenumerate}
  
- % Definition of @item while inside @itemize.
- 
- \def\itemizeitem{%
- \advance\itemno by 1
- {\let\par=\endgraf \smallbreak}%
- \ifhmode \errmessage{In hmode at itemizeitem}\fi
- {\parskip=0in \hskip 0pt
- \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
- \vadjust{\penalty 1200}}%
- \flushcr}
  
  % @multitable macros
  % Amy Hendrickson, 8/18/94, 3/6/96
--- 2450,2455 ----
***************
*** 4619,4625 ****
        \removelastskip
        % it's not a good place to break if the last penalty was \nobreak
        % or better ...
!       \ifnum\lastpenalty>10000 \else \penalty-50 \fi
        \vskip\envskipamount
      \fi
    \fi
--- 4628,4634 ----
        \removelastskip
        % it's not a good place to break if the last penalty was \nobreak
        % or better ...
!       \ifnum\lastpenalty<10000 \penalty-50 \fi
        \vskip\envskipamount
      \fi
    \fi




reply via email to

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