annotate lispintro/texinfo.tex @ 61224:25684d3a9952

*** empty log message ***
author Eli Zaretskii <eliz@gnu.org>
date Sat, 02 Apr 2005 11:32:18 +0000
parents c22fbd2084b4
children 23a17af379b1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1 % texinfo.tex -- TeX macros to handle Texinfo files.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3 % Load plain if necessary, i.e., if running under initex.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5 %
53451
c22fbd2084b4 Use arch-tag: syntax that tla can grok
Miles Bader <miles@gnu.org>
parents: 53396
diff changeset
6 \def\texinfoversion{2003-12-30.09}
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
7 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
8 % Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
9 % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
10 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
11 % This texinfo.tex file is free software; you can redistribute it and/or
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
12 % modify it under the terms of the GNU General Public License as
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
13 % published by the Free Software Foundation; either version 2, or (at
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
14 % your option) any later version.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
15 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
16 % This texinfo.tex file is distributed in the hope that it will be
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
17 % useful, but WITHOUT ANY WARRANTY; without even the implied warranty
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
18 % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
19 % General Public License for more details.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
20 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
21 % You should have received a copy of the GNU General Public License
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
22 % along with this texinfo.tex file; see the file COPYING. If not, write
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
23 % to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
24 % Boston, MA 02111-1307, USA.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
25 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
26 % In other words, you are welcome to use, share and improve this program.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
27 % You are forbidden to forbid anyone else to use, share and improve
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
28 % what you give them. Help stamp out software-hoarding!
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
29 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
30 % Please try the latest version of texinfo.tex before submitting bug
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
31 % reports; you can get the latest version from:
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
32 % ftp://ftp.gnu.org/gnu/texinfo/texinfo.tex
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
33 % (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
34 % ftp://tug.org/tex/texinfo.tex
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
35 % (and all CTAN mirrors, see http://www.ctan.org),
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
36 % and /home/gd/gnu/doc/texinfo.tex on the GNU machines.
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
37 %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
38 % The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
39 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
40 % The texinfo.tex in any given Texinfo distribution could well be out
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
41 % of date, so if that's what you're using, please check.
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
42 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
43 % Send bug reports to bug-texinfo@gnu.org. Please include including a
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
44 % complete document in each bug report with which we can reproduce the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
45 % problem. Patches are, of course, greatly appreciated.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
46 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
47 % To process a Texinfo manual with TeX, it's most reliable to use the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
48 % texi2dvi shell script that comes with the distribution. For a simple
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
49 % manual foo.texi, however, you can get away with this:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
50 % tex foo.texi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
51 % texindex foo.??
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
52 % tex foo.texi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
53 % tex foo.texi
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
54 % dvips foo.dvi -o # or whatever; this makes foo.ps.
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
55 % The extra TeX runs get the cross-reference information correct.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
56 % Sometimes one run after texindex suffices, and sometimes you need more
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
57 % than two; texi2dvi does it as many times as necessary.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
58 %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
59 % It is possible to adapt texinfo.tex for other languages, to some
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
60 % extent. You can get the existing language-specific files from the
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
61 % full Texinfo distribution.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
62
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
63 \message{Loading texinfo [version \texinfoversion]:}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
64
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
65 % If in a .fmt file, print the version number
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
66 % and turn on active characters that we couldn't do earlier because
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
67 % they might have appeared in the input file name.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
68 \everyjob{\message{[Texinfo version \texinfoversion]}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
69 \catcode`+=\active \catcode`\_=\active}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
70
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
71 \message{Basics,}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
72 \chardef\other=12
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
73
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
74 % We never want plain's \outer definition of \+ in Texinfo.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
75 % For @tex, we can use \tabalign.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
76 \let\+ = \relax
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
77
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
78 % Save some plain tex macros whose names we will redefine.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
79 \let\ptexb=\b
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
80 \let\ptexbullet=\bullet
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
81 \let\ptexc=\c
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
82 \let\ptexcomma=\,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
83 \let\ptexdot=\.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
84 \let\ptexdots=\dots
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
85 \let\ptexend=\end
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
86 \let\ptexequiv=\equiv
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
87 \let\ptexexclam=\!
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
88 \let\ptexgtr=>
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
89 \let\ptexhat=^
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
90 \let\ptexi=\i
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
91 \let\ptexindent=\indent
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
92 \let\ptexlbrace=\{
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
93 \let\ptexless=<
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
94 \let\ptexplus=+
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
95 \let\ptexrbrace=\}
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
96 \let\ptexslash=\/
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
97 \let\ptexstar=\*
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
98 \let\ptext=\t
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
99
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
100 % If this character appears in an error message or help string, it
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
101 % starts a new line in the output.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
102 \newlinechar = `^^J
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
103
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
104 % Set up fixed words for English if not already set.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
105 \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
106 \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
107 \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
108 \ifx\putwordin\undefined \gdef\putwordin{in}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
109 \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
110 \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
111 \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
112 \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
113 \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
114 \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
115 \ifx\putwordof\undefined \gdef\putwordof{of}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
116 \ifx\putwordon\undefined \gdef\putwordon{on}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
117 \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
118 \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
119 \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
120 \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
121 \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
122 \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
123 \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
124 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
125 \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
126 \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
127 \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
128 \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
129 \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
130 \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
131 \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
132 \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
133 \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
134 \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
135 \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
136 \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
137 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
138 \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
139 \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
140 \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
141 \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
142 \ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
143 \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
144 \ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
145
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
146 % In some macros, we cannot use the `\? notation---the left quote is
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
147 % in some cases the escape char.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
148 \chardef\colonChar = `\:
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
149 \chardef\commaChar = `\,
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
150 \chardef\dotChar = `\.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
151 \chardef\equalChar = `\=
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
152 \chardef\exclamChar= `\!
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
153 \chardef\questChar = `\?
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
154 \chardef\semiChar = `\;
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
155 \chardef\spaceChar = `\ %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
156 \chardef\underChar = `\_
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
157
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
158 % Ignore a token.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
159 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
160 \def\gobble#1{}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
161
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
162 % True if #1 is the empty string, i.e., called like `\ifempty{}'.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
163 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
164 \def\ifempty#1{\ifemptyx #1\emptymarkA\emptymarkB}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
165 \def\ifemptyx#1#2\emptymarkB{\ifx #1\emptymarkA}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
166
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
167 % Hyphenation fixes.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
168 \hyphenation{ap-pen-dix}
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
169 \hyphenation{eshell}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
170 \hyphenation{mini-buf-fer mini-buf-fers}
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
171 \hyphenation{time-stamp}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
172 \hyphenation{white-space}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
173
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
174 % Margin to add to right of even pages, to left of odd pages.
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
175 \newdimen\bindingoffset
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
176 \newdimen\normaloffset
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
177 \newdimen\pagewidth \newdimen\pageheight
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
178
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
179 % Sometimes it is convenient to have everything in the transcript file
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
180 % and nothing on the terminal. We don't just call \tracingall here,
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
181 % since that produces some useless output on the terminal. We also make
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
182 % some effort to order the tracing commands to reduce output in the log
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
183 % file; cf. trace.sty in LaTeX.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
184 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
185 \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
186 \def\loggingall{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
187 \tracingstats2
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
188 \tracingpages1
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
189 \tracinglostchars2 % 2 gives us more in etex
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
190 \tracingparagraphs1
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
191 \tracingoutput1
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
192 \tracingmacros2
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
193 \tracingrestores1
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
194 \showboxbreadth\maxdimen \showboxdepth\maxdimen
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
195 \ifx\eTeXversion\undefined\else % etex gives us more logging
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
196 \tracingscantokens1
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
197 \tracingifs1
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
198 \tracinggroups1
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
199 \tracingnesting2
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
200 \tracingassigns1
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
201 \fi
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
202 \tracingcommands3 % 3 gives us more in etex
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
203 \errorcontextlines\maxdimen
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
204 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
205
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
206 % add check for \lastpenalty to plain's definitions. If the last thing
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
207 % we did was a \nobreak, we don't want to insert more space.
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
208 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
209 \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
210 \removelastskip\penalty-50\smallskip\fi\fi}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
211 \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
212 \removelastskip\penalty-100\medskip\fi\fi}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
213 \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
214 \removelastskip\penalty-200\bigskip\fi\fi}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
215
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
216 % For @cropmarks command.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
217 % Do @cropmarks to get crop marks.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
218 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
219 \newif\ifcropmarks
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
220 \let\cropmarks = \cropmarkstrue
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
221 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
222 % Dimensions to add cropmarks at corners.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
223 % Added by P. A. MacKay, 12 Nov. 1986
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
224 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
225 \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
226 \newdimen\cornerlong \cornerlong=1pc
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
227 \newdimen\cornerthick \cornerthick=.3pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
228 \newdimen\topandbottommargin \topandbottommargin=.75in
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
229
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
230 % Main output routine.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
231 \chardef\PAGE = 255
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
232 \output = {\onepageout{\pagecontents\PAGE}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
233
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
234 \newbox\headlinebox
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
235 \newbox\footlinebox
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
236
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
237 % \onepageout takes a vbox as an argument. Note that \pagecontents
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
238 % does insertions, but you have to call it yourself.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
239 \def\onepageout#1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
240 \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
241 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
242 \ifodd\pageno \advance\hoffset by \bindingoffset
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
243 \else \advance\hoffset by -\bindingoffset\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
244 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
245 % Do this outside of the \shipout so @code etc. will be expanded in
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
246 % the headline as they should be, not taken literally (outputting ''code).
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
247 \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
248 \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
249 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
250 {%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
251 % Have to do this stuff outside the \shipout because we want it to
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
252 % take effect in \write's, yet the group defined by the \vbox ends
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
253 % before the \shipout runs.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
254 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
255 \escapechar = `\\ % use backslash in output files.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
256 \indexdummies % don't expand commands in the output.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
257 \normalturnoffactive % \ in index entries must not stay \, e.g., if
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
258 % the page break happens to be in the middle of an example.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
259 \shipout\vbox{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
260 % Do this early so pdf references go to the beginning of the page.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
261 \ifpdfmakepagedest \pdfmkdest{\the\pageno} \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
262 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
263 \ifcropmarks \vbox to \outervsize\bgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
264 \hsize = \outerhsize
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
265 \vskip-\topandbottommargin
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
266 \vtop to0pt{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
267 \line{\ewtop\hfil\ewtop}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
268 \nointerlineskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
269 \line{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
270 \vbox{\moveleft\cornerthick\nstop}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
271 \hfill
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
272 \vbox{\moveright\cornerthick\nstop}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
273 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
274 \vss}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
275 \vskip\topandbottommargin
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
276 \line\bgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
277 \hfil % center the page within the outer (page) hsize.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
278 \ifodd\pageno\hskip\bindingoffset\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
279 \vbox\bgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
280 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
281 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
282 \unvbox\headlinebox
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
283 \pagebody{#1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
284 \ifdim\ht\footlinebox > 0pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
285 % Only leave this space if the footline is nonempty.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
286 % (We lessened \vsize for it in \oddfootingxxx.)
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
287 % The \baselineskip=24pt in plain's \makefootline has no effect.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
288 \vskip 2\baselineskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
289 \unvbox\footlinebox
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
290 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
291 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
292 \ifcropmarks
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
293 \egroup % end of \vbox\bgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
294 \hfil\egroup % end of (centering) \line\bgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
295 \vskip\topandbottommargin plus1fill minus1fill
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
296 \boxmaxdepth = \cornerthick
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
297 \vbox to0pt{\vss
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
298 \line{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
299 \vbox{\moveleft\cornerthick\nsbot}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
300 \hfill
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
301 \vbox{\moveright\cornerthick\nsbot}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
302 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
303 \nointerlineskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
304 \line{\ewbot\hfil\ewbot}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
305 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
306 \egroup % \vbox from first cropmarks clause
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
307 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
308 }% end of \shipout\vbox
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
309 }% end of group with \normalturnoffactive
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
310 \advancepageno
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
311 \ifnum\outputpenalty>-20000 \else\dosupereject\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
312 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
313
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
314 \newinsert\margin \dimen\margin=\maxdimen
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
315
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
316 \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
317 {\catcode`\@ =11
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
318 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
319 % marginal hacks, juha@viisa.uucp (Juha Takala)
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
320 \ifvoid\margin\else % marginal info is present
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
321 \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
322 \dimen@=\dp#1 \unvbox#1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
323 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
324 \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
325 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
326
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
327 % Here are the rules for the cropmarks. Note that they are
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
328 % offset so that the space between them is truly \outerhsize or \outervsize
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
329 % (P. A. MacKay, 12 November, 1986)
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
330 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
331 \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
332 \def\nstop{\vbox
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
333 {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
334 \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
335 \def\nsbot{\vbox
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
336 {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
337
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
338 % Parse an argument, then pass it to #1. The argument is the rest of
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
339 % the input line (except we remove a trailing comment). #1 should be a
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
340 % macro which expects an ordinary undelimited TeX argument.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
341 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
342 \def\parsearg#1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
343 \let\next = #1%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
344 \begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
345 \obeylines
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
346 \futurelet\temp\parseargx
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
347 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
348
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
349 % If the next token is an obeyed space (from an @example environment or
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
350 % the like), remove it and recurse. Otherwise, we're done.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
351 \def\parseargx{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
352 % \obeyedspace is defined far below, after the definition of \sepspaces.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
353 \ifx\obeyedspace\temp
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
354 \expandafter\parseargdiscardspace
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
355 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
356 \expandafter\parseargline
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
357 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
358 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
359
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
360 % Remove a single space (as the delimiter token to the macro call).
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
361 {\obeyspaces %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
362 \gdef\parseargdiscardspace {\futurelet\temp\parseargx}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
363
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
364 {\obeylines %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
365 \gdef\parseargline#1^^M{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
366 \endgroup % End of the group started in \parsearg.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
367 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
368 % First remove any @c comment, then any @comment.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
369 % Result of each macro is put in \toks0.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
370 \argremovec #1\c\relax %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
371 \expandafter\argremovecomment \the\toks0 \comment\relax %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
372 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
373 % Call the caller's macro, saved as \next in \parsearg.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
374 \expandafter\next\expandafter{\the\toks0}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
375 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
376 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
377
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
378 % Since all \c{,omment} does is throw away the argument, we can let TeX
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
379 % do that for us. The \relax here is matched by the \relax in the call
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
380 % in \parseargline; it could be more or less anything, its purpose is
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
381 % just to delimit the argument to the \c.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
382 \def\argremovec#1\c#2\relax{\toks0 = {#1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
383 \def\argremovecomment#1\comment#2\relax{\toks0 = {#1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
384
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
385 % \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
386 % @end itemize @c foo
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
387 % will have two active spaces as part of the argument with the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
388 % `itemize'. Here we remove all active spaces from #1, and assign the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
389 % result to \toks0.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
390 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
391 % This loses if there are any *other* active characters besides spaces
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
392 % in the argument -- _ ^ +, for example -- since they get expanded.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
393 % Fortunately, Texinfo does not define any such commands. (If it ever
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
394 % does, the catcode of the characters in questionwill have to be changed
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
395 % here.) But this means we cannot call \removeactivespaces as part of
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
396 % \argremovec{,omment}, since @c uses \parsearg, and thus the argument
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
397 % that \parsearg gets might well have any character at all in it.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
398 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
399 \def\removeactivespaces#1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
400 \begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
401 \ignoreactivespaces
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
402 \edef\temp{#1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
403 \global\toks0 = \expandafter{\temp}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
404 \endgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
405 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
406
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
407 % Change the active space to expand to nothing.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
408 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
409 \begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
410 \obeyspaces
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
411 \gdef\ignoreactivespaces{\obeyspaces\let =\empty}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
412 \endgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
413
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
414
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
415 \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
416
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
417 %% These are used to keep @begin/@end levels from running away
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
418 %% Call \inENV within environments (after a \begingroup)
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
419 \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
420 \def\ENVcheck{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
421 \ifENV\errmessage{Still within an environment; press RETURN to continue}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
422 \endgroup\fi} % This is not perfect, but it should reduce lossage
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
423
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
424 % @begin foo is the same as @foo, for now.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
425 \newhelp\EMsimple{Press RETURN to continue.}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
426
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
427 \outer\def\begin{\parsearg\beginxxx}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
428
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
429 \def\beginxxx #1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
430 \expandafter\ifx\csname #1\endcsname\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
431 {\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
432 \csname #1\endcsname\fi}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
433
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
434 % @end foo executes the definition of \Efoo.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
435 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
436 \def\end{\parsearg\endxxx}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
437 \def\endxxx #1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
438 \removeactivespaces{#1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
439 \edef\endthing{\the\toks0}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
440 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
441 \expandafter\ifx\csname E\endthing\endcsname\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
442 \expandafter\ifx\csname \endthing\endcsname\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
443 % There's no \foo, i.e., no ``environment'' foo.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
444 \errhelp = \EMsimple
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
445 \errmessage{Undefined command `@end \endthing'}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
446 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
447 \unmatchedenderror\endthing
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
448 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
449 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
450 % Everything's ok; the right environment has been started.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
451 \csname E\endthing\endcsname
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
452 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
453 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
454
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
455 % There is an environment #1, but it hasn't been started. Give an error.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
456 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
457 \def\unmatchedenderror#1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
458 \errhelp = \EMsimple
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
459 \errmessage{This `@end #1' doesn't have a matching `@#1'}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
460 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
461
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
462 % Define the control sequence \E#1 to give an unmatched @end error.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
463 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
464 \def\defineunmatchedend#1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
465 \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
466 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
467
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
468
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
469 %% Simple single-character @ commands
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
470
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
471 % @@ prints an @
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
472 % Kludge this until the fonts are right (grr).
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
473 \def\@{{\tt\char64}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
474
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
475 % This is turned off because it was never documented
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
476 % and you can use @w{...} around a quote to suppress ligatures.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
477 %% Define @` and @' to be the same as ` and '
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
478 %% but suppressing ligatures.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
479 %\def\`{{`}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
480 %\def\'{{'}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
481
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
482 % Used to generate quoted braces.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
483 \def\mylbrace {{\tt\char123}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
484 \def\myrbrace {{\tt\char125}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
485 \let\{=\mylbrace
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
486 \let\}=\myrbrace
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
487 \begingroup
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
488 % Definitions to produce \{ and \} commands for indices,
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
489 % and @{ and @} for the aux file.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
490 \catcode`\{ = \other \catcode`\} = \other
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
491 \catcode`\[ = 1 \catcode`\] = 2
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
492 \catcode`\! = 0 \catcode`\\ = \other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
493 !gdef!lbracecmd[\{]%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
494 !gdef!rbracecmd[\}]%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
495 !gdef!lbraceatcmd[@{]%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
496 !gdef!rbraceatcmd[@}]%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
497 !endgroup
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
498
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
499 % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
500 % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
501 \let\, = \c
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
502 \let\dotaccent = \.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
503 \def\ringaccent#1{{\accent23 #1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
504 \let\tieaccent = \t
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
505 \let\ubaraccent = \b
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
506 \let\udotaccent = \d
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
507
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
508 % Other special characters: @questiondown @exclamdown
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
509 % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
510 \def\questiondown{?`}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
511 \def\exclamdown{!`}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
512
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
513 % Dotless i and dotless j, used for accents.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
514 \def\imacro{i}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
515 \def\jmacro{j}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
516 \def\dotless#1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
517 \def\temp{#1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
518 \ifx\temp\imacro \ptexi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
519 \else\ifx\temp\jmacro \j
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
520 \else \errmessage{@dotless can be used only with i or j}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
521 \fi\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
522 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
523
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
524 % Be sure we're in horizontal mode when doing a tie, since we make space
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
525 % equivalent to this in @example-like environments. Otherwise, a space
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
526 % at the beginning of a line will start with \penalty -- and
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
527 % since \penalty is valid in vertical mode, we'd end up putting the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
528 % penalty on the vertical list instead of in the new paragraph.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
529 {\catcode`@ = 11
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
530 % Avoid using \@M directly, because that causes trouble
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
531 % if the definition is written into an index file.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
532 \global\let\tiepenalty = \@M
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
533 \gdef\tie{\leavevmode\penalty\tiepenalty\ }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
534 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
535
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
536 % @: forces normal size whitespace following.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
537 \def\:{\spacefactor=1000 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
538
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
539 % @* forces a line break.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
540 \def\*{\hfil\break\hbox{}\ignorespaces}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
541
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
542 % @/ allows a line break.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
543 \let\/=\allowbreak
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
544
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
545 % @. is an end-of-sentence period.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
546 \def\.{.\spacefactor=3000 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
547
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
548 % @! is an end-of-sentence bang.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
549 \def\!{!\spacefactor=3000 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
550
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
551 % @? is an end-of-sentence query.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
552 \def\?{?\spacefactor=3000 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
553
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
554 % @w prevents a word break. Without the \leavevmode, @w at the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
555 % beginning of a paragraph, when TeX is still in vertical mode, would
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
556 % produce a whole line of output instead of starting the paragraph.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
557 \def\w#1{\leavevmode\hbox{#1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
558
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
559 % @group ... @end group forces ... to be all on one page, by enclosing
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
560 % it in a TeX vbox. We use \vtop instead of \vbox to construct the box
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
561 % to keep its height that of a normal line. According to the rules for
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
562 % \topskip (p.114 of the TeXbook), the glue inserted is
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
563 % max (\topskip - \ht (first item), 0). If that height is large,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
564 % therefore, no glue is inserted, and the space between the headline and
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
565 % the text is small, which looks bad.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
566 %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
567 % Another complication is that the group might be very large. This can
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
568 % cause the glue on the previous page to be unduly stretched, because it
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
569 % does not have much material. In this case, it's better to add an
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
570 % explicit \vfill so that the extra space is at the bottom. The
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
571 % threshold for doing this is if the group is more than \vfilllimit
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
572 % percent of a page (\vfilllimit can be changed inside of @tex).
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
573 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
574 \newbox\groupbox
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
575 \def\vfilllimit{0.7}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
576 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
577 \def\group{\begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
578 \ifnum\catcode13=\active \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
579 \errhelp = \groupinvalidhelp
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
580 \errmessage{@group invalid in context where filling is enabled}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
581 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
582 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
583 % The \vtop we start below produces a box with normal height and large
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
584 % depth; thus, TeX puts \baselineskip glue before it, and (when the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
585 % next line of text is done) \lineskip glue after it. (See p.82 of
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
586 % the TeXbook.) Thus, space below is not quite equal to space
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
587 % above. But it's pretty close.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
588 \def\Egroup{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
589 \egroup % End the \vtop.
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
590 % \dimen0 is the vertical size of the group's box.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
591 \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
592 % \dimen2 is how much space is left on the page (more or less).
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
593 \dimen2 = \pageheight \advance\dimen2 by -\pagetotal
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
594 % if the group doesn't fit on the current page, and it's a big big
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
595 % group, force a page break.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
596 \ifdim \dimen0 > \dimen2
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
597 \ifdim \pagetotal < \vfilllimit\pageheight
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
598 \page
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
599 \fi
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
600 \fi
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
601 \copy\groupbox
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
602 \endgroup % End the \group.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
603 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
604 %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
605 \setbox\groupbox = \vtop\bgroup
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
606 % We have to put a strut on the last line in case the @group is in
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
607 % the midst of an example, rather than completely enclosing it.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
608 % Otherwise, the interline space between the last line of the group
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
609 % and the first line afterwards is too small. But we can't put the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
610 % strut in \Egroup, since there it would be on a line by itself.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
611 % Hence this just inserts a strut at the beginning of each line.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
612 \everypar = {\strut}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
613 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
614 % Since we have a strut on every line, we don't need any of TeX's
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
615 % normal interline spacing.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
616 \offinterlineskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
617 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
618 % OK, but now we have to do something about blank
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
619 % lines in the input in @example-like environments, which normally
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
620 % just turn into \lisppar, which will insert no space now that we've
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
621 % turned off the interline space. Simplest is to make them be an
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
622 % empty paragraph.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
623 \ifx\par\lisppar
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
624 \edef\par{\leavevmode \par}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
625 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
626 % Reset ^^M's definition to new definition of \par.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
627 \obeylines
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
628 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
629 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
630 % Do @comment since we are called inside an environment such as
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
631 % @example, where each end-of-line in the input causes an
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
632 % end-of-line in the output. We don't want the end-of-line after
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
633 % the `@group' to put extra space in the output. Since @group
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
634 % should appear on a line by itself (according to the Texinfo
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
635 % manual), we don't worry about eating any user text.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
636 \comment
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
637 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
638 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
639 % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
640 % message, so this ends up printing `@group can only ...'.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
641 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
642 \newhelp\groupinvalidhelp{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
643 group can only be used in environments such as @example,^^J%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
644 where each line of input produces a line of output.}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
645
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
646 % @need space-in-mils
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
647 % forces a page break if there is not space-in-mils remaining.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
648
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
649 \newdimen\mil \mil=0.001in
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
650
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
651 \def\need{\parsearg\needx}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
652
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
653 % Old definition--didn't work.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
654 %\def\needx #1{\par %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
655 %% This method tries to make TeX break the page naturally
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
656 %% if the depth of the box does not fit.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
657 %{\baselineskip=0pt%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
658 %\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
659 %\prevdepth=-1000pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
660 %}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
661
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
662 \def\needx#1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
663 % Ensure vertical mode, so we don't make a big box in the middle of a
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
664 % paragraph.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
665 \par
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
666 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
667 % If the @need value is less than one line space, it's useless.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
668 \dimen0 = #1\mil
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
669 \dimen2 = \ht\strutbox
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
670 \advance\dimen2 by \dp\strutbox
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
671 \ifdim\dimen0 > \dimen2
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
672 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
673 % Do a \strut just to make the height of this box be normal, so the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
674 % normal leading is inserted relative to the preceding line.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
675 % And a page break here is fine.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
676 \vtop to #1\mil{\strut\vfil}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
677 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
678 % TeX does not even consider page breaks if a penalty added to the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
679 % main vertical list is 10000 or more. But in order to see if the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
680 % empty box we just added fits on the page, we must make it consider
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
681 % page breaks. On the other hand, we don't want to actually break the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
682 % page after the empty box. So we use a penalty of 9999.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
683 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
684 % There is an extremely small chance that TeX will actually break the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
685 % page at this \penalty, if there are no other feasible breakpoints in
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
686 % sight. (If the user is using lots of big @group commands, which
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
687 % almost-but-not-quite fill up a page, TeX will have a hard time doing
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
688 % good page breaking, for example.) However, I could not construct an
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
689 % example where a page broke at this \penalty; if it happens in a real
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
690 % document, then we can reconsider our strategy.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
691 \penalty9999
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
692 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
693 % Back up by the size of the box, whether we did a page break or not.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
694 \kern -#1\mil
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
695 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
696 % Do not allow a page break right after this kern.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
697 \nobreak
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
698 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
699 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
700
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
701 % @br forces paragraph break
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
702
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
703 \let\br = \par
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
704
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
705 % @dots{} output an ellipsis using the current font.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
706 % We do .5em per period so that it has the same spacing in a typewriter
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
707 % font as three actual period characters.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
708 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
709 \def\dots{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
710 \leavevmode
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
711 \hbox to 1.5em{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
712 \hskip 0pt plus 0.25fil minus 0.25fil
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
713 .\hss.\hss.%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
714 \hskip 0pt plus 0.5fil minus 0.5fil
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
715 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
716 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
717
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
718 % @enddots{} is an end-of-sentence ellipsis.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
719 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
720 \def\enddots{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
721 \leavevmode
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
722 \hbox to 2em{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
723 \hskip 0pt plus 0.25fil minus 0.25fil
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
724 .\hss.\hss.\hss.%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
725 \hskip 0pt plus 0.5fil minus 0.5fil
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
726 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
727 \spacefactor=3000
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
728 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
729
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
730 % @page forces the start of a new page.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
731 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
732 \def\page{\par\vfill\supereject}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
733
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
734 % @exdent text....
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
735 % outputs text on separate line in roman font, starting at standard page margin
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
736
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
737 % This records the amount of indent in the innermost environment.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
738 % That's how much \exdent should take out.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
739 \newskip\exdentamount
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
740
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
741 % This defn is used inside fill environments such as @defun.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
742 \def\exdent{\parsearg\exdentyyy}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
743 \def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
744
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
745 % This defn is used inside nofill environments such as @example.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
746 \def\nofillexdent{\parsearg\nofillexdentyyy}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
747 \def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
748 \leftline{\hskip\leftskip{\rm#1}}}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
749
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
750 % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
751 % paragraph. For more general purposes, use the \margin insertion
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
752 % class. WHICH is `l' or `r'.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
753 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
754 \newskip\inmarginspacing \inmarginspacing=1cm
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
755 \def\strutdepth{\dp\strutbox}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
756 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
757 \def\doinmargin#1#2{\strut\vadjust{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
758 \nobreak
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
759 \kern-\strutdepth
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
760 \vtop to \strutdepth{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
761 \baselineskip=\strutdepth
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
762 \vss
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
763 % if you have multiple lines of stuff to put here, you'll need to
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
764 % make the vbox yourself of the appropriate size.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
765 \ifx#1l%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
766 \llap{\ignorespaces #2\hskip\inmarginspacing}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
767 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
768 \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
769 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
770 \null
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
771 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
772 }}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
773 \def\inleftmargin{\doinmargin l}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
774 \def\inrightmargin{\doinmargin r}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
775 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
776 % @inmargin{TEXT [, RIGHT-TEXT]}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
777 % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
778 % else use TEXT for both).
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
779 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
780 \def\inmargin#1{\parseinmargin #1,,\finish}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
781 \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
782 \setbox0 = \hbox{\ignorespaces #2}%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
783 \ifdim\wd0 > 0pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
784 \def\lefttext{#1}% have both texts
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
785 \def\righttext{#2}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
786 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
787 \def\lefttext{#1}% have only one text
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
788 \def\righttext{#1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
789 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
790 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
791 \ifodd\pageno
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
792 \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
793 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
794 \def\temp{\inleftmargin\lefttext}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
795 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
796 \temp
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
797 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
798
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
799 % @include file insert text of that file as input.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
800 % Allow normal characters that we make active in the argument (a file name).
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
801 \def\include{\begingroup
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
802 \catcode`\\=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
803 \catcode`~=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
804 \catcode`^=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
805 \catcode`_=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
806 \catcode`|=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
807 \catcode`<=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
808 \catcode`>=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
809 \catcode`+=\other
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
810 \parsearg\includezzz}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
811 % Restore active chars for included file.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
812 \def\includezzz#1{\endgroup\begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
813 % Read the included file in a group so nested @include's work.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
814 \def\thisfile{#1}%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
815 \let\value=\expandablevalue
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
816 \input\thisfile
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
817 \endgroup}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
818
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
819 \def\thisfile{}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
820
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
821 % @center line
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
822 % outputs that line, centered.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
823 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
824 \def\center{\parsearg\docenter}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
825 \def\docenter#1{{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
826 \ifhmode \hfil\break \fi
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
827 \advance\hsize by -\leftskip
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
828 \advance\hsize by -\rightskip
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
829 \line{\hfil \ignorespaces#1\unskip \hfil}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
830 \ifhmode \break \fi
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
831 }}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
832
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
833 % @sp n outputs n lines of vertical space
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
834
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
835 \def\sp{\parsearg\spxxx}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
836 \def\spxxx #1{\vskip #1\baselineskip}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
837
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
838 % @comment ...line which is ignored...
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
839 % @c is the same as @comment
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
840 % @ignore ... @end ignore is another way to write a comment
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
841
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
842 \def\comment{\begingroup \catcode`\^^M=\other%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
843 \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
844 \commentxxx}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
845 {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
846
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
847 \let\c=\comment
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
848
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
849 % @paragraphindent NCHARS
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
850 % We'll use ems for NCHARS, close enough.
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
851 % NCHARS can also be the word `asis' or `none'.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
852 % We cannot feasibly implement @paragraphindent asis, though.
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
853 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
854 \def\asisword{asis} % no translation, these are keywords
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
855 \def\noneword{none}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
856 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
857 \def\paragraphindent{\parsearg\doparagraphindent}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
858 \def\doparagraphindent#1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
859 \def\temp{#1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
860 \ifx\temp\asisword
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
861 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
862 \ifx\temp\noneword
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
863 \defaultparindent = 0pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
864 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
865 \defaultparindent = #1em
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
866 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
867 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
868 \parindent = \defaultparindent
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
869 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
870
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
871 % @exampleindent NCHARS
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
872 % We'll use ems for NCHARS like @paragraphindent.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
873 % It seems @exampleindent asis isn't necessary, but
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
874 % I preserve it to make it similar to @paragraphindent.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
875 \def\exampleindent{\parsearg\doexampleindent}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
876 \def\doexampleindent#1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
877 \def\temp{#1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
878 \ifx\temp\asisword
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
879 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
880 \ifx\temp\noneword
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
881 \lispnarrowing = 0pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
882 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
883 \lispnarrowing = #1em
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
884 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
885 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
886 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
887
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
888 % @firstparagraphindent WORD
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
889 % If WORD is `none', then suppress indentation of the first paragraph
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
890 % after a section heading. If WORD is `insert', then do indentat such
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
891 % paragraphs.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
892 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
893 % The paragraph indentation is suppressed or not by calling
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
894 % \suppressfirstparagraphindent, which the sectioning commands do. We
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
895 % switch the definition of this back and forth according to WORD. By
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
896 % default, we suppress indentation.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
897 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
898 \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
899 \newdimen\currentparindent
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
900 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
901 \def\insertword{insert}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
902 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
903 \def\firstparagraphindent{\parsearg\dofirstparagraphindent}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
904 \def\dofirstparagraphindent#1{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
905 \def\temp{#1}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
906 \ifx\temp\noneword
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
907 \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
908 \else\ifx\temp\insertword
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
909 \let\suppressfirstparagraphindent = \relax
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
910 \else
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
911 \errhelp = \EMsimple
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
912 \errmessage{Unknown @firstparagraphindent option `\temp'}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
913 \fi\fi
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
914 }
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
915
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
916 % Here is how we actually suppress indentation. Redefine \everypar to
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
917 % \kern backwards by \parindent, and then reset itself to empty.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
918 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
919 % We also make \indent itself not actually do anything until the next
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
920 % paragraph.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
921 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
922 \gdef\dosuppressfirstparagraphindent{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
923 \gdef\indent{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
924 \global\let\indent=\ptexindent
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
925 \global\everypar = {}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
926 }%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
927 \global\everypar = {%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
928 \kern-\parindent
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
929 \global\let\indent=\ptexindent
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
930 \global\everypar = {}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
931 }%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
932 }%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
933
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
934
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
935 % @asis just yields its argument. Used with @table, for example.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
936 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
937 \def\asis#1{#1}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
938
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
939 % @math outputs its argument in math mode.
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
940 % We don't use $'s directly in the definition of \math because we need
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
941 % to set catcodes according to plain TeX first, to allow for subscripts,
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
942 % superscripts, special math chars, etc.
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
943 %
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
944 \let\implicitmath = $%$ font-lock fix
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
945 %
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
946 % One complication: _ usually means subscripts, but it could also mean
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
947 % an actual _ character, as in @math{@var{some_variable} + 1}. So make
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
948 % _ within @math be active (mathcode "8000), and distinguish by seeing
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
949 % if the current family is \slfam, which is what @var uses.
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
950 %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
951 {\catcode\underChar = \active
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
952 \gdef\mathunderscore{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
953 \catcode\underChar=\active
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
954 \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
955 }}
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
956 %
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
957 % Another complication: we want \\ (and @\) to output a \ character.
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
958 % FYI, plain.tex uses \\ as a temporary control sequence (why?), but
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
959 % this is not advertised and we don't care. Texinfo does not
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
960 % otherwise define @\.
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
961 %
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
962 % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
963 \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
964 %
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
965 \def\math{%
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
966 \tex
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
967 \mathcode`\_="8000 \mathunderscore
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
968 \let\\ = \mathbackslash
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
969 \mathactive
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
970 \implicitmath\finishmath}
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
971 \def\finishmath#1{#1\implicitmath\Etex}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
972
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
973 % Some active characters (such as <) are spaced differently in math.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
974 % We have to reset their definitions in case the @math was an
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
975 % argument to a command which set the catcodes (such as @item or @section).
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
976 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
977 {
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
978 \catcode`^ = \active
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
979 \catcode`< = \active
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
980 \catcode`> = \active
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
981 \catcode`+ = \active
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
982 \gdef\mathactive{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
983 \let^ = \ptexhat
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
984 \let< = \ptexless
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
985 \let> = \ptexgtr
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
986 \let+ = \ptexplus
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
987 }
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
988 }
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
989
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
990 % @bullet and @minus need the same treatment as @math, just above.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
991 \def\bullet{\implicitmath\ptexbullet\implicitmath}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
992 \def\minus{\implicitmath-\implicitmath}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
993
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
994 % @refill is a no-op.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
995 \let\refill=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
996
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
997 % If working on a large document in chapters, it is convenient to
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
998 % be able to disable indexing, cross-referencing, and contents, for test runs.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
999 % This is done with @novalidate (before @setfilename).
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1000 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1001 \newif\iflinks \linkstrue % by default we want the aux files.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1002 \let\novalidate = \linksfalse
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1003
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1004 % @setfilename is done at the beginning of every texinfo file.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1005 % So open here the files we need to have open while reading the input.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1006 % This makes it possible to make a .fmt file for texinfo.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1007 \def\setfilename{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1008 \iflinks
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1009 \readauxfile
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1010 \fi % \openindices needs to do some work in any case.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1011 \openindices
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1012 \fixbackslash % Turn off hack to swallow `\input texinfo'.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1013 \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1014 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1015 % If texinfo.cnf is present on the system, read it.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1016 % Useful for site-wide @afourpaper, etc.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1017 % Just to be on the safe side, close the input stream before the \input.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1018 \openin 1 texinfo.cnf
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1019 \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1020 \closein1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1021 \temp
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1022 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1023 \comment % Ignore the actual filename.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1024 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1025
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1026 % Called from \setfilename.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1027 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1028 \def\openindices{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1029 \newindex{cp}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1030 \newcodeindex{fn}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1031 \newcodeindex{vr}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1032 \newcodeindex{tp}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1033 \newcodeindex{ky}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1034 \newcodeindex{pg}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1035 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1036
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1037 % @bye.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1038 \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1039
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1040
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1041 \message{pdf,}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1042 % adobe `portable' document format
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1043 \newcount\tempnum
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1044 \newcount\lnkcount
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1045 \newtoks\filename
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1046 \newcount\filenamelength
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1047 \newcount\pgn
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1048 \newtoks\toksA
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1049 \newtoks\toksB
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1050 \newtoks\toksC
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1051 \newtoks\toksD
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1052 \newbox\boxA
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1053 \newcount\countA
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1054 \newif\ifpdf
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1055 \newif\ifpdfmakepagedest
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1056
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1057 \ifx\pdfoutput\undefined
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1058 \pdffalse
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1059 \let\pdfmkdest = \gobble
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1060 \let\pdfurl = \gobble
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1061 \let\endlink = \relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1062 \let\linkcolor = \relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1063 \let\pdfmakeoutlines = \relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1064 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1065 \pdftrue
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1066 \pdfoutput = 1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1067 \input pdfcolor
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1068 \def\dopdfimage#1#2#3{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1069 \def\imagewidth{#2}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1070 \def\imageheight{#3}%
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1071 % without \immediate, pdftex seg faults when the same image is
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1072 % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1073 \ifnum\pdftexversion < 14
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1074 \immediate\pdfimage
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1075 \else
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1076 \immediate\pdfximage
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1077 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1078 \ifx\empty\imagewidth\else width \imagewidth \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1079 \ifx\empty\imageheight\else height \imageheight \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1080 \ifnum\pdftexversion<13
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1081 #1.pdf%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1082 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1083 {#1.pdf}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1084 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1085 \ifnum\pdftexversion < 14 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1086 \pdfrefximage \pdflastximage
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1087 \fi}
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1088 \def\pdfmkdest#1{{\normalturnoffactive \pdfdest name{#1} xyz}}
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1089 \def\pdfmkpgn#1{#1}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1090 \let\linkcolor = \Blue % was Cyan, but that seems light?
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1091 \def\endlink{\Black\pdfendlink}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1092 % Adding outlines to PDF; macros for calculating structure of outlines
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1093 % come from Petr Olsak
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1094 \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1095 \else \csname#1\endcsname \fi}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1096 \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1097 \advance\tempnum by1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1098 \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1099 \def\pdfmakeoutlines{{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1100 \openin 1 \jobname.toc
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1101 \ifeof 1\else\begingroup
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
1102 \closein 1
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
1103 % Thanh's hack / proper braces in bookmarks
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1104 \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1105 \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1106 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1107 \def\chapentry ##1##2##3{}
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1108 \def\secentry ##1##2##3##4{\advancenumber{chap##2}}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1109 \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1110 \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}}
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1111 \let\appendixentry = \chapentry
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1112 \let\unnumbchapentry = \chapentry
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1113 \let\unnumbsecentry = \secentry
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1114 \let\unnumbsubsecentry = \subsecentry
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1115 \let\unnumbsubsubsecentry = \subsubsecentry
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1116 \input \jobname.toc
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1117 \def\chapentry ##1##2##3{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1118 \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1119 \def\secentry ##1##2##3##4{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1120 \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1121 \def\subsecentry ##1##2##3##4##5{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1122 \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1123 \def\subsubsecentry ##1##2##3##4##5##6{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1124 \pdfoutline goto name{\pdfmkpgn{##6}}{##1}}
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1125 \let\appendixentry = \chapentry
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1126 \let\unnumbchapentry = \chapentry
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1127 \let\unnumbsecentry = \secentry
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1128 \let\unnumbsubsecentry = \subsecentry
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1129 \let\unnumbsubsubsecentry = \subsubsecentry
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1130 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1131 % Make special characters normal for writing to the pdf file.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1132 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1133 \indexnofonts
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1134 \let\tt=\relax
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1135 \turnoffactive
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1136 \input \jobname.toc
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1137 \endgroup\fi
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1138 }}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1139 \def\makelinks #1,{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1140 \def\params{#1}\def\E{END}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1141 \ifx\params\E
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1142 \let\nextmakelinks=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1143 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1144 \let\nextmakelinks=\makelinks
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1145 \ifnum\lnkcount>0,\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1146 \picknum{#1}%
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
1147 \startlink attr{/Border [0 0 0]}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1148 goto name{\pdfmkpgn{\the\pgn}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1149 \linkcolor #1%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1150 \advance\lnkcount by 1%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1151 \endlink
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1152 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1153 \nextmakelinks
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1154 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1155 \def\picknum#1{\expandafter\pn#1}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1156 \def\pn#1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1157 \def\p{#1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1158 \ifx\p\lbrace
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1159 \let\nextpn=\ppn
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1160 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1161 \let\nextpn=\ppnn
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1162 \def\first{#1}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1163 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1164 \nextpn
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1165 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1166 \def\ppn#1{\pgn=#1\gobble}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1167 \def\ppnn{\pgn=\first}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1168 \def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1169 \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1170 \def\skipspaces#1{\def\PP{#1}\def\D{|}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1171 \ifx\PP\D\let\nextsp\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1172 \else\let\nextsp\skipspaces
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1173 \ifx\p\space\else\addtokens{\filename}{\PP}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1174 \advance\filenamelength by 1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1175 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1176 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1177 \nextsp}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1178 \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1179 \ifnum\pdftexversion < 14
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1180 \let \startlink \pdfannotlink
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1181 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1182 \let \startlink \pdfstartlink
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1183 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1184 \def\pdfurl#1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1185 \begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1186 \normalturnoffactive\def\@{@}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1187 \let\value=\expandablevalue
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1188 \leavevmode\Red
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1189 \startlink attr{/Border [0 0 0]}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1190 user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1191 % #1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1192 \endgroup}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1193 \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1194 \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1195 \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1196 \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1197 \def\maketoks{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1198 \expandafter\poptoks\the\toksA|ENDTOKS|
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1199 \ifx\first0\adn0
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1200 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1201 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
1202 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1203 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1204 \ifnum0=\countA\else\makelink\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1205 \ifx\first.\let\next=\done\else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1206 \let\next=\maketoks
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1207 \addtokens{\toksB}{\the\toksD}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1208 \ifx\first,\addtokens{\toksB}{\space}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1209 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1210 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1211 \next}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1212 \def\makelink{\addtokens{\toksB}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1213 {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1214 \def\pdflink#1{%
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1215 \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1216 \linkcolor #1\endlink}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1217 \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1218 \fi % \ifx\pdfoutput
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1219
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1220
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1221 \message{fonts,}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1222 % Font-change commands.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1223
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1224 % Texinfo sort of supports the sans serif font style, which plain TeX does not.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1225 % So we set up a \sf analogous to plain's \rm, etc.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1226 \newfam\sffam
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1227 \def\sf{\fam=\sffam \tensf}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1228 \let\li = \sf % Sometimes we call it \li, not \sf.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1229
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1230 % We don't need math for this one.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1231 \def\ttsl{\tenttsl}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1232
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1233 % Default leading.
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1234 \newdimen\textleading \textleading = 13.2pt
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1235
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1236 % Set the baselineskip to #1, and the lineskip and strut size
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1237 % correspondingly. There is no deep meaning behind these magic numbers
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1238 % used as factors; they just match (closely enough) what Knuth defined.
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1239 %
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1240 \def\lineskipfactor{.08333}
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1241 \def\strutheightpercent{.70833}
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1242 \def\strutdepthpercent {.29167}
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1243 %
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1244 \def\setleading#1{%
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1245 \normalbaselineskip = #1\relax
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1246 \normallineskip = \lineskipfactor\normalbaselineskip
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1247 \normalbaselines
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1248 \setbox\strutbox =\hbox{%
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1249 \vrule width0pt height\strutheightpercent\baselineskip
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1250 depth \strutdepthpercent \baselineskip
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1251 }%
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1252 }
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1253
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1254 % Set the font macro #1 to the font named #2, adding on the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1255 % specified font prefix (normally `cm').
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1256 % #3 is the font's design size, #4 is a scale factor
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1257 \def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1258
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1259 % Use cm as the default font prefix.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1260 % To specify the font prefix, you must define \fontprefix
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1261 % before you read in texinfo.tex.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1262 \ifx\fontprefix\undefined
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1263 \def\fontprefix{cm}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1264 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1265 % Support font families that don't use the same naming scheme as CM.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1266 \def\rmshape{r}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1267 \def\rmbshape{bx} %where the normal face is bold
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1268 \def\bfshape{b}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1269 \def\bxshape{bx}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1270 \def\ttshape{tt}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1271 \def\ttbshape{tt}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1272 \def\ttslshape{sltt}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1273 \def\itshape{ti}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1274 \def\itbshape{bxti}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1275 \def\slshape{sl}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1276 \def\slbshape{bxsl}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1277 \def\sfshape{ss}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1278 \def\sfbshape{ss}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1279 \def\scshape{csc}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1280 \def\scbshape{csc}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1281
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1282 \newcount\mainmagstep
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1283 \ifx\bigger\relax
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1284 % not really supported.
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1285 \mainmagstep=\magstep1
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1286 \setfont\textrm\rmshape{12}{1000}
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1287 \setfont\texttt\ttshape{12}{1000}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1288 \else
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1289 \mainmagstep=\magstephalf
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1290 \setfont\textrm\rmshape{10}{\mainmagstep}
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1291 \setfont\texttt\ttshape{10}{\mainmagstep}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1292 \fi
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1293 % Instead of cmb10, you may want to use cmbx10.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1294 % cmbx10 is a prettier font on its own, but cmb10
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1295 % looks better when embedded in a line with cmr10
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1296 % (in Bob's opinion).
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1297 \setfont\textbf\bfshape{10}{\mainmagstep}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1298 \setfont\textit\itshape{10}{\mainmagstep}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1299 \setfont\textsl\slshape{10}{\mainmagstep}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1300 \setfont\textsf\sfshape{10}{\mainmagstep}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1301 \setfont\textsc\scshape{10}{\mainmagstep}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1302 \setfont\textttsl\ttslshape{10}{\mainmagstep}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1303 \font\texti=cmmi10 scaled \mainmagstep
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1304 \font\textsy=cmsy10 scaled \mainmagstep
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1305
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1306 % A few fonts for @defun, etc.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1307 \setfont\defbf\bxshape{10}{\magstep1} %was 1314
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1308 \setfont\deftt\ttshape{10}{\magstep1}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1309 \def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1310
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1311 % Fonts for indices, footnotes, small examples (9pt).
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1312 \setfont\smallrm\rmshape{9}{1000}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1313 \setfont\smalltt\ttshape{9}{1000}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1314 \setfont\smallbf\bfshape{10}{900}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1315 \setfont\smallit\itshape{9}{1000}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1316 \setfont\smallsl\slshape{9}{1000}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1317 \setfont\smallsf\sfshape{9}{1000}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1318 \setfont\smallsc\scshape{10}{900}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1319 \setfont\smallttsl\ttslshape{10}{900}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1320 \font\smalli=cmmi9
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1321 \font\smallsy=cmsy9
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1322
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1323 % Fonts for small examples (8pt).
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1324 \setfont\smallerrm\rmshape{8}{1000}
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1325 \setfont\smallertt\ttshape{8}{1000}
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1326 \setfont\smallerbf\bfshape{10}{800}
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1327 \setfont\smallerit\itshape{8}{1000}
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1328 \setfont\smallersl\slshape{8}{1000}
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1329 \setfont\smallersf\sfshape{8}{1000}
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1330 \setfont\smallersc\scshape{10}{800}
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1331 \setfont\smallerttsl\ttslshape{10}{800}
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1332 \font\smalleri=cmmi8
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1333 \font\smallersy=cmsy8
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1334
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1335 % Fonts for title page:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1336 \setfont\titlerm\rmbshape{12}{\magstep3}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1337 \setfont\titleit\itbshape{10}{\magstep4}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1338 \setfont\titlesl\slbshape{10}{\magstep4}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1339 \setfont\titlett\ttbshape{12}{\magstep3}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1340 \setfont\titlettsl\ttslshape{10}{\magstep4}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1341 \setfont\titlesf\sfbshape{17}{\magstep1}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1342 \let\titlebf=\titlerm
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1343 \setfont\titlesc\scbshape{10}{\magstep4}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1344 \font\titlei=cmmi12 scaled \magstep3
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1345 \font\titlesy=cmsy10 scaled \magstep4
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1346 \def\authorrm{\secrm}
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1347 \def\authortt{\sectt}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1348
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1349 % Chapter (and unnumbered) fonts (17.28pt).
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1350 \setfont\chaprm\rmbshape{12}{\magstep2}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1351 \setfont\chapit\itbshape{10}{\magstep3}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1352 \setfont\chapsl\slbshape{10}{\magstep3}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1353 \setfont\chaptt\ttbshape{12}{\magstep2}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1354 \setfont\chapttsl\ttslshape{10}{\magstep3}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1355 \setfont\chapsf\sfbshape{17}{1000}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1356 \let\chapbf=\chaprm
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1357 \setfont\chapsc\scbshape{10}{\magstep3}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1358 \font\chapi=cmmi12 scaled \magstep2
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1359 \font\chapsy=cmsy10 scaled \magstep3
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1360
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1361 % Section fonts (14.4pt).
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1362 \setfont\secrm\rmbshape{12}{\magstep1}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1363 \setfont\secit\itbshape{10}{\magstep2}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1364 \setfont\secsl\slbshape{10}{\magstep2}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1365 \setfont\sectt\ttbshape{12}{\magstep1}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1366 \setfont\secttsl\ttslshape{10}{\magstep2}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1367 \setfont\secsf\sfbshape{12}{\magstep1}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1368 \let\secbf\secrm
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1369 \setfont\secsc\scbshape{10}{\magstep2}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1370 \font\seci=cmmi12 scaled \magstep1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1371 \font\secsy=cmsy10 scaled \magstep2
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1372
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1373 % Subsection fonts (13.15pt).
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1374 \setfont\ssecrm\rmbshape{12}{\magstephalf}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1375 \setfont\ssecit\itbshape{10}{1315}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1376 \setfont\ssecsl\slbshape{10}{1315}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1377 \setfont\ssectt\ttbshape{12}{\magstephalf}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1378 \setfont\ssecttsl\ttslshape{10}{1315}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1379 \setfont\ssecsf\sfbshape{12}{\magstephalf}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1380 \let\ssecbf\ssecrm
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1381 \setfont\ssecsc\scbshape{10}{\magstep1}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1382 \font\sseci=cmmi12 scaled \magstephalf
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1383 \font\ssecsy=cmsy10 scaled 1315
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1384 % The smallcaps and symbol fonts should actually be scaled \magstep1.5,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1385 % but that is not a standard magnification.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1386
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1387 % In order for the font changes to affect most math symbols and letters,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1388 % we have to define the \textfont of the standard families. Since
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1389 % texinfo doesn't allow for producing subscripts and superscripts except
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1390 % in the main text, we don't bother to reset \scriptfont and
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1391 % \scriptscriptfont (which would also require loading a lot more fonts).
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1392 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1393 \def\resetmathfonts{%
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1394 \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1395 \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1396 \textfont\ttfam=\tentt \textfont\sffam=\tensf
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1397 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1398
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1399 % The font-changing commands redefine the meanings of \tenSTYLE, instead
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1400 % of just \STYLE. We do this so that font changes will continue to work
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1401 % in math mode, where it is the current \fam that is relevant in most
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1402 % cases, not the current font. Plain TeX does \def\bf{\fam=\bffam
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1403 % \tenbf}, for example. By redefining \tenbf, we obviate the need to
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1404 % redefine \bf itself.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1405 \def\textfonts{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1406 \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1407 \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1408 \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1409 \resetmathfonts \setleading{\textleading}}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1410 \def\titlefonts{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1411 \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1412 \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1413 \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1414 \let\tenttsl=\titlettsl
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1415 \resetmathfonts \setleading{25pt}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1416 \def\titlefont#1{{\titlefonts\rm #1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1417 \def\chapfonts{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1418 \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1419 \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1420 \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1421 \resetmathfonts \setleading{19pt}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1422 \def\secfonts{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1423 \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1424 \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1425 \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1426 \resetmathfonts \setleading{16pt}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1427 \def\subsecfonts{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1428 \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1429 \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1430 \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1431 \resetmathfonts \setleading{15pt}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1432 \let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf?
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1433 \def\smallfonts{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1434 \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1435 \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1436 \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1437 \let\tenttsl=\smallttsl
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1438 \resetmathfonts \setleading{10.5pt}}
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1439 \def\smallerfonts{%
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1440 \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1441 \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1442 \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1443 \let\tenttsl=\smallerttsl
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1444 \resetmathfonts \setleading{9.5pt}}
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1445
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1446 % Set the fonts to use with the @small... environments.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1447 \let\smallexamplefonts = \smallfonts
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1448
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1449 % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1450 % can fit this many characters:
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1451 % 8.5x11=86 smallbook=72 a4=90 a5=69
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1452 % If we use \smallerfonts (8pt), then we can fit this many characters:
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1453 % 8.5x11=90+ smallbook=80 a4=90+ a5=77
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1454 % For me, subjectively, the few extra characters that fit aren't worth
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1455 % the additional smallness of 8pt. So I'm making the default 9pt.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1456 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1457 % By the way, for comparison, here's what fits with @example (10pt):
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1458 % 8.5x11=71 smallbook=60 a4=75 a5=58
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1459 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1460 % I wish we used A4 paper on this side of the Atlantic.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1461 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1462 % --karl, 24jan03.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1463
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1464
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1465 % Set up the default fonts, so we can use them for creating boxes.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1466 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1467 \textfonts
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1468
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1469 % Define these so they can be easily changed for other fonts.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1470 \def\angleleft{$\langle$}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1471 \def\angleright{$\rangle$}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1472
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1473 % Count depth in font-changes, for error checks
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1474 \newcount\fontdepth \fontdepth=0
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1475
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1476 % Fonts for short table of contents.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1477 \setfont\shortcontrm\rmshape{12}{1000}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1478 \setfont\shortcontbf\bxshape{12}{1000}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1479 \setfont\shortcontsl\slshape{12}{1000}
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1480 \setfont\shortconttt\ttshape{12}{1000}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1481
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1482 %% Add scribe-like font environments, plus @l for inline lisp (usually sans
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1483 %% serif) and @ii for TeX italic
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1484
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1485 % \smartitalic{ARG} outputs arg in italics, followed by an italic correction
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1486 % unless the following character is such as not to need one.
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1487 \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1488 \ptexslash\fi\fi\fi}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1489 \def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1490 \def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1491
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1492 \let\i=\smartitalic
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1493 \let\var=\smartslanted
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1494 \let\dfn=\smartslanted
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1495 \let\emph=\smartitalic
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1496 \let\cite=\smartslanted
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1497
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1498 \def\b#1{{\bf #1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1499 \let\strong=\b
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1500
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1501 % We can't just use \exhyphenpenalty, because that only has effect at
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1502 % the end of a paragraph. Restore normal hyphenation at the end of the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1503 % group within which \nohyphenation is presumably called.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1504 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1505 \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1506 \def\restorehyphenation{\hyphenchar\font = `- }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1507
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1508 % Set sfcode to normal for the chars that usually have another value.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1509 % Can't use plain's \frenchspacing because it uses the `\x notation, and
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1510 % sometimes \x has an active definition that messes things up.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1511 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1512 \catcode`@=11
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1513 \def\frenchspacing{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1514 \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1515 \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1516 }
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1517 \catcode`@=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1518
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1519 \def\t#1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1520 {\tt \rawbackslash \frenchspacing #1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1521 \null
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1522 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1523 \let\ttfont=\t
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1524 \def\samp#1{`\tclose{#1}'\null}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1525 \setfont\keyrm\rmshape{8}{1000}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1526 \font\keysy=cmsy9
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1527 \def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1528 \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1529 \vbox{\hrule\kern-0.4pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1530 \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1531 \kern-0.4pt\hrule}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1532 \kern-.06em\raise0.4pt\hbox{\angleright}}}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1533 % The old definition, with no lozenge:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1534 %\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1535 \def\ctrl #1{{\tt \rawbackslash \hat}#1}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1536
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1537 % @file, @option are the same as @samp.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1538 \let\file=\samp
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1539 \let\option=\samp
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1540
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1541 % @code is a modification of @t,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1542 % which makes spaces the same size as normal in the surrounding text.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1543 \def\tclose#1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1544 {%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1545 % Change normal interword space to be same as for the current font.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1546 \spaceskip = \fontdimen2\font
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1547 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1548 % Switch to typewriter.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1549 \tt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1550 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1551 % But `\ ' produces the large typewriter interword space.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1552 \def\ {{\spaceskip = 0pt{} }}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1553 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1554 % Turn off hyphenation.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1555 \nohyphenation
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1556 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1557 \rawbackslash
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1558 \frenchspacing
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1559 #1%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1560 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1561 \null
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1562 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1563
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1564 % We *must* turn on hyphenation at `-' and `_' in \code.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1565 % Otherwise, it is too hard to avoid overfull hboxes
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1566 % in the Emacs manual, the Library manual, etc.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1567
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1568 % Unfortunately, TeX uses one parameter (\hyphenchar) to control
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1569 % both hyphenation at - and hyphenation within words.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1570 % We must therefore turn them both off (\tclose does that)
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1571 % and arrange explicitly to hyphenate at a dash.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1572 % -- rms.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1573 {
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1574 \catcode`\-=\active
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1575 \catcode`\_=\active
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1576 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1577 \global\def\code{\begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1578 \catcode`\-=\active \let-\codedash
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1579 \catcode`\_=\active \let_\codeunder
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1580 \codex
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1581 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1582 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1583 % If we end up with any active - characters when handling the index,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1584 % just treat them as a normal -.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1585 \global\def\indexbreaks{\catcode`\-=\active \let-\realdash}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1586 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1587
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1588 \def\realdash{-}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1589 \def\codedash{-\discretionary{}{}{}}
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1590 \def\codeunder{%
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1591 % this is all so @math{@code{var_name}+1} can work. In math mode, _
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1592 % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1593 % will therefore expand the active definition of _, which is us
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1594 % (inside @code that is), therefore an endless loop.
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1595 \ifusingtt{\ifmmode
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1596 \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1597 \else\normalunderscore \fi
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1598 \discretionary{}{}{}}%
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1599 {\_}%
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1600 }
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1601 \def\codex #1{\tclose{#1}\endgroup}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1602
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1603 % @kbd is like @code, except that if the argument is just one @key command,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1604 % then @kbd has no effect.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1605
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1606 % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1607 % `example' (@kbd uses ttsl only inside of @example and friends),
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1608 % or `code' (@kbd uses normal tty font always).
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1609 \def\kbdinputstyle{\parsearg\kbdinputstylexxx}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1610 \def\kbdinputstylexxx#1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1611 \def\arg{#1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1612 \ifx\arg\worddistinct
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1613 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1614 \else\ifx\arg\wordexample
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1615 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1616 \else\ifx\arg\wordcode
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1617 \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1618 \else
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1619 \errhelp = \EMsimple
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1620 \errmessage{Unknown @kbdinputstyle option `\arg'}%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1621 \fi\fi\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1622 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1623 \def\worddistinct{distinct}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1624 \def\wordexample{example}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1625 \def\wordcode{code}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1626
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1627 % Default is `distinct.'
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1628 \kbdinputstyle distinct
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1629
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1630 \def\xkey{\key}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1631 \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1632 \ifx\one\xkey\ifx\threex\three \key{#2}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1633 \else{\tclose{\kbdfont\look}}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1634 \else{\tclose{\kbdfont\look}}\fi}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1635
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1636 % For @url, @env, @command quotes seem unnecessary, so use \code.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1637 \let\url=\code
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1638 \let\env=\code
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1639 \let\command=\code
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1640
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1641 % @uref (abbreviation for `urlref') takes an optional (comma-separated)
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1642 % second argument specifying the text to display and an optional third
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1643 % arg as text to display instead of (rather than in addition to) the url
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1644 % itself. First (mandatory) arg is the url. Perhaps eventually put in
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1645 % a hypertex \special here.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1646 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1647 \def\uref#1{\douref #1,,,\finish}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1648 \def\douref#1,#2,#3,#4\finish{\begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1649 \unsepspaces
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1650 \pdfurl{#1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1651 \setbox0 = \hbox{\ignorespaces #3}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1652 \ifdim\wd0 > 0pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1653 \unhbox0 % third arg given, show only that
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1654 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1655 \setbox0 = \hbox{\ignorespaces #2}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1656 \ifdim\wd0 > 0pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1657 \ifpdf
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1658 \unhbox0 % PDF: 2nd arg given, show only it
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1659 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1660 \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1661 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1662 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1663 \code{#1}% only url given, so show it
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1664 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1665 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1666 \endlink
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1667 \endgroup}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1668
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1669 % rms does not like angle brackets --karl, 17may97.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1670 % So now @email is just like @uref, unless we are pdf.
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
1671 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1672 %\def\email#1{\angleleft{\tt #1}\angleright}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1673 \ifpdf
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1674 \def\email#1{\doemail#1,,\finish}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1675 \def\doemail#1,#2,#3\finish{\begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1676 \unsepspaces
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1677 \pdfurl{mailto:#1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1678 \setbox0 = \hbox{\ignorespaces #2}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1679 \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1680 \endlink
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1681 \endgroup}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1682 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1683 \let\email=\uref
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1684 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1685
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1686 % Check if we are currently using a typewriter font. Since all the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1687 % Computer Modern typewriter fonts have zero interword stretch (and
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1688 % shrink), and it is reasonable to expect all typewriter fonts to have
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1689 % this property, we can check that font parameter.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1690 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1691 \def\ifmonospace{\ifdim\fontdimen3\font=0pt }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1692
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1693 % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1694 % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1695 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1696 \def\dmn#1{\thinspace #1}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1697
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1698 \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1699
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1700 % @l was never documented to mean ``switch to the Lisp font'',
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1701 % and it is not used as such in any manual I can find. We need it for
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1702 % Polish suppressed-l. --karl, 22sep96.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1703 %\def\l#1{{\li #1}\null}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1704
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1705 % Explicit font changes: @r, @sc, undocumented @ii.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1706 \def\r#1{{\rm #1}} % roman font
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1707 \def\sc#1{{\smallcaps#1}} % smallcaps font
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1708 \def\ii#1{{\it #1}} % italic font
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1709
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1710 % @acronym downcases the argument and prints in smallcaps.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1711 \def\acronym#1{{\smallcaps \lowercase{#1}}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1712
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1713 % @pounds{} is a sterling sign.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1714 \def\pounds{{\it\$}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1715
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1716 % @registeredsymbol - R in a circle. For now, only works in text size;
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1717 % we'd have to redo the font mechanism to change the \scriptstyle and
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1718 % \scriptscriptstyle font sizes to make it look right in headings.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1719 % Adapted from the plain.tex definition of \copyright.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1720 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1721 \def\registeredsymbol{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1722 $^{{\ooalign{\hfil\raise.07ex\hbox{$\scriptstyle\rm R$}\hfil\crcr\Orb}}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1723 }$%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1724 }
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1725
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1726
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1727 \message{page headings,}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1728
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1729 \newskip\titlepagetopglue \titlepagetopglue = 1.5in
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1730 \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1731
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1732 % First the title page. Must do @settitle before @titlepage.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1733 \newif\ifseenauthor
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1734 \newif\iffinishedtitlepage
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1735
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1736 % Do an implicit @contents or @shortcontents after @end titlepage if the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1737 % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1738 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1739 \newif\ifsetcontentsaftertitlepage
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1740 \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1741 \newif\ifsetshortcontentsaftertitlepage
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1742 \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1743
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1744 \def\shorttitlepage{\parsearg\shorttitlepagezzz}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1745 \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1746 \endgroup\page\hbox{}\page}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1747
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1748 \def\titlepage{\begingroup \parindent=0pt \textfonts
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1749 \let\subtitlerm=\tenrm
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1750 \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1751 %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1752 \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
1753 \let\tt=\authortt}%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1754 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1755 % Leave some space at the very top of the page.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1756 \vglue\titlepagetopglue
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1757 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1758 % Now you can print the title using @title.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1759 \def\title{\parsearg\titlezzz}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1760 \def\titlezzz##1{\leftline{\titlefonts\rm ##1}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1761 % print a rule at the page bottom also.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1762 \finishedtitlepagefalse
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1763 \vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1764 % No rule at page bottom unless we print one at the top with @title.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1765 \finishedtitlepagetrue
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1766 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1767 % Now you can put text using @subtitle.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1768 \def\subtitle{\parsearg\subtitlezzz}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1769 \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1770 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1771 % @author should come last, but may come many times.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1772 \def\author{\parsearg\authorzzz}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1773 \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1774 {\authorfont \leftline{##1}}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1775 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1776 % Most title ``pages'' are actually two pages long, with space
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1777 % at the top of the second. We don't want the ragged left on the second.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1778 \let\oldpage = \page
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1779 \def\page{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1780 \iffinishedtitlepage\else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1781 \finishtitlepage
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1782 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1783 \oldpage
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1784 \let\page = \oldpage
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1785 \hbox{}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1786 % \def\page{\oldpage \hbox{}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1787 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1788
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1789 \def\Etitlepage{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1790 \iffinishedtitlepage\else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1791 \finishtitlepage
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1792 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1793 % It is important to do the page break before ending the group,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1794 % because the headline and footline are only empty inside the group.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1795 % If we use the new definition of \page, we always get a blank page
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1796 % after the title page, which we certainly don't want.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1797 \oldpage
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1798 \endgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1799 %
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1800 % Need this before the \...aftertitlepage checks so that if they are
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1801 % in effect the toc pages will come out with page numbers.
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1802 \HEADINGSon
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
1803 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1804 % If they want short, they certainly want long too.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1805 \ifsetshortcontentsaftertitlepage
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1806 \shortcontents
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1807 \contents
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1808 \global\let\shortcontents = \relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1809 \global\let\contents = \relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1810 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1811 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1812 \ifsetcontentsaftertitlepage
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1813 \contents
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1814 \global\let\contents = \relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1815 \global\let\shortcontents = \relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1816 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1817 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1818
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1819 \def\finishtitlepage{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1820 \vskip4pt \hrule height 2pt width \hsize
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1821 \vskip\titlepagebottomglue
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1822 \finishedtitlepagetrue
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1823 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1824
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1825 %%% Set up page headings and footings.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1826
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1827 \let\thispage=\folio
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1828
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1829 \newtoks\evenheadline % headline on even pages
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1830 \newtoks\oddheadline % headline on odd pages
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1831 \newtoks\evenfootline % footline on even pages
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1832 \newtoks\oddfootline % footline on odd pages
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1833
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1834 % Now make Tex use those variables
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1835 \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1836 \else \the\evenheadline \fi}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1837 \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1838 \else \the\evenfootline \fi}\HEADINGShook}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1839 \let\HEADINGShook=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1840
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1841 % Commands to set those variables.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1842 % For example, this is what @headings on does
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1843 % @evenheading @thistitle|@thispage|@thischapter
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1844 % @oddheading @thischapter|@thispage|@thistitle
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1845 % @evenfooting @thisfile||
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1846 % @oddfooting ||@thisfile
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1847
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1848 \def\evenheading{\parsearg\evenheadingxxx}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1849 \def\oddheading{\parsearg\oddheadingxxx}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1850 \def\everyheading{\parsearg\everyheadingxxx}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1851
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1852 \def\evenfooting{\parsearg\evenfootingxxx}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1853 \def\oddfooting{\parsearg\oddfootingxxx}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1854 \def\everyfooting{\parsearg\everyfootingxxx}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1855
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1856 {\catcode`\@=0 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1857
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1858 \gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1859 \gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1860 \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1861
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1862 \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1863 \gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1864 \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1865
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1866 \gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1867
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1868 \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1869 \gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1870 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1871
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1872 \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1873 \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1874 \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1875 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1876 % Leave some space for the footline. Hopefully ok to assume
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1877 % @evenfooting will not be used by itself.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1878 \global\advance\pageheight by -\baselineskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1879 \global\advance\vsize by -\baselineskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1880 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1881
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1882 \gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1883 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1884 }% unbind the catcode of @.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1885
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1886 % @headings double turns headings on for double-sided printing.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1887 % @headings single turns headings on for single-sided printing.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1888 % @headings off turns them off.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1889 % @headings on same as @headings double, retained for compatibility.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1890 % @headings after turns on double-sided headings after this page.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1891 % @headings doubleafter turns on double-sided headings after this page.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1892 % @headings singleafter turns on single-sided headings after this page.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1893 % By default, they are off at the start of a document,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1894 % and turned `on' after @end titlepage.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1895
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1896 \def\headings #1 {\csname HEADINGS#1\endcsname}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1897
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1898 \def\HEADINGSoff{
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1899 \global\evenheadline={\hfil} \global\evenfootline={\hfil}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1900 \global\oddheadline={\hfil} \global\oddfootline={\hfil}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1901 \HEADINGSoff
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1902 % When we turn headings on, set the page number to 1.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1903 % For double-sided printing, put current file name in lower left corner,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1904 % chapter name on inside top of right hand pages, document
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1905 % title on inside top of left hand pages, and page numbers on outside top
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1906 % edge of all pages.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1907 \def\HEADINGSdouble{
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1908 \global\pageno=1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1909 \global\evenfootline={\hfil}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1910 \global\oddfootline={\hfil}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1911 \global\evenheadline={\line{\folio\hfil\thistitle}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1912 \global\oddheadline={\line{\thischapter\hfil\folio}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1913 \global\let\contentsalignmacro = \chapoddpage
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1914 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1915 \let\contentsalignmacro = \chappager
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1916
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1917 % For single-sided printing, chapter title goes across top left of page,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1918 % page number on top right.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1919 \def\HEADINGSsingle{
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1920 \global\pageno=1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1921 \global\evenfootline={\hfil}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1922 \global\oddfootline={\hfil}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1923 \global\evenheadline={\line{\thischapter\hfil\folio}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1924 \global\oddheadline={\line{\thischapter\hfil\folio}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1925 \global\let\contentsalignmacro = \chappager
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1926 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1927 \def\HEADINGSon{\HEADINGSdouble}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1928
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1929 \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1930 \let\HEADINGSdoubleafter=\HEADINGSafter
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1931 \def\HEADINGSdoublex{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1932 \global\evenfootline={\hfil}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1933 \global\oddfootline={\hfil}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1934 \global\evenheadline={\line{\folio\hfil\thistitle}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1935 \global\oddheadline={\line{\thischapter\hfil\folio}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1936 \global\let\contentsalignmacro = \chapoddpage
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1937 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1938
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1939 \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1940 \def\HEADINGSsinglex{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1941 \global\evenfootline={\hfil}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1942 \global\oddfootline={\hfil}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1943 \global\evenheadline={\line{\thischapter\hfil\folio}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1944 \global\oddheadline={\line{\thischapter\hfil\folio}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1945 \global\let\contentsalignmacro = \chappager
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1946 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1947
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1948 % Subroutines used in generating headings
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1949 % This produces Day Month Year style of output.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1950 % Only define if not already defined, in case a txi-??.tex file has set
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1951 % up a different format (e.g., txi-cs.tex does this).
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1952 \ifx\today\undefined
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1953 \def\today{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1954 \number\day\space
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1955 \ifcase\month
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1956 \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1957 \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1958 \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1959 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1960 \space\number\year}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1961 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1962
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1963 % @settitle line... specifies the title of the document, for headings.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1964 % It generates no output of its own.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1965 \def\thistitle{\putwordNoTitle}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1966 \def\settitle{\parsearg\settitlezzz}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1967 \def\settitlezzz #1{\gdef\thistitle{#1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1968
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1969
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1970 \message{tables,}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1971 % Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1972
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1973 % default indentation of table text
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1974 \newdimen\tableindent \tableindent=.8in
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1975 % default indentation of @itemize and @enumerate text
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1976 \newdimen\itemindent \itemindent=.3in
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1977 % margin between end of table item and start of table text.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1978 \newdimen\itemmargin \itemmargin=.1in
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1979
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1980 % used internally for \itemindent minus \itemmargin
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1981 \newdimen\itemmax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1982
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1983 % Note @table, @vtable, and @vtable define @item, @itemx, etc., with
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1984 % these defs.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1985 % They also define \itemindex
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1986 % to index the item name in whatever manner is desired (perhaps none).
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1987
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1988 \newif\ifitemxneedsnegativevskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1989
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1990 \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1991
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1992 \def\internalBitem{\smallbreak \parsearg\itemzzz}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1993 \def\internalBitemx{\itemxpar \parsearg\itemzzz}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1994
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1995 \def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1996 \def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1997
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1998 \def\internalBkitem{\smallbreak \parsearg\kitemzzz}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1999 \def\internalBkitemx{\itemxpar \parsearg\kitemzzz}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2000
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2001 \def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2002 \itemzzz {#1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2003
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2004 \def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2005 \itemzzz {#1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2006
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2007 \def\itemzzz #1{\begingroup %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2008 \advance\hsize by -\rightskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2009 \advance\hsize by -\tableindent
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2010 \setbox0=\hbox{\itemfont{#1}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2011 \itemindex{#1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2012 \nobreak % This prevents a break before @itemx.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2013 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2014 % If the item text does not fit in the space we have, put it on a line
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2015 % by itself, and do not allow a page break either before or after that
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2016 % line. We do not start a paragraph here because then if the next
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2017 % command is, e.g., @kindex, the whatsit would get put into the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2018 % horizontal list on a line by itself, resulting in extra blank space.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2019 \ifdim \wd0>\itemmax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2020 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2021 % Make this a paragraph so we get the \parskip glue and wrapping,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2022 % but leave it ragged-right.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2023 \begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2024 \advance\leftskip by-\tableindent
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2025 \advance\hsize by\tableindent
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2026 \advance\rightskip by0pt plus1fil
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2027 \leavevmode\unhbox0\par
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2028 \endgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2029 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2030 % We're going to be starting a paragraph, but we don't want the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2031 % \parskip glue -- logically it's part of the @item we just started.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2032 \nobreak \vskip-\parskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2033 %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2034 % Stop a page break at the \parskip glue coming up. (Unfortunately
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2035 % we can't prevent a possible page break at the following
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2036 % \baselineskip glue.) However, if what follows is an environment
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2037 % such as @example, there will be no \parskip glue; then
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2038 % the negative vskip we just would cause the example and the item to
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2039 % crash together. So we use this bizarre value of 10001 as a signal
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2040 % to \aboveenvbreak to insert \parskip glue after all.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2041 % (Possibly there are other commands that could be followed by
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2042 % @example which need the same treatment, but not section titles; or
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2043 % maybe section titles are the only special case and they should be
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2044 % penalty 10001...)
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2045 \penalty 10001
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2046 \endgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2047 \itemxneedsnegativevskipfalse
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2048 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2049 % The item text fits into the space. Start a paragraph, so that the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2050 % following text (if any) will end up on the same line.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2051 \noindent
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2052 % Do this with kerns and \unhbox so that if there is a footnote in
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2053 % the item text, it can migrate to the main vertical list and
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2054 % eventually be printed.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2055 \nobreak\kern-\tableindent
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2056 \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2057 \unhbox0
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2058 \nobreak\kern\dimen0
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2059 \endgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2060 \itemxneedsnegativevskiptrue
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2061 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2062 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2063
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2064 \def\item{\errmessage{@item while not in a table}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2065 \def\itemx{\errmessage{@itemx while not in a table}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2066 \def\kitem{\errmessage{@kitem while not in a table}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2067 \def\kitemx{\errmessage{@kitemx while not in a table}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2068 \def\xitem{\errmessage{@xitem while not in a table}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2069 \def\xitemx{\errmessage{@xitemx while not in a table}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2070
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2071 % Contains a kludge to get @end[description] to work.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2072 \def\description{\tablez{\dontindex}{1}{}{}{}{}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2073
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2074 % @table, @ftable, @vtable.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2075 \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2076 {\obeylines\obeyspaces%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2077 \gdef\tablex #1^^M{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2078 \tabley\dontindex#1 \endtabley}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2079
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2080 \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2081 {\obeylines\obeyspaces%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2082 \gdef\ftablex #1^^M{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2083 \tabley\fnitemindex#1 \endtabley
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2084 \def\Eftable{\endgraf\afterenvbreak\endgroup}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2085 \let\Etable=\relax}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2086
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2087 \def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2088 {\obeylines\obeyspaces%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2089 \gdef\vtablex #1^^M{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2090 \tabley\vritemindex#1 \endtabley
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2091 \def\Evtable{\endgraf\afterenvbreak\endgroup}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2092 \let\Etable=\relax}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2093
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2094 \def\dontindex #1{}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2095 \def\fnitemindex #1{\doind {fn}{\code{#1}}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2096 \def\vritemindex #1{\doind {vr}{\code{#1}}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2097
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2098 {\obeyspaces %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2099 \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2100 \tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2101
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2102 \def\tablez #1#2#3#4#5#6{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2103 \aboveenvbreak %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2104 \begingroup %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2105 \def\Edescription{\Etable}% Necessary kludge.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2106 \let\itemindex=#1%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2107 \ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2108 \ifnum 0#4>0 \tableindent=#4\mil \fi %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2109 \ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2110 \def\itemfont{#2}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2111 \itemmax=\tableindent %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2112 \advance \itemmax by -\itemmargin %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2113 \advance \leftskip by \tableindent %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2114 \exdentamount=\tableindent
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2115 \parindent = 0pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2116 \parskip = \smallskipamount
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2117 \ifdim \parskip=0pt \parskip=2pt \fi%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2118 \def\Etable{\endgraf\afterenvbreak\endgroup}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2119 \let\item = \internalBitem %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2120 \let\itemx = \internalBitemx %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2121 \let\kitem = \internalBkitem %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2122 \let\kitemx = \internalBkitemx %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2123 \let\xitem = \internalBxitem %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2124 \let\xitemx = \internalBxitemx %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2125 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2126
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2127 % This is the counter used by @enumerate, which is really @itemize
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2128
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2129 \newcount \itemno
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2130
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2131 \def\itemize{\parsearg\itemizezzz}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2132
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2133 \def\itemizezzz #1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2134 \begingroup % ended by the @end itemize
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2135 \itemizey {#1}{\Eitemize}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2136 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2137
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2138 \def\itemizey#1#2{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2139 \aboveenvbreak
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2140 \itemmax=\itemindent
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2141 \advance\itemmax by -\itemmargin
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2142 \advance\leftskip by \itemindent
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2143 \exdentamount=\itemindent
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2144 \parindent=0pt
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2145 \parskip=\smallskipamount
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2146 \ifdim\parskip=0pt \parskip=2pt \fi
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2147 \def#2{\endgraf\afterenvbreak\endgroup}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2148 \def\itemcontents{#1}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2149 % @itemize with no arg is equivalent to @itemize @bullet.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2150 \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2151 \let\item=\itemizeitem
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2152 }
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2153
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2154 % \splitoff TOKENS\endmark defines \first to be the first token in
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2155 % TOKENS, and \rest to be the remainder.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2156 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2157 \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2158
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2159 % Allow an optional argument of an uppercase letter, lowercase letter,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2160 % or number, to specify the first label in the enumerated list. No
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2161 % argument is the same as `1'.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2162 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2163 \def\enumerate{\parsearg\enumeratezzz}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2164 \def\enumeratezzz #1{\enumeratey #1 \endenumeratey}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2165 \def\enumeratey #1 #2\endenumeratey{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2166 \begingroup % ended by the @end enumerate
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2167 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2168 % If we were given no argument, pretend we were given `1'.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2169 \def\thearg{#1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2170 \ifx\thearg\empty \def\thearg{1}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2171 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2172 % Detect if the argument is a single token. If so, it might be a
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2173 % letter. Otherwise, the only valid thing it can be is a number.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2174 % (We will always have one token, because of the test we just made.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2175 % This is a good thing, since \splitoff doesn't work given nothing at
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2176 % all -- the first parameter is undelimited.)
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2177 \expandafter\splitoff\thearg\endmark
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2178 \ifx\rest\empty
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2179 % Only one token in the argument. It could still be anything.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2180 % A ``lowercase letter'' is one whose \lccode is nonzero.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2181 % An ``uppercase letter'' is one whose \lccode is both nonzero, and
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2182 % not equal to itself.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2183 % Otherwise, we assume it's a number.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2184 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2185 % We need the \relax at the end of the \ifnum lines to stop TeX from
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2186 % continuing to look for a <number>.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2187 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2188 \ifnum\lccode\expandafter`\thearg=0\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2189 \numericenumerate % a number (we hope)
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2190 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2191 % It's a letter.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2192 \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2193 \lowercaseenumerate % lowercase letter
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2194 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2195 \uppercaseenumerate % uppercase letter
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2196 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2197 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2198 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2199 % Multiple tokens in the argument. We hope it's a number.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2200 \numericenumerate
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2201 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2202 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2203
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2204 % An @enumerate whose labels are integers. The starting integer is
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2205 % given in \thearg.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2206 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2207 \def\numericenumerate{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2208 \itemno = \thearg
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2209 \startenumeration{\the\itemno}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2210 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2211
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2212 % The starting (lowercase) letter is in \thearg.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2213 \def\lowercaseenumerate{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2214 \itemno = \expandafter`\thearg
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2215 \startenumeration{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2216 % Be sure we're not beyond the end of the alphabet.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2217 \ifnum\itemno=0
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2218 \errmessage{No more lowercase letters in @enumerate; get a bigger
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2219 alphabet}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2220 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2221 \char\lccode\itemno
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2222 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2223 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2224
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2225 % The starting (uppercase) letter is in \thearg.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2226 \def\uppercaseenumerate{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2227 \itemno = \expandafter`\thearg
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2228 \startenumeration{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2229 % Be sure we're not beyond the end of the alphabet.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2230 \ifnum\itemno=0
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2231 \errmessage{No more uppercase letters in @enumerate; get a bigger
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2232 alphabet}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2233 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2234 \char\uccode\itemno
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2235 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2236 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2237
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2238 % Call itemizey, adding a period to the first argument and supplying the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2239 % common last two arguments. Also subtract one from the initial value in
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2240 % \itemno, since @item increments \itemno.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2241 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2242 \def\startenumeration#1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2243 \advance\itemno by -1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2244 \itemizey{#1.}\Eenumerate\flushcr
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2245 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2246
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2247 % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2248 % to @enumerate.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2249 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2250 \def\alphaenumerate{\enumerate{a}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2251 \def\capsenumerate{\enumerate{A}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2252 \def\Ealphaenumerate{\Eenumerate}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2253 \def\Ecapsenumerate{\Eenumerate}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2254
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2255 % Definition of @item while inside @itemize.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2256
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2257 \def\itemizeitem{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2258 \advance\itemno by 1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2259 {\let\par=\endgraf \smallbreak}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2260 \ifhmode \errmessage{In hmode at itemizeitem}\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2261 {\parskip=0in \hskip 0pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2262 \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2263 \vadjust{\penalty 1200}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2264 \flushcr}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2265
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2266 % @multitable macros
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2267 % Amy Hendrickson, 8/18/94, 3/6/96
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2268 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2269 % @multitable ... @end multitable will make as many columns as desired.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2270 % Contents of each column will wrap at width given in preamble. Width
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2271 % can be specified either with sample text given in a template line,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2272 % or in percent of \hsize, the current width of text on page.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2273
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2274 % Table can continue over pages but will only break between lines.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2275
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2276 % To make preamble:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2277 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2278 % Either define widths of columns in terms of percent of \hsize:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2279 % @multitable @columnfractions .25 .3 .45
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2280 % @item ...
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2281 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2282 % Numbers following @columnfractions are the percent of the total
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2283 % current hsize to be used for each column. You may use as many
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2284 % columns as desired.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2285
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2286
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2287 % Or use a template:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2288 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2289 % @item ...
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2290 % using the widest term desired in each column.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2291 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2292 % For those who want to use more than one line's worth of words in
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2293 % the preamble, break the line within one argument and it
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2294 % will parse correctly, i.e.,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2295 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2296 % @multitable {Column 1 template} {Column 2 template} {Column 3
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2297 % template}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2298 % Not:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2299 % @multitable {Column 1 template} {Column 2 template}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2300 % {Column 3 template}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2301
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2302 % Each new table line starts with @item, each subsequent new column
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2303 % starts with @tab. Empty columns may be produced by supplying @tab's
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2304 % with nothing between them for as many times as empty columns are needed,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2305 % ie, @tab@tab@tab will produce two empty columns.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2306
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2307 % @item, @tab, @multitable or @end multitable do not need to be on their
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2308 % own lines, but it will not hurt if they are.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2309
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2310 % Sample multitable:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2311
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2312 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2313 % @item first col stuff @tab second col stuff @tab third col
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2314 % @item
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2315 % first col stuff
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2316 % @tab
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2317 % second col stuff
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2318 % @tab
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2319 % third col
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2320 % @item first col stuff @tab second col stuff
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2321 % @tab Many paragraphs of text may be used in any column.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2322 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2323 % They will wrap at the width determined by the template.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2324 % @item@tab@tab This will be in third column.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2325 % @end multitable
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2326
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2327 % Default dimensions may be reset by user.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2328 % @multitableparskip is vertical space between paragraphs in table.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2329 % @multitableparindent is paragraph indent in table.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2330 % @multitablecolmargin is horizontal space to be left between columns.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2331 % @multitablelinespace is space to leave between table items, baseline
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2332 % to baseline.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2333 % 0pt means it depends on current normal line spacing.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2334 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2335 \newskip\multitableparskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2336 \newskip\multitableparindent
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2337 \newdimen\multitablecolspace
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2338 \newskip\multitablelinespace
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2339 \multitableparskip=0pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2340 \multitableparindent=6pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2341 \multitablecolspace=12pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2342 \multitablelinespace=0pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2343
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2344 % Macros used to set up halign preamble:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2345 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2346 \let\endsetuptable\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2347 \def\xendsetuptable{\endsetuptable}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2348 \let\columnfractions\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2349 \def\xcolumnfractions{\columnfractions}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2350 \newif\ifsetpercent
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2351
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2352 % #1 is the part of the @columnfraction before the decimal point, which
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2353 % is presumably either 0 or the empty string (but we don't check, we
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2354 % just throw it away). #2 is the decimal part, which we use as the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2355 % percent of \hsize for this column.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2356 \def\pickupwholefraction#1.#2 {%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2357 \global\advance\colcount by 1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2358 \expandafter\xdef\csname col\the\colcount\endcsname{.#2\hsize}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2359 \setuptable
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2360 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2361
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2362 \newcount\colcount
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2363 \def\setuptable#1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2364 \def\firstarg{#1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2365 \ifx\firstarg\xendsetuptable
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2366 \let\go = \relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2367 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2368 \ifx\firstarg\xcolumnfractions
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2369 \global\setpercenttrue
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2370 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2371 \ifsetpercent
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2372 \let\go\pickupwholefraction
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2373 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2374 \global\advance\colcount by 1
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2375 \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2376 % separator; typically that is always in the input, anyway.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2377 \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2378 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2379 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2380 \ifx\go\pickupwholefraction
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2381 % Put the argument back for the \pickupwholefraction call, so
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2382 % we'll always have a period there to be parsed.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2383 \def\go{\pickupwholefraction#1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2384 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2385 \let\go = \setuptable
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2386 \fi%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2387 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2388 \go
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2389 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2390
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2391 % @multitable ... @end multitable definitions:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2392 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2393 \def\multitable{\parsearg\dotable}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2394 \def\dotable#1{\bgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2395 \vskip\parskip
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2396 \let\item=\crcrwithfootnotes
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2397 % A \tab used to include \hskip1sp. But then the space in a template
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2398 % line is not enough. That is bad. So let's go back to just & until
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2399 % we encounter the problem it was intended to solve again. --karl,
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2400 % nathan@acm.org, 20apr99.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2401 \let\tab=&%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2402 \let\startfootins=\startsavedfootnote
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2403 \tolerance=9500
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2404 \hbadness=9500
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2405 \setmultitablespacing
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2406 \parskip=\multitableparskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2407 \parindent=\multitableparindent
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2408 \overfullrule=0pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2409 \global\colcount=0
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2410 \def\Emultitable{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2411 \global\setpercentfalse
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2412 \crcrwithfootnotes\crcr
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2413 \egroup\egroup
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2414 }%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2415 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2416 % To parse everything between @multitable and @item:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2417 \setuptable#1 \endsetuptable
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2418 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2419 % \everycr will reset column counter, \colcount, at the end of
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2420 % each line. Every column entry will cause \colcount to advance by one.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2421 % The table preamble
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2422 % looks at the current \colcount to find the correct column width.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2423 \everycr{\noalign{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2424 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2425 % \filbreak%% keeps underfull box messages off when table breaks over pages.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2426 % Maybe so, but it also creates really weird page breaks when the table
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2427 % breaks over pages. Wouldn't \vfil be better? Wait until the problem
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2428 % manifests itself, so it can be fixed for real --karl.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2429 \global\colcount=0\relax}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2430 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2431 % This preamble sets up a generic column definition, which will
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2432 % be used as many times as user calls for columns.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2433 % \vtop will set a single line and will also let text wrap and
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2434 % continue for many paragraphs if desired.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2435 \halign\bgroup&\global\advance\colcount by 1\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2436 \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2437 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2438 % In order to keep entries from bumping into each other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2439 % we will add a \leftskip of \multitablecolspace to all columns after
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2440 % the first one.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2441 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2442 % If a template has been used, we will add \multitablecolspace
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2443 % to the width of each template entry.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2444 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2445 % If the user has set preamble in terms of percent of \hsize we will
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2446 % use that dimension as the width of the column, and the \leftskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2447 % will keep entries from bumping into each other. Table will start at
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2448 % left margin and final column will justify at right margin.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2449 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2450 % Make sure we don't inherit \rightskip from the outer environment.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2451 \rightskip=0pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2452 \ifnum\colcount=1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2453 % The first column will be indented with the surrounding text.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2454 \advance\hsize by\leftskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2455 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2456 \ifsetpercent \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2457 % If user has not set preamble in terms of percent of \hsize
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2458 % we will advance \hsize by \multitablecolspace.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2459 \advance\hsize by \multitablecolspace
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2460 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2461 % In either case we will make \leftskip=\multitablecolspace:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2462 \leftskip=\multitablecolspace
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2463 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2464 % Ignoring space at the beginning and end avoids an occasional spurious
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2465 % blank line, when TeX decides to break the line at the space before the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2466 % box from the multistrut, so the strut ends up on a line by itself.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2467 % For example:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2468 % @multitable @columnfractions .11 .89
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2469 % @item @code{#}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2470 % @tab Legal holiday which is valid in major parts of the whole country.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2471 % Is automatically provided with highlighting sequences respectively marking
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2472 % characters.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2473 \noindent\ignorespaces##\unskip\multistrut}\cr
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2474 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2475
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2476 \def\setmultitablespacing{% test to see if user has set \multitablelinespace.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2477 % If so, do nothing. If not, give it an appropriate dimension based on
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2478 % current baselineskip.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2479 \ifdim\multitablelinespace=0pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2480 \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2481 \global\advance\multitablelinespace by-\ht0
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2482 %% strut to put in table in case some entry doesn't have descenders,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2483 %% to keep lines equally spaced
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2484 \let\multistrut = \strut
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2485 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2486 %% FIXME: what is \box0 supposed to be?
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2487 \gdef\multistrut{\vrule height\multitablelinespace depth\dp0
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2488 width0pt\relax} \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2489 %% Test to see if parskip is larger than space between lines of
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2490 %% table. If not, do nothing.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2491 %% If so, set to same dimension as multitablelinespace.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2492 \ifdim\multitableparskip>\multitablelinespace
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2493 \global\multitableparskip=\multitablelinespace
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2494 \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2495 %% than skip between lines in the table.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2496 \fi%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2497 \ifdim\multitableparskip=0pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2498 \global\multitableparskip=\multitablelinespace
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2499 \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2500 %% than skip between lines in the table.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2501 \fi}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2502
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2503 % In case a @footnote appears inside an alignment, save the footnote
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2504 % text to a box and make the \insert when a row of the table is
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2505 % finished. Otherwise, the insertion is lost, it never migrates to the
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2506 % main vertical list. --kasal, 22jan03.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2507 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2508 \newbox\savedfootnotes
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2509 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2510 % \dotable \let's \startfootins to this, so that \dofootnote will call
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2511 % it instead of starting the insertion right away.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2512 \def\startsavedfootnote{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2513 \global\setbox\savedfootnotes = \vbox\bgroup
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2514 \unvbox\savedfootnotes
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2515 }
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2516 \def\crcrwithfootnotes{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2517 \crcr
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2518 \ifvoid\savedfootnotes \else
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2519 \noalign{\insert\footins{\box\savedfootnotes}}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2520 \fi
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2521 }
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2522
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2523 \message{conditionals,}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2524 % Prevent errors for section commands.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2525 % Used in @ignore and in failing conditionals.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2526 \def\ignoresections{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2527 \let\chapter=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2528 \let\unnumbered=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2529 \let\top=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2530 \let\unnumberedsec=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2531 \let\unnumberedsection=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2532 \let\unnumberedsubsec=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2533 \let\unnumberedsubsection=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2534 \let\unnumberedsubsubsec=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2535 \let\unnumberedsubsubsection=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2536 \let\section=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2537 \let\subsec=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2538 \let\subsubsec=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2539 \let\subsection=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2540 \let\subsubsection=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2541 \let\appendix=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2542 \let\appendixsec=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2543 \let\appendixsection=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2544 \let\appendixsubsec=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2545 \let\appendixsubsection=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2546 \let\appendixsubsubsec=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2547 \let\appendixsubsubsection=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2548 \let\contents=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2549 \let\smallbook=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2550 \let\titlepage=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2551 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2552
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2553 % Used in nested conditionals, where we have to parse the Texinfo source
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2554 % and so want to turn off most commands, in case they are used
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2555 % incorrectly.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2556 %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2557 % We use \empty instead of \relax for the @def... commands, so that \end
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2558 % doesn't throw an error. For instance:
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2559 % @ignore
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2560 % @deffn ...
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2561 % @end deffn
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2562 % @end ignore
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2563 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2564 % The @end deffn is going to get expanded, because we're trying to allow
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2565 % nested conditionals. But we don't want to expand the actual @deffn,
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2566 % since it might be syntactically correct and intended to be ignored.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2567 % Since \end checks for \relax, using \empty does not cause an error.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2568 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2569 \def\ignoremorecommands{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2570 \let\defcodeindex = \relax
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2571 \let\defcv = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2572 \let\defcvx = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2573 \let\Edefcv = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2574 \let\deffn = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2575 \let\deffnx = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2576 \let\Edeffn = \empty
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2577 \let\defindex = \relax
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2578 \let\defivar = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2579 \let\defivarx = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2580 \let\Edefivar = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2581 \let\defmac = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2582 \let\defmacx = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2583 \let\Edefmac = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2584 \let\defmethod = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2585 \let\defmethodx = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2586 \let\Edefmethod = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2587 \let\defop = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2588 \let\defopx = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2589 \let\Edefop = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2590 \let\defopt = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2591 \let\defoptx = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2592 \let\Edefopt = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2593 \let\defspec = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2594 \let\defspecx = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2595 \let\Edefspec = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2596 \let\deftp = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2597 \let\deftpx = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2598 \let\Edeftp = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2599 \let\deftypefn = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2600 \let\deftypefnx = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2601 \let\Edeftypefn = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2602 \let\deftypefun = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2603 \let\deftypefunx = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2604 \let\Edeftypefun = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2605 \let\deftypeivar = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2606 \let\deftypeivarx = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2607 \let\Edeftypeivar = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2608 \let\deftypemethod = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2609 \let\deftypemethodx = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2610 \let\Edeftypemethod = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2611 \let\deftypeop = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2612 \let\deftypeopx = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2613 \let\Edeftypeop = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2614 \let\deftypevar = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2615 \let\deftypevarx = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2616 \let\Edeftypevar = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2617 \let\deftypevr = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2618 \let\deftypevrx = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2619 \let\Edeftypevr = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2620 \let\defun = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2621 \let\defunx = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2622 \let\Edefun = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2623 \let\defvar = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2624 \let\defvarx = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2625 \let\Edefvar = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2626 \let\defvr = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2627 \let\defvrx = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2628 \let\Edefvr = \empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2629 \let\clear = \relax
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2630 \let\down = \relax
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2631 \let\evenfooting = \relax
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2632 \let\evenheading = \relax
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2633 \let\everyfooting = \relax
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2634 \let\everyheading = \relax
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2635 \let\headings = \relax
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2636 \let\include = \relax
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2637 \let\item = \relax
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2638 \let\lowersections = \relax
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2639 \let\oddfooting = \relax
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2640 \let\oddheading = \relax
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2641 \let\printindex = \relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2642 \let\pxref = \relax
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2643 \let\raisesections = \relax
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2644 \let\ref = \relax
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2645 \let\set = \relax
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2646 \let\setchapternewpage = \relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2647 \let\setchapterstyle = \relax
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2648 \let\settitle = \relax
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2649 \let\up = \relax
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2650 \let\verbatiminclude = \relax
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2651 \let\xref = \relax
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2652 }
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2653
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2654 % Ignore @ignore, @ifhtml, @ifinfo, and the like.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2655 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2656 \def\direntry{\doignore{direntry}}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2657 \def\documentdescriptionword{documentdescription}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2658 \def\documentdescription{\doignore{documentdescription}}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2659 \def\html{\doignore{html}}
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
2660 \def\ifhtml{\doignore{ifhtml}}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2661 \def\ifinfo{\doignore{ifinfo}}
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2662 \def\ifnottex{\nestedignore{ifnottex}}
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
2663 \def\ifplaintext{\doignore{ifplaintext}}
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2664 \def\ifxml{\doignore{ifxml}}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2665 \def\ignore{\doignore{ignore}}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2666 \def\menu{\doignore{menu}}
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2667 \def\xml{\doignore{xml}}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2668
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2669 % @dircategory CATEGORY -- specify a category of the dir file
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2670 % which this file should belong to. Ignore this in TeX.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2671 \let\dircategory = \comment
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2672
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2673 % Ignore text until a line `@end #1'.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2674 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2675 \def\doignore#1{\begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2676 % Don't complain about control sequences we have declared \outer.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2677 \ignoresections
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2678 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2679 % Define a command to swallow text until we reach `@end #1'.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2680 % This @ is a catcode 12 token (that is the normal catcode of @ in
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2681 % this texinfo.tex file). We change the catcode of @ below to match.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2682 \long\def\doignoretext##1@end #1{\enddoignore}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2683 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2684 % Make sure that spaces turn into tokens that match what \doignoretext wants.
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2685 \catcode\spaceChar = 10
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2686 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2687 % Ignore braces, too, so mismatched braces don't cause trouble.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2688 \catcode`\{ = 9
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2689 \catcode`\} = 9
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2690 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2691 % We must not have @c interpreted as a control sequence.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2692 \catcode`\@ = 12
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2693 %
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
2694 \def\ignoreword{#1}%
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
2695 \ifx\ignoreword\documentdescriptionword
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
2696 % The c kludge breaks documentdescription, since
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
2697 % `documentdescription' contains a `c'. Means not everything will
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
2698 % be ignored inside @documentdescription, but oh well...
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
2699 \else
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
2700 % Make the letter c a comment character so that the rest of the line
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
2701 % will be ignored. This way, the document can have (for example)
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
2702 % @c @end ifinfo
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
2703 % and the @end ifinfo will be properly ignored.
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
2704 % (We've just changed @ to catcode 12.)
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
2705 \catcode`\c = 14
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
2706 \fi
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2707 %
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
2708 % And now expand the command defined above.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2709 \doignoretext
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2710 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2711
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2712 % What we do to finish off ignored text.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2713 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2714 \def\enddoignore{\endgroup\ignorespaces}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2715
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2716 \newif\ifwarnedobs\warnedobsfalse
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2717 \def\obstexwarn{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2718 \ifwarnedobs\relax\else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2719 % We need to warn folks that they may have trouble with TeX 3.0.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2720 % This uses \immediate\write16 rather than \message to get newlines.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2721 \immediate\write16{}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2722 \immediate\write16{WARNING: for users of Unix TeX 3.0!}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2723 \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2724 \immediate\write16{If you are running another version of TeX, relax.}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2725 \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2726 \immediate\write16{ Then upgrade your TeX installation if you can.}
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2727 \immediate\write16{ (See ftp://ftp.gnu.org/non-gnu/TeX.README.)}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2728 \immediate\write16{If you are stuck with version 3.0, run the}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2729 \immediate\write16{ script ``tex3patch'' from the Texinfo distribution}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2730 \immediate\write16{ to use a workaround.}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2731 \immediate\write16{}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2732 \global\warnedobstrue
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2733 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2734 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2735
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2736 % **In TeX 3.0, setting text in \nullfont hangs tex. For a
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2737 % workaround (which requires the file ``dummy.tfm'' to be installed),
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2738 % uncomment the following line:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2739 %%%%%\font\nullfont=dummy\let\obstexwarn=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2740
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2741 % Ignore text, except that we keep track of conditional commands for
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2742 % purposes of nesting, up to an `@end #1' command.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2743 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2744 \def\nestedignore#1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2745 \obstexwarn
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2746 % We must actually expand the ignored text to look for the @end
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2747 % command, so that nested ignore constructs work. Thus, we put the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2748 % text into a \vbox and then do nothing with the result. To minimize
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2749 % the chance of memory overflow, we follow the approach outlined on
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2750 % page 401 of the TeXbook.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2751 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2752 \setbox0 = \vbox\bgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2753 % Don't complain about control sequences we have declared \outer.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2754 \ignoresections
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2755 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2756 % Define `@end #1' to end the box, which will in turn undefine the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2757 % @end command again.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2758 \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2759 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2760 % We are going to be parsing Texinfo commands. Most cause no
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2761 % trouble when they are used incorrectly, but some commands do
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2762 % complicated argument parsing or otherwise get confused, so we
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2763 % undefine them.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2764 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2765 % We can't do anything about stray @-signs, unfortunately;
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2766 % they'll produce `undefined control sequence' errors.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2767 \ignoremorecommands
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2768 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2769 % Set the current font to be \nullfont, a TeX primitive, and define
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2770 % all the font commands to also use \nullfont. We don't use
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2771 % dummy.tfm, as suggested in the TeXbook, because some sites
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2772 % might not have that installed. Therefore, math mode will still
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2773 % produce output, but that should be an extremely small amount of
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2774 % stuff compared to the main input.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2775 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2776 \nullfont
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2777 \let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2778 \let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2779 \let\tensf=\nullfont
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
2780 % Similarly for index fonts.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2781 \let\smallrm=\nullfont \let\smallit=\nullfont \let\smallsl=\nullfont
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2782 \let\smallbf=\nullfont \let\smalltt=\nullfont \let\smallsc=\nullfont
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2783 \let\smallsf=\nullfont
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
2784 % Similarly for smallexample fonts.
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
2785 \let\smallerrm=\nullfont \let\smallerit=\nullfont \let\smallersl=\nullfont
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
2786 \let\smallerbf=\nullfont \let\smallertt=\nullfont \let\smallersc=\nullfont
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
2787 \let\smallersf=\nullfont
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2788 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2789 % Don't complain when characters are missing from the fonts.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2790 \tracinglostchars = 0
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2791 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2792 % Don't bother to do space factor calculations.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2793 \frenchspacing
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2794 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2795 % Don't report underfull hboxes.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2796 \hbadness = 10000
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2797 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2798 % Do minimal line-breaking.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2799 \pretolerance = 10000
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2800 %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2801 % Do not execute instructions in @tex.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2802 \def\tex{\doignore{tex}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2803 % Do not execute macro definitions.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2804 % `c' is a comment character, so the word `macro' will get cut off.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2805 \def\macro{\doignore{ma}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2806 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2807
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2808 % @set VAR sets the variable VAR to an empty value.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2809 % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2810 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2811 % Since we want to separate VAR from REST-OF-LINE (which might be
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2812 % empty), we can't just use \parsearg; we have to insert a space of our
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2813 % own to delimit the rest of the line, and then take it out again if we
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2814 % didn't need it. Make sure the catcode of space is correct to avoid
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2815 % losing inside @example, for instance.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2816 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2817 \def\set{\begingroup\catcode` =10
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2818 \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2819 \parsearg\setxxx}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2820 \def\setxxx#1{\setyyy#1 \endsetyyy}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2821 \def\setyyy#1 #2\endsetyyy{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2822 \def\temp{#2}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2823 \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2824 \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2825 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2826 \endgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2827 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2828 % Can't use \xdef to pre-expand #2 and save some time, since \temp or
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2829 % \next or other control sequences that we've defined might get us into
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2830 % an infinite loop. Consider `@set foo @cite{bar}'.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2831 \def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2832
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2833 % @clear VAR clears (i.e., unsets) the variable VAR.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2834 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2835 \def\clear{\parsearg\clearxxx}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2836 \def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2837
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2838 % @value{foo} gets the text saved in variable foo.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2839 {
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2840 \catcode`\_ = \active
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2841 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2842 % We might end up with active _ or - characters in the argument if
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2843 % we're called from @code, as @code{@value{foo-bar_}}. So \let any
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2844 % such active characters to their normal equivalents.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2845 \gdef\value{\begingroup
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2846 \catcode`\-=\other \catcode`\_=\other
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2847 \indexbreaks \let_\normalunderscore
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2848 \valuexxx}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2849 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2850 \def\valuexxx#1{\expandablevalue{#1}\endgroup}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2851
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2852 % We have this subroutine so that we can handle at least some @value's
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2853 % properly in indexes (we \let\value to this in \indexdummies). Ones
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2854 % whose names contain - or _ still won't work, but we can't do anything
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2855 % about that. The command has to be fully expandable (if the variable
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2856 % is set), since the result winds up in the index file. This means that
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2857 % if the variable's value contains other Texinfo commands, it's almost
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2858 % certain it will fail (although perhaps we could fix that with
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2859 % sufficient work to do a one-level expansion on the result, instead of
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2860 % complete).
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2861 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2862 \def\expandablevalue#1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2863 \expandafter\ifx\csname SET#1\endcsname\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2864 {[No value for ``#1'']}%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2865 \message{Variable `#1', used in @value, is not set.}%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2866 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2867 \csname SET#1\endcsname
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2868 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2869 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2870
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2871 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2872 % with @set.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2873 %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2874 \def\ifset{\parsearg\doifset}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2875 \def\doifset#1{%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2876 \expandafter\ifx\csname SET#1\endcsname\relax
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2877 \let\next=\ifsetfail
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2878 \else
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2879 \let\next=\ifsetsucceed
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2880 \fi
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2881 \next
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2882 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2883 \def\ifsetsucceed{\conditionalsucceed{ifset}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2884 \def\ifsetfail{\nestedignore{ifset}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2885 \defineunmatchedend{ifset}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2886
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2887 % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2888 % defined with @set, or has been undefined with @clear.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2889 %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2890 \def\ifclear{\parsearg\doifclear}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2891 \def\doifclear#1{%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2892 \expandafter\ifx\csname SET#1\endcsname\relax
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2893 \let\next=\ifclearsucceed
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2894 \else
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2895 \let\next=\ifclearfail
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2896 \fi
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2897 \next
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2898 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2899 \def\ifclearsucceed{\conditionalsucceed{ifclear}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2900 \def\ifclearfail{\nestedignore{ifclear}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2901 \defineunmatchedend{ifclear}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2902
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
2903 % @iftex, @ifnothtml, @ifnotinfo, @ifnotplaintext always succeed; we
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
2904 % read the text following, through the first @end iftex (etc.). Make
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
2905 % `@end iftex' (etc.) valid only after an @iftex.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2906 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2907 \def\iftex{\conditionalsucceed{iftex}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2908 \def\ifnothtml{\conditionalsucceed{ifnothtml}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2909 \def\ifnotinfo{\conditionalsucceed{ifnotinfo}}
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
2910 \def\ifnotplaintext{\conditionalsucceed{ifnotplaintext}}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2911 \defineunmatchedend{iftex}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2912 \defineunmatchedend{ifnothtml}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2913 \defineunmatchedend{ifnotinfo}
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
2914 \defineunmatchedend{ifnotplaintext}
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
2915
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2916 % True conditional. Since \set globally defines its variables, we can
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2917 % just start and end a group (to keep the @end definition undefined at
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2918 % the outer level).
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2919 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2920 \def\conditionalsucceed#1{\begingroup
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2921 \expandafter\def\csname E#1\endcsname{\endgroup}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
2922 }
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2923
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2924 % @defininfoenclose.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2925 \let\definfoenclose=\comment
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2926
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2927
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2928 \message{indexing,}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2929 % Index generation facilities
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2930
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2931 % Define \newwrite to be identical to plain tex's \newwrite
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2932 % except not \outer, so it can be used within \newindex.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2933 {\catcode`\@=11
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2934 \gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2935
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2936 % \newindex {foo} defines an index named foo.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2937 % It automatically defines \fooindex such that
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2938 % \fooindex ...rest of line... puts an entry in the index foo.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2939 % It also defines \fooindfile to be the number of the output channel for
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2940 % the file that accumulates this index. The file's extension is foo.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2941 % The name of an index should be no more than 2 characters long
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2942 % for the sake of vms.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2943 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2944 \def\newindex#1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2945 \iflinks
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2946 \expandafter\newwrite \csname#1indfile\endcsname
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2947 \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2948 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2949 \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2950 \noexpand\doindex{#1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2951 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2952
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2953 % @defindex foo == \newindex{foo}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2954 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2955 \def\defindex{\parsearg\newindex}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2956
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2957 % Define @defcodeindex, like @defindex except put all entries in @code.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2958 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2959 \def\defcodeindex{\parsearg\newcodeindex}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2960 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2961 \def\newcodeindex#1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2962 \iflinks
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2963 \expandafter\newwrite \csname#1indfile\endcsname
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2964 \openout \csname#1indfile\endcsname \jobname.#1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2965 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2966 \expandafter\xdef\csname#1index\endcsname{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2967 \noexpand\docodeindex{#1}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2968 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2969
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2970
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2971 % @synindex foo bar makes index foo feed into index bar.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2972 % Do this instead of @defindex foo if you don't want it as a separate index.
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
2973 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2974 % @syncodeindex foo bar similar, but put all entries made for index foo
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2975 % inside @code.
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
2976 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2977 \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2978 \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2979
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2980 % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2981 % #3 the target index (bar).
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2982 \def\dosynindex#1#2#3{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2983 % Only do \closeout if we haven't already done it, else we'll end up
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2984 % closing the target index.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2985 \expandafter \ifx\csname donesynindex#2\endcsname \undefined
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2986 % The \closeout helps reduce unnecessary open files; the limit on the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2987 % Acorn RISC OS is a mere 16 files.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2988 \expandafter\closeout\csname#2indfile\endcsname
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2989 \expandafter\let\csname\donesynindex#2\endcsname = 1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2990 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2991 % redefine \fooindfile:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2992 \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2993 \expandafter\let\csname#2indfile\endcsname=\temp
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2994 % redefine \fooindex:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2995 \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2996 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2997
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2998 % Define \doindex, the driver for all \fooindex macros.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2999 % Argument #1 is generated by the calling \fooindex macro,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3000 % and it is "foo", the name of the index.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3001
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3002 % \doindex just uses \parsearg; it calls \doind for the actual work.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3003 % This is because \doind is more useful to call from other macros.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3004
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3005 % There is also \dosubind {index}{topic}{subtopic}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3006 % which makes an entry in a two-level index such as the operation index.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3007
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3008 \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3009 \def\singleindexer #1{\doind{\indexname}{#1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3010
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3011 % like the previous two, but they put @code around the argument.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3012 \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3013 \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3014
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3015 % Take care of Texinfo commands that can appear in an index entry.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3016 % Since there are some commands we want to expand, and others we don't,
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3017 % we have to laboriously prevent expansion for those that we don't.
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
3018 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3019 \def\indexdummies{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3020 \def\@{@}% change to @@ when we switch to @ as escape char in index files.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3021 \def\ {\realbackslash\space }%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3022 % Need these in case \tex is in effect and \{ is a \delimiter again.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3023 % But can't use \lbracecmd and \rbracecmd because texindex assumes
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3024 % braces and backslashes are used only as delimiters.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3025 \let\{ = \mylbrace
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3026 \let\} = \myrbrace
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3027 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3028 % \definedummyword defines \#1 as \realbackslash #1\space, thus
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3029 % effectively preventing its expansion. This is used only for control
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3030 % words, not control letters, because the \space would be incorrect
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3031 % for control characters, but is needed to separate the control word
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3032 % from whatever follows.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3033 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3034 % For control letters, we have \definedummyletter, which omits the
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3035 % space.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3036 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3037 % These can be used both for control words that take an argument and
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3038 % those that do not. If it is followed by {arg} in the input, then
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3039 % that will dutifully get written to the index (or wherever).
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3040 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3041 \def\definedummyword##1{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3042 \expandafter\def\csname ##1\endcsname{\realbackslash ##1\space}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3043 }%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3044 \def\definedummyletter##1{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3045 \expandafter\def\csname ##1\endcsname{\realbackslash ##1}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3046 }%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3047 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3048 % Do the redefinitions.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3049 \commondummies
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3050 }
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3051
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3052 % For the aux file, @ is the escape character. So we want to redefine
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3053 % everything using @ instead of \realbackslash. When everything uses
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3054 % @, this will be simpler.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3055 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3056 \def\atdummies{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3057 \def\@{@@}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3058 \def\ {@ }%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3059 \let\{ = \lbraceatcmd
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3060 \let\} = \rbraceatcmd
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3061 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3062 % (See comments in \indexdummies.)
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3063 \def\definedummyword##1{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3064 \expandafter\def\csname ##1\endcsname{@##1\space}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3065 }%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3066 \def\definedummyletter##1{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3067 \expandafter\def\csname ##1\endcsname{@##1}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3068 }%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3069 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3070 % Do the redefinitions.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3071 \commondummies
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3072 }
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3073
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3074 % Called from \indexdummies and \atdummies. \definedummyword and
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3075 % \definedummyletter must be defined first.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3076 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3077 \def\commondummies{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3078 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3079 \normalturnoffactive
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3080 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3081 % Control letters and accents.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3082 \definedummyletter{_}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3083 \definedummyletter{,}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3084 \definedummyletter{"}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3085 \definedummyletter{`}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3086 \definedummyletter{'}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3087 \definedummyletter{^}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3088 \definedummyletter{~}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3089 \definedummyletter{=}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3090 \definedummyword{u}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3091 \definedummyword{v}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3092 \definedummyword{H}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3093 \definedummyword{dotaccent}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3094 \definedummyword{ringaccent}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3095 \definedummyword{tieaccent}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3096 \definedummyword{ubaraccent}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3097 \definedummyword{udotaccent}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3098 \definedummyword{dotless}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3099 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3100 % Other non-English letters.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3101 \definedummyword{AA}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3102 \definedummyword{AE}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3103 \definedummyword{L}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3104 \definedummyword{OE}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3105 \definedummyword{O}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3106 \definedummyword{aa}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3107 \definedummyword{ae}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3108 \definedummyword{l}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3109 \definedummyword{oe}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3110 \definedummyword{o}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3111 \definedummyword{ss}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3112 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3113 % Although these internal commands shouldn't show up, sometimes they do.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3114 \definedummyword{bf}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3115 \definedummyword{gtr}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3116 \definedummyword{hat}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3117 \definedummyword{less}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3118 \definedummyword{sf}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3119 \definedummyword{sl}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3120 \definedummyword{tclose}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3121 \definedummyword{tt}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3122 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3123 % Texinfo font commands.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3124 \definedummyword{b}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3125 \definedummyword{i}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3126 \definedummyword{r}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3127 \definedummyword{sc}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3128 \definedummyword{t}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3129 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3130 \definedummyword{TeX}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3131 \definedummyword{acronym}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3132 \definedummyword{cite}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3133 \definedummyword{code}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3134 \definedummyword{command}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3135 \definedummyword{dfn}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3136 \definedummyword{dots}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3137 \definedummyword{emph}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3138 \definedummyword{env}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3139 \definedummyword{file}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3140 \definedummyword{kbd}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3141 \definedummyword{key}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3142 \definedummyword{math}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3143 \definedummyword{option}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3144 \definedummyword{samp}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3145 \definedummyword{strong}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3146 \definedummyword{uref}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3147 \definedummyword{url}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3148 \definedummyword{var}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3149 \definedummyword{w}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3150 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3151 % Assorted special characters.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3152 \definedummyword{bullet}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3153 \definedummyword{copyright}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3154 \definedummyword{dots}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3155 \definedummyword{enddots}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3156 \definedummyword{equiv}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3157 \definedummyword{error}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3158 \definedummyword{expansion}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3159 \definedummyword{minus}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3160 \definedummyword{pounds}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3161 \definedummyword{point}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3162 \definedummyword{print}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3163 \definedummyword{result}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3164 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3165 % Handle some cases of @value -- where the variable name does not
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3166 % contain - or _, and the value does not contain any
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3167 % (non-fully-expandable) commands.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3168 \let\value = \expandablevalue
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3169 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3170 % Normal spaces, not active ones.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3171 \unsepspaces
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3172 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3173 % No macro expansion.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3174 \turnoffmacros
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3175 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3176
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3177 % If an index command is used in an @example environment, any spaces
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3178 % therein should become regular spaces in the raw index file, not the
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
3179 % expansion of \tie (\leavevmode \penalty \@M \ ).
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3180 {\obeyspaces
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3181 \gdef\unsepspaces{\obeyspaces\let =\space}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3182
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3183
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3184 % \indexnofonts is used when outputting the strings to sort the index
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3185 % by, and when constructing control sequence names. It eliminates all
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3186 % control sequences and just writes whatever the best ASCII sort string
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3187 % would be for a given command (usually its argument).
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3188 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3189 \def\indexdummytex{TeX}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3190 \def\indexdummydots{...}
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3191 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3192 \def\indexnofonts{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3193 \def\ { }%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3194 \def\@{@}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3195 % how to handle braces?
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3196 \def\_{\normalunderscore}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3197 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3198 \let\,=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3199 \let\"=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3200 \let\`=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3201 \let\'=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3202 \let\^=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3203 \let\~=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3204 \let\==\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3205 \let\u=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3206 \let\v=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3207 \let\H=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3208 \let\dotaccent=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3209 \let\ringaccent=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3210 \let\tieaccent=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3211 \let\ubaraccent=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3212 \let\udotaccent=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3213 \let\dotless=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3214 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3215 % Other non-English letters.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3216 \def\AA{AA}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3217 \def\AE{AE}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3218 \def\L{L}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3219 \def\OE{OE}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3220 \def\O{O}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3221 \def\aa{aa}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3222 \def\ae{ae}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3223 \def\l{l}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3224 \def\oe{oe}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3225 \def\o{o}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3226 \def\ss{ss}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3227 \def\exclamdown{!}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3228 \def\questiondown{?}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3229 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3230 % Don't no-op \tt, since it isn't a user-level command
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3231 % and is used in the definitions of the active chars like <, >, |, etc.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3232 % Likewise with the other plain tex font commands.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3233 %\let\tt=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3234 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3235 % Texinfo font commands.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3236 \let\b=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3237 \let\i=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3238 \let\r=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3239 \let\sc=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3240 \let\t=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3241 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3242 \let\TeX=\indexdummytex
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3243 \let\acronym=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3244 \let\cite=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3245 \let\code=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3246 \let\command=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3247 \let\dfn=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3248 \let\dots=\indexdummydots
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3249 \let\emph=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3250 \let\env=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3251 \let\file=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3252 \let\kbd=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3253 \let\key=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3254 \let\math=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3255 \let\option=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3256 \let\samp=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3257 \let\strong=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3258 \let\uref=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3259 \let\url=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3260 \let\var=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3261 \let\w=\asis
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3262 }
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3263
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3264 \let\indexbackslash=0 %overridden during \printindex.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3265 \let\SETmarginindex=\relax % put index entries in margin (undocumented)?
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3266
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3267 % For \ifx comparisons.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3268 \def\emptymacro{\empty}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3269
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3270 % Most index entries go through here, but \dosubind is the general case.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3271 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3272 \def\doind#1#2{\dosubind{#1}{#2}\empty}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3273
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3274 % Workhorse for all \fooindexes.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3275 % #1 is name of index, #2 is stuff to put there, #3 is subentry --
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3276 % \empty if called from \doind, as we usually are. The main exception
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3277 % is with defuns, which call us directly.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3278 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3279 \def\dosubind#1#2#3{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3280 % Put the index entry in the margin if desired.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3281 \ifx\SETmarginindex\relax\else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3282 \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3283 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3284 {%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3285 \count255=\lastpenalty
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3286 {%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3287 \indexdummies % Must do this here, since \bf, etc expand at this stage
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3288 \escapechar=`\\
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3289 {%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3290 \let\folio = 0% We will expand all macros now EXCEPT \folio.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3291 \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3292 % so it will be output as is; and it will print as backslash.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3293 %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3294 % The main index entry text.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3295 \toks0 = {#2}%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3296 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3297 % If third arg is present, precede it with space in sort key.
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3298 \def\thirdarg{#3}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3299 \ifx\thirdarg\emptymacro \else
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3300 % If the third (subentry) arg is present, add it to the index
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3301 % line to write.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3302 \toks0 = \expandafter{\the\toks0 \space #3}%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3303 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3304 %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3305 % Process the index entry with all font commands turned off, to
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3306 % get the string to sort by.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3307 {\indexnofonts
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3308 \edef\temp{\the\toks0}% need full expansion
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3309 \xdef\indexsorttmp{\temp}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3310 }%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3311 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3312 % Set up the complete index entry, with both the sort key and
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3313 % the original text, including any font commands. We write
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3314 % three arguments to \entry to the .?? file (four in the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3315 % subentry case), texindex reduces to two when writing the .??s
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3316 % sorted result.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3317 \edef\temp{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3318 \write\csname#1indfile\endcsname{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3319 \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3320 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3321 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3322 % If a skip is the last thing on the list now, preserve it
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3323 % by backing up by \lastskip, doing the \write, then inserting
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3324 % the skip again. Otherwise, the whatsit generated by the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3325 % \write will make \lastskip zero. The result is that sequences
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3326 % like this:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3327 % @end defun
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3328 % @tindex whatever
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3329 % @defun ...
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3330 % will have extra space inserted, because the \medbreak in the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3331 % start of the @defun won't see the skip inserted by the @end of
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3332 % the previous defun.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3333 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3334 % But don't do any of this if we're not in vertical mode. We
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3335 % don't want to do a \vskip and prematurely end a paragraph.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3336 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3337 % Avoid page breaks due to these extra skips, too.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3338 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3339 \iflinks
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3340 \ifvmode
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3341 \skip0 = \lastskip
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3342 \ifdim\lastskip = 0pt \else \nobreak\vskip-\skip0 \fi
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3343 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3344 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3345 \temp % do the write
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3346 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3347 \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3348 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3349 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3350 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3351 \penalty\count255
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3352 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3353 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3354
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3355 % The index entry written in the file actually looks like
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3356 % \entry {sortstring}{page}{topic}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3357 % or
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3358 % \entry {sortstring}{page}{topic}{subtopic}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3359 % The texindex program reads in these files and writes files
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3360 % containing these kinds of lines:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3361 % \initial {c}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3362 % before the first topic whose initial is c
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3363 % \entry {topic}{pagelist}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3364 % for a topic that is used without subtopics
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3365 % \primary {topic}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3366 % for the beginning of a topic that is used with subtopics
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3367 % \secondary {subtopic}{pagelist}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3368 % for each subtopic.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3369
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3370 % Define the user-accessible indexing commands
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3371 % @findex, @vindex, @kindex, @cindex.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3372
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3373 \def\findex {\fnindex}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3374 \def\kindex {\kyindex}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3375 \def\cindex {\cpindex}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3376 \def\vindex {\vrindex}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3377 \def\tindex {\tpindex}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3378 \def\pindex {\pgindex}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3379
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3380 \def\cindexsub {\begingroup\obeylines\cindexsub}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3381 {\obeylines %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3382 \gdef\cindexsub "#1" #2^^M{\endgroup %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3383 \dosubind{cp}{#2}{#1}}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3384
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3385 % Define the macros used in formatting output of the sorted index material.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3386
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3387 % @printindex causes a particular index (the ??s file) to get printed.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3388 % It does not print any chapter heading (usually an @unnumbered).
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3389 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3390 \def\printindex{\parsearg\doprintindex}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3391 \def\doprintindex#1{\begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3392 \dobreak \chapheadingskip{10000}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3393 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3394 \smallfonts \rm
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3395 \tolerance = 9500
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3396 \everypar = {}% don't want the \kern\-parindent from indentation suppression.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3397 \indexbreaks
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3398 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3399 % See if the index file exists and is nonempty.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3400 % Change catcode of @ here so that if the index file contains
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3401 % \initial {@}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3402 % as its first line, TeX doesn't complain about mismatched braces
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3403 % (because it thinks @} is a control sequence).
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3404 \catcode`\@ = 11
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3405 \openin 1 \jobname.#1s
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3406 \ifeof 1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3407 % \enddoublecolumns gets confused if there is no text in the index,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3408 % and it loses the chapter title and the aux file entries for the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3409 % index. The easiest way to prevent this problem is to make sure
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3410 % there is some text.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3411 \putwordIndexNonexistent
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3412 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3413 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3414 % If the index file exists but is empty, then \openin leaves \ifeof
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3415 % false. We have to make TeX try to read something from the file, so
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3416 % it can discover if there is anything in it.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3417 \read 1 to \temp
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3418 \ifeof 1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3419 \putwordIndexIsEmpty
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3420 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3421 % Index files are almost Texinfo source, but we use \ as the escape
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3422 % character. It would be better to use @, but that's too big a change
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3423 % to make right now.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3424 \def\indexbackslash{\rawbackslashxx}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3425 \catcode`\\ = 0
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3426 \escapechar = `\\
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3427 \begindoublecolumns
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3428 \input \jobname.#1s
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3429 \enddoublecolumns
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3430 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3431 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3432 \closein 1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3433 \endgroup}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3434
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3435 % These macros are used by the sorted index file itself.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3436 % Change them to control the appearance of the index.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3437
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3438 \def\initial#1{{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3439 % Some minor font changes for the special characters.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3440 \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3441 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3442 % Remove any glue we may have, we'll be inserting our own.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3443 \removelastskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3444 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3445 % We like breaks before the index initials, so insert a bonus.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3446 \penalty -300
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3447 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3448 % Typeset the initial. Making this add up to a whole number of
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3449 % baselineskips increases the chance of the dots lining up from column
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3450 % to column. It still won't often be perfect, because of the stretch
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3451 % we need before each entry, but it's better.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3452 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3453 % No shrink because it confuses \balancecolumns.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3454 \vskip 1.67\baselineskip plus .5\baselineskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3455 \leftline{\secbf #1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3456 \vskip .33\baselineskip plus .1\baselineskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3457 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3458 % Do our best not to break after the initial.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3459 \nobreak
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3460 }}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3461
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3462 % This typesets a paragraph consisting of #1, dot leaders, and then #2
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3463 % flush to the right margin. It is used for index and table of contents
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3464 % entries. The paragraph is indented by \leftskip.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3465 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3466 \def\entry#1#2{\begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3467 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3468 % Start a new paragraph if necessary, so our assignments below can't
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3469 % affect previous text.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3470 \par
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3471 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3472 % Do not fill out the last line with white space.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3473 \parfillskip = 0in
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3474 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3475 % No extra space above this paragraph.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3476 \parskip = 0in
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3477 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3478 % Do not prefer a separate line ending with a hyphen to fewer lines.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3479 \finalhyphendemerits = 0
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3480 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3481 % \hangindent is only relevant when the entry text and page number
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3482 % don't both fit on one line. In that case, bob suggests starting the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3483 % dots pretty far over on the line. Unfortunately, a large
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3484 % indentation looks wrong when the entry text itself is broken across
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3485 % lines. So we use a small indentation and put up with long leaders.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3486 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3487 % \hangafter is reset to 1 (which is the value we want) at the start
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3488 % of each paragraph, so we need not do anything with that.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3489 \hangindent = 2em
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3490 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3491 % When the entry text needs to be broken, just fill out the first line
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3492 % with blank space.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3493 \rightskip = 0pt plus1fil
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3494 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3495 % A bit of stretch before each entry for the benefit of balancing columns.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3496 \vskip 0pt plus1pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3497 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3498 % Start a ``paragraph'' for the index entry so the line breaking
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3499 % parameters we've set above will have an effect.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3500 \noindent
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3501 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3502 % Insert the text of the index entry. TeX will do line-breaking on it.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3503 #1%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3504 % The following is kludged to not output a line of dots in the index if
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3505 % there are no page numbers. The next person who breaks this will be
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3506 % cursed by a Unix daemon.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3507 \def\tempa{{\rm }}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3508 \def\tempb{#2}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3509 \edef\tempc{\tempa}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3510 \edef\tempd{\tempb}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3511 \ifx\tempc\tempd\ \else%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3512 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3513 % If we must, put the page number on a line of its own, and fill out
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3514 % this line with blank space. (The \hfil is overwhelmed with the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3515 % fill leaders glue in \indexdotfill if the page number does fit.)
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3516 \hfil\penalty50
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3517 \null\nobreak\indexdotfill % Have leaders before the page number.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3518 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3519 % The `\ ' here is removed by the implicit \unskip that TeX does as
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3520 % part of (the primitive) \par. Without it, a spurious underfull
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3521 % \hbox ensues.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3522 \ifpdf
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3523 \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3524 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3525 \ #2% The page number ends the paragraph.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3526 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3527 \fi%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3528 \par
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3529 \endgroup}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3530
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3531 % Like \dotfill except takes at least 1 em.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3532 \def\indexdotfill{\cleaders
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3533 \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3534
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3535 \def\primary #1{\line{#1\hfil}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3536
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3537 \newskip\secondaryindent \secondaryindent=0.5cm
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3538 \def\secondary#1#2{{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3539 \parfillskip=0in
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3540 \parskip=0in
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3541 \hangindent=1in
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3542 \hangafter=1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3543 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3544 \ifpdf
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3545 \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3546 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3547 #2
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3548 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3549 \par
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3550 }}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3551
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3552 % Define two-column mode, which we use to typeset indexes.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3553 % Adapted from the TeXbook, page 416, which is to say,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3554 % the manmac.tex format used to print the TeXbook itself.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3555 \catcode`\@=11
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3556
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3557 \newbox\partialpage
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3558 \newdimen\doublecolumnhsize
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3559
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3560 \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3561 % Grab any single-column material above us.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3562 \output = {%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3563 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3564 % Here is a possibility not foreseen in manmac: if we accumulate a
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3565 % whole lot of material, we might end up calling this \output
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3566 % routine twice in a row (see the doublecol-lose test, which is
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3567 % essentially a couple of indexes with @setchapternewpage off). In
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3568 % that case we just ship out what is in \partialpage with the normal
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3569 % output routine. Generally, \partialpage will be empty when this
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3570 % runs and this will be a no-op. See the indexspread.tex test case.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3571 \ifvoid\partialpage \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3572 \onepageout{\pagecontents\partialpage}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3573 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3574 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3575 \global\setbox\partialpage = \vbox{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3576 % Unvbox the main output page.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3577 \unvbox\PAGE
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3578 \kern-\topskip \kern\baselineskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3579 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3580 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3581 \eject % run that output routine to set \partialpage
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3582 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3583 % Use the double-column output routine for subsequent pages.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3584 \output = {\doublecolumnout}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3585 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3586 % Change the page size parameters. We could do this once outside this
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3587 % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3588 % format, but then we repeat the same computation. Repeating a couple
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3589 % of assignments once per index is clearly meaningless for the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3590 % execution time, so we may as well do it in one place.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3591 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3592 % First we halve the line length, less a little for the gutter between
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3593 % the columns. We compute the gutter based on the line length, so it
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3594 % changes automatically with the paper format. The magic constant
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3595 % below is chosen so that the gutter has the same value (well, +-<1pt)
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3596 % as it did when we hard-coded it.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3597 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3598 % We put the result in a separate register, \doublecolumhsize, so we
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3599 % can restore it in \pagesofar, after \hsize itself has (potentially)
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3600 % been clobbered.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3601 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3602 \doublecolumnhsize = \hsize
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3603 \advance\doublecolumnhsize by -.04154\hsize
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3604 \divide\doublecolumnhsize by 2
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3605 \hsize = \doublecolumnhsize
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3606 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3607 % Double the \vsize as well. (We don't need a separate register here,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3608 % since nobody clobbers \vsize.)
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3609 \vsize = 2\vsize
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3610 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3611
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3612 % The double-column output routine for all double-column pages except
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3613 % the last.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3614 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3615 \def\doublecolumnout{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3616 \splittopskip=\topskip \splitmaxdepth=\maxdepth
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3617 % Get the available space for the double columns -- the normal
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3618 % (undoubled) page height minus any material left over from the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3619 % previous page.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3620 \dimen@ = \vsize
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3621 \divide\dimen@ by 2
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3622 \advance\dimen@ by -\ht\partialpage
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3623 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3624 % box0 will be the left-hand column, box2 the right.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3625 \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3626 \onepageout\pagesofar
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3627 \unvbox255
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3628 \penalty\outputpenalty
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3629 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3630 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3631 % Re-output the contents of the output page -- any previous material,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3632 % followed by the two boxes we just split, in box0 and box2.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3633 \def\pagesofar{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3634 \unvbox\partialpage
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3635 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3636 \hsize = \doublecolumnhsize
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3637 \wd0=\hsize \wd2=\hsize
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3638 \hbox to\pagewidth{\box0\hfil\box2}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3639 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
3640 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3641 % All done with double columns.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3642 \def\enddoublecolumns{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3643 \output = {%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3644 % Split the last of the double-column material. Leave it on the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3645 % current page, no automatic page break.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3646 \balancecolumns
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3647 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3648 % If we end up splitting too much material for the current page,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3649 % though, there will be another page break right after this \output
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3650 % invocation ends. Having called \balancecolumns once, we do not
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3651 % want to call it again. Therefore, reset \output to its normal
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3652 % definition right away. (We hope \balancecolumns will never be
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3653 % called on to balance too much material, but if it is, this makes
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3654 % the output somewhat more palatable.)
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3655 \global\output = {\onepageout{\pagecontents\PAGE}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3656 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3657 \eject
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3658 \endgroup % started in \begindoublecolumns
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3659 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3660 % \pagegoal was set to the doubled \vsize above, since we restarted
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3661 % the current page. We're now back to normal single-column
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3662 % typesetting, so reset \pagegoal to the normal \vsize (after the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3663 % \endgroup where \vsize got restored).
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3664 \pagegoal = \vsize
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3665 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3666 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3667 % Called at the end of the double column material.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3668 \def\balancecolumns{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3669 \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3670 \dimen@ = \ht0
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3671 \advance\dimen@ by \topskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3672 \advance\dimen@ by-\baselineskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3673 \divide\dimen@ by 2 % target to split to
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3674 %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3675 \splittopskip = \topskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3676 % Loop until we get a decent breakpoint.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3677 {%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3678 \vbadness = 10000
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3679 \loop
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3680 \global\setbox3 = \copy0
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3681 \global\setbox1 = \vsplit3 to \dimen@
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3682 \ifdim\ht3>\dimen@
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3683 \global\advance\dimen@ by 1pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3684 \repeat
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3685 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3686 %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3687 \setbox0=\vbox to\dimen@{\unvbox1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3688 \setbox2=\vbox to\dimen@{\unvbox3}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3689 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3690 \pagesofar
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3691 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3692 \catcode`\@ = \other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3693
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3694
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3695 \message{sectioning,}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3696 % Chapters, sections, etc.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3697
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3698 \newcount\chapno
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3699 \newcount\secno \secno=0
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3700 \newcount\subsecno \subsecno=0
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3701 \newcount\subsubsecno \subsubsecno=0
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3702
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3703 % This counter is funny since it counts through charcodes of letters A, B, ...
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3704 \newcount\appendixno \appendixno = `\@
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3705 % \def\appendixletter{\char\the\appendixno}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3706 % We do the following for the sake of pdftex, which needs the actual
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3707 % letter in the expansion, not just typeset.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3708 \def\appendixletter{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3709 \ifnum\appendixno=`A A%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3710 \else\ifnum\appendixno=`B B%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3711 \else\ifnum\appendixno=`C C%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3712 \else\ifnum\appendixno=`D D%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3713 \else\ifnum\appendixno=`E E%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3714 \else\ifnum\appendixno=`F F%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3715 \else\ifnum\appendixno=`G G%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3716 \else\ifnum\appendixno=`H H%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3717 \else\ifnum\appendixno=`I I%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3718 \else\ifnum\appendixno=`J J%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3719 \else\ifnum\appendixno=`K K%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3720 \else\ifnum\appendixno=`L L%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3721 \else\ifnum\appendixno=`M M%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3722 \else\ifnum\appendixno=`N N%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3723 \else\ifnum\appendixno=`O O%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3724 \else\ifnum\appendixno=`P P%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3725 \else\ifnum\appendixno=`Q Q%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3726 \else\ifnum\appendixno=`R R%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3727 \else\ifnum\appendixno=`S S%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3728 \else\ifnum\appendixno=`T T%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3729 \else\ifnum\appendixno=`U U%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3730 \else\ifnum\appendixno=`V V%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3731 \else\ifnum\appendixno=`W W%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3732 \else\ifnum\appendixno=`X X%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3733 \else\ifnum\appendixno=`Y Y%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3734 \else\ifnum\appendixno=`Z Z%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3735 % The \the is necessary, despite appearances, because \appendixletter is
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3736 % expanded while writing the .toc file. \char\appendixno is not
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3737 % expandable, thus it is written literally, thus all appendixes come out
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3738 % with the same letter (or @) in the toc without it.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3739 \else\char\the\appendixno
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3740 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3741 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3742
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3743 % Each @chapter defines this as the name of the chapter.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3744 % page headings and footings can use it. @section does likewise.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3745 \def\thischapter{}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3746 \def\thissection{}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3747
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3748 \newcount\absseclevel % used to calculate proper heading level
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3749 \newcount\secbase\secbase=0 % @raise/lowersections modify this count
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3750
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3751 % @raisesections: treat @section as chapter, @subsection as section, etc.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3752 \def\raisesections{\global\advance\secbase by -1}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3753 \let\up=\raisesections % original BFox name
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3754
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3755 % @lowersections: treat @chapter as section, @section as subsection, etc.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3756 \def\lowersections{\global\advance\secbase by 1}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3757 \let\down=\lowersections % original BFox name
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3758
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3759 % Choose a numbered-heading macro
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3760 % #1 is heading level if unmodified by @raisesections or @lowersections
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3761 % #2 is text for heading
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3762 \def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3763 \ifcase\absseclevel
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3764 \chapterzzz{#2}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3765 \or
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3766 \seczzz{#2}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3767 \or
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3768 \numberedsubseczzz{#2}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3769 \or
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3770 \numberedsubsubseczzz{#2}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3771 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3772 \ifnum \absseclevel<0
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3773 \chapterzzz{#2}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3774 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3775 \numberedsubsubseczzz{#2}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3776 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3777 \fi
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3778 \suppressfirstparagraphindent
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3779 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3780
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3781 % like \numhead, but chooses appendix heading levels
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3782 \def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3783 \ifcase\absseclevel
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3784 \appendixzzz{#2}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3785 \or
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3786 \appendixsectionzzz{#2}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3787 \or
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3788 \appendixsubseczzz{#2}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3789 \or
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3790 \appendixsubsubseczzz{#2}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3791 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3792 \ifnum \absseclevel<0
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3793 \appendixzzz{#2}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3794 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3795 \appendixsubsubseczzz{#2}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3796 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3797 \fi
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3798 \suppressfirstparagraphindent
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3799 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3800
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3801 % like \numhead, but chooses numberless heading levels
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3802 \def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3803 \ifcase\absseclevel
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3804 \unnumberedzzz{#2}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3805 \or
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3806 \unnumberedseczzz{#2}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3807 \or
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3808 \unnumberedsubseczzz{#2}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3809 \or
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3810 \unnumberedsubsubseczzz{#2}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3811 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3812 \ifnum \absseclevel<0
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3813 \unnumberedzzz{#2}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3814 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3815 \unnumberedsubsubseczzz{#2}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3816 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3817 \fi
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3818 \suppressfirstparagraphindent
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3819 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3820
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3821 % @chapter, @appendix, @unnumbered.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3822 \def\thischaptername{No Chapter Title}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3823 \outer\def\chapter{\parsearg\chapteryyy}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3824 \def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3825 \def\chapterzzz #1{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3826 \secno=0 \subsecno=0 \subsubsecno=0
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3827 \global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3828 \chapmacro {#1}{\the\chapno}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3829 \gdef\thissection{#1}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3830 \gdef\thischaptername{#1}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3831 % We don't substitute the actual chapter name into \thischapter
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3832 % because we don't want its macros evaluated now.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3833 \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3834 \writetocentry{chap}{#1}{{\the\chapno}}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3835 \donoderef
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3836 \global\let\section = \numberedsec
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3837 \global\let\subsection = \numberedsubsec
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3838 \global\let\subsubsection = \numberedsubsubsec
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3839 }
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3840
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3841 % we use \chapno to avoid indenting back
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3842 \def\appendixbox#1{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3843 \setbox0 = \hbox{\putwordAppendix{} \the\chapno}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3844 \hbox to \wd0{#1\hss}}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3845
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3846 \outer\def\appendix{\parsearg\appendixyyy}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3847 \def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3848 \def\appendixzzz #1{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3849 \secno=0 \subsecno=0 \subsubsecno=0
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3850 \global\advance \appendixno by 1
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3851 \message{\putwordAppendix\space \appendixletter}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3852 \chapmacro {#1}{\appendixbox{\putwordAppendix{} \appendixletter}}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3853 \gdef\thissection{#1}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3854 \gdef\thischaptername{#1}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3855 \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3856 \writetocentry{appendix}{#1}{{\appendixletter}}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3857 \appendixnoderef
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3858 \global\let\section = \appendixsec
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3859 \global\let\subsection = \appendixsubsec
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3860 \global\let\subsubsection = \appendixsubsubsec
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3861 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3862
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3863 % @centerchap is like @unnumbered, but the heading is centered.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3864 \outer\def\centerchap{\parsearg\centerchapyyy}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3865 \def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3866
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3867 % @top is like @unnumbered.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3868 \outer\def\top{\parsearg\unnumberedyyy}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3869
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3870 \outer\def\unnumbered{\parsearg\unnumberedyyy}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3871 \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3872 \def\unnumberedzzz #1{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3873 \secno=0 \subsecno=0 \subsubsecno=0
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3874 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3875 % This used to be simply \message{#1}, but TeX fully expands the
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3876 % argument to \message. Therefore, if #1 contained @-commands, TeX
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3877 % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3878 % expanded @cite (which turns out to cause errors because \cite is meant
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3879 % to be executed, not expanded).
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3880 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3881 % Anyway, we don't want the fully-expanded definition of @cite to appear
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3882 % as a result of the \message, we just want `@cite' itself. We use
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3883 % \the<toks register> to achieve this: TeX expands \the<toks> only once,
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3884 % simply yielding the contents of <toks register>. (We also do this for
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3885 % the toc entries.)
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3886 \toks0 = {#1}\message{(\the\toks0)}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3887 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3888 \unnumbchapmacro {#1}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3889 \gdef\thischapter{#1}\gdef\thissection{#1}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3890 \writetocentry{unnumbchap}{#1}{{\the\chapno}}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3891 \unnumbnoderef
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3892 \global\let\section = \unnumberedsec
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3893 \global\let\subsection = \unnumberedsubsec
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3894 \global\let\subsubsection = \unnumberedsubsubsec
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3895 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3896
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3897 % Sections.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3898 \outer\def\numberedsec{\parsearg\secyyy}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3899 \def\secyyy #1{\numhead1{#1}} % normally calls seczzz
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3900 \def\seczzz #1{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3901 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3902 \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3903 \writetocentry{sec}{#1}{{\the\chapno}{\the\secno}}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3904 \donoderef
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3905 \nobreak
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3906 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3907
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3908 \outer\def\appendixsection{\parsearg\appendixsecyyy}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3909 \outer\def\appendixsec{\parsearg\appendixsecyyy}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3910 \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3911 \def\appendixsectionzzz #1{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3912 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3913 \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3914 \writetocentry{sec}{#1}{{\appendixletter}{\the\secno}}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3915 \appendixnoderef
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3916 \nobreak
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3917 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3918
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3919 \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3920 \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3921 \def\unnumberedseczzz #1{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3922 \plainsecheading {#1}\gdef\thissection{#1}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3923 \writetocentry{unnumbsec}{#1}{{\the\chapno}{\the\secno}}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3924 \unnumbnoderef
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3925 \nobreak
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3926 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3927
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3928 % Subsections.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3929 \outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3930 \def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3931 \def\numberedsubseczzz #1{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3932 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3933 \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3934 \writetocentry{subsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3935 \donoderef
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3936 \nobreak
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3937 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3938
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3939 \outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3940 \def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3941 \def\appendixsubseczzz #1{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3942 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3943 \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3944 \writetocentry{subsec}{#1}{{\appendixletter}{\the\secno}{\the\subsecno}}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3945 \appendixnoderef
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3946 \nobreak
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3947 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3948
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3949 \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3950 \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3951 \def\unnumberedsubseczzz #1{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3952 \plainsubsecheading {#1}\gdef\thissection{#1}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3953 \writetocentry{unnumbsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3954 \unnumbnoderef
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3955 \nobreak
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3956 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3957
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3958 % Subsubsections.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3959 \outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3960 \def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3961 \def\numberedsubsubseczzz #1{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3962 \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3963 \subsubsecheading {#1}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3964 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3965 \writetocentry{subsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3966 \donoderef
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3967 \nobreak
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3968 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3969
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3970 \outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3971 \def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3972 \def\appendixsubsubseczzz #1{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3973 \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3974 \subsubsecheading {#1}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3975 {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3976 \writetocentry{subsubsec}{#1}{{\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3977 \appendixnoderef
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3978 \nobreak
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3979 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3980
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3981 \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3982 \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3983 \def\unnumberedsubsubseczzz #1{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3984 \plainsubsubsecheading {#1}\gdef\thissection{#1}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3985 \writetocentry{unnumbsubsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3986 \unnumbnoderef
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
3987 \nobreak
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3988 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3989
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3990 % These are variants which are not "outer", so they can appear in @ifinfo.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3991 % Actually, they should now be obsolete; ordinary section commands should work.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3992 \def\infotop{\parsearg\unnumberedzzz}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3993 \def\infounnumbered{\parsearg\unnumberedzzz}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3994 \def\infounnumberedsec{\parsearg\unnumberedseczzz}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3995 \def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3996 \def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3997
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3998 \def\infoappendix{\parsearg\appendixzzz}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3999 \def\infoappendixsec{\parsearg\appendixseczzz}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4000 \def\infoappendixsubsec{\parsearg\appendixsubseczzz}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4001 \def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4002
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4003 \def\infochapter{\parsearg\chapterzzz}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4004 \def\infosection{\parsearg\sectionzzz}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4005 \def\infosubsection{\parsearg\subsectionzzz}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4006 \def\infosubsubsection{\parsearg\subsubsectionzzz}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4007
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4008 % These macros control what the section commands do, according
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4009 % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4010 % Define them by default for a numbered chapter.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4011 \global\let\section = \numberedsec
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4012 \global\let\subsection = \numberedsubsec
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4013 \global\let\subsubsection = \numberedsubsubsec
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4014
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4015 % Define @majorheading, @heading and @subheading
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4016
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4017 % NOTE on use of \vbox for chapter headings, section headings, and such:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4018 % 1) We use \vbox rather than the earlier \line to permit
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4019 % overlong headings to fold.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4020 % 2) \hyphenpenalty is set to 10000 because hyphenation in a
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4021 % heading is obnoxious; this forbids it.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4022 % 3) Likewise, headings look best if no \parindent is used, and
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4023 % if justification is not attempted. Hence \raggedright.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4024
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4025
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4026 \def\majorheading{\parsearg\majorheadingzzz}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4027 \def\majorheadingzzz #1{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4028 {\advance\chapheadingskip by 10pt \chapbreak }%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4029 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4030 \parindent=0pt\raggedright
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4031 \rm #1\hfill}}\bigskip \par\penalty 200}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4032
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4033 \def\chapheading{\parsearg\chapheadingzzz}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4034 \def\chapheadingzzz #1{\chapbreak %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4035 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4036 \parindent=0pt\raggedright
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4037 \rm #1\hfill}}\bigskip \par\penalty 200}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4038
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4039 % @heading, @subheading, @subsubheading.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4040 \def\heading{\parsearg\plainsecheading}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4041 \def\subheading{\parsearg\plainsubsecheading}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4042 \def\subsubheading{\parsearg\plainsubsubsecheading}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4043
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4044 % These macros generate a chapter, section, etc. heading only
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4045 % (including whitespace, linebreaking, etc. around it),
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4046 % given all the information in convenient, parsed form.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4047
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4048 %%% Args are the skip and penalty (usually negative)
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4049 \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4050
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4051 \def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4052
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4053 %%% Define plain chapter starts, and page on/off switching for it
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4054 % Parameter controlling skip before chapter headings (if needed)
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4055
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4056 \newskip\chapheadingskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4057
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4058 \def\chapbreak{\dobreak \chapheadingskip {-4000}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4059 \def\chappager{\par\vfill\supereject}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4060 \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4061
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4062 \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4063
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4064 \def\CHAPPAGoff{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4065 \global\let\contentsalignmacro = \chappager
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4066 \global\let\pchapsepmacro=\chapbreak
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4067 \global\let\pagealignmacro=\chappager}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4068
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4069 \def\CHAPPAGon{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4070 \global\let\contentsalignmacro = \chappager
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4071 \global\let\pchapsepmacro=\chappager
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4072 \global\let\pagealignmacro=\chappager
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4073 \global\def\HEADINGSon{\HEADINGSsingle}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4074
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4075 \def\CHAPPAGodd{
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4076 \global\let\contentsalignmacro = \chapoddpage
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4077 \global\let\pchapsepmacro=\chapoddpage
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4078 \global\let\pagealignmacro=\chapoddpage
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4079 \global\def\HEADINGSon{\HEADINGSdouble}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4080
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4081 \CHAPPAGon
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4082
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4083 \def\CHAPFplain{
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4084 \global\let\chapmacro=\chfplain
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4085 \global\let\unnumbchapmacro=\unnchfplain
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4086 \global\let\centerchapmacro=\centerchfplain}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4087
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4088 % Plain chapter opening.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4089 % #1 is the text, #2 the chapter number or empty if unnumbered.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4090 \def\chfplain#1#2{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4091 \pchapsepmacro
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4092 {%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4093 \chapfonts \rm
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4094 \def\chapnum{#2}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4095 \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4096 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4097 \hangindent = \wd0 \centerparametersmaybe
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4098 \unhbox0 #1\par}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4099 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4100 \nobreak\bigskip % no page break after a chapter title
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4101 \nobreak
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4102 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4103
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4104 % Plain opening for unnumbered.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4105 \def\unnchfplain#1{\chfplain{#1}{}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4106
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4107 % @centerchap -- centered and unnumbered.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4108 \let\centerparametersmaybe = \relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4109 \def\centerchfplain#1{{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4110 \def\centerparametersmaybe{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4111 \advance\rightskip by 3\rightskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4112 \leftskip = \rightskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4113 \parfillskip = 0pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4114 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4115 \chfplain{#1}{}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4116 }}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4117
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4118 \CHAPFplain % The default
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4119
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4120 \def\unnchfopen #1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4121 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4122 \parindent=0pt\raggedright
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4123 \rm #1\hfill}}\bigskip \par\nobreak
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4124 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4125
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4126 \def\chfopen #1#2{\chapoddpage {\chapfonts
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4127 \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4128 \par\penalty 5000 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4129 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4130
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4131 \def\centerchfopen #1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4132 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4133 \parindent=0pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4134 \hfill {\rm #1}\hfill}}\bigskip \par\nobreak
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4135 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4136
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4137 \def\CHAPFopen{
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4138 \global\let\chapmacro=\chfopen
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4139 \global\let\unnumbchapmacro=\unnchfopen
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4140 \global\let\centerchapmacro=\centerchfopen}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4141
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4142
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4143 % Section titles.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4144 \newskip\secheadingskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4145 \def\secheadingbreak{\dobreak \secheadingskip {-1000}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4146 \def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4147 \def\plainsecheading#1{\sectionheading{sec}{}{#1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4148
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4149 % Subsection titles.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4150 \newskip \subsecheadingskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4151 \def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4152 \def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4153 \def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4154
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4155 % Subsubsection titles.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4156 \let\subsubsecheadingskip = \subsecheadingskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4157 \let\subsubsecheadingbreak = \subsecheadingbreak
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4158 \def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4159 \def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4160
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4161
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4162 % Print any size section title.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4163 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4164 % #1 is the section type (sec/subsec/subsubsec), #2 is the section
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4165 % number (maybe empty), #3 the text.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4166 \def\sectionheading#1#2#3{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4167 {%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4168 \expandafter\advance\csname #1headingskip\endcsname by \parskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4169 \csname #1headingbreak\endcsname
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4170 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4171 {%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4172 % Switch to the right set of fonts.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4173 \csname #1fonts\endcsname \rm
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4174 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4175 % Only insert the separating space if we have a section number.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4176 \def\secnum{#2}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4177 \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4178 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4179 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4180 \hangindent = \wd0 % zero if no section number
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4181 \unhbox0 #3}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4182 }%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4183 % Add extra space after the heading -- either a line space or a
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4184 % paragraph space, whichever is more. (Some people like to set
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4185 % \parskip to large values for some reason.) Don't allow stretch, though.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4186 \nobreak
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4187 \ifdim\parskip>\normalbaselineskip
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4188 \kern\parskip
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4189 \else
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4190 \kern\normalbaselineskip
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4191 \fi
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4192 \nobreak
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4193 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4194
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4195
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4196 \message{toc,}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4197 % Table of contents.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4198 \newwrite\tocfile
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4199
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4200 % Write an entry to the toc file, opening it if necessary.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4201 % Called from @chapter, etc. We supply {\folio} at the end of the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4202 % argument, which will end up as the last argument to the \...entry macro.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4203 %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4204 % Usage: \writetocentry{chap}{The Name of The Game}{{\the\chapno}}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4205 % We open the .toc file for writing here instead of at @setfilename (or
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4206 % any other fixed time) so that @contents can be anywhere in the document.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4207 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4208 \newif\iftocfileopened
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4209 \def\writetocentry#1#2#3{%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4210 \iftocfileopened\else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4211 \immediate\openout\tocfile = \jobname.toc
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4212 \global\tocfileopenedtrue
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4213 \fi
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4214 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4215 \iflinks
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4216 \toks0 = {#2}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4217 \edef\temp{\write\tocfile{\realbackslash #1entry{\the\toks0}#3{\folio}}}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4218 \temp
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4219 \fi
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4220 %
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4221 % Tell \shipout to create a page destination if we're doing pdf, which
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4222 % will be the target of the links in the table of contents. We can't
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4223 % just do it on every page because the title pages are numbered 1 and
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4224 % 2 (the page numbers aren't printed), and so are the first two pages
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4225 % of the document. Thus, we'd have two destinations named `1', and
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4226 % two named `2'.
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4227 \ifpdf \pdfmakepagedesttrue \fi
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4228 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4229
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4230 \newskip\contentsrightmargin \contentsrightmargin=1in
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4231 \newcount\savepageno
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4232 \newcount\lastnegativepageno \lastnegativepageno = -1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4233
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4234 % Finish up the main text and prepare to read what we've written
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4235 % to \tocfile.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4236 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4237 \def\startcontents#1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4238 % If @setchapternewpage on, and @headings double, the contents should
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4239 % start on an odd page, unlike chapters. Thus, we maintain
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4240 % \contentsalignmacro in parallel with \pagealignmacro.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4241 % From: Torbjorn Granlund <tege@matematik.su.se>
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4242 \contentsalignmacro
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4243 \immediate\closeout\tocfile
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4244 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4245 % Don't need to put `Contents' or `Short Contents' in the headline.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4246 % It is abundantly clear what they are.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4247 \unnumbchapmacro{#1}\def\thischapter{}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4248 \savepageno = \pageno
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4249 \begingroup % Set up to handle contents files properly.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4250 \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4251 % We can't do this, because then an actual ^ in a section
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4252 % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4253 %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4254 \raggedbottom % Worry more about breakpoints than the bottom.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4255 \advance\hsize by -\contentsrightmargin % Don't use the full line length.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4256 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4257 % Roman numerals for page numbers.
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4258 \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4259 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4260
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4261
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4262 % Normal (long) toc.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4263 \def\contents{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4264 \startcontents{\putwordTOC}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4265 \openin 1 \jobname.toc
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4266 \ifeof 1 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4267 \closein 1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4268 \input \jobname.toc
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4269 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4270 \vfill \eject
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4271 \contentsalignmacro % in case @setchapternewpage odd is in effect
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4272 \pdfmakeoutlines
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4273 \endgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4274 \lastnegativepageno = \pageno
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4275 \global\pageno = \savepageno
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4276 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4277
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4278 % And just the chapters.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4279 \def\summarycontents{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4280 \startcontents{\putwordShortTOC}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4281 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4282 \let\chapentry = \shortchapentry
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4283 \let\appendixentry = \shortappendixentry
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4284 \let\unnumbchapentry = \shortunnumberedentry
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4285 % We want a true roman here for the page numbers.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4286 \secfonts
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4287 \let\rm=\shortcontrm \let\bf=\shortcontbf
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4288 \let\sl=\shortcontsl \let\tt=\shortconttt
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4289 \rm
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4290 \hyphenpenalty = 10000
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4291 \advance\baselineskip by 1pt % Open it up a little.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4292 \def\secentry ##1##2##3##4{}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4293 \def\subsecentry ##1##2##3##4##5{}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4294 \def\subsubsecentry ##1##2##3##4##5##6{}
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4295 \let\unnumbsecentry = \secentry
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4296 \let\unnumbsubsecentry = \subsecentry
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4297 \let\unnumbsubsubsecentry = \subsubsecentry
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4298 \openin 1 \jobname.toc
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4299 \ifeof 1 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4300 \closein 1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4301 \input \jobname.toc
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4302 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4303 \vfill \eject
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4304 \contentsalignmacro % in case @setchapternewpage odd is in effect
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4305 \endgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4306 \lastnegativepageno = \pageno
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4307 \global\pageno = \savepageno
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4308 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4309 \let\shortcontents = \summarycontents
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4310
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4311 \ifpdf
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4312 \pdfcatalog{/PageMode /UseOutlines}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4313 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4314
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4315 % These macros generate individual entries in the table of contents.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4316 % The first argument is the chapter or section name.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4317 % The last argument is the page number.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4318 % The arguments in between are the chapter number, section number, ...
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4319
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4320 % Chapters, in the main contents.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4321 \def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4322 %
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4323 % Chapters, in the short toc.
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4324 % See comments in \dochapentry re vbox and related settings.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4325 \def\shortchapentry#1#2#3{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4326 \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4327 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4328
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4329 % Appendices, in the main contents.
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4330 \def\appendixentry#1#2#3{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4331 \dochapentry{\appendixbox{\putwordAppendix{} #2}\labelspace#1}{#3}}
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4332 %
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4333 % Appendices, in the short toc.
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4334 \let\shortappendixentry = \shortchapentry
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4335
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4336 % Typeset the label for a chapter or appendix for the short contents.
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4337 % The arg is, e.g., `Appendix A' for an appendix, or `3' for a chapter.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4338 % We could simplify the code here by writing out an \appendixentry
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4339 % command in the toc file for appendices, instead of using \chapentry
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4340 % for both, but it doesn't seem worth it.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4341 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4342 \newdimen\shortappendixwidth
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4343 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4344 \def\shortchaplabel#1{%
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4345 % This space should be enough, since a single number is .5em, and the
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4346 % widest letter (M) is 1em, at least in the Computer Modern fonts.
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4347 % But use \hss just in case.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4348 % (This space doesn't include the extra space that gets added after
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4349 % the label; that gets put in by \shortchapentry above.)
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4350 \dimen0 = 1em
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4351 \hbox to \dimen0{#1\hss}%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4352 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4353
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4354 % Unnumbered chapters.
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4355 \def\unnumbchapentry#1#2#3{\dochapentry{#1}{#3}}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4356 \def\shortunnumberedentry#1#2#3{\tocentry{#1}{\doshortpageno\bgroup#3\egroup}}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4357
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4358 % Sections.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4359 \def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4360 \def\unnumbsecentry#1#2#3#4{\dosecentry{#1}{#4}}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4361
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4362 % Subsections.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4363 \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4364 \def\unnumbsubsecentry#1#2#3#4#5{\dosubsecentry{#1}{#5}}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4365
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4366 % And subsubsections.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4367 \def\subsubsecentry#1#2#3#4#5#6{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4368 \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4369 \def\unnumbsubsubsecentry#1#2#3#4#5#6{\dosubsubsecentry{#1}{#6}}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4370
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4371 % This parameter controls the indentation of the various levels.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4372 \newdimen\tocindent \tocindent = 3pc
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4373
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4374 % Now for the actual typesetting. In all these, #1 is the text and #2 is the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4375 % page number.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4376 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4377 % If the toc has to be broken over pages, we want it to be at chapters
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4378 % if at all possible; hence the \penalty.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4379 \def\dochapentry#1#2{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4380 \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4381 \begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4382 \chapentryfonts
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4383 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4384 \endgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4385 \nobreak\vskip .25\baselineskip plus.1\baselineskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4386 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4387
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4388 \def\dosecentry#1#2{\begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4389 \secentryfonts \leftskip=\tocindent
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4390 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4391 \endgroup}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4392
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4393 \def\dosubsecentry#1#2{\begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4394 \subsecentryfonts \leftskip=2\tocindent
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4395 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4396 \endgroup}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4397
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4398 \def\dosubsubsecentry#1#2{\begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4399 \subsubsecentryfonts \leftskip=3\tocindent
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4400 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4401 \endgroup}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4402
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4403 % Final typesetting of a toc entry; we use the same \entry macro as for
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4404 % the index entries, but we want to suppress hyphenation here. (We
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4405 % can't do that in the \entry macro, since index entries might consist
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4406 % of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4407 \def\tocentry#1#2{\begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4408 \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4409 % Do not use \turnoffactive in these arguments. Since the toc is
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4410 % typeset in cmr, characters such as _ would come out wrong; we
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4411 % have to do the usual translation tricks.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4412 \entry{#1}{#2}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4413 \endgroup}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4414
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4415 % Space between chapter (or whatever) number and the title.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4416 \def\labelspace{\hskip1em \relax}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4417
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4418 \def\dopageno#1{{\rm #1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4419 \def\doshortpageno#1{{\rm #1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4420
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4421 \def\chapentryfonts{\secfonts \rm}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4422 \def\secentryfonts{\textfonts}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4423 \let\subsecentryfonts = \textfonts
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4424 \let\subsubsecentryfonts = \textfonts
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4425
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4426
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4427 \message{environments,}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4428 % @foo ... @end foo.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4429
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4430 % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
4431 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4432 % Since these characters are used in examples, it should be an even number of
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4433 % \tt widths. Each \tt character is 1en, so two makes it 1em.
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4434 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4435 \def\point{$\star$}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4436 \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4437 \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4438 \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4439 \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4440
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4441 % The @error{} command.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4442 % Adapted from the TeXbook's \boxit.
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
4443 %
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4444 \newbox\errorbox
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4445 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4446 {\tentt \global\dimen0 = 3em}% Width of the box.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4447 \dimen2 = .55pt % Thickness of rules
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4448 % The text. (`r' is open on the right, `e' somewhat less so on the left.)
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4449 \setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4450 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4451 \global\setbox\errorbox=\hbox to \dimen0{\hfil
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4452 \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4453 \advance\hsize by -2\dimen2 % Rules.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4454 \vbox{
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4455 \hrule height\dimen2
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4456 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4457 \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4458 \kern3pt\vrule width\dimen2}% Space to right.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4459 \hrule height\dimen2}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4460 \hfil}
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4461 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4462 \def\error{\leavevmode\lower.7ex\copy\errorbox}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4463
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4464 % @tex ... @end tex escapes into raw Tex temporarily.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4465 % One exception: @ is still an escape character, so that @end tex works.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4466 % But \@ or @@ will get a plain tex @ character.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4467
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4468 \def\tex{\begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4469 \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4470 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4471 \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4472 \catcode `\%=14
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4473 \catcode `\+=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4474 \catcode `\"=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4475 \catcode `\==\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4476 \catcode `\|=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4477 \catcode `\<=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4478 \catcode `\>=\other
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4479 \escapechar=`\\
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4480 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4481 \let\b=\ptexb
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4482 \let\bullet=\ptexbullet
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4483 \let\c=\ptexc
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4484 \let\,=\ptexcomma
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4485 \let\.=\ptexdot
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4486 \let\dots=\ptexdots
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4487 \let\equiv=\ptexequiv
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4488 \let\!=\ptexexclam
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4489 \let\i=\ptexi
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4490 \let\indent=\ptexindent
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4491 \let\{=\ptexlbrace
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4492 \let\+=\tabalign
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4493 \let\}=\ptexrbrace
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4494 \let\/=\ptexslash
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4495 \let\*=\ptexstar
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4496 \let\t=\ptext
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4497 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4498 \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4499 \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4500 \def\@{@}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4501 \let\Etex=\endgroup}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4502
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4503 % Define @lisp ... @end lisp.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4504 % @lisp does a \begingroup so it can rebind things,
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4505 % including the definition of @end lisp (which normally is erroneous).
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4506
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4507 % Amount to narrow the margins by for @lisp.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4508 \newskip\lispnarrowing \lispnarrowing=0.4in
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4509
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4510 % This is the definition that ^^M gets inside @lisp, @example, and other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4511 % such environments. \null is better than a space, since it doesn't
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4512 % have any width.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4513 \def\lisppar{\null\endgraf}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4514
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4515 % Make each space character in the input produce a normal interword
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4516 % space in the output. Don't allow a line break at this space, as this
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4517 % is used only in environments like @example, where each line of input
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4518 % should produce a line of output anyway.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4519 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4520 {\obeyspaces %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4521 \gdef\sepspaces{\obeyspaces\let =\tie}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4522
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4523 % Define \obeyedspace to be our active space, whatever it is. This is
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4524 % for use in \parsearg.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4525 {\sepspaces%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4526 \global\let\obeyedspace= }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4527
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4528 % This space is always present above and below environments.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4529 \newskip\envskipamount \envskipamount = 0pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4530
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4531 % Make spacing and below environment symmetrical. We use \parskip here
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4532 % to help in doing that, since in @example-like environments \parskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4533 % is reset to zero; thus the \afterenvbreak inserts no space -- but the
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4534 % start of the next paragraph will insert \parskip.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4535 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4536 \def\aboveenvbreak{{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4537 % =10000 instead of <10000 because of a special case in \itemzzz, q.v.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4538 \ifnum \lastpenalty=10000 \else
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4539 \advance\envskipamount by \parskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4540 \endgraf
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4541 \ifdim\lastskip<\envskipamount
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4542 \removelastskip
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4543 % it's not a good place to break if the last penalty was \nobreak
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4544 % or better ...
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4545 \ifnum\lastpenalty>10000 \else \penalty-50 \fi
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4546 \vskip\envskipamount
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4547 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4548 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4549 }}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4550
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4551 \let\afterenvbreak = \aboveenvbreak
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4552
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4553 % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4554 \let\nonarrowing=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4555
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4556 % @cartouche ... @end cartouche: draw rectangle w/rounded corners around
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4557 % environment contents.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4558 \font\circle=lcircle10
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4559 \newdimen\circthick
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4560 \newdimen\cartouter\newdimen\cartinner
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4561 \newskip\normbskip\newskip\normpskip\newskip\normlskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4562 \circthick=\fontdimen8\circle
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4563 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4564 \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4565 \def\ctr{{\hskip 6pt\circle\char'010}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4566 \def\cbl{{\circle\char'012\hskip -6pt}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4567 \def\cbr{{\hskip 6pt\circle\char'011}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4568 \def\carttop{\hbox to \cartouter{\hskip\lskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4569 \ctl\leaders\hrule height\circthick\hfil\ctr
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4570 \hskip\rskip}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4571 \def\cartbot{\hbox to \cartouter{\hskip\lskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4572 \cbl\leaders\hrule height\circthick\hfil\cbr
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4573 \hskip\rskip}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4574 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4575 \newskip\lskip\newskip\rskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4576
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4577 \def\cartouche{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4578 \par % can't be in the midst of a paragraph.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4579 \begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4580 \lskip=\leftskip \rskip=\rightskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4581 \leftskip=0pt\rightskip=0pt %we want these *outside*.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4582 \cartinner=\hsize \advance\cartinner by-\lskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4583 \advance\cartinner by-\rskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4584 \cartouter=\hsize
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4585 \advance\cartouter by 18.4pt % allow for 3pt kerns on either
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4586 % side, and for 6pt waste from
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4587 % each corner char, and rule thickness
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4588 \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4589 % Flag to tell @lisp, etc., not to narrow margin.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4590 \let\nonarrowing=\comment
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4591 \vbox\bgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4592 \baselineskip=0pt\parskip=0pt\lineskip=0pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4593 \carttop
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4594 \hbox\bgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4595 \hskip\lskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4596 \vrule\kern3pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4597 \vbox\bgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4598 \hsize=\cartinner
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4599 \kern3pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4600 \begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4601 \baselineskip=\normbskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4602 \lineskip=\normlskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4603 \parskip=\normpskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4604 \vskip -\parskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4605 \def\Ecartouche{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4606 \endgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4607 \kern3pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4608 \egroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4609 \kern3pt\vrule
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4610 \hskip\rskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4611 \egroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4612 \cartbot
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4613 \egroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4614 \endgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4615 }}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4616
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4617
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4618 % This macro is called at the beginning of all the @example variants,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4619 % inside a group.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4620 \def\nonfillstart{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4621 \aboveenvbreak
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4622 \inENV % This group ends at the end of the body
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4623 \hfuzz = 12pt % Don't be fussy
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4624 \sepspaces % Make spaces be word-separators rather than space tokens.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4625 \let\par = \lisppar % don't ignore blank lines
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4626 \obeylines % each line of input is a line of output
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4627 \parskip = 0pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4628 \parindent = 0pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4629 \emergencystretch = 0pt % don't try to avoid overfull boxes
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4630 % @cartouche defines \nonarrowing to inhibit narrowing
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4631 % at next level down.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4632 \ifx\nonarrowing\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4633 \advance \leftskip by \lispnarrowing
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4634 \exdentamount=\lispnarrowing
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4635 \let\exdent=\nofillexdent
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4636 \let\nonarrowing=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4637 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4638 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4639
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4640 % Define the \E... control sequence only if we are inside the particular
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4641 % environment, so the error checking in \end will work.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4642 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4643 % To end an @example-like environment, we first end the paragraph (via
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4644 % \afterenvbreak's vertical glue), and then the group. That way we keep
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4645 % the zero \parskip that the environments set -- \parskip glue will be
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4646 % inserted at the beginning of the next paragraph in the document, after
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4647 % the environment.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4648 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4649 \def\nonfillfinish{\afterenvbreak\endgroup}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4650
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4651 % @lisp: indented, narrowed, typewriter font.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4652 \def\lisp{\begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4653 \nonfillstart
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4654 \let\Elisp = \nonfillfinish
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4655 \tt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4656 \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4657 \gobble % eat return
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4658 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4659
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4660 % @example: Same as @lisp.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4661 \def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4662
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4663 % @smallexample and @smalllisp: use smaller fonts.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4664 % Originally contributed by Pavel@xerox.
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4665 \def\smalllisp{\begingroup
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4666 \def\Esmalllisp{\nonfillfinish\endgroup}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4667 \def\Esmallexample{\nonfillfinish\endgroup}%
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4668 \smallexamplefonts
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4669 \lisp
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4670 }
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4671 \let\smallexample = \smalllisp
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4672
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4673
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4674 % @display: same as @lisp except keep current font.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4675 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4676 \def\display{\begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4677 \nonfillstart
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4678 \let\Edisplay = \nonfillfinish
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4679 \gobble
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4680 }
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4681 %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4682 % @smalldisplay: @display plus smaller fonts.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4683 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4684 \def\smalldisplay{\begingroup
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4685 \def\Esmalldisplay{\nonfillfinish\endgroup}%
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4686 \smallexamplefonts \rm
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4687 \display
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4688 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4689
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4690 % @format: same as @display except don't narrow margins.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4691 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4692 \def\format{\begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4693 \let\nonarrowing = t
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4694 \nonfillstart
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4695 \let\Eformat = \nonfillfinish
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4696 \gobble
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4697 }
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4698 %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4699 % @smallformat: @format plus smaller fonts.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4700 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4701 \def\smallformat{\begingroup
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4702 \def\Esmallformat{\nonfillfinish\endgroup}%
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4703 \smallexamplefonts \rm
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4704 \format
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4705 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4706
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4707 % @flushleft (same as @format).
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4708 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4709 \def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4710
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4711 % @flushright.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4712 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4713 \def\flushright{\begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4714 \let\nonarrowing = t
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4715 \nonfillstart
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4716 \let\Eflushright = \nonfillfinish
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4717 \advance\leftskip by 0pt plus 1fill
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4718 \gobble
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4719 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4720
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4721
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4722 % @quotation does normal linebreaking (hence we can't use \nonfillstart)
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4723 % and narrows the margins.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4724 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4725 \def\quotation{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4726 \begingroup\inENV %This group ends at the end of the @quotation body
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4727 {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4728 \parindent=0pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4729 % We have retained a nonzero parskip for the environment, since we're
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4730 % doing normal filling. So to avoid extra space below the environment...
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4731 \def\Equotation{\parskip = 0pt \nonfillfinish}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4732 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4733 % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4734 \ifx\nonarrowing\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4735 \advance\leftskip by \lispnarrowing
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4736 \advance\rightskip by \lispnarrowing
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4737 \exdentamount = \lispnarrowing
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4738 \let\nonarrowing = \relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4739 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4740 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4741
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4742
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4743 % LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
4744 % If we want to allow any <char> as delimiter,
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4745 % we need the curly braces so that makeinfo sees the @verb command, eg:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4746 % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4747 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4748 % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4749 %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4750 % [Knuth] p.344; only we need to do the other characters Texinfo sets
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4751 % active too. Otherwise, they get lost as the first character on a
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4752 % verbatim line.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4753 \def\dospecials{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4754 \do\ \do\\\do\{\do\}\do\$\do\&%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4755 \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4756 \do\<\do\>\do\|\do\@\do+\do\"%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4757 }
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4758 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4759 % [Knuth] p. 380
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4760 \def\uncatcodespecials{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4761 \def\do##1{\catcode`##1=12}\dospecials}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4762 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4763 % [Knuth] pp. 380,381,391
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4764 % Disable Spanish ligatures ?` and !` of \tt font
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4765 \begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4766 \catcode`\`=\active\gdef`{\relax\lq}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4767 \endgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4768 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4769 % Setup for the @verb command.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4770 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4771 % Eight spaces for a tab
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4772 \begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4773 \catcode`\^^I=\active
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4774 \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4775 \endgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4776 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4777 \def\setupverb{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4778 \tt % easiest (and conventionally used) font for verbatim
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4779 \def\par{\leavevmode\endgraf}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4780 \catcode`\`=\active
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4781 \tabeightspaces
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4782 % Respect line breaks,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4783 % print special symbols as themselves, and
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4784 % make each space count
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4785 % must do in this order:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4786 \obeylines \uncatcodespecials \sepspaces
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4787 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4788
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4789 % Setup for the @verbatim environment
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4790 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4791 % Real tab expansion
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4792 \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4793 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4794 \def\starttabbox{\setbox0=\hbox\bgroup}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4795 \begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4796 \catcode`\^^I=\active
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4797 \gdef\tabexpand{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4798 \catcode`\^^I=\active
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4799 \def^^I{\leavevmode\egroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4800 \dimen0=\wd0 % the width so far, or since the previous tab
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4801 \divide\dimen0 by\tabw
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4802 \multiply\dimen0 by\tabw % compute previous multiple of \tabw
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4803 \advance\dimen0 by\tabw % advance to next multiple of \tabw
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4804 \wd0=\dimen0 \box0 \starttabbox
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4805 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4806 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4807 \endgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4808 \def\setupverbatim{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4809 % Easiest (and conventionally used) font for verbatim
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4810 \tt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4811 \def\par{\leavevmode\egroup\box0\endgraf}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4812 \catcode`\`=\active
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4813 \tabexpand
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4814 % Respect line breaks,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4815 % print special symbols as themselves, and
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4816 % make each space count
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4817 % must do in this order:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4818 \obeylines \uncatcodespecials \sepspaces
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4819 \everypar{\starttabbox}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4820 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4821
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
4822 % Do the @verb magic: verbatim text is quoted by unique
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
4823 % delimiter characters. Before first delimiter expect a
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4824 % right brace, after last delimiter expect closing brace:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4825 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4826 % \def\doverb'{'<char>#1<char>'}'{#1}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4827 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4828 % [Knuth] p. 382; only eat outer {}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4829 \begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4830 \catcode`[=1\catcode`]=2\catcode`\{=12\catcode`\}=12
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4831 \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4832 \endgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4833 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4834 \def\verb{\begingroup\setupverb\doverb}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4835 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4836 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4837 % Do the @verbatim magic: define the macro \doverbatim so that
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4838 % the (first) argument ends when '@end verbatim' is reached, ie:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4839 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4840 % \def\doverbatim#1@end verbatim{#1}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4841 %
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
4842 % For Texinfo it's a lot easier than for LaTeX,
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4843 % because texinfo's \verbatim doesn't stop at '\end{verbatim}':
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4844 % we need not redefine '\', '{' and '}'.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4845 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4846 % Inspired by LaTeX's verbatim command set [latex.ltx]
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4847 %% Include LaTeX hack for completeness -- never know
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4848 %% \begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4849 %% \catcode`|=0 \catcode`[=1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4850 %% \catcode`]=2\catcode`\{=12\catcode`\}=12\catcode`\ =\active
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4851 %% \catcode`\\=12|gdef|doverbatim#1@end verbatim[
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4852 %% #1|endgroup|def|Everbatim[]|end[verbatim]]
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4853 %% |endgroup
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4854 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4855 \begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4856 \catcode`\ =\active
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4857 \obeylines %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4858 % ignore everything up to the first ^^M, that's the newline at the end
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4859 % of the @verbatim input line itself. Otherwise we get an extra blank
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4860 % line in the output.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4861 \gdef\doverbatim#1^^M#2@end verbatim{#2\end{verbatim}}%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4862 \endgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4863 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4864 \def\verbatim{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4865 \def\Everbatim{\nonfillfinish\endgroup}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4866 \begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4867 \nonfillstart
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4868 \advance\leftskip by -\defbodyindent
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4869 \begingroup\setupverbatim\doverbatim
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4870 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4871
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4872 % @verbatiminclude FILE - insert text of file in verbatim environment.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4873 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4874 % Allow normal characters that we make active in the argument (a file name).
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4875 \def\verbatiminclude{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4876 \begingroup
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4877 \catcode`\\=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4878 \catcode`~=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4879 \catcode`^=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4880 \catcode`_=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4881 \catcode`|=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4882 \catcode`<=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4883 \catcode`>=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4884 \catcode`+=\other
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4885 \parsearg\doverbatiminclude
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4886 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4887 \def\setupverbatiminclude{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4888 \begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4889 \nonfillstart
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4890 \advance\leftskip by -\defbodyindent
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4891 \begingroup\setupverbatim
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4892 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4893 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4894 \def\doverbatiminclude#1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4895 % Restore active chars for included file.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4896 \endgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4897 \begingroup
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4898 \let\value=\expandablevalue
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4899 \def\thisfile{#1}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4900 \expandafter\expandafter\setupverbatiminclude\input\thisfile
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4901 \endgroup
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4902 \nonfillfinish
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4903 \endgroup
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4904 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4905
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4906 % @copying ... @end copying.
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4907 % Save the text away for @insertcopying later. Many commands won't be
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4908 % allowed in this context, but that's ok.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4909 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4910 % We save the uninterpreted tokens, rather than creating a box.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4911 % Saving the text in a box would be much easier, but then all the
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4912 % typesetting commands (@smallbook, font changes, etc.) have to be done
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4913 % beforehand -- and a) we want @copying to be done first in the source
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4914 % file; b) letting users define the frontmatter in as flexible order as
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4915 % possible is very desirable.
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4916 %
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4917 \def\copying{\begingroup
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4918 % Define a command to swallow text until we reach `@end copying'.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4919 % \ is the escape char in this texinfo.tex file, so it is the
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4920 % delimiter for the command; @ will be the escape char when we read
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4921 % it, but that doesn't matter.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4922 \long\def\docopying##1\end copying{\gdef\copyingtext{##1}\enddocopying}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4923 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4924 % We must preserve ^^M's in the input file; see \insertcopying below.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4925 \catcode`\^^M = \active
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4926 \docopying
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4927 }
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4928
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4929 % What we do to finish off the copying text.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4930 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4931 \def\enddocopying{\endgroup\ignorespaces}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4932
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4933 % @insertcopying. Here we must play games with ^^M's. On the one hand,
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4934 % we need them to delimit commands such as `@end quotation', so they
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4935 % must be active. On the other hand, we certainly don't want every
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4936 % end-of-line to be a \par, as would happen with the normal active
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4937 % definition of ^^M. On the third hand, two ^^M's in a row should still
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4938 % generate a \par.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4939 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4940 % Our approach is to make ^^M insert a space and a penalty1 normally;
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4941 % then it can also check if \lastpenalty=1. If it does, then manually
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4942 % do \par.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4943 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4944 % This messes up the normal definitions of @c[omment], so we redefine
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4945 % it. Similarly for @ignore. (These commands are used in the gcc
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4946 % manual for man page generation.)
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4947 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4948 % Seems pretty fragile, most line-oriented commands will presumably
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4949 % fail, but for the limited use of getting the copying text (which
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4950 % should be quite simple) inserted, we can hope it's ok.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4951 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4952 {\catcode`\^^M=\active %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4953 \gdef\insertcopying{\begingroup %
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
4954 \parindent = 0pt % looks wrong on title page
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4955 \def^^M{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4956 \ifnum \lastpenalty=1 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4957 \par %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4958 \else %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4959 \space \penalty 1 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4960 \fi %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4961 }%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4962 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4963 % Fix @c[omment] for catcode 13 ^^M's.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4964 \def\c##1^^M{\ignorespaces}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4965 \let\comment = \c %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4966 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4967 % Don't bother jumping through all the hoops that \doignore does, it
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4968 % would be very hard since the catcodes are already set.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4969 \long\def\ignore##1\end ignore{\ignorespaces}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4970 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4971 \copyingtext %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4972 \endgroup}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4973 }
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4974
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4975 \message{defuns,}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4976 % @defun etc.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4977
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4978 % Allow user to change definition object font (\df) internally
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4979 \def\setdeffont#1 {\csname DEF#1\endcsname}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4980
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4981 \newskip\defbodyindent \defbodyindent=.4in
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4982 \newskip\defargsindent \defargsindent=50pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4983 \newskip\deflastargmargin \deflastargmargin=18pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4984
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4985 \newcount\parencount
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4986
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4987 % We want ()&[] to print specially on the defun line.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4988 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4989 \def\activeparens{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4990 \catcode`\(=\active \catcode`\)=\active
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4991 \catcode`\&=\active
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4992 \catcode`\[=\active \catcode`\]=\active
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
4993 }
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4994
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4995 % Make control sequences which act like normal parenthesis chars.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4996 \let\lparen = ( \let\rparen = )
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4997
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4998 {\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4999
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5000 % Be sure that we always have a definition for `(', etc. For example,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5001 % if the fn name has parens in it, \boldbrax will not be in effect yet,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5002 % so TeX would otherwise complain about undefined control sequence.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5003 \global\let(=\lparen \global\let)=\rparen
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5004 \global\let[=\lbrack \global\let]=\rbrack
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5005
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5006 \gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5007 \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5008 % This is used to turn on special parens
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5009 % but make & act ordinary (given that it's active).
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5010 \gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5011
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5012 % Definitions of (, ) and & used in args for functions.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5013 % This is the definition of ( outside of all parentheses.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5014 \gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5015 \global\advance\parencount by 1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5016 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5017 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5018 % This is the definition of ( when already inside a level of parens.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5019 \gdef\opnested{\char`\(\global\advance\parencount by 1 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5020 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5021 \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5022 % also in that case restore the outer-level definition of (.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5023 \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5024 \global\advance \parencount by -1 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5025 % If we encounter &foo, then turn on ()-hacking afterwards
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5026 \gdef\amprm#1 {{\rm\&#1}\let(=\oprm \let)=\clrm\ }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5027 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5028 \gdef\normalparens{\boldbrax\let&=\ampnr}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5029 } % End of definition inside \activeparens
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5030 %% These parens (in \boldbrax) actually are a little bolder than the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5031 %% contained text. This is especially needed for [ and ]
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5032 \def\opnr{{\sf\char`\(}\global\advance\parencount by 1 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5033 \def\clnr{{\sf\char`\)}\global\advance\parencount by -1 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5034 \let\ampnr = \&
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5035 \def\lbrb{{\bf\char`\[}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5036 \def\rbrb{{\bf\char`\]}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5037
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5038 % Active &'s sneak into the index arguments, so make sure it's defined.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5039 {
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5040 \catcode`& = \active
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5041 \global\let& = \ampnr
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5042 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5043
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5044 % \defname, which formats the name of the @def (not the args).
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5045 % #1 is the function name.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5046 % #2 is the type of definition, such as "Function".
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5047 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5048 \def\defname#1#2{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5049 % How we'll output the type name. Putting it in brackets helps
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5050 % distinguish it from the body text that may end up on the next line
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5051 % just below it.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5052 \ifempty{#2}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5053 \def\defnametype{}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5054 \else
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5055 \def\defnametype{[\rm #2]}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5056 \fi
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5057 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5058 % Get the values of \leftskip and \rightskip as they were outside the @def...
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5059 \dimen2=\leftskip
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5060 \advance\dimen2 by -\defbodyindent
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5061 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5062 % Figure out values for the paragraph shape.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5063 \setbox0=\hbox{\hskip \deflastargmargin{\defnametype}}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5064 \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5065 \dimen1=\hsize \advance \dimen1 by -\defargsindent % size for continuations
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5066 \parshape 2 0in \dimen0 \defargsindent \dimen1
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5067 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5068 % Output arg 2 ("Function" or some such) but stuck inside a box of
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5069 % width 0 so it does not interfere with linebreaking.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5070 \noindent
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5071 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5072 {% Adjust \hsize to exclude the ambient margins,
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5073 % so that \rightline will obey them.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5074 \advance \hsize by -\dimen2
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5075 \dimen3 = 0pt % was -1.25pc
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5076 \rlap{\rightline{\defnametype\kern\dimen3}}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5077 }%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5078 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5079 % Allow all lines to be underfull without complaint:
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5080 \tolerance=10000 \hbadness=10000
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5081 \advance\leftskip by -\defbodyindent
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5082 \exdentamount=\defbodyindent
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5083 {\df #1}\enskip % output function name
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5084 % \defunargs will be called next to output the arguments, if any.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5085 }
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5086
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5087 % Common pieces to start any @def...
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5088 % #1 is the \E... control sequence to end the definition (which we define).
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5089 % #2 is the \...x control sequence (which our caller defines).
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5090 % #3 is the control sequence to process the header, such as \defunheader.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5091 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5092 \def\parsebodycommon#1#2#3{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5093 \begingroup\inENV
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5094 % If there are two @def commands in a row, we'll have a \nobreak,
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5095 % which is there to keep the function description together with its
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5096 % header. But if there's nothing but headers, we want to allow a
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5097 % break after all. Check for penalty 10002 (inserted by
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5098 % \defargscommonending) instead of 10000, since the sectioning
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5099 % commands insert a \penalty10000, and we don't want to allow a break
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5100 % between a section heading and a defun.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5101 \ifnum\lastpenalty=10002 \penalty0 \fi
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5102 \medbreak
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5103 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5104 % Define the \E... end token that this defining construct specifies
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5105 % so that it will exit this group.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5106 \def#1{\endgraf\endgroup\medbreak}%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5107 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5108 \parindent=0in
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5109 \advance\leftskip by \defbodyindent
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5110 \exdentamount=\defbodyindent
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5111 }
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5112
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5113 % Common part of the \...x definitions.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5114 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5115 \def\defxbodycommon{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5116 % As with \parsebodycommon above, allow line break if we have multiple
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5117 % x headers in a row. It's not a great place, though.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5118 \ifnum\lastpenalty=10000 \penalty1000 \fi
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5119 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5120 \begingroup\obeylines
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5121 }
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5122
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5123 % Process body of @defun, @deffn, @defmac, etc.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5124 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5125 \def\defparsebody#1#2#3{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5126 \parsebodycommon{#1}{#2}{#3}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5127 \def#2{\defxbodycommon \activeparens \spacesplit#3}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5128 \catcode\equalChar=\active
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5129 \begingroup\obeylines\activeparens
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5130 \spacesplit#3%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5131 }
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5132
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5133 % #1, #2, #3 are the common arguments (see \parsebodycommon above).
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5134 % #4, delimited by the space, is the class name.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5135 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5136 \def\defmethparsebody#1#2#3#4 {%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5137 \parsebodycommon{#1}{#2}{#3}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5138 \def#2##1 {\defxbodycommon \activeparens \spacesplit{#3{##1}}}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5139 \begingroup\obeylines\activeparens
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5140 % The \empty here prevents misinterpretation of a construct such as
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5141 % @deffn {whatever} {Enharmonic comma}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5142 % See comments at \deftpparsebody, although in our case we don't have
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5143 % to remove the \empty afterwards, since it is empty.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5144 \spacesplit{#3{#4}}\empty
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5145 }
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5146
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5147 % Used for @deftypemethod and @deftypeivar.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5148 % #1, #2, #3 are the common arguments (see \defparsebody).
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5149 % #4, delimited by a space, is the class name.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5150 % #5 is the method's return type.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5151 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5152 \def\deftypemethparsebody#1#2#3#4 #5 {%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5153 \parsebodycommon{#1}{#2}{#3}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5154 \def#2##1 ##2 {\defxbodycommon \activeparens \spacesplit{#3{##1}{##2}}}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5155 \begingroup\obeylines\activeparens
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5156 \spacesplit{#3{#4}{#5}}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5157 }
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5158
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5159 % Used for @deftypeop. The change from \deftypemethparsebody is an
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5160 % extra argument at the beginning which is the `category', instead of it
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5161 % being the hardwired string `Method' or `Instance Variable'. We have
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5162 % to account for this both in the \...x definition and in parsing the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5163 % input at hand. Thus also need a control sequence (passed as #5) for
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5164 % the \E... definition to assign the category name to.
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
5165 %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5166 \def\deftypeopparsebody#1#2#3#4#5 #6 {%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5167 \parsebodycommon{#1}{#2}{#3}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5168 \def#2##1 ##2 ##3 {\def#4{##1}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5169 \defxbodycommon \activeparens \spacesplit{#3{##2}{##3}}}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5170 \begingroup\obeylines\activeparens
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5171 \spacesplit{#3{#5}{#6}}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5172 }
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5173
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5174 % For @defop.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5175 \def\defopparsebody #1#2#3#4#5 {%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5176 \parsebodycommon{#1}{#2}{#3}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5177 \def#2##1 ##2 {\def#4{##1}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5178 \defxbodycommon \activeparens \spacesplit{#3{##2}}}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5179 \begingroup\obeylines\activeparens
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5180 \spacesplit{#3{#5}}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5181 }
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5182
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5183 % These parsing functions are similar to the preceding ones
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5184 % except that they do not make parens into active characters.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5185 % These are used for "variables" since they have no arguments.
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5186 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5187 \def\defvarparsebody #1#2#3{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5188 \parsebodycommon{#1}{#2}{#3}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5189 \def#2{\defxbodycommon \spacesplit#3}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5190 \catcode\equalChar=\active
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5191 \begingroup\obeylines
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5192 \spacesplit#3%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5193 }
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5194
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5195 % @defopvar.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5196 \def\defopvarparsebody #1#2#3#4#5 {%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5197 \parsebodycommon{#1}{#2}{#3}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5198 \def#2##1 ##2 {\def#4{##1}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5199 \defxbodycommon \spacesplit{#3{##2}}}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5200 \begingroup\obeylines
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5201 \spacesplit{#3{#5}}%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5202 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5203
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5204 \def\defvrparsebody#1#2#3#4 {%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5205 \parsebodycommon{#1}{#2}{#3}%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5206 \def#2##1 {\defxbodycommon \spacesplit{#3{##1}}}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5207 \begingroup\obeylines
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5208 \spacesplit{#3{#4}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5209 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5210
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5211 % This loses on `@deftp {Data Type} {struct termios}' -- it thinks the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5212 % type is just `struct', because we lose the braces in `{struct
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5213 % termios}' when \spacesplit reads its undelimited argument. Sigh.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5214 % \let\deftpparsebody=\defvrparsebody
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5215 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5216 % So, to get around this, we put \empty in with the type name. That
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5217 % way, TeX won't find exactly `{...}' as an undelimited argument, and
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5218 % won't strip off the braces.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5219 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5220 \def\deftpparsebody #1#2#3#4 {%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5221 \parsebodycommon{#1}{#2}{#3}%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5222 \def#2##1 {\defxbodycommon \spacesplit{#3{##1}}}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5223 \begingroup\obeylines
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5224 \spacesplit{\parsetpheaderline{#3{#4}}}\empty
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5225 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5226
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5227 % Fine, but then we have to eventually remove the \empty *and* the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5228 % braces (if any). That's what this does.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5229 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5230 \def\removeemptybraces\empty#1\relax{#1}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5231
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5232 % After \spacesplit has done its work, this is called -- #1 is the final
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5233 % thing to call, #2 the type name (which starts with \empty), and #3
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5234 % (which might be empty) the arguments.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5235 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5236 \def\parsetpheaderline#1#2#3{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5237 #1{\removeemptybraces#2\relax}{#3}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5238 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5239
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5240 % Split up #2 (the rest of the input line) at the first space token.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5241 % call #1 with two arguments:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5242 % the first is all of #2 before the space token,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5243 % the second is all of #2 after that space token.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5244 % If #2 contains no space token, all of it is passed as the first arg
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5245 % and the second is passed as empty.
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5246 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5247 {\obeylines %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5248 \gdef\spacesplit#1#2^^M{\endgroup\spacesplitx{#1}#2 \relax\spacesplitx}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5249 \long\gdef\spacesplitx#1#2 #3#4\spacesplitx{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5250 \ifx\relax #3%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5251 #1{#2}{}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5252 \else %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5253 #1{#2}{#3#4}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5254 \fi}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5255 }
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5256
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5257 % Define @defun.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5258
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5259 % This is called to end the arguments processing for all the @def... commands.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5260 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5261 \def\defargscommonending{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5262 \interlinepenalty = 10000
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5263 \advance\rightskip by 0pt plus 1fil
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5264 \endgraf
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5265 \nobreak\vskip -\parskip
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5266 \penalty 10002 % signal to \parsebodycommon.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5267 }
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5268
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5269 % This expands the args and terminates the paragraph they comprise.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5270 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5271 \def\defunargs#1{\functionparens \sl
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5272 % Expand, preventing hyphenation at `-' chars.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5273 % Note that groups don't affect changes in \hyphenchar.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5274 % Set the font temporarily and use \font in case \setfont made \tensl a macro.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5275 {\tensl\hyphenchar\font=0}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5276 #1%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5277 {\tensl\hyphenchar\font=45}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5278 \ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5279 \defargscommonending
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5280 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5281
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5282 \def\deftypefunargs #1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5283 % Expand, preventing hyphenation at `-' chars.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5284 % Note that groups don't affect changes in \hyphenchar.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5285 % Use \boldbraxnoamp, not \functionparens, so that & is not special.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5286 \boldbraxnoamp
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5287 \tclose{#1}% avoid \code because of side effects on active chars
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5288 \defargscommonending
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5289 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5290
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5291 % Do complete processing of one @defun or @defunx line already parsed.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5292
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5293 % @deffn Command forward-char nchars
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5294
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5295 \def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5296
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5297 \def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5298 \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5299 \catcode\equalChar=\other % Turn off change made in \defparsebody
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5300 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5301
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5302 % @defun == @deffn Function
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5303
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5304 \def\defun{\defparsebody\Edefun\defunx\defunheader}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5305
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5306 \def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5307 \begingroup\defname {#1}{\putwordDeffunc}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5308 \defunargs {#2}\endgroup %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5309 \catcode\equalChar=\other % Turn off change made in \defparsebody
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5310 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5311
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5312 % @deftypefun int foobar (int @var{foo}, float @var{bar})
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5313
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5314 \def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5315
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5316 % #1 is the data type. #2 is the name and args.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5317 \def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5318 % #1 is the data type, #2 the name, #3 the args.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5319 \def\deftypefunheaderx #1#2 #3\relax{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5320 \doind {fn}{\code{#2}}% Make entry in function index
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
5321 \begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypefun}%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5322 \deftypefunargs {#3}\endgroup %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5323 \catcode\equalChar=\other % Turn off change made in \defparsebody
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5324 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5325
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5326 % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5327
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5328 \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5329
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
5330 % \defheaderxcond#1\relax$.$
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5331 % puts #1 in @code, followed by a space, but does nothing if #1 is null.
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
5332 \def\defheaderxcond#1#2$.${\ifx#1\relax\else\code{#1#2} \fi}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5333
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5334 % #1 is the classification. #2 is the data type. #3 is the name and args.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5335 \def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5336 % #1 is the classification, #2 the data type, #3 the name, #4 the args.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5337 \def\deftypefnheaderx #1#2#3 #4\relax{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5338 \doind {fn}{\code{#3}}% Make entry in function index
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5339 \begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5340 \normalparens % notably, turn off `&' magic, which prevents
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5341 % at least some C++ text from working
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
5342 \defname {\defheaderxcond#2\relax$.$#3}{#1}%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5343 \deftypefunargs {#4}\endgroup %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5344 \catcode\equalChar=\other % Turn off change made in \defparsebody
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5345 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5346
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5347 % @defmac == @deffn Macro
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5348
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5349 \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5350
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5351 \def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5352 \begingroup\defname {#1}{\putwordDefmac}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5353 \defunargs {#2}\endgroup %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5354 \catcode\equalChar=\other % Turn off change made in \defparsebody
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5355 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5356
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5357 % @defspec == @deffn Special Form
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5358
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5359 \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5360
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5361 \def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5362 \begingroup\defname {#1}{\putwordDefspec}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5363 \defunargs {#2}\endgroup %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5364 \catcode\equalChar=\other % Turn off change made in \defparsebody
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5365 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5366
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5367 % @defop CATEGORY CLASS OPERATION ARG...
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5368 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5369 \def\defop #1 {\def\defoptype{#1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5370 \defopparsebody\Edefop\defopx\defopheader\defoptype}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5371 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5372 \def\defopheader#1#2#3{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5373 \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% function index entry
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5374 \begingroup
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5375 \defname{#2}{\defoptype\ \putwordon\ #1}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5376 \defunargs{#3}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5377 \endgroup
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5378 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5379
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5380 % @deftypeop CATEGORY CLASS TYPE OPERATION ARG...
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5381 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5382 \def\deftypeop #1 {\def\deftypeopcategory{#1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5383 \deftypeopparsebody\Edeftypeop\deftypeopx\deftypeopheader
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5384 \deftypeopcategory}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5385 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5386 % #1 is the class name, #2 the data type, #3 the operation name, #4 the args.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5387 \def\deftypeopheader#1#2#3#4{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5388 \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5389 \begingroup
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
5390 \defname{\defheaderxcond#2\relax$.$#3}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5391 {\deftypeopcategory\ \putwordon\ \code{#1}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5392 \deftypefunargs{#4}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5393 \endgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5394 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5395
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5396 % @deftypemethod CLASS TYPE METHOD ARG...
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5397 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5398 \def\deftypemethod{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5399 \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5400 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5401 % #1 is the class name, #2 the data type, #3 the method name, #4 the args.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5402 \def\deftypemethodheader#1#2#3#4{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5403 \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5404 \begingroup
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
5405 \defname{\defheaderxcond#2\relax$.$#3}{\putwordMethodon\ \code{#1}}%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5406 \deftypefunargs{#4}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5407 \endgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5408 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5409
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5410 % @deftypeivar CLASS TYPE VARNAME
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5411 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5412 \def\deftypeivar{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5413 \deftypemethparsebody\Edeftypeivar\deftypeivarx\deftypeivarheader}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5414 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5415 % #1 is the class name, #2 the data type, #3 the variable name.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5416 \def\deftypeivarheader#1#2#3{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5417 \dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5418 \begingroup
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
5419 \defname{\defheaderxcond#2\relax$.$#3}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5420 {\putwordInstanceVariableof\ \code{#1}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5421 \defvarargs{#3}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5422 \endgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5423 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5424
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5425 % @defmethod == @defop Method
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5426 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5427 \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5428 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5429 % #1 is the class name, #2 the method name, #3 the args.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5430 \def\defmethodheader#1#2#3{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5431 \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5432 \begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5433 \defname{#2}{\putwordMethodon\ \code{#1}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5434 \defunargs{#3}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5435 \endgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5436 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5437
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5438 % @defcv {Class Option} foo-class foo-flag
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5439
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5440 \def\defcv #1 {\def\defcvtype{#1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5441 \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5442
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5443 \def\defcvarheader #1#2#3{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5444 \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% variable index entry
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5445 \begingroup
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5446 \defname{#2}{\defcvtype\ \putwordof\ #1}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5447 \defvarargs{#3}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5448 \endgroup
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5449 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5450
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5451 % @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5452 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5453 \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5454 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5455 \def\defivarheader#1#2#3{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5456 \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% entry in var index
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5457 \begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5458 \defname{#2}{\putwordInstanceVariableof\ #1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5459 \defvarargs{#3}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5460 \endgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5461 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5462
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5463 % @defvar
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5464 % First, define the processing that is wanted for arguments of @defvar.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5465 % This is actually simple: just print them in roman.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5466 % This must expand the args and terminate the paragraph they make up
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5467 \def\defvarargs #1{\normalparens #1%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5468 \defargscommonending
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5469 }
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5470
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5471 % @defvr Counter foo-count
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5472
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5473 \def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5474
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5475 \def\defvrheader #1#2#3{\doind {vr}{\code{#2}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5476 \begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5477
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5478 % @defvar == @defvr Variable
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5479
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5480 \def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5481
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5482 \def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5483 \begingroup\defname {#1}{\putwordDefvar}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5484 \defvarargs {#2}\endgroup %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5485 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5486
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5487 % @defopt == @defvr {User Option}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5488
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5489 \def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5490
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5491 \def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5492 \begingroup\defname {#1}{\putwordDefopt}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5493 \defvarargs {#2}\endgroup %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5494 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5495
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5496 % @deftypevar int foobar
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5497
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5498 \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5499
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5500 % #1 is the data type. #2 is the name, perhaps followed by text that
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5501 % is actually part of the data type, which should not be put into the index.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5502 \def\deftypevarheader #1#2{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5503 \dovarind#2 \relax% Make entry in variables index
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
5504 \begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5505 \defargscommonending
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5506 \endgroup}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5507 \def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5508
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5509 % @deftypevr {Global Flag} int enable
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5510
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5511 \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5512
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5513 \def\deftypevrheader #1#2#3{\dovarind#3 \relax%
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
5514 \begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1}
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5515 \defargscommonending
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5516 \endgroup}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5517
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5518 % Now define @deftp
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5519 % Args are printed in bold, a slight difference from @defvar.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5520
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5521 \def\deftpargs #1{\bf \defvarargs{#1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5522
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5523 % @deftp Class window height width ...
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5524
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5525 \def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5526
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5527 \def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5528 \begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5529
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5530 % These definitions are used if you use @defunx (etc.)
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5531 % anywhere other than immediately after a @defun or @defunx.
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
5532 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5533 \def\defcvx#1 {\errmessage{@defcvx in invalid context}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5534 \def\deffnx#1 {\errmessage{@deffnx in invalid context}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5535 \def\defivarx#1 {\errmessage{@defivarx in invalid context}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5536 \def\defmacx#1 {\errmessage{@defmacx in invalid context}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5537 \def\defmethodx#1 {\errmessage{@defmethodx in invalid context}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5538 \def\defoptx #1 {\errmessage{@defoptx in invalid context}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5539 \def\defopx#1 {\errmessage{@defopx in invalid context}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5540 \def\defspecx#1 {\errmessage{@defspecx in invalid context}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5541 \def\deftpx#1 {\errmessage{@deftpx in invalid context}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5542 \def\deftypefnx#1 {\errmessage{@deftypefnx in invalid context}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5543 \def\deftypefunx#1 {\errmessage{@deftypefunx in invalid context}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5544 \def\deftypeivarx#1 {\errmessage{@deftypeivarx in invalid context}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5545 \def\deftypemethodx#1 {\errmessage{@deftypemethodx in invalid context}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5546 \def\deftypeopx#1 {\errmessage{@deftypeopx in invalid context}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5547 \def\deftypevarx#1 {\errmessage{@deftypevarx in invalid context}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5548 \def\deftypevrx#1 {\errmessage{@deftypevrx in invalid context}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5549 \def\defunx#1 {\errmessage{@defunx in invalid context}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5550 \def\defvarx#1 {\errmessage{@defvarx in invalid context}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5551 \def\defvrx#1 {\errmessage{@defvrx in invalid context}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5552
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5553
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5554 \message{macros,}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5555 % @macro.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5556
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5557 % To do this right we need a feature of e-TeX, \scantokens,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5558 % which we arrange to emulate with a temporary file in ordinary TeX.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5559 \ifx\eTeXversion\undefined
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5560 \newwrite\macscribble
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5561 \def\scanmacro#1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5562 \begingroup \newlinechar`\^^M
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5563 % Undo catcode changes of \startcontents and \doprintindex
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5564 \catcode`\@=0 \catcode`\\=\other \escapechar=`\@
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5565 % Append \endinput to make sure that TeX does not see the ending newline.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5566 \toks0={#1\endinput}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5567 \immediate\openout\macscribble=\jobname.tmp
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5568 \immediate\write\macscribble{\the\toks0}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5569 \immediate\closeout\macscribble
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5570 \let\xeatspaces\eatspaces
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5571 \input \jobname.tmp
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5572 \endgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5573 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5574 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5575 \def\scanmacro#1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5576 \begingroup \newlinechar`\^^M
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5577 % Undo catcode changes of \startcontents and \doprintindex
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5578 \catcode`\@=0 \catcode`\\=\other \escapechar=`\@
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5579 \let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5580 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5581
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5582 \newcount\paramno % Count of parameters
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5583 \newtoks\macname % Macro name
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5584 \newif\ifrecursive % Is it recursive?
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5585 \def\macrolist{} % List of all defined macros in the form
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5586 % \do\macro1\do\macro2...
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5587
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5588 % Utility routines.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5589 % Thisdoes \let #1 = #2, except with \csnames.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5590 \def\cslet#1#2{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5591 \expandafter\expandafter
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5592 \expandafter\let
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5593 \expandafter\expandafter
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5594 \csname#1\endcsname
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5595 \csname#2\endcsname}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5596
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5597 % Trim leading and trailing spaces off a string.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5598 % Concepts from aro-bend problem 15 (see CTAN).
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5599 {\catcode`\@=11
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5600 \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5601 \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5602 \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5603 \def\unbrace#1{#1}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5604 \unbrace{\gdef\trim@@@ #1 } #2@{#1}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5605 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5606
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5607 % Trim a single trailing ^^M off a string.
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5608 {\catcode`\^^M=\other \catcode`\Q=3%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5609 \gdef\eatcr #1{\eatcra #1Q^^MQ}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5610 \gdef\eatcra#1^^MQ{\eatcrb#1Q}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5611 \gdef\eatcrb#1Q#2Q{#1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5612 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5613
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5614 % Macro bodies are absorbed as an argument in a context where
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5615 % all characters are catcode 10, 11 or 12, except \ which is active
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5616 % (as in normal texinfo). It is necessary to change the definition of \.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5617
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5618 % It's necessary to have hard CRs when the macro is executed. This is
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5619 % done by making ^^M (\endlinechar) catcode 12 when reading the macro
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5620 % body, and then making it the \newlinechar in \scanmacro.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5621
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5622 \def\macrobodyctxt{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5623 \catcode`\~=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5624 \catcode`\^=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5625 \catcode`\_=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5626 \catcode`\|=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5627 \catcode`\<=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5628 \catcode`\>=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5629 \catcode`\+=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5630 \catcode`\{=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5631 \catcode`\}=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5632 \catcode`\@=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5633 \catcode`\^^M=\other
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5634 \usembodybackslash}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5635
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5636 \def\macroargctxt{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5637 \catcode`\~=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5638 \catcode`\^=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5639 \catcode`\_=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5640 \catcode`\|=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5641 \catcode`\<=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5642 \catcode`\>=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5643 \catcode`\+=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5644 \catcode`\@=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5645 \catcode`\\=\other}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5646
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5647 % \mbodybackslash is the definition of \ in @macro bodies.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5648 % It maps \foo\ => \csname macarg.foo\endcsname => #N
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5649 % where N is the macro parameter number.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5650 % We define \csname macarg.\endcsname to be \realbackslash, so
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5651 % \\ in macro replacement text gets you a backslash.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5652
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5653 {\catcode`@=0 @catcode`@\=@active
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5654 @gdef@usembodybackslash{@let\=@mbodybackslash}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5655 @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5656 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5657 \expandafter\def\csname macarg.\endcsname{\realbackslash}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5658
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5659 \def\macro{\recursivefalse\parsearg\macroxxx}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5660 \def\rmacro{\recursivetrue\parsearg\macroxxx}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5661
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5662 \def\macroxxx#1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5663 \getargs{#1}% now \macname is the macname and \argl the arglist
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5664 \ifx\argl\empty % no arguments
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5665 \paramno=0%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5666 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5667 \expandafter\parsemargdef \argl;%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5668 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5669 \if1\csname ismacro.\the\macname\endcsname
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5670 \message{Warning: redefining \the\macname}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5671 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5672 \expandafter\ifx\csname \the\macname\endcsname \relax
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
5673 \else \errmessage{Macro name \the\macname\space already defined}\fi
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5674 \global\cslet{macsave.\the\macname}{\the\macname}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5675 \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5676 % Add the macroname to \macrolist
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5677 \toks0 = \expandafter{\macrolist\do}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5678 \xdef\macrolist{\the\toks0
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5679 \expandafter\noexpand\csname\the\macname\endcsname}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5680 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5681 \begingroup \macrobodyctxt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5682 \ifrecursive \expandafter\parsermacbody
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5683 \else \expandafter\parsemacbody
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5684 \fi}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5685
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5686 \def\unmacro{\parsearg\dounmacro}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5687 \def\dounmacro#1{%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5688 \if1\csname ismacro.#1\endcsname
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5689 \global\cslet{#1}{macsave.#1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5690 \global\expandafter\let \csname ismacro.#1\endcsname=0%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5691 % Remove the macro name from \macrolist:
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5692 \begingroup
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5693 \expandafter\let\csname#1\endcsname \relax
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5694 \let\do\unmacrodo
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5695 \xdef\macrolist{\macrolist}%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5696 \endgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5697 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5698 \errmessage{Macro #1 not defined}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5699 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5700 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5701
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5702 % Called by \do from \dounmacro on each macro. The idea is to omit any
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5703 % macro definitions that have been changed to \relax.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5704 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5705 \def\unmacrodo#1{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5706 \ifx#1\relax
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5707 % remove this
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5708 \else
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5709 \noexpand\do \noexpand #1%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5710 \fi
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5711 }
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5712
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5713 % This makes use of the obscure feature that if the last token of a
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5714 % <parameter list> is #, then the preceding argument is delimited by
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5715 % an opening brace, and that opening brace is not consumed.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5716 \def\getargs#1{\getargsxxx#1{}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5717 \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5718 \def\getmacname #1 #2\relax{\macname={#1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5719 \def\getmacargs#1{\def\argl{#1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5720
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5721 % Parse the optional {params} list. Set up \paramno and \paramlist
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5722 % so \defmacro knows what to do. Define \macarg.blah for each blah
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5723 % in the params list, to be ##N where N is the position in that list.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5724 % That gets used by \mbodybackslash (above).
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5725
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5726 % We need to get `macro parameter char #' into several definitions.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5727 % The technique used is stolen from LaTeX: let \hash be something
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5728 % unexpandable, insert that wherever you need a #, and then redefine
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5729 % it to # just before using the token list produced.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5730 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5731 % The same technique is used to protect \eatspaces till just before
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5732 % the macro is used.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5733
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5734 \def\parsemargdef#1;{\paramno=0\def\paramlist{}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5735 \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5736 \def\parsemargdefxxx#1,{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5737 \if#1;\let\next=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5738 \else \let\next=\parsemargdefxxx
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5739 \advance\paramno by 1%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5740 \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5741 {\xeatspaces{\hash\the\paramno}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5742 \edef\paramlist{\paramlist\hash\the\paramno,}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5743 \fi\next}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5744
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5745 % These two commands read recursive and nonrecursive macro bodies.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5746 % (They're different since rec and nonrec macros end differently.)
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5747
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5748 \long\def\parsemacbody#1@end macro%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5749 {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5750 \long\def\parsermacbody#1@end rmacro%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5751 {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5752
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5753 % This defines the macro itself. There are six cases: recursive and
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5754 % nonrecursive macros of zero, one, and many arguments.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5755 % Much magic with \expandafter here.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5756 % \xdef is used so that macro definitions will survive the file
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5757 % they're defined in; @include reads the file inside a group.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5758 \def\defmacro{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5759 \let\hash=##% convert placeholders to macro parameter chars
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5760 \ifrecursive
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5761 \ifcase\paramno
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5762 % 0
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5763 \expandafter\xdef\csname\the\macname\endcsname{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5764 \noexpand\scanmacro{\temp}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5765 \or % 1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5766 \expandafter\xdef\csname\the\macname\endcsname{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5767 \bgroup\noexpand\macroargctxt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5768 \noexpand\braceorline
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5769 \expandafter\noexpand\csname\the\macname xxx\endcsname}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5770 \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5771 \egroup\noexpand\scanmacro{\temp}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5772 \else % many
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5773 \expandafter\xdef\csname\the\macname\endcsname{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5774 \bgroup\noexpand\macroargctxt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5775 \noexpand\csname\the\macname xx\endcsname}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5776 \expandafter\xdef\csname\the\macname xx\endcsname##1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5777 \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5778 \expandafter\expandafter
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5779 \expandafter\xdef
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5780 \expandafter\expandafter
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5781 \csname\the\macname xxx\endcsname
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5782 \paramlist{\egroup\noexpand\scanmacro{\temp}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5783 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5784 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5785 \ifcase\paramno
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5786 % 0
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5787 \expandafter\xdef\csname\the\macname\endcsname{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5788 \noexpand\norecurse{\the\macname}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5789 \noexpand\scanmacro{\temp}\egroup}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5790 \or % 1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5791 \expandafter\xdef\csname\the\macname\endcsname{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5792 \bgroup\noexpand\macroargctxt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5793 \noexpand\braceorline
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5794 \expandafter\noexpand\csname\the\macname xxx\endcsname}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5795 \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5796 \egroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5797 \noexpand\norecurse{\the\macname}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5798 \noexpand\scanmacro{\temp}\egroup}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5799 \else % many
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5800 \expandafter\xdef\csname\the\macname\endcsname{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5801 \bgroup\noexpand\macroargctxt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5802 \expandafter\noexpand\csname\the\macname xx\endcsname}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5803 \expandafter\xdef\csname\the\macname xx\endcsname##1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5804 \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5805 \expandafter\expandafter
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5806 \expandafter\xdef
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5807 \expandafter\expandafter
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5808 \csname\the\macname xxx\endcsname
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5809 \paramlist{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5810 \egroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5811 \noexpand\norecurse{\the\macname}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5812 \noexpand\scanmacro{\temp}\egroup}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5813 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5814 \fi}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5815
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5816 \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5817
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5818 % \braceorline decides whether the next nonwhitespace character is a
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5819 % {. If so it reads up to the closing }, if not, it reads the whole
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5820 % line. Whatever was read is then fed to the next control sequence
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5821 % as an argument (by \parsebrace or \parsearg)
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5822 \def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5823 \def\braceorlinexxx{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5824 \ifx\nchar\bgroup\else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5825 \expandafter\parsearg
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5826 \fi \next}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5827
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5828 % We mant to disable all macros during \shipout so that they are not
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5829 % expanded by \write.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5830 \def\turnoffmacros{\begingroup \def\do##1{\let\noexpand##1=\relax}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5831 \edef\next{\macrolist}\expandafter\endgroup\next}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5832
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5833
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5834 % @alias.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5835 % We need some trickery to remove the optional spaces around the equal
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5836 % sign. Just make them active and then expand them all to nothing.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5837 \def\alias{\begingroup\obeyspaces\parsearg\aliasxxx}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5838 \def\aliasxxx #1{\aliasyyy#1\relax}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5839 \def\aliasyyy #1=#2\relax{\ignoreactivespaces
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5840 \edef\next{\global\let\expandafter\noexpand\csname#1\endcsname=%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5841 \expandafter\noexpand\csname#2\endcsname}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5842 \expandafter\endgroup\next}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5843
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5844
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5845 \message{cross references,}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5846 % @xref etc.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5847
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5848 \newwrite\auxfile
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5849
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5850 \newif\ifhavexrefs % True if xref values are known.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5851 \newif\ifwarnedxrefs % True if we warned once that they aren't known.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5852
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5853 % @inforef is relatively simple.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5854 \def\inforef #1{\inforefzzz #1,,,,**}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5855 \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5856 node \samp{\ignorespaces#1{}}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5857
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5858 % @node's job is to define \lastnode.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5859 \def\node{\ENVcheck\parsearg\nodezzz}
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5860 \def\nodezzz#1{\nodexxx #1,\finishnodeparse}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5861 \def\nodexxx#1,#2\finishnodeparse{\gdef\lastnode{#1}}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5862 \let\nwnode=\node
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5863 \let\lastnode=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5864
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5865 % The sectioning commands (@chapter, etc.) call these.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5866 \def\donoderef{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5867 \ifx\lastnode\relax\else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5868 \expandafter\expandafter\expandafter\setref{\lastnode}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5869 {Ysectionnumberandtype}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5870 \global\let\lastnode=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5871 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5872 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5873 \def\unnumbnoderef{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5874 \ifx\lastnode\relax\else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5875 \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5876 \global\let\lastnode=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5877 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5878 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5879 \def\appendixnoderef{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5880 \ifx\lastnode\relax\else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5881 \expandafter\expandafter\expandafter\setref{\lastnode}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5882 {Yappendixletterandtype}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5883 \global\let\lastnode=\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5884 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5885 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5886
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5887
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5888 % @anchor{NAME} -- define xref target at arbitrary point.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5889 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5890 \newcount\savesfregister
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5891 \gdef\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5892 \gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5893 \gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5894
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5895 % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5896 % anchor), namely NAME-title (the corresponding @chapter/etc. name),
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5897 % NAME-pg (the page number), and NAME-snt (section number and type).
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5898 % Called from \foonoderef.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5899 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5900 % We have to set \indexdummies so commands such as @code in a section
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5901 % title aren't expanded. It would be nicer not to expand the titles in
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5902 % the first place, but there's so many layers that that is hard to do.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5903 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5904 % Likewise, use \turnoffactive so that punctuation chars such as underscore
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5905 % and backslash work in node names.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5906 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5907 \def\setref#1#2{{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5908 \atdummies
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5909 \pdfmkdest{#1}%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5910 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5911 \turnoffactive
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5912 \dosetq{#1-title}{Ytitle}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5913 \dosetq{#1-pg}{Ypagenumber}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5914 \dosetq{#1-snt}{#2}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5915 }}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5916
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5917 % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5918 % the node name, #2 the name of the Info cross-reference, #3 the printed
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5919 % node name, #4 the name of the Info file, #5 the name of the printed
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5920 % manual. All but the node name can be omitted.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5921 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5922 \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5923 \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5924 \def\ref#1{\xrefX[#1,,,,,,,]}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5925 \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5926 \unsepspaces
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5927 \def\printedmanual{\ignorespaces #5}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5928 \def\printednodename{\ignorespaces #3}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5929 \setbox1=\hbox{\printedmanual}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5930 \setbox0=\hbox{\printednodename}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5931 \ifdim \wd0 = 0pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5932 % No printed node name was explicitly given.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5933 \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5934 % Use the node name inside the square brackets.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5935 \def\printednodename{\ignorespaces #1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5936 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5937 % Use the actual chapter/section title appear inside
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5938 % the square brackets. Use the real section title if we have it.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5939 \ifdim \wd1 > 0pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5940 % It is in another manual, so we don't have it.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5941 \def\printednodename{\ignorespaces #1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5942 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5943 \ifhavexrefs
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5944 % We know the real title if we have the xref values.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5945 \def\printednodename{\refx{#1-title}{}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5946 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5947 % Otherwise just copy the Info node name.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5948 \def\printednodename{\ignorespaces #1}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5949 \fi%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5950 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5951 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5952 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5953 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5954 % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5955 % insert empty discretionaries after hyphens, which means that it will
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5956 % not find a line break at a hyphen in a node names. Since some manuals
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5957 % are best written with fairly long node names, containing hyphens, this
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5958 % is a loss. Therefore, we give the text of the node name again, so it
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5959 % is as if TeX is seeing it for the first time.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5960 \ifpdf
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5961 \leavevmode
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5962 \getfilename{#4}%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5963 {\turnoffactive \otherbackslash
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
5964 \ifnum\filenamelength>0
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
5965 \startlink attr{/Border [0 0 0]}%
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
5966 goto file{\the\filename.pdf} name{#1}%
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
5967 \else
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
5968 \startlink attr{/Border [0 0 0]}%
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
5969 goto name{#1}%
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
5970 \fi
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
5971 }%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5972 \linkcolor
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5973 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5974 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5975 \ifdim \wd1 > 0pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5976 \putwordsection{} ``\printednodename'' \putwordin{} \cite{\printedmanual}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5977 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5978 % _ (for example) has to be the character _ for the purposes of the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5979 % control sequence corresponding to the node, but it has to expand
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5980 % into the usual \leavevmode...\vrule stuff for purposes of
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5981 % printing. So we \turnoffactive for the \refx-snt, back on for the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5982 % printing, back off for the \refx-pg.
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5983 {\turnoffactive \otherbackslash
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5984 % Only output a following space if the -snt ref is nonempty; for
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5985 % @unnumbered and @anchor, it won't be.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5986 \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5987 \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5988 }%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5989 % output the `[mynode]' via a macro.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5990 \xrefprintnodename\printednodename
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5991 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5992 % But we always want a comma and a space:
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5993 ,\space
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5994 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5995 % output the `page 3'.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
5996 \turnoffactive \otherbackslash \putwordpage\tie\refx{#1-pg}{}%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5997 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5998 \endlink
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5999 \endgroup}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6000
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6001 % This macro is called from \xrefX for the `[nodename]' part of xref
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6002 % output. It's a separate macro only so it can be changed more easily,
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6003 % since not square brackets don't work in some documents. Particularly
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6004 % one that Bob is working on :).
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6005 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6006 \def\xrefprintnodename#1{[#1]}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6007
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6008 % \dosetq is called from \setref to do the actual \write (\iflinks).
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6009 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6010 \def\dosetq#1#2{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6011 {\let\folio=0%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6012 \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6013 \iflinks \next \fi
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6014 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6015 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6016
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6017 % \internalsetq{foo}{page} expands into
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6018 % CHARACTERS @xrdef{foo}{...expansion of \page...}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6019 \def\internalsetq#1#2{@xrdef{#1}{\csname #2\endcsname}}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6020
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6021 % Things to be expanded by \internalsetq.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6022 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6023 \def\Ypagenumber{\folio}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6024 \def\Ytitle{\thissection}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6025 \def\Ynothing{}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6026 \def\Ysectionnumberandtype{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6027 \ifnum\secno=0
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6028 \putwordChapter@tie \the\chapno
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6029 \else \ifnum\subsecno=0
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6030 \putwordSection@tie \the\chapno.\the\secno
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6031 \else \ifnum\subsubsecno=0
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6032 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6033 \else
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6034 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6035 \fi\fi\fi
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6036 }
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6037
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6038 \def\Yappendixletterandtype{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6039 \ifnum\secno=0
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6040 \putwordAppendix@tie @char\the\appendixno{}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6041 \else \ifnum\subsecno=0
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6042 \putwordSection@tie @char\the\appendixno.\the\secno
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6043 \else \ifnum\subsubsecno=0
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6044 \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6045 \else
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6046 \putwordSection@tie
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6047 @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6048 \fi\fi\fi
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6049 }
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6050
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6051 % Use TeX 3.0's \inputlineno to get the line number, for better error
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6052 % messages, but if we're using an old version of TeX, don't do anything.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6053 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6054 \ifx\inputlineno\thisisundefined
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6055 \let\linenumber = \empty % Pre-3.0.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6056 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6057 \def\linenumber{\the\inputlineno:\space}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6058 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6059
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6060 % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6061 % If its value is nonempty, SUFFIX is output afterward.
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6062 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6063 \def\refx#1#2{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6064 {%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6065 \indexnofonts
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6066 \otherbackslash
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6067 \expandafter\global\expandafter\let\expandafter\thisrefX
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6068 \csname X#1\endcsname
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6069 }%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6070 \ifx\thisrefX\relax
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6071 % If not defined, say something at least.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6072 \angleleft un\-de\-fined\angleright
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6073 \iflinks
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6074 \ifhavexrefs
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6075 \message{\linenumber Undefined cross reference `#1'.}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6076 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6077 \ifwarnedxrefs\else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6078 \global\warnedxrefstrue
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6079 \message{Cross reference values unknown; you must run TeX again.}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6080 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6081 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6082 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6083 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6084 % It's defined, so just use it.
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6085 \thisrefX
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6086 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6087 #2% Output the suffix in any case.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6088 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6089
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6090 % This is the macro invoked by entries in the aux file.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6091 %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6092 \def\xrdef#1{\expandafter\gdef\csname X#1\endcsname}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6093
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6094 % Read the last existing aux file, if any. No error if none exists.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6095 \def\readauxfile{\begingroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6096 \catcode`\^^@=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6097 \catcode`\^^A=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6098 \catcode`\^^B=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6099 \catcode`\^^C=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6100 \catcode`\^^D=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6101 \catcode`\^^E=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6102 \catcode`\^^F=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6103 \catcode`\^^G=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6104 \catcode`\^^H=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6105 \catcode`\^^K=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6106 \catcode`\^^L=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6107 \catcode`\^^N=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6108 \catcode`\^^P=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6109 \catcode`\^^Q=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6110 \catcode`\^^R=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6111 \catcode`\^^S=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6112 \catcode`\^^T=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6113 \catcode`\^^U=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6114 \catcode`\^^V=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6115 \catcode`\^^W=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6116 \catcode`\^^X=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6117 \catcode`\^^Z=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6118 \catcode`\^^[=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6119 \catcode`\^^\=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6120 \catcode`\^^]=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6121 \catcode`\^^^=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6122 \catcode`\^^_=\other
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6123 % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6124 % in xref tags, i.e., node names. But since ^^e4 notation isn't
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6125 % supported in the main text, it doesn't seem desirable. Furthermore,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6126 % that is not enough: for node names that actually contain a ^
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6127 % character, we would end up writing a line like this: 'xrdef {'hat
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6128 % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6129 % argument, and \hat is not an expandable control sequence. It could
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6130 % all be worked out, but why? Either we support ^^ or we don't.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6131 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6132 % The other change necessary for this was to define \auxhat:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6133 % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6134 % and then to call \auxhat in \setq.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6135 %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6136 \catcode`\^=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6137 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6138 % Special characters. Should be turned off anyway, but...
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6139 \catcode`\~=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6140 \catcode`\[=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6141 \catcode`\]=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6142 \catcode`\"=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6143 \catcode`\_=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6144 \catcode`\|=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6145 \catcode`\<=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6146 \catcode`\>=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6147 \catcode`\$=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6148 \catcode`\#=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6149 \catcode`\&=\other
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6150 \catcode`\%=\other
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6151 \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6152 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6153 % Make the characters 128-255 be printing characters
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6154 {%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6155 \count 1=128
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6156 \def\loop{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6157 \catcode\count 1=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6158 \advance\count 1 by 1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6159 \ifnum \count 1<256 \loop \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6160 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6161 }%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6162 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6163 % Turn off \ as an escape so we do not lose on
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6164 % entries which were dumped with control sequences in their names.
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6165 % For example, @xrdef{$\leq $-fun}{page ...} made by @defun ^^
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6166 % Reference to such entries still does not work the way one would wish,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6167 % but at least they do not bomb out when the aux file is read in.
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6168 \catcode`\\=\other
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6169 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6170 % @ is our escape character in .aux files.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6171 \catcode`\{=1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6172 \catcode`\}=2
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6173 \catcode`\@=0
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6174 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6175 \openin 1 \jobname.aux
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6176 \ifeof 1 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6177 \closein 1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6178 \input \jobname.aux
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6179 \global\havexrefstrue
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6180 \global\warnedobstrue
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6181 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6182 % Open the new aux file. TeX will close it automatically at exit.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6183 \openout\auxfile=\jobname.aux
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6184 \endgroup}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6185
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6186
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6187 % Footnotes.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6188
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6189 \newcount \footnoteno
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6190
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6191 % The trailing space in the following definition for supereject is
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6192 % vital for proper filling; pages come out unaligned when you do a
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6193 % pagealignmacro call if that space before the closing brace is
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6194 % removed. (Generally, numeric constants should always be followed by a
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6195 % space to prevent strange expansion errors.)
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6196 \def\supereject{\par\penalty -20000\footnoteno =0 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6197
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6198 % @footnotestyle is meaningful for info output only.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6199 \let\footnotestyle=\comment
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6200
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6201 \let\ptexfootnote=\footnote
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6202
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6203 {\catcode `\@=11
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6204 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6205 % Auto-number footnotes. Otherwise like plain.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6206 \gdef\footnote{%
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6207 \let\indent=\ptexindent
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6208 \global\advance\footnoteno by \@ne
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6209 \edef\thisfootno{$^{\the\footnoteno}$}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6210 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6211 % In case the footnote comes at the end of a sentence, preserve the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6212 % extra spacing after we do the footnote number.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6213 \let\@sf\empty
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6214 \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6215 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6216 % Remove inadvertent blank space before typesetting the footnote number.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6217 \unskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6218 \thisfootno\@sf
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6219 \dofootnote
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6220 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6221
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6222 % Don't bother with the trickery in plain.tex to not require the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6223 % footnote text as a parameter. Our footnotes don't need to be so general.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6224 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6225 % Oh yes, they do; otherwise, @ifset and anything else that uses
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6226 % \parseargline fail inside footnotes because the tokens are fixed when
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6227 % the footnote is read. --karl, 16nov96.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6228 %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6229 % The start of the footnote looks usually like this:
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6230 \gdef\startfootins{\insert\footins\bgroup}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6231 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6232 % ... but this macro is redefined inside @multitable.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6233 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6234 \gdef\dofootnote{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6235 \startfootins
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6236 % We want to typeset this text as a normal paragraph, even if the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6237 % footnote reference occurs in (for example) a display environment.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6238 % So reset some parameters.
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6239 \hsize=\pagewidth
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6240 \interlinepenalty\interfootnotelinepenalty
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6241 \splittopskip\ht\strutbox % top baseline for broken footnotes
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6242 \splitmaxdepth\dp\strutbox
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6243 \floatingpenalty\@MM
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6244 \leftskip\z@skip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6245 \rightskip\z@skip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6246 \spaceskip\z@skip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6247 \xspaceskip\z@skip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6248 \parindent\defaultparindent
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6249 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6250 \smallfonts \rm
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6251 %
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6252 % Because we use hanging indentation in footnotes, a @noindent appears
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6253 % to exdent this text, so make it be a no-op. makeinfo does not use
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6254 % hanging indentation so @noindent can still be needed within footnote
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6255 % text after an @example or the like (not that this is good style).
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6256 \let\noindent = \relax
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6257 %
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6258 % Hang the footnote text off the number. Use \everypar in case the
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6259 % footnote extends for more than one paragraph.
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6260 \everypar = {\hang}%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6261 \textindent{\thisfootno}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6262 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6263 % Don't crash into the line above the footnote text. Since this
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6264 % expands into a box, it must come within the paragraph, lest it
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6265 % provide a place where TeX can split the footnote.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6266 \footstrut
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6267 \futurelet\next\fo@t
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6268 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6269 }%end \catcode `\@=11
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6270
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6271 % @| inserts a changebar to the left of the current line. It should
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6272 % surround any changed text. This approach does *not* work if the
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6273 % change spans more than two lines of output. To handle that, we would
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6274 % have adopt a much more difficult approach (putting marks into the main
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6275 % vertical list for the beginning and end of each change).
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6276 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6277 \def\|{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6278 % \vadjust can only be used in horizontal mode.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6279 \leavevmode
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6280 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6281 % Append this vertical mode material after the current line in the output.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6282 \vadjust{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6283 % We want to insert a rule with the height and depth of the current
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6284 % leading; that is exactly what \strutbox is supposed to record.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6285 \vskip-\baselineskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6286 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6287 % \vadjust-items are inserted at the left edge of the type. So
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6288 % the \llap here moves out into the left-hand margin.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6289 \llap{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6290 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6291 % For a thicker or thinner bar, change the `1pt'.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6292 \vrule height\baselineskip width1pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6293 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6294 % This is the space between the bar and the text.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6295 \hskip 12pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6296 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6297 }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6298 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6299
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6300 % For a final copy, take out the rectangles
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6301 % that mark overfull boxes (in case you have decided
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6302 % that the text looks ok even though it passes the margin).
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6303 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6304 \def\finalout{\overfullrule=0pt}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6305
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6306 % @image. We use the macros from epsf.tex to support this.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6307 % If epsf.tex is not installed and @image is used, we complain.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6308 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6309 % Check for and read epsf.tex up front. If we read it only at @image
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6310 % time, we might be inside a group, and then its definitions would get
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6311 % undone and the next image would fail.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6312 \openin 1 = epsf.tex
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6313 \ifeof 1 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6314 \closein 1
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6315 % Do not bother showing banner with epsf.tex v2.7k (available in
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6316 % doc/epsf.tex and on ctan).
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6317 \def\epsfannounce{\toks0 = }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6318 \input epsf.tex
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6319 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6320 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6321 % We will only complain once about lack of epsf.tex.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6322 \newif\ifwarnednoepsf
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6323 \newhelp\noepsfhelp{epsf.tex must be installed for images to
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6324 work. It is also included in the Texinfo distribution, or you can get
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6325 it from ftp://tug.org/tex/epsf.tex.}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6326 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6327 \def\image#1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6328 \ifx\epsfbox\undefined
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6329 \ifwarnednoepsf \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6330 \errhelp = \noepsfhelp
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6331 \errmessage{epsf.tex not found, images will be ignored}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6332 \global\warnednoepsftrue
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6333 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6334 \else
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6335 \imagexxx #1,,,,,\finish
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6336 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6337 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6338 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6339 % Arguments to @image:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6340 % #1 is (mandatory) image filename; we tack on .eps extension.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6341 % #2 is (optional) width, #3 is (optional) height.
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6342 % #4 is (ignored optional) html alt text.
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6343 % #5 is (ignored optional) extension.
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6344 % #6 is just the usual extra ignored arg for parsing this stuff.
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6345 \newif\ifimagevmode
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6346 \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6347 \catcode`\^^M = 5 % in case we're inside an example
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6348 \normalturnoffactive % allow _ et al. in names
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6349 % If the image is by itself, center it.
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6350 \ifvmode
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6351 \imagevmodetrue
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6352 \nobreak\bigskip
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6353 % Usually we'll have text after the image which will insert
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6354 % \parskip glue, so insert it here too to equalize the space
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
6355 % above and below.
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6356 \nobreak\vskip\parskip
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6357 \nobreak
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6358 \line\bgroup\hss
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6359 \fi
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6360 %
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6361 % Output the image.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6362 \ifpdf
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6363 \dopdfimage{#1}{#2}{#3}%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6364 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6365 % \epsfbox itself resets \epsf?size at each figure.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6366 \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6367 \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6368 \epsfbox{#1.eps}%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6369 \fi
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6370 %
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6371 \ifimagevmode \hss \egroup \bigbreak \fi % space after the image
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6372 \endgroup}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6373
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6374
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6375 \message{localization,}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6376 % and i18n.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6377
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6378 % @documentlanguage is usually given very early, just after
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6379 % @setfilename. If done too late, it may not override everything
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6380 % properly. Single argument is the language abbreviation.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6381 % It would be nice if we could set up a hyphenation file here.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6382 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6383 \def\documentlanguage{\parsearg\dodocumentlanguage}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6384 \def\dodocumentlanguage#1{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6385 \tex % read txi-??.tex file in plain TeX.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6386 % Read the file if it exists.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6387 \openin 1 txi-#1.tex
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6388 \ifeof1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6389 \errhelp = \nolanghelp
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6390 \errmessage{Cannot read language file txi-#1.tex}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6391 \let\temp = \relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6392 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6393 \def\temp{\input txi-#1.tex }%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6394 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6395 \temp
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6396 \endgroup
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6397 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6398 \newhelp\nolanghelp{The given language definition file cannot be found or
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6399 is empty. Maybe you need to install it? In the current directory
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6400 should work if nowhere else does.}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6401
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6402
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6403 % @documentencoding should change something in TeX eventually, most
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6404 % likely, but for now just recognize it.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6405 \let\documentencoding = \comment
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6406
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6407
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6408 % Page size parameters.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6409 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6410 \newdimen\defaultparindent \defaultparindent = 15pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6411
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6412 \chapheadingskip = 15pt plus 4pt minus 2pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6413 \secheadingskip = 12pt plus 3pt minus 2pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6414 \subsecheadingskip = 9pt plus 2pt minus 2pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6415
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6416 % Prevent underfull vbox error messages.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6417 \vbadness = 10000
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6419 % Don't be so finicky about underfull hboxes, either.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6420 \hbadness = 2000
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6421
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6422 % Following George Bush, just get rid of widows and orphans.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6423 \widowpenalty=10000
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6424 \clubpenalty=10000
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6425
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6426 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6427 % using an old version of TeX, don't do anything. We want the amount of
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6428 % stretch added to depend on the line length, hence the dependence on
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6429 % \hsize. We call this whenever the paper size is set.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6430 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6431 \def\setemergencystretch{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6432 \ifx\emergencystretch\thisisundefined
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6433 % Allow us to assign to \emergencystretch anyway.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6434 \def\emergencystretch{\dimen0}%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6435 \else
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6436 \emergencystretch = .15\hsize
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6437 \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6438 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6439
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6440 % Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6441 % 4) hoffset; 5) binding offset; 6) topskip; 7) physical page height; 8)
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6442 % physical page width.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6443 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6444 % We also call \setleading{\textleading}, so the caller should define
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6445 % \textleading. The caller should also set \parskip.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6446 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6447 \def\internalpagesizes#1#2#3#4#5#6#7#8{%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6448 \voffset = #3\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6449 \topskip = #6\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6450 \splittopskip = \topskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6451 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6452 \vsize = #1\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6453 \advance\vsize by \topskip
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6454 \outervsize = \vsize
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6455 \advance\outervsize by 2\topandbottommargin
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6456 \pageheight = \vsize
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6457 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6458 \hsize = #2\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6459 \outerhsize = \hsize
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6460 \advance\outerhsize by 0.5in
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6461 \pagewidth = \hsize
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6462 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6463 \normaloffset = #4\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6464 \bindingoffset = #5\relax
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6465 %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6466 \ifpdf
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6467 \pdfpageheight #7\relax
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6468 \pdfpagewidth #8\relax
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6469 \fi
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6470 %
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6471 \setleading{\textleading}
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6472 %
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6473 \parindent = \defaultparindent
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6474 \setemergencystretch
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6475 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6476
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6477 % @letterpaper (the default).
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6478 \def\letterpaper{{\globaldefs = 1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6479 \parskip = 3pt plus 2pt minus 1pt
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6480 \textleading = 13.2pt
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6481 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6482 % If page is nothing but text, make it come out even.
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6483 \internalpagesizes{46\baselineskip}{6in}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6484 {\voffset}{.25in}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6485 {\bindingoffset}{36pt}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6486 {11in}{8.5in}%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6487 }}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6488
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6489 % Use @smallbook to reset parameters for 7x9.5 (or so) format.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6490 \def\smallbook{{\globaldefs = 1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6491 \parskip = 2pt plus 1pt
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6492 \textleading = 12pt
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6493 %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6494 \internalpagesizes{7.5in}{5in}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6495 {\voffset}{.25in}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6496 {\bindingoffset}{16pt}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6497 {9.25in}{7in}%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6498 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6499 \lispnarrowing = 0.3in
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6500 \tolerance = 700
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6501 \hfuzz = 1pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6502 \contentsrightmargin = 0pt
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6503 \defbodyindent = .5cm
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6504 }}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6505
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6506 % Use @afourpaper to print on European A4 paper.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6507 \def\afourpaper{{\globaldefs = 1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6508 \parskip = 3pt plus 2pt minus 1pt
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6509 \textleading = 13.2pt
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6510 %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6511 % Double-side printing via postscript on Laserjet 4050
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6512 % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6513 % To change the settings for a different printer or situation, adjust
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6514 % \normaloffset until the front-side and back-side texts align. Then
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6515 % do the same for \bindingoffset. You can set these for testing in
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6516 % your texinfo source file like this:
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6517 % @tex
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6518 % \global\normaloffset = -6mm
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6519 % \global\bindingoffset = 10mm
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6520 % @end tex
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6521 \internalpagesizes{51\baselineskip}{160mm}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6522 {\voffset}{\hoffset}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6523 {\bindingoffset}{44pt}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6524 {297mm}{210mm}%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6525 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6526 \tolerance = 700
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6527 \hfuzz = 1pt
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6528 \contentsrightmargin = 0pt
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6529 \defbodyindent = 5mm
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6530 }}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6531
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6532 % Use @afivepaper to print on European A5 paper.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6533 % From romildo@urano.iceb.ufop.br, 2 July 2000.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6534 % He also recommends making @example and @lisp be small.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6535 \def\afivepaper{{\globaldefs = 1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6536 \parskip = 2pt plus 1pt minus 0.1pt
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6537 \textleading = 12.5pt
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6538 %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6539 \internalpagesizes{160mm}{120mm}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6540 {\voffset}{\hoffset}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6541 {\bindingoffset}{8pt}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6542 {210mm}{148mm}%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6543 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6544 \lispnarrowing = 0.2in
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6545 \tolerance = 800
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6546 \hfuzz = 1.2pt
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6547 \contentsrightmargin = 0pt
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6548 \defbodyindent = 2mm
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6549 \tableindent = 12mm
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6550 }}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6551
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6552 % A specific text layout, 24x15cm overall, intended for A4 paper.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6553 \def\afourlatex{{\globaldefs = 1
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6554 \afourpaper
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6555 \internalpagesizes{237mm}{150mm}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6556 {\voffset}{4.6mm}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6557 {\bindingoffset}{7mm}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6558 {297mm}{210mm}%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6559 %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6560 % Must explicitly reset to 0 because we call \afourpaper.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6561 \globaldefs = 0
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6562 }}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6563
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6564 % Use @afourwide to print on A4 paper in landscape format.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6565 \def\afourwide{{\globaldefs = 1
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6566 \afourpaper
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6567 \internalpagesizes{241mm}{165mm}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6568 {\voffset}{-2.95mm}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6569 {\bindingoffset}{7mm}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6570 {297mm}{210mm}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6571 \globaldefs = 0
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6572 }}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6573
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6574 % @pagesizes TEXTHEIGHT[,TEXTWIDTH]
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6575 % Perhaps we should allow setting the margins, \topskip, \parskip,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6576 % and/or leading, also. Or perhaps we should compute them somehow.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6577 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6578 \def\pagesizes{\parsearg\pagesizesxxx}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6579 \def\pagesizesxxx#1{\pagesizesyyy #1,,\finish}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6580 \def\pagesizesyyy#1,#2,#3\finish{{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6581 \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6582 \globaldefs = 1
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6583 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6584 \parskip = 3pt plus 2pt minus 1pt
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6585 \setleading{\textleading}%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6586 %
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6587 \dimen0 = #1
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6588 \advance\dimen0 by \voffset
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6589 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6590 \dimen2 = \hsize
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6591 \advance\dimen2 by \normaloffset
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6592 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6593 \internalpagesizes{#1}{\hsize}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6594 {\voffset}{\normaloffset}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6595 {\bindingoffset}{44pt}%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6596 {\dimen0}{\dimen2}%
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6597 }}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6598
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6599 % Set default to letter.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6600 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6601 \letterpaper
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6602
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6603
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6604 \message{and turning on texinfo input format.}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6605
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6606 % Define macros to output various characters with catcode for normal text.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6607 \catcode`\"=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6608 \catcode`\~=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6609 \catcode`\^=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6610 \catcode`\_=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6611 \catcode`\|=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6612 \catcode`\<=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6613 \catcode`\>=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6614 \catcode`\+=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6615 \catcode`\$=\other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6616 \def\normaldoublequote{"}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6617 \def\normaltilde{~}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6618 \def\normalcaret{^}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6619 \def\normalunderscore{_}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6620 \def\normalverticalbar{|}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6621 \def\normalless{<}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6622 \def\normalgreater{>}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6623 \def\normalplus{+}
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6624 \def\normaldollar{$}%$ font-lock fix
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6625
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6626 % This macro is used to make a character print one way in ttfont
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6627 % where it can probably just be output, and another way in other fonts,
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6628 % where something hairier probably needs to be done.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6629 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6630 % #1 is what to print if we are indeed using \tt; #2 is what to print
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6631 % otherwise. Since all the Computer Modern typewriter fonts have zero
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6632 % interword stretch (and shrink), and it is reasonable to expect all
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6633 % typewriter fonts to have this, we can check that font parameter.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6634 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6635 \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6636
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6637 % Same as above, but check for italic font. Actually this also catches
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6638 % non-italic slanted fonts since it is impossible to distinguish them from
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6639 % italic fonts. But since this is only used by $ and it uses \sl anyway
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6640 % this is not a problem.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6641 \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6642
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6643 % Turn off all special characters except @
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6644 % (and those which the user can use as if they were ordinary).
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6645 % Most of these we simply print from the \tt font, but for some, we can
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6646 % use math or other variants that look better in normal text.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6647
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6648 \catcode`\"=\active
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6649 \def\activedoublequote{{\tt\char34}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6650 \let"=\activedoublequote
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6651 \catcode`\~=\active
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6652 \def~{{\tt\char126}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6653 \chardef\hat=`\^
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6654 \catcode`\^=\active
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6655 \def^{{\tt \hat}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6656
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6657 \catcode`\_=\active
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6658 \def_{\ifusingtt\normalunderscore\_}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6659 % Subroutine for the previous macro.
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6660 \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6661
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6662 \catcode`\|=\active
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6663 \def|{{\tt\char124}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6664 \chardef \less=`\<
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6665 \catcode`\<=\active
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6666 \def<{{\tt \less}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6667 \chardef \gtr=`\>
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6668 \catcode`\>=\active
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6669 \def>{{\tt \gtr}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6670 \catcode`\+=\active
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6671 \def+{{\tt \char 43}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6672 \catcode`\$=\active
47006
f267224443ae Update to version 4.2
Robert J. Chassell <bob@rattlesnake.com>
parents: 41418
diff changeset
6673 \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6674
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6675 % Set up an active definition for =, but don't enable it most of the time.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6676 {\catcode`\==\active
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6677 \global\def={{\tt \char 61}}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6678
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6679 \catcode`+=\active
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6680 \catcode`\_=\active
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6681
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6682 % If a .fmt file is being used, characters that might appear in a file
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6683 % name cannot be active until we have parsed the command line.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6684 % So turn them off again, and have \everyjob (or @setfilename) turn them on.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6685 % \otherifyactive is called near the end of this file.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6686 \def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6687
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6688 \catcode`\@=0
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6689
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6690 % \rawbackslashxx outputs one backslash character in current font,
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6691 % as in \char`\\.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6692 \global\chardef\rawbackslashxx=`\\
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6693
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6694 % \rawbackslash defines an active \ to do \rawbackslashxx.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6695 % \otherbackslash defines an active \ to be a literal `\' character with
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6696 % catcode other.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6697 {\catcode`\\=\active
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6698 @gdef@rawbackslash{@let\=@rawbackslashxx}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6699 @gdef@otherbackslash{@let\=@realbackslash}
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6700 }
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6701
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6702 % \realbackslash is an actual character `\' with catcode other.
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6703 {\catcode`\\=\other @gdef@realbackslash{\}}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6704
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6705 % \normalbackslash outputs one backslash in fixed width font.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6706 \def\normalbackslash{{\tt\rawbackslashxx}}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6707
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6708 \catcode`\\=\active
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6709
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6710 % Used sometimes to turn off (effectively) the active characters
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6711 % even after parsing them.
51944
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6712 @def@turnoffactive{%
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6713 @let"=@normaldoublequote
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6714 @let\=@realbackslash
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6715 @let~=@normaltilde
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6716 @let^=@normalcaret
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6717 @let_=@normalunderscore
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6718 @let|=@normalverticalbar
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6719 @let<=@normalless
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6720 @let>=@normalgreater
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6721 @let+=@normalplus
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6722 @let$=@normaldollar %$ font-lock fix
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6723 }
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6724
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6725 % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6726 % the literal character `\'. (Thus, \ is not expandable when this is in
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6727 % effect.)
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6728 %
4bfad02b45db Apply Karl Berry's bug fix so @copying works with @ifnottex
Robert J. Chassell <bob@rattlesnake.com>
parents: 49600
diff changeset
6729 @def@normalturnoffactive{@turnoffactive @let\=@normalbackslash}
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6730
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6731 % Make _ and + \other characters, temporarily.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6732 % This is canceled by @fixbackslash.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6733 @otherifyactive
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6734
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6735 % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6736 % That is what \eatinput is for; after that, the `\' should revert to printing
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6737 % a backslash.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6738 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6739 @gdef@eatinput input texinfo{@fixbackslash}
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6740 @global@let\ = @eatinput
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6741
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6742 % On the other hand, perhaps the file did not have a `\input texinfo'. Then
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6743 % the first `\{ in the file would cause an error. This macro tries to fix
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6744 % that, assuming it is called before the first `\' could plausibly occur.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6745 % Also back turn on active characters that might appear in the input
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6746 % file name, in case not using a pre-dumped format.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6747 %
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6748 @gdef@fixbackslash{%
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6749 @ifx\@eatinput @let\ = @normalbackslash @fi
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6750 @catcode`+=@active
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6751 @catcode`@_=@active
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6752 }
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6753
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6754 % Say @foo, not \foo, in error messages.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6755 @escapechar = `@@
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6756
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47006
diff changeset
6757 % These look ok in all fonts, so just make them not special.
41418
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6758 @catcode`@& = @other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6759 @catcode`@# = @other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6760 @catcode`@% = @other
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6761
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6762 @c Set initial fonts.
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6763 @textfonts
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6764 @rm
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6765
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6766
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6767 @c Local variables:
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6768 @c eval: (add-hook 'write-file-hooks 'time-stamp)
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6769 @c page-delimiter: "^\\\\message"
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6770 @c time-stamp-start: "def\\\\texinfoversion{"
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6771 @c time-stamp-format: "%:y-%02m-%02d.%02H"
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6772 @c time-stamp-end: "}"
a8ee89e61d20 *** empty log message ***
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6773 @c End:
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 51944
diff changeset
6774
53451
c22fbd2084b4 Use arch-tag: syntax that tla can grok
Miles Bader <miles@gnu.org>
parents: 53396
diff changeset
6775 @ignore
c22fbd2084b4 Use arch-tag: syntax that tla can grok
Miles Bader <miles@gnu.org>
parents: 53396
diff changeset
6776 arch-tag: 53261dd3-7df7-4ec3-9d90-af7a955d3c87
c22fbd2084b4 Use arch-tag: syntax that tla can grok
Miles Bader <miles@gnu.org>
parents: 53396
diff changeset
6777 @end ignore