bug-texinfo
[Top][All Lists]
Advanced

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

Re: bad page breaks and ugly formatting


From: Karl Berry
Subject: Re: bad page breaks and ugly formatting
Date: Fri, 31 Jan 2003 16:13:33 -0500

    If @unnumberedsubsubsec is immediately followed by @deffn, texinfo.tex
    allows a break right after the title.  

I can't find a way to completely prevent a break in this case, but this
patch makes it less likely, at least.  (The same is true when a heading
is followed by regular text, as it turns out.)  The resulting vertical
list looks like this:

[subsubsection heading]
....\ssecrm s
....\ssecrm 2
....\penalty 10000
....\glue(\parfillskip) 0.0 plus 1.0fil
....\glue(\rightskip) 0.0 plus 29.56497
[space after heading]
..\penalty 10000
..\kern 13.2
..\penalty 10000
..\write0{\subsubsecentry{s2}{0}{0}{0}{2}{1}}
..\penalty 10000
..\write3{\entry{Deffn.}{\folio }{\code {\empty Deffn.}}}
..\penalty 10000
..\glue(\parskip) 3.0 plus 2.0 minus 1.0
address@hidden starts]
..\glue(\baselineskip) 4.86667
..\hbox(8.33333+2.73749)x399.2558, glue set 181.39883fil
...\hbox(8.2125+2.73749)x0.0, glue set - 433.62fil
....\hbox(8.2125+2.73749)x433.62, glue set 417.2558fil
.....\glue 0.0 plus 1.0fil minus 1.0fil
.....\textrm [
.....\textrm d
.....\textrm f

The possible breakpoint is at the \baselineskip glue before the deffn
text, and I don't know how to get control at that point.

This is not on prep quite yet, wanted to get your feedback.



*** /u/karl/gnu/src/gnulib/config/texinfo.tex   Thu Jan 30 17:21:47 2003
--- ./texinfo.tex       Fri Jan 31 13:03:59 2003
***************
*** 4999,5004 ****
    % which is there to keep the function description together with its
    % header.  But if there's nothing but headers, we want to allow a
!   % break after all.
!   \ifnum\lastpenalty=10000 \penalty0 \fi
    \medbreak
    %
--- 4999,5007 ----
    % which is there to keep the function description together with its
    % header.  But if there's nothing but headers, we want to allow a
!   % break after all.  Check for penalty 10002 (inserted by
!   % \defargscommonending) instead of 10000, since the sectioning
!   % commands insert a \penalty10000, and we don't want to allow a break
!   % between a section heading and a defun.
!   \ifnum\lastpenalty=10002 \penalty0 \fi
    \medbreak
    %
***************
*** 5158,5164 ****
  % Define @defun.
  
! % First, define the processing that is wanted for arguments of \defun
! % Use this to expand the args and terminate the paragraph they make up
  
  \def\defunargs#1{\functionparens \sl
  % Expand, preventing hyphenation at `-' chars.
--- 5161,5176 ----
  % Define @defun.
  
! % This is called to end the arguments processing for all the @def... commands.
! %
! \def\defargscommonending{%
!   \interlinepenalty = 10000
!   \advance\rightskip by 0pt plus 1fil
!   \endgraf
!   \nobreak\vskip -\parskip
!   \penalty 10002
! }
  
+ % This expands the args and terminates the paragraph they comprise.
+ % 
  \def\defunargs#1{\functionparens \sl
  % Expand, preventing hyphenation at `-' chars.
***************
*** 5169,5175 ****
  {\tensl\hyphenchar\font=45}%
  \ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
! \interlinepenalty=10000
! \advance\rightskip by 0pt plus 1fil
! \endgraf\nobreak\vskip -\parskip\nobreak
  }
  
--- 5181,5185 ----
  {\tensl\hyphenchar\font=45}%
  \ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
!   \defargscommonending
  }
  
***************
*** 5180,5186 ****
  \boldbraxnoamp
  \tclose{#1}% avoid \code because of side effects on active chars
! \interlinepenalty=10000
! \advance\rightskip by 0pt plus 1fil
! \endgraf\nobreak\vskip -\parskip\nobreak
  }
  
--- 5190,5194 ----
  \boldbraxnoamp
  \tclose{#1}% avoid \code because of side effects on active chars
!   \defargscommonending
  }
  
***************
*** 5362,5367 ****
  % This must expand the args and terminate the paragraph they make up
  \def\defvarargs #1{\normalparens #1%
! \interlinepenalty=10000
! \endgraf\nobreak\vskip -\parskip\nobreak}
  
  % @defvr Counter foo-count
--- 5370,5375 ----
  % This must expand the args and terminate the paragraph they make up
  \def\defvarargs #1{\normalparens #1%
!   \defargscommonending
! }
  
  % @defvr Counter foo-count
***************
*** 5399,5404 ****
  \dovarind#2 \relax% Make entry in variables index
  \begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}%
! \interlinepenalty=10000
! \endgraf\nobreak\vskip -\parskip\nobreak
  \endgroup}
  \def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}}
--- 5407,5411 ----
  \dovarind#2 \relax% Make entry in variables index
  \begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}%
!   \defargscommonending
  \endgroup}
  \def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}}
***************
*** 5410,5415 ****
  \def\deftypevrheader #1#2#3{\dovarind#3 \relax%
  \begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1}
! \interlinepenalty=10000
! \endgraf\nobreak\vskip -\parskip\nobreak
  \endgroup}
  
--- 5417,5421 ----
  \def\deftypevrheader #1#2#3{\dovarind#3 \relax%
  \begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1}
!   \defargscommonending
  \endgroup}
  




reply via email to

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