texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/doc texinfo.tex,1.22,1.23


From: karl
Subject: texinfo/doc texinfo.tex,1.22,1.23
Date: Mon, 19 Jan 2004 02:37:53 +0100

Update of /cvsroot/texinfo/texinfo/doc
In directory sheep:/tmp/cvs-serv30523

Modified Files:
        texinfo.tex 
Log Message:
(\commondummies): dummify @tie and remaining
@<char> commands.
(\tocindent): reduce to 15pt to match \defaultparindent.
(\setref): use XR as control sequence prefix
instead of just X; seems nicer.  Change calls.

Finish implementing @listoffloats:
(\xrdef): keep lists of each float type.
(\dofloat): save the floattype in the aux file.
(\Efloat): write the lof text to the aux file.
(\iffloat, \doiffloat, \listoffloats,
\listoffloatsdo, \listoffloatsentry): new macros.


Index: texinfo.tex
===================================================================
RCS file: /cvsroot/texinfo/texinfo/doc/texinfo.tex,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** texinfo.tex 18 Jan 2004 00:34:41 -0000      1.22
--- texinfo.tex 19 Jan 2004 01:37:50 -0000      1.23
***************
*** 4,8 ****
  \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
  %
! \def\texinfoversion{2004-01-17.16}
  %
  % Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
--- 4,8 ----
  \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
  %
! \def\texinfoversion{2004-01-18.17}
  %
  % Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
***************
*** 2339,2343 ****
    {%
     % If the document has an @itemize directly after a section title, a
!    % \nobreak will be the last contribution, 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
--- 2339,2343 ----
    {%
     % 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
***************
*** 3098,3102 ****
    \definedummyword{LaTeX}%
    \definedummyword{TeX}%
-   \definedummyword{dots}%
    %
    % Assorted special characters.
--- 3098,3101 ----
***************
*** 3133,3143 ****
    \gdef\commondummiesnofonts{%
      % Control letters and accents.
!     \definedummyletter{,}%
      \definedummyletter{"}%
-     \definedummyletter{`}%
      \definedummyletter{'}%
      \definedummyletter{^}%
      \definedummyletter{~}%
-     \definedummyletter{=}%
      \definedummyword{u}%
      \definedummyword{v}%
--- 3132,3148 ----
    \gdef\commondummiesnofonts{%
      % Control letters and accents.
!     \definedummyletter{!}%
      \definedummyletter{"}%
      \definedummyletter{'}%
+     \definedummyletter{*}%
+     \definedummyletter{,}%
+     \definedummyletter{.}%
+     \definedummyletter{/}%
+     \definedummyletter{:}%
+     \definedummyletter{=}%
+     \definedummyletter{?}%
      \definedummyletter{^}%
+     \definedummyletter{`}%
      \definedummyletter{~}%
      \definedummyword{u}%
      \definedummyword{v}%
***************
*** 3171,3174 ****
--- 3176,3180 ----
      \definedummyword{samp}%
      \definedummyword{strong}%
+     \definedummyword{tie}%
      \definedummyword{uref}%
      \definedummyword{url}%
***************
*** 3470,3479 ****
  % and table of contents entries.  The paragraph is indented by \leftskip.
  %
! % A straigtforward implementation would start like this:
  %     \def\entry#1#2{...
  % But this frozes the catcodes in the argument, and can cause problems to
! % @code, which set's active ``-''.  This problem was fixed by a kludge---
! % ``-'' was active throughout whole index, but this isn't what we really
! % want.
  % The right solution is to prevent \entry from swallowing the whole text.
  %                                 --kasal, 21nov03
--- 3476,3485 ----
  % and table of contents entries.  The paragraph is indented by \leftskip.
  %
! % A straightforward implementation would start like this:
  %     \def\entry#1#2{...
  % But this frozes the catcodes in the argument, and can cause problems to
! % @code, which sets - active.  This problem was fixed by a kludge---
! % ``-'' was active throughout whole index, but this isn't really right.
! % 
  % The right solution is to prevent \entry from swallowing the whole text.
  %                                 --kasal, 21nov03
***************
*** 4477,4481 ****
  
  % This parameter controls the indentation of the various levels.
! \newdimen\tocindent \tocindent = 2pc
  
  % Now for the actual typesetting. In all these, #1 is the text and #2 is the
--- 4483,4488 ----
  
  % This parameter controls the indentation of the various levels.
! % Same as \defaultparindent.
! \newdimen\tocindent \tocindent = 15pt
  
  % Now for the actual typesetting. In all these, #1 is the text and #2 is the
***************
*** 5142,5146 ****
  %
  \def\deffngeneral#1#2 #3 #4\endheader{%
!   % Remember that \dosubin{fn}{xxx}{} is equivalent to \doind{fn}{xxx}.
    \dosubind{fn}{\code{#3}}{#1}%
    \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
--- 5149,5153 ----
  %
  \def\deffngeneral#1#2 #3 #4\endheader{%
!   % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
    \dosubind{fn}{\code{#3}}{#1}%
    \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
***************
*** 5710,5724 ****
  % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
  % anchor), which consists of three parts:
! % 1) NAME-title - the current sectioning name, taken from \thissection;
! % 2) NAME-snt   - section number and type, defined as the SNT arg;
  % 3) NAME-pg    - the page number.
- % This is called from \donoderef, \anchor, and \dofloat.
  % 
! % We take care not to fully expand the title, since it may contain
! % arbitrary macros.
! %
! % Use \turnoffactive so that punctuation chars such as underscore
! % and backslash work in node names.
! %
  \def\setref#1#2{%
    \pdfmkdest{#1}%
--- 5717,5730 ----
  % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
  % anchor), which consists of three parts:
! % 1) NAME-title - the current sectioning name taken from \thissection,
! %                 or the anchor name.
! % 2) NAME-snt   - section number and type, passed as the SNT arg, or
! %                 empty for anchors.
  % 3) NAME-pg    - the page number.
  % 
! % This is called from \donoderef, \anchor, and \dofloat.  In the case of
! % floats, there is an additional part, which is not written here:
! % 4) NAME-lof   - the text as it should appear in a @listoffloats.
! % 
  \def\setref#1#2{%
    \pdfmkdest{#1}%
***************
*** 5803,5809 ****
      \otherbackslash
      \expandafter\global\expandafter\let\expandafter\Xthisreftitle
!       \csname X#1-title\endcsname
    }%
!   \ifx \Xthisreftitle \floatmagic
      % If the user specified the print name (third arg) to the ref,
      % print it instead of our usual "Figure 1.2".
--- 5809,5815 ----
      \otherbackslash
      \expandafter\global\expandafter\let\expandafter\Xthisreftitle
!       \csname XR#1-title\endcsname
    }%
!   \iffloat\Xthisreftitle
      % If the user specified the print name (third arg) to the ref,
      % print it instead of our usual "Figure 1.2".
***************
*** 5898,5902 ****
      \otherbackslash
      \expandafter\global\expandafter\let\expandafter\thisrefX
!       \csname X#1\endcsname
    }%
    \ifx\thisrefX\relax
--- 5904,5908 ----
      \otherbackslash
      \expandafter\global\expandafter\let\expandafter\thisrefX
!       \csname XR#1\endcsname
    }%
    \ifx\thisrefX\relax
***************
*** 5920,5926 ****
  }
  
! % This is the macro invoked by entries in the aux file.
  %
! \def\xrdef#1{\expandafter\gdef\csname X#1\endcsname}
  
  % Read the last existing aux file, if any.  No error if none exists.
--- 5926,5955 ----
  }
  
! % This is the macro invoked by entries in the aux file.  Usually it's
! % just a \def (we prepend XR to the control sequence name to avoid
! % collisions).  But if this is a float type, we have more work to do.
  %
! \def\xrdef#1#2{%
!   \expandafter\gdef\csname XR#1\endcsname{#2}% remember this xref value.
!   %
!   % Was that xref control sequence that we just defined for a float?
!   \expandafter\iffloat\csname XR#1\endcsname
!     % it was a float, and we have the (safe) float type in \iffloattype.
!     \expandafter\let\expandafter\floatlist
!       \csname floatlist\iffloattype\endcsname
!     % 
!     % Is this the first time we've seen this float type?
!     \expandafter\ifx\floatlist\relax
!       \toks0 = {\do}% yes, so just \do
!     \else
!       % had it before, so preserve previous elements in list.
!       \toks0 = \expandafter{\floatlist\do}%
!     \fi
!     %
!     % Remember this xref in the control sequence \floatlistFLOATTYPE,
!     % for later use in \listoffloats.
!     \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0{#1}}%
!   \fi
! }
  
  % Read the last existing aux file, if any.  No error if none exists.
***************
*** 6278,6284 ****
          % XREFLABEL-title value.  \xrefX uses it to distinguish float
          % labels (which have a completely different output format) from
!         % node and anchor labels.
          % 
!         \let\thissection=\floatmagic
          \setref{\floatlabel}{Yfloat}%
        }%
--- 6307,6314 ----
          % XREFLABEL-title value.  \xrefX uses it to distinguish float
          % labels (which have a completely different output format) from
!         % node and anchor labels.  And \xrdef uses it to construct the
!         % lists of floats.
          % 
!         \edef\thissection{\floatmagic=\safefloattype}%
          \setref{\floatlabel}{Yfloat}%
        }%
***************
*** 6288,6294 ****
  
  % we have four possibilities:
! % @float Foo & @caption{Cap}: Foo 1.1: Cap
! % @float Foo & no caption:    Foo 1.1
! % @float & @caption{Cap}:     Cap
  % @float & no caption:
  %
--- 6318,6324 ----
  
  % we have four possibilities:
! % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
! % @float Foo,lbl & no caption:    Foo 1.1
! % @float & @caption{Cap}:         Cap
  % @float & no caption:
  %
***************
*** 6300,6308 ****
        %
        % Print the float number preceded by the chapter-level number
!       % (empty in the case of unnumbered).  Although there are other
!       % styles of float numbering, we hardwire this one.
!       \floattype\space\chaplevelprefix\the\floatno
        \let\printedsomething = t%
!     \fi
      %
      \ifx\thiscaption\empty \else
--- 6330,6357 ----
        %
        % Print the float number preceded by the chapter-level number
!       % (empty in the case of unnumbered), as in "Figure 1.1".  Although
!       % there are other styles of float numbering, we hardwire this one.
!       \def\floatident{\floattype\tie\chaplevelprefix\the\floatno}%
!       \floatident
        \let\printedsomething = t%
!       %
!       % Write the text that goes in the list of floats to the aux file
!       % as \floatlabel-lof.  Besides the float ident, we include the
!       % short caption if specified, else the full caption if specified,
!       % else nothing.
!       {%
!         \atdummies \turnoffactive \otherbackslash
!         address@hidden
!           \floatident
!           \ifx\thisshortcaption\empty
!             \ifx\thiscaption\empty \else
!               : \thiscaption
!             \fi
!           \else
!             : \thisshortcaption
!           \fi
!         }}%
!       }%
!     \fi % end have xref label for this float
      %
      \ifx\thiscaption\empty \else
***************
*** 6320,6324 ****
      % Space below caption, if we printed anything.
      \ifx\printedsomething\empty \else \vskip\parskip \fi
-     %
    \egroup  % end of \vtop
    \checkinserts
--- 6369,6372 ----
***************
*** 6348,6352 ****
  % first read the @float command.
  % 
! \def\Yfloat{\floattype @tie{}\chaplevelprefix\the\floatno}%
  
  % Magic string used for the XREFLABEL-title value, so \xrefX can
--- 6396,6400 ----
  % first read the @float command.
  % 
! address@hidden \chaplevelprefix\the\floatno}%
  
  % Magic string used for the XREFLABEL-title value, so \xrefX can
***************
*** 6354,6361 ****
  \def\floatmagic{!!float!!}
  
  % @listoffloats FLOATTYPE - print a list of floats like a table of contents.
! \parseargdef\listoffloats{%xx
  }
  
  
  \message{localization,}
--- 6402,6460 ----
  \def\floatmagic{!!float!!}
  
+ % #1 is the control sequence we are passed; we expand into a conditional
+ % which is true if #1 represents a float ref.  That is, the magic
+ % \thissection value which we \setref above.
+ % 
+ \def\iffloat#1{\expandafter\doiffloat#1==\finish}
+ %
+ % #1 is (maybe) the \floatmagic string.  If so, #2 will be the
+ % (safe) float type for this float.  We set \iffloattype to #2.
+ % 
+ \def\doiffloat#1=#2=#3\finish{%
+   \def\temp{#1}%
+   \def\iffloattype{#2}%
+   \ifx\temp\floatmagic
+ }
+ 
  % @listoffloats FLOATTYPE - print a list of floats like a table of contents.
! % 
! \parseargdef\listoffloats{%
!   \def\floattype{#1}% floattype
!   {%
!     % the floattype might have accents or other special characters,
!     % but we need to use it in a control sequence name.
!     \indexnofonts
!     \turnoffactive
!     \xdef\safefloattype{\floattype}%
!   }%
!   %
!   % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
!   \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
!     \ifhavexrefs
!       % if the user said @listoffloats foo but never @float foo.
!       \message{\linenumber No `\safefloattype' floats to list.}%
!     \fi
!   \else
!     \begingroup
!       \leftskip=\tocindent  % indent these entries like a toc
!       \let\do=\listoffloatsdo
!       \csname floatlist\safefloattype\endcsname
!     \endgroup
!   \fi
  }
  
+ % This is called on each entry in a list of floats.  We're passed the
+ % xref label, in the form LABEL-title, which is how we save it in the
+ % aux file.  We strip off the -title and look up \XRLABEL-lof, which
+ % has the text we're supposed to typeset here.
+ % 
+ % Figures without xref labels will not be included in the list (since
+ % they won't appear in the aux file).
+ % 
+ \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
+ \def\listoffloatsdoentry#1-title\finish{%
+   % use the same \entry we use for the TOC.
+   \entry{\csname XR#1-lof\endcsname}{\csname XR#1-pg\endcsname}%
+ }
  
  \message{localization,}
***************
*** 6667,6670 ****
--- 6766,6770 ----
  % as in \char`\\.
  \global\chardef\backslashcurfont=`\\
+ \global\let\rawbackslashxx=\backslashcurfont  % let existing .??s files work
  
  % \rawbackslash defines an active \ to do \backslashcurfont.



reply via email to

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