annotate man/texinfo.tex @ 5142:f965e31a35f0

reduce lcrecord headers to 2 words, rename printing_unreadable_object -------------------- ChangeLog entries follow: -------------------- man/ChangeLog addition: 2010-03-13 Ben Wing <ben@xemacs.org> * internals/internals.texi (Working with Lisp Objects): * internals/internals.texi (Writing Macros): * internals/internals.texi (lrecords): More rewriting to correspond with changes from *LRECORD* to *LISP_OBJECT*. modules/ChangeLog addition: 2010-03-13 Ben Wing <ben@xemacs.org> * postgresql/postgresql.c (print_pgconn): * postgresql/postgresql.c (print_pgresult): printing_unreadable_object -> printing_unreadable_object_fmt. 2010-03-13 Ben Wing <ben@xemacs.org> * ldap/eldap.c (print_ldap): printing_unreadable_object -> printing_unreadable_object_fmt. src/ChangeLog addition: 2010-03-13 Ben Wing <ben@xemacs.org> * alloc.c (alloc_sized_lrecord_1): * alloc.c (alloc_sized_lrecord_array): * alloc.c (old_alloc_sized_lcrecord): * alloc.c (disksave_object_finalization_1): * alloc.c (mark_lcrecord_list): * alloc.c (alloc_managed_lcrecord): * alloc.c (free_managed_lcrecord): * alloc.c (tick_lcrecord_stats): * alloc.c (sweep_lcrecords_1): * buffer.c (print_buffer): * buffer.c (DEFVAR_BUFFER_LOCAL_1): * casetab.c: * casetab.c (print_case_table): * console.c (print_console): * console.c (DEFVAR_CONSOLE_LOCAL_1): * data.c (print_weak_list): * data.c (print_weak_box): * data.c (print_ephemeron): * data.c (ephemeron_equal): * database.c (print_database): * database.c (finalize_database): * device-msw.c (sync_printer_with_devmode): * device-msw.c (print_devmode): * device-msw.c (finalize_devmode): * device.c: * device.c (print_device): * elhash.c: * elhash.c (print_hash_table): * eval.c (print_subr): * eval.c (print_multiple_value): * event-stream.c (event_stream_resignal_wakeup): * events.c (clear_event_resource): * events.c (zero_event): * events.c (print_event): * extents.c: * extents.c (print_extent): * file-coding.c (print_coding_system): * font-mgr.c: * font-mgr.c (Ffc_init): * frame.c: * frame.c (print_frame): * gc.c: * gc.c (GC_CHECK_NOT_FREE): * glyphs.c: * glyphs.c (print_image_instance): * glyphs.c (print_glyph): * gui.c (print_gui_item): * gui.c (copy_gui_item): * keymap.c (print_keymap): * keymap.c (MARKED_SLOT): * lisp.h: * lisp.h (struct Lisp_String): * lisp.h (DEFUN): * lisp.h (DEFUN_NORETURN): * lrecord.h: * lrecord.h (NORMAL_LISP_OBJECT_UID): * lrecord.h (struct lrecord_header): * lrecord.h (set_lheader_implementation): * lrecord.h (struct old_lcrecord_header): * lrecord.h (struct free_lcrecord_header): * marker.c (print_marker): * mule-charset.c: * mule-charset.c (print_charset): * objects.c (print_color_instance): * objects.c (print_font_instance): * objects.c (finalize_font_instance): * print.c (print_cons): * print.c (printing_unreadable_object_fmt): * print.c (printing_unreadable_lisp_object): * print.c (external_object_printer): * print.c (internal_object_printer): * print.c (debug_p4): * print.c (ext_print_begin): * process.c (print_process): * rangetab.c (print_range_table): * rangetab.c (range_table_equal): * scrollbar.c (free_scrollbar_instance): * specifier.c (print_specifier): * specifier.c (finalize_specifier): * symbols.c (guts_of_unbound_marker): * symeval.h: * symeval.h (DEFVAR_SYMVAL_FWD): * tooltalk.c: * tooltalk.c (print_tooltalk_message): * tooltalk.c (print_tooltalk_pattern): * ui-gtk.c (ffi_object_printer): * ui-gtk.c (emacs_gtk_object_printer): * ui-gtk.c (emacs_gtk_boxed_printer): * window.c (print_window): * window.c (free_window_mirror): * window.c (debug_print_window): * xemacs.def.in.in: (1) printing_unreadable_object -> printing_unreadable_object_fmt. (2) printing_unreadable_lcrecord -> printing_unreadable_lisp_object and fix up so it no longer requires an lcrecord. These previous changes eliminate most of the remaining places where the terms `lcrecord' and `lrecord' occurred outside of specialized code. (3) Fairly major change: Reduce the number of words in an lcrecord from 3 to 2. The third word consisted of a uid that duplicated the lrecord uid, and a single free bit, which was moved into the lrecord structure. This reduces the size of the `uid' slot from 21 bits to 20 bits. Arguably this isn't enough -- we could easily have more than 1,000,000 or so objects created in a session. The answer is (a) It doesn't really matter if we overflow the uid field because it's only used for debugging, to identify an object uniquely (or pretty much so). (b) If we cared about it overflowing and wanted to reduce this, we could make it so that cons, string, float and certain other frob-block types that never print out the uid simply don't store a uid in them and don't increment the lrecord_uid_counter. (4) In conjunction with (3), create new macro NORMAL_LISP_OBJECT_UID() and use it to abstract out the differences between NEWGC and old-GC in accessing the `uid' value from a "normal Lisp Object pointer". (5) In events.c, use zero_nonsized_lisp_object() in place of custom- written equivalent. In font-mgr.c use external_object_printer() in place of custom-written equivalents.
author Ben Wing <ben@xemacs.org>
date Sat, 13 Mar 2010 05:38:08 -0600
parents 3ecd8885ac67
children 5cddeeeb25bb e82f5b7010fe
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 % texinfo.tex -- TeX macros to handle Texinfo files.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3 % Load plain if necessary, i.e., if running under initex.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 \def\texinfoversion{1999-09-25.10}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 % Free Software Foundation, Inc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 % This texinfo.tex file is free software; you can redistribute it and/or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 % modify it under the terms of the GNU General Public License as
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 % published by the Free Software Foundation; either version 2, or (at
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 % your option) any later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 % This texinfo.tex file is distributed in the hope that it will be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 % useful, but WITHOUT ANY WARRANTY; without even the implied warranty
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 % General Public License for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 % You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 % along with this texinfo.tex file; see the file COPYING. If not, write
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 % to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 % Boston, MA 02111-1307, USA.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 % In other words, you are welcome to use, share and improve this program.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 % You are forbidden to forbid anyone else to use, share and improve
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28 % what you give them. Help stamp out software-hoarding!
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30 % Please try the latest version of texinfo.tex before submitting bug
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 % reports; you can get the latest version from:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 % ftp://ftp.gnu.org/gnu/texinfo.tex
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 % (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 % ftp://texinfo.org/tex/texinfo.tex
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35 % ftp://us.ctan.org/macros/texinfo/texinfo.tex
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 % (and all CTAN mirrors, finger ctan@us.ctan.org for a list).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 % /home/gd/gnu/doc/texinfo.tex on the GNU machines.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 % The texinfo.tex in any given Texinfo distribution could well be out
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 % of date, so if that's what you're using, please check.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 % Texinfo has a small home page at http://texinfo.org/.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 % Send bug reports to bug-texinfo@gnu.org. Please include including a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 % complete document in each bug report with which we can reproduce the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44 % problem. Patches are, of course, greatly appreciated.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 % To process a Texinfo manual with TeX, it's most reliable to use the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 % texi2dvi shell script that comes with the distribution. For a simple
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 % manual foo.texi, however, you can get away with this:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 % tex foo.texi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 % texindex foo.??
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 % tex foo.texi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52 % tex foo.texi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 % dvips foo.dvi -o # or whatever, to process the dvi file; this makes foo.ps.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54 % The extra runs of TeX get the cross-reference information correct.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55 % Sometimes one run after texindex suffices, and sometimes you need more
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 % than two; texi2dvi does it as many times as necessary.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 % It is possible to adapt texinfo.tex for other languages. You can get
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 % the existing language-specific files from ftp://ftp.gnu.org/gnu/texinfo/.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 \message{Loading texinfo [version \texinfoversion]:}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 % If in a .fmt file, print the version number
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 % and turn on active characters that we couldn't do earlier because
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 % they might have appeared in the input file name.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 \everyjob{\message{[Texinfo version \texinfoversion]}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 \catcode`+=\active \catcode`\_=\active}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 % Save some parts of plain tex whose names we will redefine.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 \let\ptexb=\b
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 \let\ptexbullet=\bullet
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 \let\ptexc=\c
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 \let\ptexcomma=\,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 \let\ptexdot=\.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 \let\ptexdots=\dots
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 \let\ptexend=\end
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 \let\ptexequiv=\equiv
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 \let\ptexexclam=\!
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 \let\ptexi=\i
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80 \let\ptexlbrace=\{
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 \let\ptexrbrace=\}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 \let\ptexstar=\*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 \let\ptext=\t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 % We never want plain's outer \+ definition in Texinfo.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86 % For @tex, we can use \tabalign.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87 \let\+ = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 \message{Basics,}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 \chardef\other=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92 % If this character appears in an error message or help string, it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 % starts a new line in the output.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 \newlinechar = `^^J
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 % Set up fixed words for English if not already set.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 \ifx\putwordin\undefined \gdef\putwordin{in}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101 \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 \ifx\putwordof\undefined \gdef\putwordof{of}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 \ifx\putwordon\undefined \gdef\putwordon{on}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110 \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111 \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114 \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115 \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117 \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118 \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119 \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120 \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121 \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122 \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127 \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128 \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130 \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131 \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132 \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133 \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 \ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135 \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
136 \ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138 % Ignore a token.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140 \def\gobble#1{}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
142 \hyphenation{ap-pen-dix}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143 \hyphenation{mini-buf-fer mini-buf-fers}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
144 \hyphenation{eshell}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145 \hyphenation{white-space}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
146
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
147 % Margin to add to right of even pages, to left of odd pages.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
148 \newdimen \bindingoffset
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
149 \newdimen \normaloffset
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
150 \newdimen\pagewidth \newdimen\pageheight
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
151
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
152 % Sometimes it is convenient to have everything in the transcript file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
153 % and nothing on the terminal. We don't just call \tracingall here,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
154 % since that produces some useless output on the terminal.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
155 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
156 \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
157 \ifx\eTeXversion\undefined
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
158 \def\loggingall{\tracingcommands2 \tracingstats2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
159 \tracingpages1 \tracingoutput1 \tracinglostchars1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
160 \tracingmacros2 \tracingparagraphs1 \tracingrestores1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161 \showboxbreadth\maxdimen\showboxdepth\maxdimen
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
162 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
164 \def\loggingall{\tracingcommands3 \tracingstats2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
165 \tracingpages1 \tracingoutput1 \tracinglostchars1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166 \tracingmacros2 \tracingparagraphs1 \tracingrestores1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167 \tracingscantokens1 \tracingassigns1 \tracingifs1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
168 \tracinggroups1 \tracingnesting2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
169 \showboxbreadth\maxdimen\showboxdepth\maxdimen
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
172
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
173 % For @cropmarks command.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
174 % Do @cropmarks to get crop marks.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
175 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
176 \newif\ifcropmarks
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177 \let\cropmarks = \cropmarkstrue
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
178 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
179 % Dimensions to add cropmarks at corners.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
180 % Added by P. A. MacKay, 12 Nov. 1986
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
182 \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183 \newdimen\cornerlong \cornerlong=1pc
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 \newdimen\cornerthick \cornerthick=.3pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
185 \newdimen\topandbottommargin \topandbottommargin=.75in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
186
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
187 % Main output routine.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
188 \chardef\PAGE = 255
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
189 \output = {\onepageout{\pagecontents\PAGE}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
191 \newbox\headlinebox
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
192 \newbox\footlinebox
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
193
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194 % \onepageout takes a vbox as an argument. Note that \pagecontents
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195 % does insertions, but you have to call it yourself.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196 \def\onepageout#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197 \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
198 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
199 \ifodd\pageno \advance\hoffset by \bindingoffset
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
200 \else \advance\hoffset by -\bindingoffset\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
201 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
202 % Do this outside of the \shipout so @code etc. will be expanded in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
203 % the headline as they should be, not taken literally (outputting ''code).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
204 \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
205 \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
206 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
207 {%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
208 % Have to do this stuff outside the \shipout because we want it to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
209 % take effect in \write's, yet the group defined by the \vbox ends
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
210 % before the \shipout runs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
211 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
212 \escapechar = `\\ % use backslash in output files.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
213 \indexdummies % don't expand commands in the output.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
214 \normalturnoffactive % \ in index entries must not stay \, e.g., if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
215 % the page break happens to be in the middle of an example.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
216 \shipout\vbox{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
217 \ifcropmarks \vbox to \outervsize\bgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
218 \hsize = \outerhsize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
219 \vskip-\topandbottommargin
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
220 \vtop to0pt{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
221 \line{\ewtop\hfil\ewtop}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
222 \nointerlineskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
223 \line{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
224 \vbox{\moveleft\cornerthick\nstop}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
225 \hfill
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
226 \vbox{\moveright\cornerthick\nstop}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
227 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
228 \vss}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
229 \vskip\topandbottommargin
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
230 \line\bgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
231 \hfil % center the page within the outer (page) hsize.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
232 \ifodd\pageno\hskip\bindingoffset\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
233 \vbox\bgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
234 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
235 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
236 \unvbox\headlinebox
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237 \pagebody{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
238 \ifdim\ht\footlinebox > 0pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
239 % Only leave this space if the footline is nonempty.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
240 % (We lessened \vsize for it in \oddfootingxxx.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
241 % The \baselineskip=24pt in plain's \makefootline has no effect.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
242 \vskip 2\baselineskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
243 \unvbox\footlinebox
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
244 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 \ifpdfmakepagedest \pdfmkdest{\the\pageno} \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
248 \ifcropmarks
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
249 \egroup % end of \vbox\bgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250 \hfil\egroup % end of (centering) \line\bgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251 \vskip\topandbottommargin plus1fill minus1fill
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
252 \boxmaxdepth = \cornerthick
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
253 \vbox to0pt{\vss
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254 \line{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
255 \vbox{\moveleft\cornerthick\nsbot}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
256 \hfill
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
257 \vbox{\moveright\cornerthick\nsbot}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
258 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
259 \nointerlineskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
260 \line{\ewbot\hfil\ewbot}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
261 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
262 \egroup % \vbox from first cropmarks clause
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
263 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
264 }% end of \shipout\vbox
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
265 }% end of group with \turnoffactive
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
266 \advancepageno
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
267 \ifnum\outputpenalty>-20000 \else\dosupereject\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
268 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
269
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
270 \newinsert\margin \dimen\margin=\maxdimen
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
271
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
272 \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
273 {\catcode`\@ =11
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
274 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
275 % marginal hacks, juha@viisa.uucp (Juha Takala)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
276 \ifvoid\margin\else % marginal info is present
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
277 \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
278 \dimen@=\dp#1 \unvbox#1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
279 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
280 \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
281 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
282
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
283 % Here are the rules for the cropmarks. Note that they are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
284 % offset so that the space between them is truly \outerhsize or \outervsize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
285 % (P. A. MacKay, 12 November, 1986)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
286 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
287 \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
288 \def\nstop{\vbox
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
289 {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
290 \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
291 \def\nsbot{\vbox
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
292 {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
293
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
294 % Parse an argument, then pass it to #1. The argument is the rest of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
295 % the input line (except we remove a trailing comment). #1 should be a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
296 % macro which expects an ordinary undelimited TeX argument.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
297 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
298 \def\parsearg#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
299 \let\next = #1%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
300 \begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
301 \obeylines
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
302 \futurelet\temp\parseargx
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
303 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
304
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
305 % If the next token is an obeyed space (from an @example environment or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
306 % the like), remove it and recurse. Otherwise, we're done.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
307 \def\parseargx{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
308 % \obeyedspace is defined far below, after the definition of \sepspaces.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
309 \ifx\obeyedspace\temp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
310 \expandafter\parseargdiscardspace
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
311 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
312 \expandafter\parseargline
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
313 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
314 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
315
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
316 % Remove a single space (as the delimiter token to the macro call).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
317 {\obeyspaces %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
318 \gdef\parseargdiscardspace {\futurelet\temp\parseargx}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
319
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
320 {\obeylines %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
321 \gdef\parseargline#1^^M{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
322 \endgroup % End of the group started in \parsearg.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
323 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
324 % First remove any @c comment, then any @comment.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
325 % Result of each macro is put in \toks0.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
326 \argremovec #1\c\relax %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
327 \expandafter\argremovecomment \the\toks0 \comment\relax %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
328 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
329 % Call the caller's macro, saved as \next in \parsearg.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
330 \expandafter\next\expandafter{\the\toks0}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
331 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
332 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
333
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
334 % Since all \c{,omment} does is throw away the argument, we can let TeX
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
335 % do that for us. The \relax here is matched by the \relax in the call
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
336 % in \parseargline; it could be more or less anything, its purpose is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
337 % just to delimit the argument to the \c.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
338 \def\argremovec#1\c#2\relax{\toks0 = {#1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
339 \def\argremovecomment#1\comment#2\relax{\toks0 = {#1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
340
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
341 % \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
342 % @end itemize @c foo
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
343 % will have two active spaces as part of the argument with the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
344 % `itemize'. Here we remove all active spaces from #1, and assign the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
345 % result to \toks0.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
346 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
347 % This loses if there are any *other* active characters besides spaces
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
348 % in the argument -- _ ^ +, for example -- since they get expanded.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
349 % Fortunately, Texinfo does not define any such commands. (If it ever
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
350 % does, the catcode of the characters in questionwill have to be changed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
351 % here.) But this means we cannot call \removeactivespaces as part of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
352 % \argremovec{,omment}, since @c uses \parsearg, and thus the argument
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
353 % that \parsearg gets might well have any character at all in it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
354 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
355 \def\removeactivespaces#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
356 \begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
357 \ignoreactivespaces
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
358 \edef\temp{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
359 \global\toks0 = \expandafter{\temp}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
360 \endgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
361 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
362
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
363 % Change the active space to expand to nothing.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
364 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
365 \begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
366 \obeyspaces
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
367 \gdef\ignoreactivespaces{\obeyspaces\let =\empty}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
368 \endgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
369
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
370
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
371 \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
372
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
373 %% These are used to keep @begin/@end levels from running away
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
374 %% Call \inENV within environments (after a \begingroup)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
375 \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
376 \def\ENVcheck{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
377 \ifENV\errmessage{Still within an environment; press RETURN to continue}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
378 \endgroup\fi} % This is not perfect, but it should reduce lossage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
379
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
380 % @begin foo is the same as @foo, for now.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
381 \newhelp\EMsimple{Press RETURN to continue.}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
382
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
383 \outer\def\begin{\parsearg\beginxxx}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
384
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
385 \def\beginxxx #1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
386 \expandafter\ifx\csname #1\endcsname\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
387 {\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
388 \csname #1\endcsname\fi}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
389
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
390 % @end foo executes the definition of \Efoo.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
391 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
392 \def\end{\parsearg\endxxx}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
393 \def\endxxx #1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
394 \removeactivespaces{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
395 \edef\endthing{\the\toks0}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
396 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
397 \expandafter\ifx\csname E\endthing\endcsname\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
398 \expandafter\ifx\csname \endthing\endcsname\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
399 % There's no \foo, i.e., no ``environment'' foo.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
400 \errhelp = \EMsimple
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
401 \errmessage{Undefined command `@end \endthing'}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
402 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
403 \unmatchedenderror\endthing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
404 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
405 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
406 % Everything's ok; the right environment has been started.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
407 \csname E\endthing\endcsname
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
408 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
409 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
410
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
411 % There is an environment #1, but it hasn't been started. Give an error.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
412 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
413 \def\unmatchedenderror#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
414 \errhelp = \EMsimple
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
415 \errmessage{This `@end #1' doesn't have a matching `@#1'}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
416 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
417
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
418 % Define the control sequence \E#1 to give an unmatched @end error.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
419 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
420 \def\defineunmatchedend#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
421 \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
422 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
423
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
424
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
425 % Single-spacing is done by various environments (specifically, in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
426 % \nonfillstart and \quotations).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
427 \newskip\singlespaceskip \singlespaceskip = 12.5pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
428 \def\singlespace{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
429 % Why was this kern here? It messes up equalizing space above and below
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
430 % environments. --karl, 6may93
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
431 %{\advance \baselineskip by -\singlespaceskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
432 %\kern \baselineskip}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
433 \setleading \singlespaceskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
434 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
435
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
436 %% Simple single-character @ commands
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
437
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
438 % @@ prints an @
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
439 % Kludge this until the fonts are right (grr).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
440 \def\@{{\tt\char64}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
441
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
442 % This is turned off because it was never documented
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
443 % and you can use @w{...} around a quote to suppress ligatures.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
444 %% Define @` and @' to be the same as ` and '
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
445 %% but suppressing ligatures.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
446 %\def\`{{`}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
447 %\def\'{{'}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
448
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
449 % Used to generate quoted braces.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
450 \def\mylbrace {{\tt\char123}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
451 \def\myrbrace {{\tt\char125}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
452 \let\{=\mylbrace
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
453 \let\}=\myrbrace
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
454 \begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
455 % Definitions to produce actual \{ & \} command in an index.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
456 \catcode`\{ = 12 \catcode`\} = 12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
457 \catcode`\[ = 1 \catcode`\] = 2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
458 \catcode`\@ = 0 \catcode`\\ = 12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
459 @gdef@lbracecmd[\{]%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
460 @gdef@rbracecmd[\}]%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
461 @endgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
462
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
463 % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
464 % Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
465 \let\, = \c
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
466 \let\dotaccent = \.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
467 \def\ringaccent#1{{\accent23 #1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
468 \let\tieaccent = \t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
469 \let\ubaraccent = \b
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
470 \let\udotaccent = \d
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
471
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
472 % Other special characters: @questiondown @exclamdown
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
473 % Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
474 \def\questiondown{?`}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
475 \def\exclamdown{!`}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
476
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
477 % Dotless i and dotless j, used for accents.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
478 \def\imacro{i}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
479 \def\jmacro{j}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
480 \def\dotless#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
481 \def\temp{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
482 \ifx\temp\imacro \ptexi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
483 \else\ifx\temp\jmacro \j
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
484 \else \errmessage{@dotless can be used only with i or j}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
485 \fi\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
486 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
487
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
488 % Be sure we're in horizontal mode when doing a tie, since we make space
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
489 % equivalent to this in @example-like environments. Otherwise, a space
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
490 % at the beginning of a line will start with \penalty -- and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
491 % since \penalty is valid in vertical mode, we'd end up putting the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
492 % penalty on the vertical list instead of in the new paragraph.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
493 {\catcode`@ = 11
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
494 % Avoid using \@M directly, because that causes trouble
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
495 % if the definition is written into an index file.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
496 \global\let\tiepenalty = \@M
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
497 \gdef\tie{\leavevmode\penalty\tiepenalty\ }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
498 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
499
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
500 % @: forces normal size whitespace following.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
501 \def\:{\spacefactor=1000 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
502
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
503 % @* forces a line break.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
504 \def\*{\hfil\break\hbox{}\ignorespaces}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
505
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
506 % @. is an end-of-sentence period.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
507 \def\.{.\spacefactor=3000 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
508
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
509 % @! is an end-of-sentence bang.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
510 \def\!{!\spacefactor=3000 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
511
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
512 % @? is an end-of-sentence query.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
513 \def\?{?\spacefactor=3000 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
514
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
515 % @w prevents a word break. Without the \leavevmode, @w at the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
516 % beginning of a paragraph, when TeX is still in vertical mode, would
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
517 % produce a whole line of output instead of starting the paragraph.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
518 \def\w#1{\leavevmode\hbox{#1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
519
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
520 % @group ... @end group forces ... to be all on one page, by enclosing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
521 % it in a TeX vbox. We use \vtop instead of \vbox to construct the box
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
522 % to keep its height that of a normal line. According to the rules for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
523 % \topskip (p.114 of the TeXbook), the glue inserted is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
524 % max (\topskip - \ht (first item), 0). If that height is large,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
525 % therefore, no glue is inserted, and the space between the headline and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
526 % the text is small, which looks bad.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
527 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
528 \def\group{\begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
529 \ifnum\catcode13=\active \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
530 \errhelp = \groupinvalidhelp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
531 \errmessage{@group invalid in context where filling is enabled}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
532 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
533 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
534 % The \vtop we start below produces a box with normal height and large
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
535 % depth; thus, TeX puts \baselineskip glue before it, and (when the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
536 % next line of text is done) \lineskip glue after it. (See p.82 of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
537 % the TeXbook.) Thus, space below is not quite equal to space
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
538 % above. But it's pretty close.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
539 \def\Egroup{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
540 \egroup % End the \vtop.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
541 \endgroup % End the \group.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
542 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
543 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
544 \vtop\bgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
545 % We have to put a strut on the last line in case the @group is in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
546 % the midst of an example, rather than completely enclosing it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
547 % Otherwise, the interline space between the last line of the group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
548 % and the first line afterwards is too small. But we can't put the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
549 % strut in \Egroup, since there it would be on a line by itself.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
550 % Hence this just inserts a strut at the beginning of each line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
551 \everypar = {\strut}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
552 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
553 % Since we have a strut on every line, we don't need any of TeX's
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
554 % normal interline spacing.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
555 \offinterlineskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
556 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
557 % OK, but now we have to do something about blank
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
558 % lines in the input in @example-like environments, which normally
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
559 % just turn into \lisppar, which will insert no space now that we've
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
560 % turned off the interline space. Simplest is to make them be an
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
561 % empty paragraph.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
562 \ifx\par\lisppar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
563 \edef\par{\leavevmode \par}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
564 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
565 % Reset ^^M's definition to new definition of \par.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
566 \obeylines
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
567 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
568 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
569 % Do @comment since we are called inside an environment such as
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
570 % @example, where each end-of-line in the input causes an
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
571 % end-of-line in the output. We don't want the end-of-line after
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
572 % the `@group' to put extra space in the output. Since @group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
573 % should appear on a line by itself (according to the Texinfo
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
574 % manual), we don't worry about eating any user text.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
575 \comment
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
576 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
577 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
578 % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
579 % message, so this ends up printing `@group can only ...'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
580 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
581 \newhelp\groupinvalidhelp{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
582 group can only be used in environments such as @example,^^J%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
583 where each line of input produces a line of output.}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
584
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
585 % @need space-in-mils
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
586 % forces a page break if there is not space-in-mils remaining.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
587
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
588 \newdimen\mil \mil=0.001in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
589
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
590 \def\need{\parsearg\needx}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
591
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
592 % Old definition--didn't work.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
593 %\def\needx #1{\par %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
594 %% This method tries to make TeX break the page naturally
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
595 %% if the depth of the box does not fit.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
596 %{\baselineskip=0pt%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
597 %\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
598 %\prevdepth=-1000pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
599 %}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
600
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
601 \def\needx#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
602 % Ensure vertical mode, so we don't make a big box in the middle of a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
603 % paragraph.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
604 \par
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
605 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
606 % If the @need value is less than one line space, it's useless.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
607 \dimen0 = #1\mil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
608 \dimen2 = \ht\strutbox
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
609 \advance\dimen2 by \dp\strutbox
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
610 \ifdim\dimen0 > \dimen2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
611 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
612 % Do a \strut just to make the height of this box be normal, so the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
613 % normal leading is inserted relative to the preceding line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
614 % And a page break here is fine.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
615 \vtop to #1\mil{\strut\vfil}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
616 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
617 % TeX does not even consider page breaks if a penalty added to the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
618 % main vertical list is 10000 or more. But in order to see if the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
619 % empty box we just added fits on the page, we must make it consider
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
620 % page breaks. On the other hand, we don't want to actually break the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
621 % page after the empty box. So we use a penalty of 9999.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
622 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
623 % There is an extremely small chance that TeX will actually break the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
624 % page at this \penalty, if there are no other feasible breakpoints in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
625 % sight. (If the user is using lots of big @group commands, which
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
626 % almost-but-not-quite fill up a page, TeX will have a hard time doing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
627 % good page breaking, for example.) However, I could not construct an
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
628 % example where a page broke at this \penalty; if it happens in a real
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
629 % document, then we can reconsider our strategy.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
630 \penalty9999
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
631 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
632 % Back up by the size of the box, whether we did a page break or not.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
633 \kern -#1\mil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
634 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
635 % Do not allow a page break right after this kern.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
636 \nobreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
637 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
638 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
639
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
640 % @br forces paragraph break
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
641
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
642 \let\br = \par
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
643
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
644 % @dots{} output an ellipsis using the current font.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
645 % We do .5em per period so that it has the same spacing in a typewriter
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
646 % font as three actual period characters.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
647 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
648 \def\dots{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
649 \leavevmode
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
650 \hbox to 1.5em{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
651 \hskip 0pt plus 0.25fil minus 0.25fil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
652 .\hss.\hss.%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
653 \hskip 0pt plus 0.5fil minus 0.5fil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
654 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
655 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
656
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
657 % @enddots{} is an end-of-sentence ellipsis.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
658 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
659 \def\enddots{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
660 \leavevmode
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
661 \hbox to 2em{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
662 \hskip 0pt plus 0.25fil minus 0.25fil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
663 .\hss.\hss.\hss.%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
664 \hskip 0pt plus 0.5fil minus 0.5fil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
665 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
666 \spacefactor=3000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
667 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
668
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
669
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
670 % @page forces the start of a new page
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
671 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
672 \def\page{\par\vfill\supereject}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
673
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
674 % @exdent text....
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
675 % outputs text on separate line in roman font, starting at standard page margin
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
676
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
677 % This records the amount of indent in the innermost environment.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
678 % That's how much \exdent should take out.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
679 \newskip\exdentamount
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
680
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
681 % This defn is used inside fill environments such as @defun.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
682 \def\exdent{\parsearg\exdentyyy}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
683 \def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
684
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
685 % This defn is used inside nofill environments such as @example.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
686 \def\nofillexdent{\parsearg\nofillexdentyyy}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
687 \def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
688 \leftline{\hskip\leftskip{\rm#1}}}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
689
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
690 % @inmargin{TEXT} puts TEXT in the margin next to the current paragraph.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
691
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
692 \def\inmargin#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
693 \strut\vadjust{\nobreak\kern-\strutdepth
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
694 \vtop to \strutdepth{\baselineskip\strutdepth\vss
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
695 \llap{\rightskip=\inmarginspacing \vbox{\noindent #1}}\null}}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
696 \newskip\inmarginspacing \inmarginspacing=1cm
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
697 \def\strutdepth{\dp\strutbox}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
698
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
699 %\hbox{{\rm#1}}\hfil\break}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
700
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
701 % @include file insert text of that file as input.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
702 % Allow normal characters that we make active in the argument (a file name).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
703 \def\include{\begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
704 \catcode`\\=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
705 \catcode`~=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
706 \catcode`^=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
707 \catcode`_=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
708 \catcode`|=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
709 \catcode`<=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
710 \catcode`>=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
711 \catcode`+=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
712 \parsearg\includezzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
713 % Restore active chars for included file.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
714 \def\includezzz#1{\endgroup\begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
715 % Read the included file in a group so nested @include's work.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
716 \def\thisfile{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
717 \input\thisfile
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
718 \endgroup}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
719
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
720 \def\thisfile{}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
721
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
722 % @center line outputs that line, centered
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
723
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
724 \def\center{\parsearg\centerzzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
725 \def\centerzzz #1{{\advance\hsize by -\leftskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
726 \advance\hsize by -\rightskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
727 \centerline{#1}}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
728
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
729 % @sp n outputs n lines of vertical space
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
730
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
731 \def\sp{\parsearg\spxxx}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
732 \def\spxxx #1{\vskip #1\baselineskip}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
733
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
734 % @comment ...line which is ignored...
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
735 % @c is the same as @comment
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
736 % @ignore ... @end ignore is another way to write a comment
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
737
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
738 \def\comment{\begingroup \catcode`\^^M=\other%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
739 \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
740 \commentxxx}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
741 {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
742
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
743 \let\c=\comment
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
744
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
745 % @paragraphindent NCHARS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
746 % We'll use ems for NCHARS, close enough.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
747 % We cannot implement @paragraphindent asis, though.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
748 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
749 \def\asisword{asis} % no translation, these are keywords
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
750 \def\noneword{none}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
751 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
752 \def\paragraphindent{\parsearg\doparagraphindent}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
753 \def\doparagraphindent#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
754 \def\temp{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
755 \ifx\temp\asisword
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
756 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
757 \ifx\temp\noneword
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
758 \defaultparindent = 0pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
759 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
760 \defaultparindent = #1em
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
761 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
762 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
763 \parindent = \defaultparindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
764 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
765
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
766 % @exampleindent NCHARS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
767 % We'll use ems for NCHARS like @paragraphindent.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
768 % It seems @exampleindent asis isn't necessary, but
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
769 % I preserve it to make it similar to @paragraphindent.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
770 \def\exampleindent{\parsearg\doexampleindent}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
771 \def\doexampleindent#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
772 \def\temp{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
773 \ifx\temp\asisword
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
774 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
775 \ifx\temp\noneword
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
776 \lispnarrowing = 0pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
777 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
778 \lispnarrowing = #1em
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
779 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
780 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
781 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
782
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
783 % @asis just yields its argument. Used with @table, for example.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
784 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
785 \def\asis#1{#1}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
786
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
787 % @math means output in math mode.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
788 % We don't use $'s directly in the definition of \math because control
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
789 % sequences like \math are expanded when the toc file is written. Then,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
790 % we read the toc file back, the $'s will be normal characters (as they
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
791 % should be, according to the definition of Texinfo). So we must use a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
792 % control sequence to switch into and out of math mode.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
793 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
794 % This isn't quite enough for @math to work properly in indices, but it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
795 % seems unlikely it will ever be needed there.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
796 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
797 \let\implicitmath = $
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
798 \def\math#1{\implicitmath #1\implicitmath}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
799
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
800 % @bullet and @minus need the same treatment as @math, just above.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
801 \def\bullet{\implicitmath\ptexbullet\implicitmath}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
802 \def\minus{\implicitmath-\implicitmath}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
803
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
804 % @refill is a no-op.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
805 \let\refill=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
806
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
807 % If working on a large document in chapters, it is convenient to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
808 % be able to disable indexing, cross-referencing, and contents, for test runs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
809 % This is done with @novalidate (before @setfilename).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
810 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
811 \newif\iflinks \linkstrue % by default we want the aux files.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
812 \let\novalidate = \linksfalse
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
813
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
814 % @setfilename is done at the beginning of every texinfo file.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
815 % So open here the files we need to have open while reading the input.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
816 % This makes it possible to make a .fmt file for texinfo.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
817 \def\setfilename{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
818 \iflinks
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
819 \readauxfile
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
820 \fi % \openindices needs to do some work in any case.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
821 \openindices
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
822 \fixbackslash % Turn off hack to swallow `\input texinfo'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
823 \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
824 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
825 % If texinfo.cnf is present on the system, read it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
826 % Useful for site-wide @afourpaper, etc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
827 % Just to be on the safe side, close the input stream before the \input.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
828 \openin 1 texinfo.cnf
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
829 \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
830 \closein1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
831 \temp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
832 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
833 \comment % Ignore the actual filename.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
834 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
835
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
836 % Called from \setfilename.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
837 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
838 \def\openindices{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
839 \newindex{cp}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
840 \newcodeindex{fn}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
841 \newcodeindex{vr}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
842 \newcodeindex{tp}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
843 \newcodeindex{ky}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
844 \newcodeindex{pg}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
845 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
846
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
847 % @bye.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
848 \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
849
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
850
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
851 \message{pdf,}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
852 % adobe `portable' document format
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
853 \newcount\tempnum
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
854 \newcount\lnkcount
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
855 \newtoks\filename
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
856 \newcount\filenamelength
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
857 \newcount\pgn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
858 \newtoks\toksA
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
859 \newtoks\toksB
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
860 \newtoks\toksC
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
861 \newtoks\toksD
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
862 \newbox\boxA
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
863 \newcount\countA
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
864 \newif\ifpdf
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
865 \newif\ifpdfmakepagedest
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
866
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
867 \ifx\pdfoutput\undefined
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
868 \pdffalse
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
869 \let\pdfmkdest = \gobble
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
870 \let\pdfurl = \gobble
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
871 \let\endlink = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
872 \let\linkcolor = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
873 \let\pdfmakeoutlines = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
874 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
875 \pdftrue
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
876 \pdfoutput = 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
877 \input pdfcolor
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
878 \def\dopdfimage#1#2#3{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
879 \def\imagewidth{#2}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
880 \def\imageheight{#3}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
881 \ifnum\pdftexversion < 14
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
882 \pdfimage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
883 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
884 \pdfximage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
885 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
886 \ifx\empty\imagewidth\else width \imagewidth \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
887 \ifx\empty\imageheight\else height \imageheight \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
888 {#1.pdf}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
889 \ifnum\pdftexversion < 14 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
890 \pdfrefximage \pdflastximage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
891 \fi}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
892 \def\pdfmkdest#1{\pdfdest name{#1@} xyz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
893 \def\pdfmkpgn#1{#1@}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
894 \let\linkcolor = \Cyan
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
895 \def\endlink{\Black\pdfendlink}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
896 % Adding outlines to PDF; macros for calculating structure of outlines
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
897 % come from Petr Olsak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
898 \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
899 \else \csname#1\endcsname \fi}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
900 \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
901 \advance\tempnum by1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
902 \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
903 \def\pdfmakeoutlines{{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
904 \openin 1 \jobname.toc
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
905 \ifeof 1\else\bgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
906 \closein 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
907 \indexnofonts
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
908 \def\tt{}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
909 % thanh's hack / proper braces in bookmarks
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
910 \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
911 \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
912 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
913 \def\chapentry ##1##2##3{}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
914 \def\unnumbchapentry ##1##2{}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
915 \def\secentry ##1##2##3##4{\advancenumber{chap##2}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
916 \def\unnumbsecentry ##1##2{}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
917 \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
918 \def\unnumbsubsecentry ##1##2{}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
919 \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
920 \def\unnumbsubsubsecentry ##1##2{}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
921 \input \jobname.toc
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
922 \def\chapentry ##1##2##3{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
923 \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
924 \def\unnumbchapentry ##1##2{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
925 \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
926 \def\secentry ##1##2##3##4{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
927 \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
928 \def\unnumbsecentry ##1##2{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
929 \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
930 \def\subsecentry ##1##2##3##4##5{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
931 \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
932 \def\unnumbsubsecentry ##1##2{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
933 \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
934 \def\subsubsecentry ##1##2##3##4##5##6{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
935 \pdfoutline goto name{\pdfmkpgn{##6}}{##1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
936 \def\unnumbsubsubsecentry ##1##2{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
937 \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
938 \input \jobname.toc
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
939 \egroup\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
940 }}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
941 \def\makelinks #1,{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
942 \def\params{#1}\def\E{END}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
943 \ifx\params\E
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
944 \let\nextmakelinks=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
945 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
946 \let\nextmakelinks=\makelinks
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
947 \ifnum\lnkcount>0,\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
948 \picknum{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
949 \startlink attr{/Border [0 0 0]}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
950 goto name{\pdfmkpgn{\the\pgn}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
951 \linkcolor #1%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
952 \advance\lnkcount by 1%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
953 \endlink
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
954 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
955 \nextmakelinks
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
956 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
957 \def\picknum#1{\expandafter\pn#1}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
958 \def\pn#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
959 \def\p{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
960 \ifx\p\lbrace
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
961 \let\nextpn=\ppn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
962 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
963 \let\nextpn=\ppnn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
964 \def\first{#1}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
965 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
966 \nextpn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
967 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
968 \def\ppn#1{\pgn=#1\gobble}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
969 \def\ppnn{\pgn=\first}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
970 \def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
971 \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
972 \def\skipspaces#1{\def\PP{#1}\def\D{|}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
973 \ifx\PP\D\let\nextsp\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
974 \else\let\nextsp\skipspaces
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
975 \ifx\p\space\else\addtokens{\filename}{\PP}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
976 \advance\filenamelength by 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
977 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
978 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
979 \nextsp}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
980 \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
981 \ifnum\pdftexversion < 14
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
982 \let \startlink \pdfannotlink
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
983 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
984 \let \startlink \pdfstartlink
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
985 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
986 \def\pdfurl#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
987 \begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
988 \normalturnoffactive\def\@{@}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
989 \leavevmode\Red
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
990 \startlink attr{/Border [0 0 0]}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
991 user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
992 % #1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
993 \endgroup}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
994 \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
995 \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
996 \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
997 \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
998 \def\maketoks{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
999 \expandafter\poptoks\the\toksA|ENDTOKS|
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1000 \ifx\first0\adn0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1001 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1002 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1003 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1004 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1005 \ifnum0=\countA\else\makelink\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1006 \ifx\first.\let\next=\done\else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1007 \let\next=\maketoks
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1008 \addtokens{\toksB}{\the\toksD}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1009 \ifx\first,\addtokens{\toksB}{\space}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1010 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1011 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1012 \next}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1013 \def\makelink{\addtokens{\toksB}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1014 {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1015 \def\pdflink#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1016 \startlink attr{/Border [0 0 0]} goto name{\mkpgn{#1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1017 \linkcolor #1\endlink}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1018 \def\mkpgn#1{#1@}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1019 \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1020 \fi % \ifx\pdfoutput
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1021
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1022
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1023 \message{fonts,}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1024 % Font-change commands.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1025
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1026 % Texinfo sort of supports the sans serif font style, which plain TeX does not.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1027 % So we set up a \sf analogous to plain's \rm, etc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1028 \newfam\sffam
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1029 \def\sf{\fam=\sffam \tensf}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1030 \let\li = \sf % Sometimes we call it \li, not \sf.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1031
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1032 % We don't need math for this one.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1033 \def\ttsl{\tenttsl}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1034
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1035 % Use Computer Modern fonts at \magstephalf (11pt).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1036 \newcount\mainmagstep
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1037 \mainmagstep=\magstephalf
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1038
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1039 % Set the font macro #1 to the font named #2, adding on the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1040 % specified font prefix (normally `cm').
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1041 % #3 is the font's design size, #4 is a scale factor
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1042 \def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1043
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1044 % Use cm as the default font prefix.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1045 % To specify the font prefix, you must define \fontprefix
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1046 % before you read in texinfo.tex.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1047 \ifx\fontprefix\undefined
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1048 \def\fontprefix{cm}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1049 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1050 % Support font families that don't use the same naming scheme as CM.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1051 \def\rmshape{r}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1052 \def\rmbshape{bx} %where the normal face is bold
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1053 \def\bfshape{b}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1054 \def\bxshape{bx}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1055 \def\ttshape{tt}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1056 \def\ttbshape{tt}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1057 \def\ttslshape{sltt}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1058 \def\itshape{ti}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1059 \def\itbshape{bxti}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1060 \def\slshape{sl}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1061 \def\slbshape{bxsl}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1062 \def\sfshape{ss}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1063 \def\sfbshape{ss}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1064 \def\scshape{csc}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1065 \def\scbshape{csc}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1066
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1067 \ifx\bigger\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1068 \let\mainmagstep=\magstep1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1069 \setfont\textrm\rmshape{12}{1000}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1070 \setfont\texttt\ttshape{12}{1000}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1071 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1072 \setfont\textrm\rmshape{10}{\mainmagstep}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1073 \setfont\texttt\ttshape{10}{\mainmagstep}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1074 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1075 % Instead of cmb10, you many want to use cmbx10.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1076 % cmbx10 is a prettier font on its own, but cmb10
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1077 % looks better when embedded in a line with cmr10.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1078 \setfont\textbf\bfshape{10}{\mainmagstep}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1079 \setfont\textit\itshape{10}{\mainmagstep}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1080 \setfont\textsl\slshape{10}{\mainmagstep}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1081 \setfont\textsf\sfshape{10}{\mainmagstep}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1082 \setfont\textsc\scshape{10}{\mainmagstep}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1083 \setfont\textttsl\ttslshape{10}{\mainmagstep}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1084 \font\texti=cmmi10 scaled \mainmagstep
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1085 \font\textsy=cmsy10 scaled \mainmagstep
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1086
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1087 % A few fonts for @defun, etc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1088 \setfont\defbf\bxshape{10}{\magstep1} %was 1314
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1089 \setfont\deftt\ttshape{10}{\magstep1}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1090 \def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1091
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1092 % Fonts for indices, footnotes, small examples (9pt).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1093 \setfont\smallrm\rmshape{9}{1000}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1094 \setfont\smalltt\ttshape{9}{1000}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1095 \setfont\smallbf\bfshape{10}{900}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1096 \setfont\smallit\itshape{9}{1000}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1097 \setfont\smallsl\slshape{9}{1000}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1098 \setfont\smallsf\sfshape{9}{1000}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1099 \setfont\smallsc\scshape{10}{900}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1100 \setfont\smallttsl\ttslshape{10}{900}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1101 \font\smalli=cmmi9
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1102 \font\smallsy=cmsy9
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1103
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1104 % Fonts for title page:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1105 \setfont\titlerm\rmbshape{12}{\magstep3}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1106 \setfont\titleit\itbshape{10}{\magstep4}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1107 \setfont\titlesl\slbshape{10}{\magstep4}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1108 \setfont\titlett\ttbshape{12}{\magstep3}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1109 \setfont\titlettsl\ttslshape{10}{\magstep4}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1110 \setfont\titlesf\sfbshape{17}{\magstep1}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1111 \let\titlebf=\titlerm
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1112 \setfont\titlesc\scbshape{10}{\magstep4}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1113 \font\titlei=cmmi12 scaled \magstep3
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1114 \font\titlesy=cmsy10 scaled \magstep4
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1115 \def\authorrm{\secrm}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1116
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1117 % Chapter (and unnumbered) fonts (17.28pt).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1118 \setfont\chaprm\rmbshape{12}{\magstep2}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1119 \setfont\chapit\itbshape{10}{\magstep3}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1120 \setfont\chapsl\slbshape{10}{\magstep3}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1121 \setfont\chaptt\ttbshape{12}{\magstep2}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1122 \setfont\chapttsl\ttslshape{10}{\magstep3}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1123 \setfont\chapsf\sfbshape{17}{1000}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1124 \let\chapbf=\chaprm
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1125 \setfont\chapsc\scbshape{10}{\magstep3}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1126 \font\chapi=cmmi12 scaled \magstep2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1127 \font\chapsy=cmsy10 scaled \magstep3
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1128
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1129 % Section fonts (14.4pt).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1130 \setfont\secrm\rmbshape{12}{\magstep1}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1131 \setfont\secit\itbshape{10}{\magstep2}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1132 \setfont\secsl\slbshape{10}{\magstep2}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1133 \setfont\sectt\ttbshape{12}{\magstep1}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1134 \setfont\secttsl\ttslshape{10}{\magstep2}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1135 \setfont\secsf\sfbshape{12}{\magstep1}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1136 \let\secbf\secrm
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1137 \setfont\secsc\scbshape{10}{\magstep2}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1138 \font\seci=cmmi12 scaled \magstep1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1139 \font\secsy=cmsy10 scaled \magstep2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1140
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1141 % \setfont\ssecrm\bxshape{10}{\magstep1} % This size an font looked bad.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1142 % \setfont\ssecit\itshape{10}{\magstep1} % The letters were too crowded.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1143 % \setfont\ssecsl\slshape{10}{\magstep1}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1144 % \setfont\ssectt\ttshape{10}{\magstep1}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1145 % \setfont\ssecsf\sfshape{10}{\magstep1}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1146
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1147 %\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1148 %\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1149 %\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1150 %\setfont\ssectt\ttshape{10}{1315}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1151 %\setfont\ssecsf\sfshape{10}{1315}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1152
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1153 %\let\ssecbf=\ssecrm
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1154
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1155 % Subsection fonts (13.15pt).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1156 \setfont\ssecrm\rmbshape{12}{\magstephalf}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1157 \setfont\ssecit\itbshape{10}{1315}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1158 \setfont\ssecsl\slbshape{10}{1315}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1159 \setfont\ssectt\ttbshape{12}{\magstephalf}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1160 \setfont\ssecttsl\ttslshape{10}{1315}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1161 \setfont\ssecsf\sfbshape{12}{\magstephalf}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1162 \let\ssecbf\ssecrm
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1163 \setfont\ssecsc\scbshape{10}{\magstep1}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1164 \font\sseci=cmmi12 scaled \magstephalf
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1165 \font\ssecsy=cmsy10 scaled 1315
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1166 % The smallcaps and symbol fonts should actually be scaled \magstep1.5,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1167 % but that is not a standard magnification.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1168
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1169 % In order for the font changes to affect most math symbols and letters,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1170 % we have to define the \textfont of the standard families. Since
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1171 % texinfo doesn't allow for producing subscripts and superscripts, we
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1172 % don't bother to reset \scriptfont and \scriptscriptfont (which would
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1173 % also require loading a lot more fonts).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1174 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1175 \def\resetmathfonts{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1176 \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1177 \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1178 \textfont\ttfam = \tentt \textfont\sffam = \tensf
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1179 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1180
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1181
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1182 % The font-changing commands redefine the meanings of \tenSTYLE, instead
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1183 % of just \STYLE. We do this so that font changes will continue to work
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1184 % in math mode, where it is the current \fam that is relevant in most
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1185 % cases, not the current font. Plain TeX does \def\bf{\fam=\bffam
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1186 % \tenbf}, for example. By redefining \tenbf, we obviate the need to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1187 % redefine \bf itself.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1188 \def\textfonts{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1189 \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1190 \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1191 \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1192 \resetmathfonts}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1193 \def\titlefonts{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1194 \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1195 \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1196 \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1197 \let\tenttsl=\titlettsl
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1198 \resetmathfonts \setleading{25pt}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1199 \def\titlefont#1{{\titlefonts\rm #1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1200 \def\chapfonts{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1201 \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1202 \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1203 \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1204 \resetmathfonts \setleading{19pt}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1205 \def\secfonts{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1206 \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1207 \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1208 \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1209 \resetmathfonts \setleading{16pt}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1210 \def\subsecfonts{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1211 \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1212 \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1213 \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1214 \resetmathfonts \setleading{15pt}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1215 \let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf?
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1216 \def\smallfonts{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1217 \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1218 \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1219 \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1220 \let\tenttsl=\smallttsl
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1221 \resetmathfonts \setleading{11pt}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1222
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1223 % Set up the default fonts, so we can use them for creating boxes.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1224 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1225 \textfonts
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1226
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1227 % Define these so they can be easily changed for other fonts.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1228 \def\angleleft{$\langle$}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1229 \def\angleright{$\rangle$}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1230
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1231 % Count depth in font-changes, for error checks
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1232 \newcount\fontdepth \fontdepth=0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1233
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1234 % Fonts for short table of contents.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1235 \setfont\shortcontrm\rmshape{12}{1000}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1236 \setfont\shortcontbf\bxshape{12}{1000}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1237 \setfont\shortcontsl\slshape{12}{1000}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1238
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1239 %% Add scribe-like font environments, plus @l for inline lisp (usually sans
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1240 %% serif) and @ii for TeX italic
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1241
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1242 % \smartitalic{ARG} outputs arg in italics, followed by an italic correction
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1243 % unless the following character is such as not to need one.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1244 \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1245 \def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1246 \def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1247
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1248 \let\i=\smartitalic
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1249 \let\var=\smartslanted
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1250 \let\dfn=\smartslanted
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1251 \let\emph=\smartitalic
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1252 \let\cite=\smartslanted
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1253
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1254 \def\b#1{{\bf #1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1255 \let\strong=\b
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1256
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1257 % We can't just use \exhyphenpenalty, because that only has effect at
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1258 % the end of a paragraph. Restore normal hyphenation at the end of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1259 % group within which \nohyphenation is presumably called.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1260 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1261 \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1262 \def\restorehyphenation{\hyphenchar\font = `- }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1263
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1264 \def\t#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1265 {\tt \rawbackslash \frenchspacing #1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1266 \null
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1267 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1268 \let\ttfont=\t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1269 \def\samp#1{`\tclose{#1}'\null}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1270 \setfont\keyrm\rmshape{8}{1000}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1271 \font\keysy=cmsy9
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1272 \def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1273 \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1274 \vbox{\hrule\kern-0.4pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1275 \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1276 \kern-0.4pt\hrule}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1277 \kern-.06em\raise0.4pt\hbox{\angleright}}}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1278 % The old definition, with no lozenge:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1279 %\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1280 \def\ctrl #1{{\tt \rawbackslash \hat}#1}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1281
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1282 % @file, @option are the same as @samp.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1283 \let\file=\samp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1284 \let\option=\samp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1285
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1286 % @code is a modification of @t,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1287 % which makes spaces the same size as normal in the surrounding text.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1288 \def\tclose#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1289 {%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1290 % Change normal interword space to be same as for the current font.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1291 \spaceskip = \fontdimen2\font
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1292 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1293 % Switch to typewriter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1294 \tt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1295 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1296 % But `\ ' produces the large typewriter interword space.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1297 \def\ {{\spaceskip = 0pt{} }}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1298 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1299 % Turn off hyphenation.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1300 \nohyphenation
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1301 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1302 \rawbackslash
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1303 \frenchspacing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1304 #1%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1305 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1306 \null
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1307 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1308
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1309 % We *must* turn on hyphenation at `-' and `_' in \code.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1310 % Otherwise, it is too hard to avoid overfull hboxes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1311 % in the Emacs manual, the Library manual, etc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1312
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1313 % Unfortunately, TeX uses one parameter (\hyphenchar) to control
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1314 % both hyphenation at - and hyphenation within words.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1315 % We must therefore turn them both off (\tclose does that)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1316 % and arrange explicitly to hyphenate at a dash.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1317 % -- rms.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1318 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1319 \catcode`\-=\active
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1320 \catcode`\_=\active
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1321 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1322 \global\def\code{\begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1323 \catcode`\-=\active \let-\codedash
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1324 \catcode`\_=\active \let_\codeunder
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1325 \codex
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1326 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1327 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1328 % If we end up with any active - characters when handling the index,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1329 % just treat them as a normal -.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1330 \global\def\indexbreaks{\catcode`\-=\active \let-\realdash}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1331 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1332
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1333 \def\realdash{-}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1334 \def\codedash{-\discretionary{}{}{}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1335 \def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1336 \def\codex #1{\tclose{#1}\endgroup}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1337
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1338 %\let\exp=\tclose %Was temporary
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1339
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1340 % @kbd is like @code, except that if the argument is just one @key command,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1341 % then @kbd has no effect.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1342
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1343 % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1344 % `example' (@kbd uses ttsl only inside of @example and friends),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1345 % or `code' (@kbd uses normal tty font always).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1346 \def\kbdinputstyle{\parsearg\kbdinputstylexxx}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1347 \def\kbdinputstylexxx#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1348 \def\arg{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1349 \ifx\arg\worddistinct
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1350 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1351 \else\ifx\arg\wordexample
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1352 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1353 \else\ifx\arg\wordcode
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1354 \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1355 \fi\fi\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1356 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1357 \def\worddistinct{distinct}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1358 \def\wordexample{example}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1359 \def\wordcode{code}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1360
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1361 % Default is kbdinputdistinct. (Too much of a hassle to call the macro,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1362 % the catcodes are wrong for parsearg to work.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1363 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1364
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1365 \def\xkey{\key}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1366 \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1367 \ifx\one\xkey\ifx\threex\three \key{#2}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1368 \else{\tclose{\kbdfont\look}}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1369 \else{\tclose{\kbdfont\look}}\fi}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1370
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1371 % For @url, @env, @command quotes seem unnecessary, so use \code.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1372 \let\url=\code
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1373 \let\env=\code
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1374 \let\command=\code
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1375
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1376 % @uref (abbreviation for `urlref') takes an optional (comma-separated)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1377 % second argument specifying the text to display and an optional third
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1378 % arg as text to display instead of (rather than in addition to) the url
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1379 % itself. First (mandatory) arg is the url. Perhaps eventually put in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1380 % a hypertex \special here.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1381 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1382 \def\uref#1{\douref #1,,,\finish}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1383 \def\douref#1,#2,#3,#4\finish{\begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1384 \unsepspaces
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1385 \pdfurl{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1386 \setbox0 = \hbox{\ignorespaces #3}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1387 \ifdim\wd0 > 0pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1388 \unhbox0 % third arg given, show only that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1389 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1390 \setbox0 = \hbox{\ignorespaces #2}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1391 \ifdim\wd0 > 0pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1392 \ifpdf
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1393 \unhbox0 % PDF: 2nd arg given, show only it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1394 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1395 \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1396 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1397 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1398 \code{#1}% only url given, so show it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1399 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1400 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1401 \endlink
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1402 \endgroup}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1403
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1404 % rms does not like angle brackets --karl, 17may97.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1405 % So now @email is just like @uref, unless we are pdf.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1406 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1407 %\def\email#1{\angleleft{\tt #1}\angleright}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1408 \ifpdf
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1409 \def\email#1{\doemail#1,,\finish}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1410 \def\doemail#1,#2,#3\finish{\begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1411 \unsepspaces
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1412 \pdfurl{mailto:#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1413 \setbox0 = \hbox{\ignorespaces #2}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1414 \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1415 \endlink
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1416 \endgroup}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1417 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1418 \let\email=\uref
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1419 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1420
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1421 % Check if we are currently using a typewriter font. Since all the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1422 % Computer Modern typewriter fonts have zero interword stretch (and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1423 % shrink), and it is reasonable to expect all typewriter fonts to have
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1424 % this property, we can check that font parameter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1425 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1426 \def\ifmonospace{\ifdim\fontdimen3\font=0pt }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1427
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1428 % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1429 % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1430 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1431 \def\dmn#1{\thinspace #1}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1432
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1433 \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1434
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1435 % @l was never documented to mean ``switch to the Lisp font'',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1436 % and it is not used as such in any manual I can find. We need it for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1437 % Polish suppressed-l. --karl, 22sep96.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1438 %\def\l#1{{\li #1}\null}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1439
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1440 % Explicit font changes: @r, @sc, undocumented @ii.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1441 \def\r#1{{\rm #1}} % roman font
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1442 \def\sc#1{{\smallcaps#1}} % smallcaps font
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1443 \def\ii#1{{\it #1}} % italic font
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1444
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1445 % @acronym downcases the argument and prints in smallcaps.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1446 \def\acronym#1{{\smallcaps \lowercase{#1}}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1447
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1448 % @pounds{} is a sterling sign.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1449 \def\pounds{{\it\$}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1450
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1451
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1452 \message{page headings,}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1453
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1454 \newskip\titlepagetopglue \titlepagetopglue = 1.5in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1455 \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1456
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1457 % First the title page. Must do @settitle before @titlepage.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1458 \newif\ifseenauthor
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1459 \newif\iffinishedtitlepage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1460
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1461 % Do an implicit @contents or @shortcontents after @end titlepage if the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1462 % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1463 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1464 \newif\ifsetcontentsaftertitlepage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1465 \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1466 \newif\ifsetshortcontentsaftertitlepage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1467 \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1468
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1469 \def\shorttitlepage{\parsearg\shorttitlepagezzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1470 \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1471 \endgroup\page\hbox{}\page}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1472
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1473 \def\titlepage{\begingroup \parindent=0pt \textfonts
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1474 \let\subtitlerm=\tenrm
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1475 \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1476 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1477 \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1478 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1479 % Leave some space at the very top of the page.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1480 \vglue\titlepagetopglue
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1481 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1482 % Now you can print the title using @title.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1483 \def\title{\parsearg\titlezzz}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1484 \def\titlezzz##1{\leftline{\titlefonts\rm ##1}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1485 % print a rule at the page bottom also.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1486 \finishedtitlepagefalse
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1487 \vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1488 % No rule at page bottom unless we print one at the top with @title.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1489 \finishedtitlepagetrue
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1490 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1491 % Now you can put text using @subtitle.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1492 \def\subtitle{\parsearg\subtitlezzz}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1493 \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1494 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1495 % @author should come last, but may come many times.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1496 \def\author{\parsearg\authorzzz}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1497 \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1498 {\authorfont \leftline{##1}}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1499 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1500 % Most title ``pages'' are actually two pages long, with space
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1501 % at the top of the second. We don't want the ragged left on the second.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1502 \let\oldpage = \page
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1503 \def\page{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1504 \iffinishedtitlepage\else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1505 \finishtitlepage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1506 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1507 \oldpage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1508 \let\page = \oldpage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1509 \hbox{}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1510 % \def\page{\oldpage \hbox{}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1511 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1512
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1513 \def\Etitlepage{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1514 \iffinishedtitlepage\else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1515 \finishtitlepage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1516 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1517 % It is important to do the page break before ending the group,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1518 % because the headline and footline are only empty inside the group.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1519 % If we use the new definition of \page, we always get a blank page
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1520 % after the title page, which we certainly don't want.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1521 \oldpage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1522 \endgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1523 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1524 % If they want short, they certainly want long too.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1525 \ifsetshortcontentsaftertitlepage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1526 \shortcontents
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1527 \contents
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1528 \global\let\shortcontents = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1529 \global\let\contents = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1530 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1531 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1532 \ifsetcontentsaftertitlepage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1533 \contents
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1534 \global\let\contents = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1535 \global\let\shortcontents = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1536 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1537 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1538 \ifpdf \pdfmakepagedesttrue \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1539 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1540 \HEADINGSon
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1541 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1542
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1543 \def\finishtitlepage{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1544 \vskip4pt \hrule height 2pt width \hsize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1545 \vskip\titlepagebottomglue
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1546 \finishedtitlepagetrue
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1547 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1548
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1549 %%% Set up page headings and footings.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1550
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1551 \let\thispage=\folio
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1552
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1553 \newtoks\evenheadline % headline on even pages
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1554 \newtoks\oddheadline % headline on odd pages
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1555 \newtoks\evenfootline % footline on even pages
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1556 \newtoks\oddfootline % footline on odd pages
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1557
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1558 % Now make Tex use those variables
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1559 \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1560 \else \the\evenheadline \fi}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1561 \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1562 \else \the\evenfootline \fi}\HEADINGShook}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1563 \let\HEADINGShook=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1564
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1565 % Commands to set those variables.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1566 % For example, this is what @headings on does
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1567 % @evenheading @thistitle|@thispage|@thischapter
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1568 % @oddheading @thischapter|@thispage|@thistitle
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1569 % @evenfooting @thisfile||
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1570 % @oddfooting ||@thisfile
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1571
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1572 \def\evenheading{\parsearg\evenheadingxxx}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1573 \def\oddheading{\parsearg\oddheadingxxx}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1574 \def\everyheading{\parsearg\everyheadingxxx}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1575
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1576 \def\evenfooting{\parsearg\evenfootingxxx}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1577 \def\oddfooting{\parsearg\oddfootingxxx}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1578 \def\everyfooting{\parsearg\everyfootingxxx}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1579
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1580 {\catcode`\@=0 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1581
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1582 \gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1583 \gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1584 \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1585
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1586 \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1587 \gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1588 \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1589
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1590 \gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1591
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1592 \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1593 \gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1594 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1595
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1596 \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1597 \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1598 \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1599 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1600 % Leave some space for the footline. Hopefully ok to assume
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1601 % @evenfooting will not be used by itself.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1602 \global\advance\pageheight by -\baselineskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1603 \global\advance\vsize by -\baselineskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1604 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1605
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1606 \gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1607 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1608 }% unbind the catcode of @.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1609
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1610 % @headings double turns headings on for double-sided printing.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1611 % @headings single turns headings on for single-sided printing.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1612 % @headings off turns them off.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1613 % @headings on same as @headings double, retained for compatibility.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1614 % @headings after turns on double-sided headings after this page.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1615 % @headings doubleafter turns on double-sided headings after this page.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1616 % @headings singleafter turns on single-sided headings after this page.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1617 % By default, they are off at the start of a document,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1618 % and turned `on' after @end titlepage.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1619
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1620 \def\headings #1 {\csname HEADINGS#1\endcsname}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1621
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1622 \def\HEADINGSoff{
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1623 \global\evenheadline={\hfil} \global\evenfootline={\hfil}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1624 \global\oddheadline={\hfil} \global\oddfootline={\hfil}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1625 \HEADINGSoff
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1626 % When we turn headings on, set the page number to 1.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1627 % For double-sided printing, put current file name in lower left corner,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1628 % chapter name on inside top of right hand pages, document
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1629 % title on inside top of left hand pages, and page numbers on outside top
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1630 % edge of all pages.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1631 \def\HEADINGSdouble{
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1632 \global\pageno=1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1633 \global\evenfootline={\hfil}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1634 \global\oddfootline={\hfil}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1635 \global\evenheadline={\line{\folio\hfil\thistitle}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1636 \global\oddheadline={\line{\thischapter\hfil\folio}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1637 \global\let\contentsalignmacro = \chapoddpage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1638 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1639 \let\contentsalignmacro = \chappager
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1640
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1641 % For single-sided printing, chapter title goes across top left of page,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1642 % page number on top right.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1643 \def\HEADINGSsingle{
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1644 \global\pageno=1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1645 \global\evenfootline={\hfil}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1646 \global\oddfootline={\hfil}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1647 \global\evenheadline={\line{\thischapter\hfil\folio}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1648 \global\oddheadline={\line{\thischapter\hfil\folio}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1649 \global\let\contentsalignmacro = \chappager
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1650 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1651 \def\HEADINGSon{\HEADINGSdouble}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1652
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1653 \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1654 \let\HEADINGSdoubleafter=\HEADINGSafter
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1655 \def\HEADINGSdoublex{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1656 \global\evenfootline={\hfil}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1657 \global\oddfootline={\hfil}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1658 \global\evenheadline={\line{\folio\hfil\thistitle}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1659 \global\oddheadline={\line{\thischapter\hfil\folio}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1660 \global\let\contentsalignmacro = \chapoddpage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1661 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1662
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1663 \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1664 \def\HEADINGSsinglex{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1665 \global\evenfootline={\hfil}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1666 \global\oddfootline={\hfil}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1667 \global\evenheadline={\line{\thischapter\hfil\folio}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1668 \global\oddheadline={\line{\thischapter\hfil\folio}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1669 \global\let\contentsalignmacro = \chappager
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1670 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1671
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1672 % Subroutines used in generating headings
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1673 % Produces Day Month Year style of output.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1674 \def\today{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1675 \number\day\space
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1676 \ifcase\month
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1677 \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1678 \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1679 \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1680 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1681 \space\number\year}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1682
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1683 % @settitle line... specifies the title of the document, for headings.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1684 % It generates no output of its own.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1685 \def\thistitle{\putwordNoTitle}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1686 \def\settitle{\parsearg\settitlezzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1687 \def\settitlezzz #1{\gdef\thistitle{#1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1688
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1689
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1690 \message{tables,}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1691 % Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1692
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1693 % default indentation of table text
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1694 \newdimen\tableindent \tableindent=.8in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1695 % default indentation of @itemize and @enumerate text
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1696 \newdimen\itemindent \itemindent=.3in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1697 % margin between end of table item and start of table text.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1698 \newdimen\itemmargin \itemmargin=.1in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1699
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1700 % used internally for \itemindent minus \itemmargin
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1701 \newdimen\itemmax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1702
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1703 % Note @table, @vtable, and @vtable define @item, @itemx, etc., with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1704 % these defs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1705 % They also define \itemindex
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1706 % to index the item name in whatever manner is desired (perhaps none).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1707
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1708 \newif\ifitemxneedsnegativevskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1709
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1710 \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1711
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1712 \def\internalBitem{\smallbreak \parsearg\itemzzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1713 \def\internalBitemx{\itemxpar \parsearg\itemzzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1714
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1715 \def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1716 \def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1717
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1718 \def\internalBkitem{\smallbreak \parsearg\kitemzzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1719 \def\internalBkitemx{\itemxpar \parsearg\kitemzzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1720
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1721 \def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1722 \itemzzz {#1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1723
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1724 \def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1725 \itemzzz {#1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1726
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1727 \def\itemzzz #1{\begingroup %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1728 \advance\hsize by -\rightskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1729 \advance\hsize by -\tableindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1730 \setbox0=\hbox{\itemfont{#1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1731 \itemindex{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1732 \nobreak % This prevents a break before @itemx.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1733 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1734 % If the item text does not fit in the space we have, put it on a line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1735 % by itself, and do not allow a page break either before or after that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1736 % line. We do not start a paragraph here because then if the next
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1737 % command is, e.g., @kindex, the whatsit would get put into the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1738 % horizontal list on a line by itself, resulting in extra blank space.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1739 \ifdim \wd0>\itemmax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1740 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1741 % Make this a paragraph so we get the \parskip glue and wrapping,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1742 % but leave it ragged-right.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1743 \begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1744 \advance\leftskip by-\tableindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1745 \advance\hsize by\tableindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1746 \advance\rightskip by0pt plus1fil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1747 \leavevmode\unhbox0\par
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1748 \endgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1749 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1750 % We're going to be starting a paragraph, but we don't want the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1751 % \parskip glue -- logically it's part of the @item we just started.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1752 \nobreak \vskip-\parskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1753 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1754 % Stop a page break at the \parskip glue coming up. Unfortunately
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1755 % we can't prevent a possible page break at the following
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1756 % \baselineskip glue.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1757 \nobreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1758 \endgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1759 \itemxneedsnegativevskipfalse
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1760 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1761 % The item text fits into the space. Start a paragraph, so that the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1762 % following text (if any) will end up on the same line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1763 \noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1764 % Do this with kerns and \unhbox so that if there is a footnote in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1765 % the item text, it can migrate to the main vertical list and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1766 % eventually be printed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1767 \nobreak\kern-\tableindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1768 \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1769 \unhbox0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1770 \nobreak\kern\dimen0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1771 \endgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1772 \itemxneedsnegativevskiptrue
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1773 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1774 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1775
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1776 \def\item{\errmessage{@item while not in a table}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1777 \def\itemx{\errmessage{@itemx while not in a table}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1778 \def\kitem{\errmessage{@kitem while not in a table}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1779 \def\kitemx{\errmessage{@kitemx while not in a table}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1780 \def\xitem{\errmessage{@xitem while not in a table}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1781 \def\xitemx{\errmessage{@xitemx while not in a table}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1782
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1783 % Contains a kludge to get @end[description] to work.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1784 \def\description{\tablez{\dontindex}{1}{}{}{}{}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1785
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1786 % @table, @ftable, @vtable.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1787 \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1788 {\obeylines\obeyspaces%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1789 \gdef\tablex #1^^M{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1790 \tabley\dontindex#1 \endtabley}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1791
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1792 \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1793 {\obeylines\obeyspaces%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1794 \gdef\ftablex #1^^M{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1795 \tabley\fnitemindex#1 \endtabley
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1796 \def\Eftable{\endgraf\afterenvbreak\endgroup}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1797 \let\Etable=\relax}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1798
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1799 \def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1800 {\obeylines\obeyspaces%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1801 \gdef\vtablex #1^^M{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1802 \tabley\vritemindex#1 \endtabley
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1803 \def\Evtable{\endgraf\afterenvbreak\endgroup}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1804 \let\Etable=\relax}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1805
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1806 \def\dontindex #1{}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1807 \def\fnitemindex #1{\doind {fn}{\code{#1}}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1808 \def\vritemindex #1{\doind {vr}{\code{#1}}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1809
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1810 {\obeyspaces %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1811 \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1812 \tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1813
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1814 \def\tablez #1#2#3#4#5#6{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1815 \aboveenvbreak %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1816 \begingroup %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1817 \def\Edescription{\Etable}% Necessary kludge.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1818 \let\itemindex=#1%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1819 \ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1820 \ifnum 0#4>0 \tableindent=#4\mil \fi %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1821 \ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1822 \def\itemfont{#2}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1823 \itemmax=\tableindent %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1824 \advance \itemmax by -\itemmargin %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1825 \advance \leftskip by \tableindent %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1826 \exdentamount=\tableindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1827 \parindent = 0pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1828 \parskip = \smallskipamount
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1829 \ifdim \parskip=0pt \parskip=2pt \fi%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1830 \def\Etable{\endgraf\afterenvbreak\endgroup}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1831 \let\item = \internalBitem %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1832 \let\itemx = \internalBitemx %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1833 \let\kitem = \internalBkitem %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1834 \let\kitemx = \internalBkitemx %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1835 \let\xitem = \internalBxitem %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1836 \let\xitemx = \internalBxitemx %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1837 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1838
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1839 % This is the counter used by @enumerate, which is really @itemize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1840
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1841 \newcount \itemno
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1842
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1843 \def\itemize{\parsearg\itemizezzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1844
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1845 \def\itemizezzz #1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1846 \begingroup % ended by the @end itemize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1847 \itemizey {#1}{\Eitemize}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1848 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1849
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1850 \def\itemizey #1#2{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1851 \aboveenvbreak %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1852 \itemmax=\itemindent %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1853 \advance \itemmax by -\itemmargin %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1854 \advance \leftskip by \itemindent %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1855 \exdentamount=\itemindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1856 \parindent = 0pt %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1857 \parskip = \smallskipamount %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1858 \ifdim \parskip=0pt \parskip=2pt \fi%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1859 \def#2{\endgraf\afterenvbreak\endgroup}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1860 \def\itemcontents{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1861 \let\item=\itemizeitem}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1862
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1863 % Set sfcode to normal for the chars that usually have another value.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1864 % These are `.?!:;,'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1865 \def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1866 \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1867
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1868 % \splitoff TOKENS\endmark defines \first to be the first token in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1869 % TOKENS, and \rest to be the remainder.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1870 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1871 \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1872
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1873 % Allow an optional argument of an uppercase letter, lowercase letter,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1874 % or number, to specify the first label in the enumerated list. No
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1875 % argument is the same as `1'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1876 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1877 \def\enumerate{\parsearg\enumeratezzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1878 \def\enumeratezzz #1{\enumeratey #1 \endenumeratey}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1879 \def\enumeratey #1 #2\endenumeratey{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1880 \begingroup % ended by the @end enumerate
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1881 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1882 % If we were given no argument, pretend we were given `1'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1883 \def\thearg{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1884 \ifx\thearg\empty \def\thearg{1}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1885 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1886 % Detect if the argument is a single token. If so, it might be a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1887 % letter. Otherwise, the only valid thing it can be is a number.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1888 % (We will always have one token, because of the test we just made.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1889 % This is a good thing, since \splitoff doesn't work given nothing at
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1890 % all -- the first parameter is undelimited.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1891 \expandafter\splitoff\thearg\endmark
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1892 \ifx\rest\empty
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1893 % Only one token in the argument. It could still be anything.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1894 % A ``lowercase letter'' is one whose \lccode is nonzero.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1895 % An ``uppercase letter'' is one whose \lccode is both nonzero, and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1896 % not equal to itself.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1897 % Otherwise, we assume it's a number.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1898 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1899 % We need the \relax at the end of the \ifnum lines to stop TeX from
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1900 % continuing to look for a <number>.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1901 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1902 \ifnum\lccode\expandafter`\thearg=0\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1903 \numericenumerate % a number (we hope)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1904 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1905 % It's a letter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1906 \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1907 \lowercaseenumerate % lowercase letter
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1908 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1909 \uppercaseenumerate % uppercase letter
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1910 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1911 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1912 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1913 % Multiple tokens in the argument. We hope it's a number.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1914 \numericenumerate
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1915 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1916 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1917
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1918 % An @enumerate whose labels are integers. The starting integer is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1919 % given in \thearg.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1920 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1921 \def\numericenumerate{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1922 \itemno = \thearg
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1923 \startenumeration{\the\itemno}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1924 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1925
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1926 % The starting (lowercase) letter is in \thearg.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1927 \def\lowercaseenumerate{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1928 \itemno = \expandafter`\thearg
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1929 \startenumeration{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1930 % Be sure we're not beyond the end of the alphabet.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1931 \ifnum\itemno=0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1932 \errmessage{No more lowercase letters in @enumerate; get a bigger
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1933 alphabet}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1934 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1935 \char\lccode\itemno
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1936 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1937 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1938
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1939 % The starting (uppercase) letter is in \thearg.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1940 \def\uppercaseenumerate{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1941 \itemno = \expandafter`\thearg
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1942 \startenumeration{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1943 % Be sure we're not beyond the end of the alphabet.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1944 \ifnum\itemno=0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1945 \errmessage{No more uppercase letters in @enumerate; get a bigger
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1946 alphabet}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1947 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1948 \char\uccode\itemno
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1949 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1950 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1951
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1952 % Call itemizey, adding a period to the first argument and supplying the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1953 % common last two arguments. Also subtract one from the initial value in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1954 % \itemno, since @item increments \itemno.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1955 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1956 \def\startenumeration#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1957 \advance\itemno by -1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1958 \itemizey{#1.}\Eenumerate\flushcr
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1959 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1960
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1961 % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1962 % to @enumerate.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1963 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1964 \def\alphaenumerate{\enumerate{a}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1965 \def\capsenumerate{\enumerate{A}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1966 \def\Ealphaenumerate{\Eenumerate}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1967 \def\Ecapsenumerate{\Eenumerate}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1968
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1969 % Definition of @item while inside @itemize.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1970
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1971 \def\itemizeitem{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1972 \advance\itemno by 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1973 {\let\par=\endgraf \smallbreak}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1974 \ifhmode \errmessage{In hmode at itemizeitem}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1975 {\parskip=0in \hskip 0pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1976 \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1977 \vadjust{\penalty 1200}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1978 \flushcr}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1979
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1980 % @multitable macros
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1981 % Amy Hendrickson, 8/18/94, 3/6/96
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1982 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1983 % @multitable ... @end multitable will make as many columns as desired.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1984 % Contents of each column will wrap at width given in preamble. Width
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1985 % can be specified either with sample text given in a template line,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1986 % or in percent of \hsize, the current width of text on page.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1987
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1988 % Table can continue over pages but will only break between lines.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1989
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1990 % To make preamble:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1991 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1992 % Either define widths of columns in terms of percent of \hsize:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1993 % @multitable @columnfractions .25 .3 .45
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1994 % @item ...
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1995 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1996 % Numbers following @columnfractions are the percent of the total
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1997 % current hsize to be used for each column. You may use as many
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1998 % columns as desired.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1999
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2001 % Or use a template:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2002 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2003 % @item ...
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2004 % using the widest term desired in each column.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2005 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2006 % For those who want to use more than one line's worth of words in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2007 % the preamble, break the line within one argument and it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2008 % will parse correctly, i.e.,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2009 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2010 % @multitable {Column 1 template} {Column 2 template} {Column 3
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2011 % template}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2012 % Not:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2013 % @multitable {Column 1 template} {Column 2 template}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2014 % {Column 3 template}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2015
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2016 % Each new table line starts with @item, each subsequent new column
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2017 % starts with @tab. Empty columns may be produced by supplying @tab's
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2018 % with nothing between them for as many times as empty columns are needed,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2019 % ie, @tab@tab@tab will produce two empty columns.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2020
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2021 % @item, @tab, @multitable or @end multitable do not need to be on their
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2022 % own lines, but it will not hurt if they are.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2023
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2024 % Sample multitable:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2025
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2026 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2027 % @item first col stuff @tab second col stuff @tab third col
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2028 % @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2029 % first col stuff
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2030 % @tab
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2031 % second col stuff
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2032 % @tab
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2033 % third col
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2034 % @item first col stuff @tab second col stuff
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2035 % @tab Many paragraphs of text may be used in any column.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2036 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2037 % They will wrap at the width determined by the template.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2038 % @item@tab@tab This will be in third column.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2039 % @end multitable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2040
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2041 % Default dimensions may be reset by user.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2042 % @multitableparskip is vertical space between paragraphs in table.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2043 % @multitableparindent is paragraph indent in table.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2044 % @multitablecolmargin is horizontal space to be left between columns.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2045 % @multitablelinespace is space to leave between table items, baseline
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2046 % to baseline.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2047 % 0pt means it depends on current normal line spacing.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2048 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2049 \newskip\multitableparskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2050 \newskip\multitableparindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2051 \newdimen\multitablecolspace
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2052 \newskip\multitablelinespace
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2053 \multitableparskip=0pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2054 \multitableparindent=6pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2055 \multitablecolspace=12pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2056 \multitablelinespace=0pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2057
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2058 % Macros used to set up halign preamble:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2059 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2060 \let\endsetuptable\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2061 \def\xendsetuptable{\endsetuptable}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2062 \let\columnfractions\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2063 \def\xcolumnfractions{\columnfractions}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2064 \newif\ifsetpercent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2065
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2066 % #1 is the part of the @columnfraction before the decimal point, which
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2067 % is presumably either 0 or the empty string (but we don't check, we
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2068 % just throw it away). #2 is the decimal part, which we use as the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2069 % percent of \hsize for this column.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2070 \def\pickupwholefraction#1.#2 {%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2071 \global\advance\colcount by 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2072 \expandafter\xdef\csname col\the\colcount\endcsname{.#2\hsize}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2073 \setuptable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2074 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2075
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2076 \newcount\colcount
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2077 \def\setuptable#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2078 \def\firstarg{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2079 \ifx\firstarg\xendsetuptable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2080 \let\go = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2081 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2082 \ifx\firstarg\xcolumnfractions
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2083 \global\setpercenttrue
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2084 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2085 \ifsetpercent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2086 \let\go\pickupwholefraction
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2087 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2088 \global\advance\colcount by 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2089 \setbox0=\hbox{#1\unskip }% Add a normal word space as a separator;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2090 % typically that is always in the input, anyway.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2091 \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2092 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2093 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2094 \ifx\go\pickupwholefraction
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2095 % Put the argument back for the \pickupwholefraction call, so
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2096 % we'll always have a period there to be parsed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2097 \def\go{\pickupwholefraction#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2098 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2099 \let\go = \setuptable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2100 \fi%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2101 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2102 \go
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2103 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2104
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2105 % This used to have \hskip1sp. But then the space in a template line is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2106 % not enough. That is bad. So let's go back to just & until we
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2107 % encounter the problem it was intended to solve again.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2108 % --karl, nathan@acm.org, 20apr99.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2109 \def\tab{&}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2110
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2111 % @multitable ... @end multitable definitions:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2112 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2113 \def\multitable{\parsearg\dotable}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2114 \def\dotable#1{\bgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2115 \vskip\parskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2116 \let\item\crcr
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2117 \tolerance=9500
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2118 \hbadness=9500
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2119 \setmultitablespacing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2120 \parskip=\multitableparskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2121 \parindent=\multitableparindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2122 \overfullrule=0pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2123 \global\colcount=0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2124 \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2125 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2126 % To parse everything between @multitable and @item:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2127 \setuptable#1 \endsetuptable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2128 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2129 % \everycr will reset column counter, \colcount, at the end of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2130 % each line. Every column entry will cause \colcount to advance by one.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2131 % The table preamble
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2132 % looks at the current \colcount to find the correct column width.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2133 \everycr{\noalign{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2134 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2135 % \filbreak%% keeps underfull box messages off when table breaks over pages.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2136 % Maybe so, but it also creates really weird page breaks when the table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2137 % breaks over pages. Wouldn't \vfil be better? Wait until the problem
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2138 % manifests itself, so it can be fixed for real --karl.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2139 \global\colcount=0\relax}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2140 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2141 % This preamble sets up a generic column definition, which will
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2142 % be used as many times as user calls for columns.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2143 % \vtop will set a single line and will also let text wrap and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2144 % continue for many paragraphs if desired.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2145 \halign\bgroup&\global\advance\colcount by 1\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2146 \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2147 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2148 % In order to keep entries from bumping into each other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2149 % we will add a \leftskip of \multitablecolspace to all columns after
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2150 % the first one.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2151 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2152 % If a template has been used, we will add \multitablecolspace
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2153 % to the width of each template entry.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2154 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2155 % If the user has set preamble in terms of percent of \hsize we will
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2156 % use that dimension as the width of the column, and the \leftskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2157 % will keep entries from bumping into each other. Table will start at
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2158 % left margin and final column will justify at right margin.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2159 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2160 % Make sure we don't inherit \rightskip from the outer environment.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2161 \rightskip=0pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2162 \ifnum\colcount=1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2163 % The first column will be indented with the surrounding text.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2164 \advance\hsize by\leftskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2165 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2166 \ifsetpercent \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2167 % If user has not set preamble in terms of percent of \hsize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2168 % we will advance \hsize by \multitablecolspace.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2169 \advance\hsize by \multitablecolspace
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2170 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2171 % In either case we will make \leftskip=\multitablecolspace:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2172 \leftskip=\multitablecolspace
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2173 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2174 % Ignoring space at the beginning and end avoids an occasional spurious
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2175 % blank line, when TeX decides to break the line at the space before the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2176 % box from the multistrut, so the strut ends up on a line by itself.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2177 % For example:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2178 % @multitable @columnfractions .11 .89
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2179 % @item @code{#}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2180 % @tab Legal holiday which is valid in major parts of the whole country.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2181 % Is automatically provided with highlighting sequences respectively marking
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2182 % characters.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2183 \noindent\ignorespaces##\unskip\multistrut}\cr
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2184 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2185
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2186 \def\setmultitablespacing{% test to see if user has set \multitablelinespace.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2187 % If so, do nothing. If not, give it an appropriate dimension based on
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2188 % current baselineskip.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2189 \ifdim\multitablelinespace=0pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2190 \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2191 \global\advance\multitablelinespace by-\ht0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2192 %% strut to put in table in case some entry doesn't have descenders,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2193 %% to keep lines equally spaced
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2194 \let\multistrut = \strut
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2195 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2196 %% FIXME: what is \box0 supposed to be?
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2197 \gdef\multistrut{\vrule height\multitablelinespace depth\dp0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2198 width0pt\relax} \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2199 %% Test to see if parskip is larger than space between lines of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2200 %% table. If not, do nothing.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2201 %% If so, set to same dimension as multitablelinespace.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2202 \ifdim\multitableparskip>\multitablelinespace
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2203 \global\multitableparskip=\multitablelinespace
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2204 \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2205 %% than skip between lines in the table.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2206 \fi%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2207 \ifdim\multitableparskip=0pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2208 \global\multitableparskip=\multitablelinespace
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2209 \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2210 %% than skip between lines in the table.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2211 \fi}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2212
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2213
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2214 \message{conditionals,}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2215 % Prevent errors for section commands.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2216 % Used in @ignore and in failing conditionals.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2217 \def\ignoresections{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2218 \let\chapter=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2219 \let\unnumbered=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2220 \let\top=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2221 \let\unnumberedsec=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2222 \let\unnumberedsection=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2223 \let\unnumberedsubsec=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2224 \let\unnumberedsubsection=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2225 \let\unnumberedsubsubsec=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2226 \let\unnumberedsubsubsection=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2227 \let\section=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2228 \let\subsec=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2229 \let\subsubsec=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2230 \let\subsection=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2231 \let\subsubsection=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2232 \let\appendix=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2233 \let\appendixsec=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2234 \let\appendixsection=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2235 \let\appendixsubsec=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2236 \let\appendixsubsection=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2237 \let\appendixsubsubsec=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2238 \let\appendixsubsubsection=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2239 \let\contents=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2240 \let\smallbook=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2241 \let\titlepage=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2242 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2243
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2244 % Used in nested conditionals, where we have to parse the Texinfo source
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2245 % and so want to turn off most commands, in case they are used
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2246 % incorrectly.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2247 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2248 \def\ignoremorecommands{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2249 \let\defcodeindex = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2250 \let\defcv = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2251 \let\deffn = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2252 \let\deffnx = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2253 \let\defindex = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2254 \let\defivar = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2255 \let\defmac = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2256 \let\defmethod = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2257 \let\defop = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2258 \let\defopt = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2259 \let\defspec = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2260 \let\deftp = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2261 \let\deftypefn = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2262 \let\deftypefun = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2263 \let\deftypeivar = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2264 \let\deftypeop = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2265 \let\deftypevar = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2266 \let\deftypevr = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2267 \let\defun = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2268 \let\defvar = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2269 \let\defvr = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2270 \let\ref = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2271 \let\xref = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2272 \let\printindex = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2273 \let\pxref = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2274 \let\settitle = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2275 \let\setchapternewpage = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2276 \let\setchapterstyle = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2277 \let\everyheading = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2278 \let\evenheading = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2279 \let\oddheading = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2280 \let\everyfooting = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2281 \let\evenfooting = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2282 \let\oddfooting = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2283 \let\headings = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2284 \let\include = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2285 \let\lowersections = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2286 \let\down = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2287 \let\raisesections = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2288 \let\up = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2289 \let\set = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2290 \let\clear = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2291 \let\item = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2292 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2293
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2294 % Ignore @ignore ... @end ignore.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2295 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2296 \def\ignore{\doignore{ignore}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2297
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2298 % Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2299 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2300 \def\ifinfo{\doignore{ifinfo}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2301 \def\ifhtml{\doignore{ifhtml}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2302 \def\ifnottex{\doignore{ifnottex}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2303 \def\html{\doignore{html}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2304 \def\menu{\doignore{menu}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2305 \def\direntry{\doignore{direntry}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2306
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2307 % @dircategory CATEGORY -- specify a category of the dir file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2308 % which this file should belong to. Ignore this in TeX.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2309 \let\dircategory = \comment
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2310
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2311 % Ignore text until a line `@end #1'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2312 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2313 \def\doignore#1{\begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2314 % Don't complain about control sequences we have declared \outer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2315 \ignoresections
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2316 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2317 % Define a command to swallow text until we reach `@end #1'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2318 % This @ is a catcode 12 token (that is the normal catcode of @ in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2319 % this texinfo.tex file). We change the catcode of @ below to match.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2320 \long\def\doignoretext##1@end #1{\enddoignore}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2321 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2322 % Make sure that spaces turn into tokens that match what \doignoretext wants.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2323 \catcode32 = 10
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2324 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2325 % Ignore braces, too, so mismatched braces don't cause trouble.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2326 \catcode`\{ = 9
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2327 \catcode`\} = 9
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2328 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2329 % We must not have @c interpreted as a control sequence.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2330 \catcode`\@ = 12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2331 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2332 % Make the letter c a comment character so that the rest of the line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2333 % will be ignored. This way, the document can have (for example)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2334 % @c @end ifinfo
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2335 % and the @end ifinfo will be properly ignored.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2336 % (We've just changed @ to catcode 12.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2337 \catcode`\c = 14
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2338 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2339 % And now expand that command.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2340 \doignoretext
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2341 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2342
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2343 % What we do to finish off ignored text.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2344 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2345 \def\enddoignore{\endgroup\ignorespaces}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2346
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2347 \newif\ifwarnedobs\warnedobsfalse
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2348 \def\obstexwarn{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2349 \ifwarnedobs\relax\else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2350 % We need to warn folks that they may have trouble with TeX 3.0.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2351 % This uses \immediate\write16 rather than \message to get newlines.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2352 \immediate\write16{}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2353 \immediate\write16{WARNING: for users of Unix TeX 3.0!}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2354 \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2355 \immediate\write16{If you are running another version of TeX, relax.}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2356 \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2357 \immediate\write16{ Then upgrade your TeX installation if you can.}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2358 \immediate\write16{ (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2359 \immediate\write16{If you are stuck with version 3.0, run the}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2360 \immediate\write16{ script ``tex3patch'' from the Texinfo distribution}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2361 \immediate\write16{ to use a workaround.}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2362 \immediate\write16{}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2363 \global\warnedobstrue
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2364 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2365 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2366
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2367 % **In TeX 3.0, setting text in \nullfont hangs tex. For a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2368 % workaround (which requires the file ``dummy.tfm'' to be installed),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2369 % uncomment the following line:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2370 %%%%%\font\nullfont=dummy\let\obstexwarn=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2371
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2372 % Ignore text, except that we keep track of conditional commands for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2373 % purposes of nesting, up to an `@end #1' command.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2374 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2375 \def\nestedignore#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2376 \obstexwarn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2377 % We must actually expand the ignored text to look for the @end
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2378 % command, so that nested ignore constructs work. Thus, we put the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2379 % text into a \vbox and then do nothing with the result. To minimize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2380 % the change of memory overflow, we follow the approach outlined on
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2381 % page 401 of the TeXbook: make the current font be a dummy font.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2382 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2383 \setbox0 = \vbox\bgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2384 % Don't complain about control sequences we have declared \outer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2385 \ignoresections
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2386 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2387 % Define `@end #1' to end the box, which will in turn undefine the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2388 % @end command again.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2389 \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2390 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2391 % We are going to be parsing Texinfo commands. Most cause no
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2392 % trouble when they are used incorrectly, but some commands do
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2393 % complicated argument parsing or otherwise get confused, so we
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2394 % undefine them.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2395 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2396 % We can't do anything about stray @-signs, unfortunately;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2397 % they'll produce `undefined control sequence' errors.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2398 \ignoremorecommands
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2399 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2400 % Set the current font to be \nullfont, a TeX primitive, and define
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2401 % all the font commands to also use \nullfont. We don't use
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2402 % dummy.tfm, as suggested in the TeXbook, because not all sites
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2403 % might have that installed. Therefore, math mode will still
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2404 % produce output, but that should be an extremely small amount of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2405 % stuff compared to the main input.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2406 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2407 \nullfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2408 \let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2409 \let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2410 \let\tensf=\nullfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2411 % Similarly for index fonts (mostly for their use in smallexample).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2412 \let\smallrm=\nullfont \let\smallit=\nullfont \let\smallsl=\nullfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2413 \let\smallbf=\nullfont \let\smalltt=\nullfont \let\smallsc=\nullfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2414 \let\smallsf=\nullfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2415 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2416 % Don't complain when characters are missing from the fonts.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2417 \tracinglostchars = 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2418 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2419 % Don't bother to do space factor calculations.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2420 \frenchspacing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2421 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2422 % Don't report underfull hboxes.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2423 \hbadness = 10000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2424 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2425 % Do minimal line-breaking.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2426 \pretolerance = 10000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2427 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2428 % Do not execute instructions in @tex
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2429 \def\tex{\doignore{tex}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2430 % Do not execute macro definitions.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2431 % `c' is a comment character, so the word `macro' will get cut off.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2432 \def\macro{\doignore{ma}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2433 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2434
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2435 % @set VAR sets the variable VAR to an empty value.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2436 % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2437 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2438 % Since we want to separate VAR from REST-OF-LINE (which might be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2439 % empty), we can't just use \parsearg; we have to insert a space of our
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2440 % own to delimit the rest of the line, and then take it out again if we
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2441 % didn't need it. Make sure the catcode of space is correct to avoid
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2442 % losing inside @example, for instance.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2443 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2444 \def\set{\begingroup\catcode` =10
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2445 \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2446 \parsearg\setxxx}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2447 \def\setxxx#1{\setyyy#1 \endsetyyy}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2448 \def\setyyy#1 #2\endsetyyy{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2449 \def\temp{#2}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2450 \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2451 \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2452 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2453 \endgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2454 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2455 % Can't use \xdef to pre-expand #2 and save some time, since \temp or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2456 % \next or other control sequences that we've defined might get us into
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2457 % an infinite loop. Consider `@set foo @cite{bar}'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2458 \def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2459
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2460 % @clear VAR clears (i.e., unsets) the variable VAR.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2461 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2462 \def\clear{\parsearg\clearxxx}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2463 \def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2464
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2465 % @value{foo} gets the text saved in variable foo.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2466 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2467 \catcode`\_ = \active
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2468 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2469 % We might end up with active _ or - characters in the argument if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2470 % we're called from @code, as @code{@value{foo-bar_}}. So \let any
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2471 % such active characters to their normal equivalents.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2472 \gdef\value{\begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2473 \catcode`\-=12 \catcode`\_=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2474 \indexbreaks \let_\normalunderscore
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2475 \valuexxx}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2476 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2477 \def\valuexxx#1{\expandablevalue{#1}\endgroup}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2478
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2479 % We have this subroutine so that we can handle at least some @value's
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2480 % properly in indexes (we \let\value to this in \indexdummies). Ones
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2481 % whose names contain - or _ still won't work, but we can't do anything
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2482 % about that. The command has to be fully expandable, since the result
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2483 % winds up in the index file. This means that if the variable's value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2484 % contains other Texinfo commands, it's almost certain it will fail
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2485 % (although perhaps we could fix that with sufficient work to do a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2486 % one-level expansion on the result, instead of complete).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2487 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2488 \def\expandablevalue#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2489 \expandafter\ifx\csname SET#1\endcsname\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2490 {[No value for ``#1'']}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2491 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2492 \csname SET#1\endcsname
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2493 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2494 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2495
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2496 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2497 % with @set.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2498 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2499 \def\ifset{\parsearg\ifsetxxx}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2500 \def\ifsetxxx #1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2501 \expandafter\ifx\csname SET#1\endcsname\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2502 \expandafter\ifsetfail
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2503 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2504 \expandafter\ifsetsucceed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2505 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2506 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2507 \def\ifsetsucceed{\conditionalsucceed{ifset}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2508 \def\ifsetfail{\nestedignore{ifset}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2509 \defineunmatchedend{ifset}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2510
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2511 % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2512 % defined with @set, or has been undefined with @clear.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2513 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2514 \def\ifclear{\parsearg\ifclearxxx}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2515 \def\ifclearxxx #1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2516 \expandafter\ifx\csname SET#1\endcsname\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2517 \expandafter\ifclearsucceed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2518 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2519 \expandafter\ifclearfail
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2520 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2521 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2522 \def\ifclearsucceed{\conditionalsucceed{ifclear}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2523 \def\ifclearfail{\nestedignore{ifclear}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2524 \defineunmatchedend{ifclear}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2525
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2526 % @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2527 % following, through the first @end iftex (etc.). Make `@end iftex'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2528 % (etc.) valid only after an @iftex.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2529 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2530 \def\iftex{\conditionalsucceed{iftex}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2531 \def\ifnothtml{\conditionalsucceed{ifnothtml}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2532 \def\ifnotinfo{\conditionalsucceed{ifnotinfo}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2533 \defineunmatchedend{iftex}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2534 \defineunmatchedend{ifnothtml}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2535 \defineunmatchedend{ifnotinfo}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2536
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2537 % We can't just want to start a group at @iftex (for example) and end it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2538 % at @end iftex, since then @set commands inside the conditional have no
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2539 % effect (they'd get reverted at the end of the group). So we must
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2540 % define \Eiftex to redefine itself to be its previous value. (We can't
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2541 % just define it to fail again with an ``unmatched end'' error, since
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2542 % the @ifset might be nested.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2543 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2544 \def\conditionalsucceed#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2545 \edef\temp{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2546 % Remember the current value of \E#1.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2547 \let\nece{prevE#1} = \nece{E#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2548 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2549 % At the `@end #1', redefine \E#1 to be its previous value.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2550 \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2551 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2552 \temp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2553 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2554
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2555 % We need to expand lots of \csname's, but we don't want to expand the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2556 % control sequences after we've constructed them.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2557 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2558 \def\nece#1{\expandafter\noexpand\csname#1\endcsname}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2559
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2560 % @defininfoenclose.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2561 \let\definfoenclose=\comment
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2562
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2563
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2564 \message{indexing,}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2565 % Index generation facilities
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2566
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2567 % Define \newwrite to be identical to plain tex's \newwrite
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2568 % except not \outer, so it can be used within \newindex.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2569 {\catcode`\@=11
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2570 \gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2571
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2572 % \newindex {foo} defines an index named foo.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2573 % It automatically defines \fooindex such that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2574 % \fooindex ...rest of line... puts an entry in the index foo.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2575 % It also defines \fooindfile to be the number of the output channel for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2576 % the file that accumulates this index. The file's extension is foo.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2577 % The name of an index should be no more than 2 characters long
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2578 % for the sake of vms.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2579 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2580 \def\newindex#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2581 \iflinks
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2582 \expandafter\newwrite \csname#1indfile\endcsname
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2583 \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2584 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2585 \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2586 \noexpand\doindex{#1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2587 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2588
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2589 % @defindex foo == \newindex{foo}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2590
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2591 \def\defindex{\parsearg\newindex}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2592
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2593 % Define @defcodeindex, like @defindex except put all entries in @code.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2594
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2595 \def\newcodeindex#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2596 \iflinks
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2597 \expandafter\newwrite \csname#1indfile\endcsname
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2598 \openout \csname#1indfile\endcsname \jobname.#1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2599 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2600 \expandafter\xdef\csname#1index\endcsname{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2601 \noexpand\docodeindex{#1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2602 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2603
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2604 \def\defcodeindex{\parsearg\newcodeindex}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2605
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2606 % @synindex foo bar makes index foo feed into index bar.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2607 % Do this instead of @defindex foo if you don't want it as a separate index.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2608 % The \closeout helps reduce unnecessary open files; the limit on the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2609 % Acorn RISC OS is a mere 16 files.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2610 \def\synindex#1 #2 {%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2611 \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2612 \expandafter\closeout\csname#1indfile\endcsname
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2613 \expandafter\let\csname#1indfile\endcsname=\synindexfoo
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2614 \expandafter\xdef\csname#1index\endcsname{% define \xxxindex
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2615 \noexpand\doindex{#2}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2616 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2617
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2618 % @syncodeindex foo bar similar, but put all entries made for index foo
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2619 % inside @code.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2620 \def\syncodeindex#1 #2 {%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2621 \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2622 \expandafter\closeout\csname#1indfile\endcsname
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2623 \expandafter\let\csname#1indfile\endcsname=\synindexfoo
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2624 \expandafter\xdef\csname#1index\endcsname{% define \xxxindex
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2625 \noexpand\docodeindex{#2}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2626 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2627
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2628 % Define \doindex, the driver for all \fooindex macros.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2629 % Argument #1 is generated by the calling \fooindex macro,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2630 % and it is "foo", the name of the index.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2631
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2632 % \doindex just uses \parsearg; it calls \doind for the actual work.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2633 % This is because \doind is more useful to call from other macros.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2634
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2635 % There is also \dosubind {index}{topic}{subtopic}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2636 % which makes an entry in a two-level index such as the operation index.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2637
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2638 \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2639 \def\singleindexer #1{\doind{\indexname}{#1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2640
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2641 % like the previous two, but they put @code around the argument.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2642 \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2643 \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2644
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2645 \def\indexdummies{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2646 \def\ { }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2647 % Take care of the plain tex accent commands.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2648 \def\"{\realbackslash "}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2649 \def\`{\realbackslash `}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2650 \def\'{\realbackslash '}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2651 \def\^{\realbackslash ^}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2652 \def\~{\realbackslash ~}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2653 \def\={\realbackslash =}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2654 \def\b{\realbackslash b}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2655 \def\c{\realbackslash c}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2656 \def\d{\realbackslash d}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2657 \def\u{\realbackslash u}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2658 \def\v{\realbackslash v}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2659 \def\H{\realbackslash H}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2660 % Take care of the plain tex special European modified letters.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2661 \def\oe{\realbackslash oe}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2662 \def\ae{\realbackslash ae}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2663 \def\aa{\realbackslash aa}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2664 \def\OE{\realbackslash OE}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2665 \def\AE{\realbackslash AE}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2666 \def\AA{\realbackslash AA}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2667 \def\o{\realbackslash o}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2668 \def\O{\realbackslash O}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2669 \def\l{\realbackslash l}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2670 \def\L{\realbackslash L}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2671 \def\ss{\realbackslash ss}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2672 % Take care of texinfo commands likely to appear in an index entry.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2673 % (Must be a way to avoid doing expansion at all, and thus not have to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2674 % laboriously list every single command here.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2675 \def\@{@}% will be @@ when we switch to @ as escape char.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2676 % Need these in case \tex is in effect and \{ is a \delimiter again.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2677 % But can't use \lbracecmd and \rbracecmd because texindex assumes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2678 % braces and backslashes are used only as delimiters.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2679 \let\{ = \mylbrace
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2680 \let\} = \myrbrace
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2681 \def\_{{\realbackslash _}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2682 \def\w{\realbackslash w }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2683 \def\bf{\realbackslash bf }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2684 %\def\rm{\realbackslash rm }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2685 \def\sl{\realbackslash sl }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2686 \def\sf{\realbackslash sf}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2687 \def\tt{\realbackslash tt}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2688 \def\gtr{\realbackslash gtr}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2689 \def\less{\realbackslash less}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2690 \def\hat{\realbackslash hat}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2691 \def\TeX{\realbackslash TeX}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2692 \def\dots{\realbackslash dots }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2693 \def\result{\realbackslash result}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2694 \def\equiv{\realbackslash equiv}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2695 \def\expansion{\realbackslash expansion}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2696 \def\print{\realbackslash print}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2697 \def\error{\realbackslash error}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2698 \def\point{\realbackslash point}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2699 \def\copyright{\realbackslash copyright}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2700 \def\tclose##1{\realbackslash tclose {##1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2701 \def\code##1{\realbackslash code {##1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2702 \def\uref##1{\realbackslash uref {##1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2703 \def\url##1{\realbackslash url {##1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2704 \def\env##1{\realbackslash env {##1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2705 \def\command##1{\realbackslash command {##1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2706 \def\option##1{\realbackslash option {##1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2707 \def\dotless##1{\realbackslash dotless {##1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2708 \def\samp##1{\realbackslash samp {##1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2709 \def\,##1{\realbackslash ,{##1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2710 \def\t##1{\realbackslash t {##1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2711 \def\r##1{\realbackslash r {##1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2712 \def\i##1{\realbackslash i {##1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2713 \def\b##1{\realbackslash b {##1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2714 \def\sc##1{\realbackslash sc {##1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2715 \def\cite##1{\realbackslash cite {##1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2716 \def\key##1{\realbackslash key {##1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2717 \def\file##1{\realbackslash file {##1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2718 \def\var##1{\realbackslash var {##1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2719 \def\kbd##1{\realbackslash kbd {##1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2720 \def\dfn##1{\realbackslash dfn {##1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2721 \def\emph##1{\realbackslash emph {##1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2722 \def\acronym##1{\realbackslash acronym {##1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2723 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2724 % Handle some cases of @value -- where the variable name does not
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2725 % contain - or _, and the value does not contain any
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2726 % (non-fully-expandable) commands.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2727 \let\value = \expandablevalue
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2728 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2729 \unsepspaces
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2730 % Turn off macro expansion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2731 \turnoffmacros
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2732 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2733
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2734 % If an index command is used in an @example environment, any spaces
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2735 % therein should become regular spaces in the raw index file, not the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2736 % expansion of \tie (\\leavevmode \penalty \@M \ ).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2737 {\obeyspaces
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2738 \gdef\unsepspaces{\obeyspaces\let =\space}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2739
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2740 % \indexnofonts no-ops all font-change commands.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2741 % This is used when outputting the strings to sort the index by.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2742 \def\indexdummyfont#1{#1}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2743 \def\indexdummytex{TeX}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2744 \def\indexdummydots{...}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2745
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2746 \def\indexnofonts{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2747 % Just ignore accents.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2748 \let\,=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2749 \let\"=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2750 \let\`=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2751 \let\'=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2752 \let\^=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2753 \let\~=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2754 \let\==\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2755 \let\b=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2756 \let\c=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2757 \let\d=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2758 \let\u=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2759 \let\v=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2760 \let\H=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2761 \let\dotless=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2762 % Take care of the plain tex special European modified letters.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2763 \def\oe{oe}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2764 \def\ae{ae}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2765 \def\aa{aa}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2766 \def\OE{OE}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2767 \def\AE{AE}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2768 \def\AA{AA}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2769 \def\o{o}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2770 \def\O{O}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2771 \def\l{l}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2772 \def\L{L}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2773 \def\ss{ss}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2774 \let\w=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2775 \let\t=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2776 \let\r=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2777 \let\i=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2778 \let\b=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2779 \let\emph=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2780 \let\strong=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2781 \let\cite=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2782 \let\sc=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2783 %Don't no-op \tt, since it isn't a user-level command
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2784 % and is used in the definitions of the active chars like <, >, |...
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2785 %\let\tt=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2786 \let\tclose=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2787 \let\code=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2788 \let\url=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2789 \let\uref=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2790 \let\env=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2791 \let\acronym=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2792 \let\command=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2793 \let\option=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2794 \let\file=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2795 \let\samp=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2796 \let\kbd=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2797 \let\key=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2798 \let\var=\indexdummyfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2799 \let\TeX=\indexdummytex
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2800 \let\dots=\indexdummydots
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2801 \def\@{@}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2802 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2803
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2804 % To define \realbackslash, we must make \ not be an escape.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2805 % We must first make another character (@) an escape
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2806 % so we do not become unable to do a definition.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2807
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2808 {\catcode`\@=0 \catcode`\\=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2809 @gdef@realbackslash{\}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2810
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2811 \let\indexbackslash=0 %overridden during \printindex.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2812 \let\SETmarginindex=\relax % put index entries in margin (undocumented)?
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2813
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2814 % For \ifx comparisons.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2815 \def\emptymacro{\empty}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2816
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2817 % Most index entries go through here, but \dosubind is the general case.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2818 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2819 \def\doind#1#2{\dosubind{#1}{#2}\empty}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2820
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2821 % Workhorse for all \fooindexes.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2822 % #1 is name of index, #2 is stuff to put there, #3 is subentry --
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2823 % \empty if called from \doind, as we usually are. The main exception
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2824 % is with defuns, which call us directly.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2825 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2826 \def\dosubind#1#2#3{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2827 % Put the index entry in the margin if desired.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2828 \ifx\SETmarginindex\relax\else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2829 \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2830 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2831 {%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2832 \count255=\lastpenalty
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2833 {%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2834 \indexdummies % Must do this here, since \bf, etc expand at this stage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2835 \escapechar=`\\
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2836 {%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2837 \let\folio = 0% We will expand all macros now EXCEPT \folio.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2838 \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2839 % so it will be output as is; and it will print as backslash.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2840 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2841 \def\thirdarg{#3}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2842 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2843 % If third arg is present, precede it with space in sort key.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2844 \ifx\thirdarg\emptymacro
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2845 \let\subentry = \empty
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2846 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2847 \def\subentry{ #3}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2848 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2849 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2850 % First process the index entry with all font commands turned
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2851 % off to get the string to sort by.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2852 {\indexnofonts \xdef\indexsorttmp{#2\subentry}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2853 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2854 % Now the real index entry with the fonts.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2855 \toks0 = {#2}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2856 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2857 % If third (subentry) arg is present, add it to the index
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2858 % string. And include a space.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2859 \ifx\thirdarg\emptymacro \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2860 \toks0 = \expandafter{\the\toks0 \space #3}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2861 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2862 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2863 % Set up the complete index entry, with both the sort key
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2864 % and the original text, including any font commands. We write
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2865 % three arguments to \entry to the .?? file, texindex reduces to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2866 % two when writing the .??s sorted result.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2867 \edef\temp{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2868 \write\csname#1indfile\endcsname{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2869 \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2870 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2871 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2872 % If a skip is the last thing on the list now, preserve it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2873 % by backing up by \lastskip, doing the \write, then inserting
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2874 % the skip again. Otherwise, the whatsit generated by the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2875 % \write will make \lastskip zero. The result is that sequences
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2876 % like this:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2877 % @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2878 % @tindex whatever
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2879 % @defun ...
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2880 % will have extra space inserted, because the \medbreak in the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2881 % start of the @defun won't see the skip inserted by the @end of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2882 % the previous defun.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2883 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2884 % But don't do any of this if we're not in vertical mode. We
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2885 % don't want to do a \vskip and prematurely end a paragraph.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2886 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2887 % Avoid page breaks due to these extra skips, too.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2888 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2889 \iflinks
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2890 \ifvmode
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2891 \skip0 = \lastskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2892 \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2893 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2894 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2895 \temp % do the write
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2896 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2897 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2898 \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2899 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2900 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2901 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2902 \penalty\count255
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2903 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2904 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2905
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2906 % The index entry written in the file actually looks like
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2907 % \entry {sortstring}{page}{topic}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2908 % or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2909 % \entry {sortstring}{page}{topic}{subtopic}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2910 % The texindex program reads in these files and writes files
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2911 % containing these kinds of lines:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2912 % \initial {c}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2913 % before the first topic whose initial is c
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2914 % \entry {topic}{pagelist}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2915 % for a topic that is used without subtopics
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2916 % \primary {topic}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2917 % for the beginning of a topic that is used with subtopics
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2918 % \secondary {subtopic}{pagelist}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2919 % for each subtopic.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2920
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2921 % Define the user-accessible indexing commands
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2922 % @findex, @vindex, @kindex, @cindex.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2923
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2924 \def\findex {\fnindex}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2925 \def\kindex {\kyindex}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2926 \def\cindex {\cpindex}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2927 \def\vindex {\vrindex}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2928 \def\tindex {\tpindex}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2929 \def\pindex {\pgindex}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2930
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2931 \def\cindexsub {\begingroup\obeylines\cindexsub}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2932 {\obeylines %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2933 \gdef\cindexsub "#1" #2^^M{\endgroup %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2934 \dosubind{cp}{#2}{#1}}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2935
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2936 % Define the macros used in formatting output of the sorted index material.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2937
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2938 % @printindex causes a particular index (the ??s file) to get printed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2939 % It does not print any chapter heading (usually an @unnumbered).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2940 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2941 \def\printindex{\parsearg\doprintindex}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2942 \def\doprintindex#1{\begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2943 \dobreak \chapheadingskip{10000}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2944 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2945 \smallfonts \rm
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2946 \tolerance = 9500
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2947 \indexbreaks
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2948 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2949 % See if the index file exists and is nonempty.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2950 % Change catcode of @ here so that if the index file contains
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2951 % \initial {@}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2952 % as its first line, TeX doesn't complain about mismatched braces
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2953 % (because it thinks @} is a control sequence).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2954 \catcode`\@ = 11
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2955 \openin 1 \jobname.#1s
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2956 \ifeof 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2957 % \enddoublecolumns gets confused if there is no text in the index,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2958 % and it loses the chapter title and the aux file entries for the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2959 % index. The easiest way to prevent this problem is to make sure
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2960 % there is some text.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2961 \putwordIndexNonexistent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2962 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2963 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2964 % If the index file exists but is empty, then \openin leaves \ifeof
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2965 % false. We have to make TeX try to read something from the file, so
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2966 % it can discover if there is anything in it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2967 \read 1 to \temp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2968 \ifeof 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2969 \putwordIndexIsEmpty
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2970 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2971 % Index files are almost Texinfo source, but we use \ as the escape
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2972 % character. It would be better to use @, but that's too big a change
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2973 % to make right now.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2974 \def\indexbackslash{\rawbackslashxx}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2975 \catcode`\\ = 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2976 \escapechar = `\\
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2977 \begindoublecolumns
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2978 \input \jobname.#1s
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2979 \enddoublecolumns
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2980 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2981 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2982 \closein 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2983 \endgroup}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2984
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2985 % These macros are used by the sorted index file itself.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2986 % Change them to control the appearance of the index.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2987
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2988 \def\initial#1{{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2989 % Some minor font changes for the special characters.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2990 \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2991 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2992 % Remove any glue we may have, we'll be inserting our own.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2993 \removelastskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2994 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2995 % We like breaks before the index initials, so insert a bonus.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2996 \penalty -300
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2997 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2998 % Typeset the initial. Making this add up to a whole number of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2999 % baselineskips increases the chance of the dots lining up from column
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3000 % to column. It still won't often be perfect, because of the stretch
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3001 % we need before each entry, but it's better.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3002 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3003 % No shrink because it confuses \balancecolumns.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3004 \vskip 1.67\baselineskip plus .5\baselineskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3005 \leftline{\secbf #1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3006 \vskip .33\baselineskip plus .1\baselineskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3007 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3008 % Do our best not to break after the initial.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3009 \nobreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3010 }}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3011
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3012 % This typesets a paragraph consisting of #1, dot leaders, and then #2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3013 % flush to the right margin. It is used for index and table of contents
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3014 % entries. The paragraph is indented by \leftskip.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3015 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3016 \def\entry#1#2{\begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3017 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3018 % Start a new paragraph if necessary, so our assignments below can't
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3019 % affect previous text.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3020 \par
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3021 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3022 % Do not fill out the last line with white space.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3023 \parfillskip = 0in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3024 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3025 % No extra space above this paragraph.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3026 \parskip = 0in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3027 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3028 % Do not prefer a separate line ending with a hyphen to fewer lines.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3029 \finalhyphendemerits = 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3030 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3031 % \hangindent is only relevant when the entry text and page number
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3032 % don't both fit on one line. In that case, bob suggests starting the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3033 % dots pretty far over on the line. Unfortunately, a large
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3034 % indentation looks wrong when the entry text itself is broken across
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3035 % lines. So we use a small indentation and put up with long leaders.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3036 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3037 % \hangafter is reset to 1 (which is the value we want) at the start
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3038 % of each paragraph, so we need not do anything with that.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3039 \hangindent = 2em
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3040 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3041 % When the entry text needs to be broken, just fill out the first line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3042 % with blank space.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3043 \rightskip = 0pt plus1fil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3044 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3045 % A bit of stretch before each entry for the benefit of balancing columns.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3046 \vskip 0pt plus1pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3047 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3048 % Start a ``paragraph'' for the index entry so the line breaking
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3049 % parameters we've set above will have an effect.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3050 \noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3051 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3052 % Insert the text of the index entry. TeX will do line-breaking on it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3053 #1%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3054 % The following is kludged to not output a line of dots in the index if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3055 % there are no page numbers. The next person who breaks this will be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3056 % cursed by a Unix daemon.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3057 \def\tempa{{\rm }}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3058 \def\tempb{#2}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3059 \edef\tempc{\tempa}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3060 \edef\tempd{\tempb}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3061 \ifx\tempc\tempd\ \else%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3062 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3063 % If we must, put the page number on a line of its own, and fill out
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3064 % this line with blank space. (The \hfil is overwhelmed with the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3065 % fill leaders glue in \indexdotfill if the page number does fit.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3066 \hfil\penalty50
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3067 \null\nobreak\indexdotfill % Have leaders before the page number.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3068 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3069 % The `\ ' here is removed by the implicit \unskip that TeX does as
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3070 % part of (the primitive) \par. Without it, a spurious underfull
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3071 % \hbox ensues.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3072 \ifpdf
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3073 \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3074 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3075 \ #2% The page number ends the paragraph.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3076 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3077 \fi%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3078 \par
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3079 \endgroup}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3080
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3081 % Like \dotfill except takes at least 1 em.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3082 \def\indexdotfill{\cleaders
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3083 \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3084
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3085 \def\primary #1{\line{#1\hfil}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3086
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3087 \newskip\secondaryindent \secondaryindent=0.5cm
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3088
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3089 \def\secondary #1#2{
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3090 {\parfillskip=0in \parskip=0in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3091 \hangindent =1in \hangafter=1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3092 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3093 }}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3094
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3095 % Define two-column mode, which we use to typeset indexes.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3096 % Adapted from the TeXbook, page 416, which is to say,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3097 % the manmac.tex format used to print the TeXbook itself.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3098 \catcode`\@=11
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3099
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3100 \newbox\partialpage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3101 \newdimen\doublecolumnhsize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3102
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3103 \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3104 % Grab any single-column material above us.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3105 \output = {%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3106 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3107 % Here is a possibility not foreseen in manmac: if we accumulate a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3108 % whole lot of material, we might end up calling this \output
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3109 % routine twice in a row (see the doublecol-lose test, which is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3110 % essentially a couple of indexes with @setchapternewpage off). In
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3111 % that case we just ship out what is in \partialpage with the normal
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3112 % output routine. Generally, \partialpage will be empty when this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3113 % runs and this will be a no-op. See the indexspread.tex test case.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3114 \ifvoid\partialpage \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3115 \onepageout{\pagecontents\partialpage}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3116 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3117 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3118 \global\setbox\partialpage = \vbox{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3119 % Unvbox the main output page.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3120 \unvbox\PAGE
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3121 \kern-\topskip \kern\baselineskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3122 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3123 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3124 \eject % run that output routine to set \partialpage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3125 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3126 % Use the double-column output routine for subsequent pages.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3127 \output = {\doublecolumnout}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3128 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3129 % Change the page size parameters. We could do this once outside this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3130 % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3131 % format, but then we repeat the same computation. Repeating a couple
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3132 % of assignments once per index is clearly meaningless for the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3133 % execution time, so we may as well do it in one place.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3134 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3135 % First we halve the line length, less a little for the gutter between
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3136 % the columns. We compute the gutter based on the line length, so it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3137 % changes automatically with the paper format. The magic constant
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3138 % below is chosen so that the gutter has the same value (well, +-<1pt)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3139 % as it did when we hard-coded it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3140 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3141 % We put the result in a separate register, \doublecolumhsize, so we
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3142 % can restore it in \pagesofar, after \hsize itself has (potentially)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3143 % been clobbered.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3144 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3145 \doublecolumnhsize = \hsize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3146 \advance\doublecolumnhsize by -.04154\hsize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3147 \divide\doublecolumnhsize by 2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3148 \hsize = \doublecolumnhsize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3149 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3150 % Double the \vsize as well. (We don't need a separate register here,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3151 % since nobody clobbers \vsize.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3152 \advance\vsize by -\ht\partialpage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3153 \vsize = 2\vsize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3154 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3155
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3156 % The double-column output routine for all double-column pages except
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3157 % the last.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3158 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3159 \def\doublecolumnout{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3160 \splittopskip=\topskip \splitmaxdepth=\maxdepth
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3161 % Get the available space for the double columns -- the normal
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3162 % (undoubled) page height minus any material left over from the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3163 % previous page.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3164 \dimen@ = \vsize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3165 \divide\dimen@ by 2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3166 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3167 % box0 will be the left-hand column, box2 the right.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3168 \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3169 \onepageout\pagesofar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3170 \unvbox255
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3171 \penalty\outputpenalty
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3172 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3173 \def\pagesofar{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3174 % Re-output the contents of the output page -- any previous material,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3175 % followed by the two boxes we just split, in box0 and box2.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3176 \unvbox\partialpage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3177 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3178 \hsize = \doublecolumnhsize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3179 \wd0=\hsize \wd2=\hsize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3180 \hbox to\pagewidth{\box0\hfil\box2}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3181 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3182 \def\enddoublecolumns{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3183 \output = {%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3184 % Split the last of the double-column material. Leave it on the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3185 % current page, no automatic page break.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3186 \balancecolumns
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3187 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3188 % If we end up splitting too much material for the current page,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3189 % though, there will be another page break right after this \output
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3190 % invocation ends. Having called \balancecolumns once, we do not
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3191 % want to call it again. Therefore, reset \output to its normal
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3192 % definition right away. (We hope \balancecolumns will never be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3193 % called on to balance too much material, but if it is, this makes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3194 % the output somewhat more palatable.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3195 \global\output = {\onepageout{\pagecontents\PAGE}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3196 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3197 \eject
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3198 \endgroup % started in \begindoublecolumns
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3199 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3200 % \pagegoal was set to the doubled \vsize above, since we restarted
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3201 % the current page. We're now back to normal single-column
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3202 % typesetting, so reset \pagegoal to the normal \vsize (after the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3203 % \endgroup where \vsize got restored).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3204 \pagegoal = \vsize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3205 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3206 \def\balancecolumns{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3207 % Called at the end of the double column material.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3208 \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3209 \dimen@ = \ht0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3210 \advance\dimen@ by \topskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3211 \advance\dimen@ by-\baselineskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3212 \divide\dimen@ by 2 % target to split to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3213 %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3214 \splittopskip = \topskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3215 % Loop until we get a decent breakpoint.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3216 {%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3217 \vbadness = 10000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3218 \loop
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3219 \global\setbox3 = \copy0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3220 \global\setbox1 = \vsplit3 to \dimen@
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3221 \ifdim\ht3>\dimen@
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3222 \global\advance\dimen@ by 1pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3223 \repeat
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3224 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3225 %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3226 \setbox0=\vbox to\dimen@{\unvbox1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3227 \setbox2=\vbox to\dimen@{\unvbox3}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3228 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3229 \pagesofar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3230 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3231 \catcode`\@ = \other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3232
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3233
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3234 \message{sectioning,}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3235 % Chapters, sections, etc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3236
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3237 \newcount\chapno
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3238 \newcount\secno \secno=0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3239 \newcount\subsecno \subsecno=0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3240 \newcount\subsubsecno \subsubsecno=0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3241
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3242 % This counter is funny since it counts through charcodes of letters A, B, ...
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3243 \newcount\appendixno \appendixno = `\@
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3244 % \def\appendixletter{\char\the\appendixno}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3245 % We do the following for the sake of pdftex, which needs the actual
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3246 % letter in the expansion, not just typeset.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3247 \def\appendixletter{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3248 \ifnum\appendixno=`A A%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3249 \else\ifnum\appendixno=`B B%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3250 \else\ifnum\appendixno=`C C%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3251 \else\ifnum\appendixno=`D D%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3252 \else\ifnum\appendixno=`E E%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3253 \else\ifnum\appendixno=`F F%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3254 \else\ifnum\appendixno=`G G%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3255 \else\ifnum\appendixno=`H H%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3256 \else\ifnum\appendixno=`I I%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3257 \else\ifnum\appendixno=`J J%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3258 \else\ifnum\appendixno=`K K%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3259 \else\ifnum\appendixno=`L L%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3260 \else\ifnum\appendixno=`M M%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3261 \else\ifnum\appendixno=`N N%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3262 \else\ifnum\appendixno=`O O%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3263 \else\ifnum\appendixno=`P P%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3264 \else\ifnum\appendixno=`Q Q%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3265 \else\ifnum\appendixno=`R R%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3266 \else\ifnum\appendixno=`S S%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3267 \else\ifnum\appendixno=`T T%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3268 \else\ifnum\appendixno=`U U%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3269 \else\ifnum\appendixno=`V V%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3270 \else\ifnum\appendixno=`W W%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3271 \else\ifnum\appendixno=`X X%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3272 \else\ifnum\appendixno=`Y Y%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3273 \else\ifnum\appendixno=`Z Z%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3274 % The \the is necessary, despite appearances, because \appendixletter is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3275 % expanded while writing the .toc file. \char\appendixno is not
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3276 % expandable, thus it is written literally, thus all appendixes come out
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3277 % with the same letter (or @) in the toc without it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3278 \else\char\the\appendixno
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3279 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3280 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3281
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3282 % Each @chapter defines this as the name of the chapter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3283 % page headings and footings can use it. @section does likewise.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3284 \def\thischapter{}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3285 \def\thissection{}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3286
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3287 \newcount\absseclevel % used to calculate proper heading level
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3288 \newcount\secbase\secbase=0 % @raise/lowersections modify this count
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3289
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3290 % @raisesections: treat @section as chapter, @subsection as section, etc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3291 \def\raisesections{\global\advance\secbase by -1}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3292 \let\up=\raisesections % original BFox name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3293
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3294 % @lowersections: treat @chapter as section, @section as subsection, etc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3295 \def\lowersections{\global\advance\secbase by 1}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3296 \let\down=\lowersections % original BFox name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3297
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3298 % Choose a numbered-heading macro
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3299 % #1 is heading level if unmodified by @raisesections or @lowersections
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3300 % #2 is text for heading
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3301 \def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3302 \ifcase\absseclevel
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3303 \chapterzzz{#2}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3304 \or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3305 \seczzz{#2}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3306 \or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3307 \numberedsubseczzz{#2}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3308 \or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3309 \numberedsubsubseczzz{#2}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3310 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3311 \ifnum \absseclevel<0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3312 \chapterzzz{#2}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3313 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3314 \numberedsubsubseczzz{#2}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3315 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3316 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3317 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3318
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3319 % like \numhead, but chooses appendix heading levels
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3320 \def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3321 \ifcase\absseclevel
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3322 \appendixzzz{#2}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3323 \or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3324 \appendixsectionzzz{#2}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3325 \or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3326 \appendixsubseczzz{#2}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3327 \or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3328 \appendixsubsubseczzz{#2}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3329 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3330 \ifnum \absseclevel<0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3331 \appendixzzz{#2}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3332 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3333 \appendixsubsubseczzz{#2}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3334 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3335 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3336 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3337
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3338 % like \numhead, but chooses numberless heading levels
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3339 \def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3340 \ifcase\absseclevel
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3341 \unnumberedzzz{#2}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3342 \or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3343 \unnumberedseczzz{#2}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3344 \or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3345 \unnumberedsubseczzz{#2}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3346 \or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3347 \unnumberedsubsubseczzz{#2}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3348 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3349 \ifnum \absseclevel<0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3350 \unnumberedzzz{#2}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3351 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3352 \unnumberedsubsubseczzz{#2}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3353 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3354 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3355 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3356
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3357 % @chapter, @appendix, @unnumbered.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3358 \def\thischaptername{No Chapter Title}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3359 \outer\def\chapter{\parsearg\chapteryyy}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3360 \def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3361 \def\chapterzzz #1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3362 \secno=0 \subsecno=0 \subsubsecno=0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3363 \global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3364 \chapmacro {#1}{\the\chapno}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3365 \gdef\thissection{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3366 \gdef\thischaptername{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3367 % We don't substitute the actual chapter name into \thischapter
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3368 % because we don't want its macros evaluated now.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3369 \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3370 \toks0 = {#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3371 \edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3372 {\the\chapno}}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3373 \temp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3374 \donoderef
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3375 \global\let\section = \numberedsec
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3376 \global\let\subsection = \numberedsubsec
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3377 \global\let\subsubsection = \numberedsubsubsec
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3378 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3379
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3380 \outer\def\appendix{\parsearg\appendixyyy}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3381 \def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3382 \def\appendixzzz #1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3383 \secno=0 \subsecno=0 \subsubsecno=0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3384 \global\advance \appendixno by 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3385 \message{\putwordAppendix\space \appendixletter}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3386 \chapmacro {#1}{\putwordAppendix{} \appendixletter}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3387 \gdef\thissection{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3388 \gdef\thischaptername{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3389 \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3390 \toks0 = {#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3391 \edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3392 {\putwordAppendix{} \appendixletter}}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3393 \temp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3394 \appendixnoderef
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3395 \global\let\section = \appendixsec
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3396 \global\let\subsection = \appendixsubsec
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3397 \global\let\subsubsection = \appendixsubsubsec
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3398 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3399
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3400 % @centerchap is like @unnumbered, but the heading is centered.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3401 \outer\def\centerchap{\parsearg\centerchapyyy}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3402 \def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3403
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3404 % @top is like @unnumbered.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3405 \outer\def\top{\parsearg\unnumberedyyy}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3406
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3407 \outer\def\unnumbered{\parsearg\unnumberedyyy}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3408 \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3409 \def\unnumberedzzz #1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3410 \secno=0 \subsecno=0 \subsubsecno=0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3411 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3412 % This used to be simply \message{#1}, but TeX fully expands the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3413 % argument to \message. Therefore, if #1 contained @-commands, TeX
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3414 % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3415 % expanded @cite (which turns out to cause errors because \cite is meant
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3416 % to be executed, not expanded).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3417 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3418 % Anyway, we don't want the fully-expanded definition of @cite to appear
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3419 % as a result of the \message, we just want `@cite' itself. We use
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3420 % \the<toks register> to achieve this: TeX expands \the<toks> only once,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3421 % simply yielding the contents of <toks register>. (We also do this for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3422 % the toc entries.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3423 \toks0 = {#1}\message{(\the\toks0)}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3424 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3425 \unnumbchapmacro {#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3426 \gdef\thischapter{#1}\gdef\thissection{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3427 \toks0 = {#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3428 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3429 \temp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3430 \unnumbnoderef
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3431 \global\let\section = \unnumberedsec
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3432 \global\let\subsection = \unnumberedsubsec
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3433 \global\let\subsubsection = \unnumberedsubsubsec
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3434 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3435
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3436 % Sections.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3437 \outer\def\numberedsec{\parsearg\secyyy}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3438 \def\secyyy #1{\numhead1{#1}} % normally calls seczzz
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3439 \def\seczzz #1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3440 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3441 \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3442 \toks0 = {#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3443 \edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3444 {\the\chapno}{\the\secno}}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3445 \temp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3446 \donoderef
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3447 \nobreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3448 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3449
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3450 \outer\def\appendixsection{\parsearg\appendixsecyyy}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3451 \outer\def\appendixsec{\parsearg\appendixsecyyy}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3452 \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3453 \def\appendixsectionzzz #1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3454 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3455 \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3456 \toks0 = {#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3457 \edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3458 {\appendixletter}{\the\secno}}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3459 \temp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3460 \appendixnoderef
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3461 \nobreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3462 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3463
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3464 \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3465 \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3466 \def\unnumberedseczzz #1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3467 \plainsecheading {#1}\gdef\thissection{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3468 \toks0 = {#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3469 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry{\the\toks0}}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3470 \temp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3471 \unnumbnoderef
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3472 \nobreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3473 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3474
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3475 % Subsections.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3476 \outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3477 \def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3478 \def\numberedsubseczzz #1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3479 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3480 \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3481 \toks0 = {#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3482 \edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3483 {\the\chapno}{\the\secno}{\the\subsecno}}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3484 \temp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3485 \donoderef
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3486 \nobreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3487 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3488
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3489 \outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3490 \def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3491 \def\appendixsubseczzz #1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3492 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3493 \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3494 \toks0 = {#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3495 \edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3496 {\appendixletter}{\the\secno}{\the\subsecno}}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3497 \temp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3498 \appendixnoderef
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3499 \nobreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3500 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3501
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3502 \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3503 \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3504 \def\unnumberedsubseczzz #1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3505 \plainsubsecheading {#1}\gdef\thissection{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3506 \toks0 = {#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3507 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3508 {\the\toks0}}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3509 \temp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3510 \unnumbnoderef
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3511 \nobreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3512 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3513
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3514 % Subsubsections.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3515 \outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3516 \def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3517 \def\numberedsubsubseczzz #1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3518 \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3519 \subsubsecheading {#1}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3520 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3521 \toks0 = {#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3522 \edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3523 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3524 \temp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3525 \donoderef
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3526 \nobreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3527 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3528
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3529 \outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3530 \def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3531 \def\appendixsubsubseczzz #1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3532 \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3533 \subsubsecheading {#1}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3534 {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3535 \toks0 = {#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3536 \edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3537 {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3538 \temp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3539 \appendixnoderef
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3540 \nobreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3541 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3542
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3543 \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3544 \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3545 \def\unnumberedsubsubseczzz #1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3546 \plainsubsubsecheading {#1}\gdef\thissection{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3547 \toks0 = {#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3548 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3549 {\the\toks0}}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3550 \temp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3551 \unnumbnoderef
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3552 \nobreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3553 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3554
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3555 % These are variants which are not "outer", so they can appear in @ifinfo.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3556 % Actually, they should now be obsolete; ordinary section commands should work.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3557 \def\infotop{\parsearg\unnumberedzzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3558 \def\infounnumbered{\parsearg\unnumberedzzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3559 \def\infounnumberedsec{\parsearg\unnumberedseczzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3560 \def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3561 \def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3562
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3563 \def\infoappendix{\parsearg\appendixzzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3564 \def\infoappendixsec{\parsearg\appendixseczzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3565 \def\infoappendixsubsec{\parsearg\appendixsubseczzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3566 \def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3567
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3568 \def\infochapter{\parsearg\chapterzzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3569 \def\infosection{\parsearg\sectionzzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3570 \def\infosubsection{\parsearg\subsectionzzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3571 \def\infosubsubsection{\parsearg\subsubsectionzzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3572
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3573 % These macros control what the section commands do, according
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3574 % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3575 % Define them by default for a numbered chapter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3576 \global\let\section = \numberedsec
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3577 \global\let\subsection = \numberedsubsec
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3578 \global\let\subsubsection = \numberedsubsubsec
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3579
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3580 % Define @majorheading, @heading and @subheading
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3581
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3582 % NOTE on use of \vbox for chapter headings, section headings, and such:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3583 % 1) We use \vbox rather than the earlier \line to permit
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3584 % overlong headings to fold.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3585 % 2) \hyphenpenalty is set to 10000 because hyphenation in a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3586 % heading is obnoxious; this forbids it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3587 % 3) Likewise, headings look best if no \parindent is used, and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3588 % if justification is not attempted. Hence \raggedright.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3589
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3590
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3591 \def\majorheading{\parsearg\majorheadingzzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3592 \def\majorheadingzzz #1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3593 {\advance\chapheadingskip by 10pt \chapbreak }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3594 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3595 \parindent=0pt\raggedright
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3596 \rm #1\hfill}}\bigskip \par\penalty 200}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3597
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3598 \def\chapheading{\parsearg\chapheadingzzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3599 \def\chapheadingzzz #1{\chapbreak %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3600 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3601 \parindent=0pt\raggedright
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3602 \rm #1\hfill}}\bigskip \par\penalty 200}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3603
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3604 % @heading, @subheading, @subsubheading.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3605 \def\heading{\parsearg\plainsecheading}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3606 \def\subheading{\parsearg\plainsubsecheading}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3607 \def\subsubheading{\parsearg\plainsubsubsecheading}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3608
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3609 % These macros generate a chapter, section, etc. heading only
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3610 % (including whitespace, linebreaking, etc. around it),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3611 % given all the information in convenient, parsed form.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3612
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3613 %%% Args are the skip and penalty (usually negative)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3614 \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3615
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3616 \def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3617
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3618 %%% Define plain chapter starts, and page on/off switching for it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3619 % Parameter controlling skip before chapter headings (if needed)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3620
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3621 \newskip\chapheadingskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3622
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3623 \def\chapbreak{\dobreak \chapheadingskip {-4000}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3624 \def\chappager{\par\vfill\supereject}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3625 \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3626
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3627 \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3628
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3629 \def\CHAPPAGoff{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3630 \global\let\contentsalignmacro = \chappager
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3631 \global\let\pchapsepmacro=\chapbreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3632 \global\let\pagealignmacro=\chappager}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3633
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3634 \def\CHAPPAGon{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3635 \global\let\contentsalignmacro = \chappager
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3636 \global\let\pchapsepmacro=\chappager
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3637 \global\let\pagealignmacro=\chappager
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3638 \global\def\HEADINGSon{\HEADINGSsingle}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3639
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3640 \def\CHAPPAGodd{
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3641 \global\let\contentsalignmacro = \chapoddpage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3642 \global\let\pchapsepmacro=\chapoddpage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3643 \global\let\pagealignmacro=\chapoddpage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3644 \global\def\HEADINGSon{\HEADINGSdouble}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3645
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3646 \CHAPPAGon
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3647
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3648 \def\CHAPFplain{
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3649 \global\let\chapmacro=\chfplain
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3650 \global\let\unnumbchapmacro=\unnchfplain
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3651 \global\let\centerchapmacro=\centerchfplain}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3652
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3653 % Plain chapter opening.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3654 % #1 is the text, #2 the chapter number or empty if unnumbered.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3655 \def\chfplain#1#2{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3656 \pchapsepmacro
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3657 {%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3658 \chapfonts \rm
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3659 \def\chapnum{#2}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3660 \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3661 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3662 \hangindent = \wd0 \centerparametersmaybe
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3663 \unhbox0 #1\par}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3664 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3665 \nobreak\bigskip % no page break after a chapter title
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3666 \nobreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3667 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3668
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3669 % Plain opening for unnumbered.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3670 \def\unnchfplain#1{\chfplain{#1}{}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3671
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3672 % @centerchap -- centered and unnumbered.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3673 \let\centerparametersmaybe = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3674 \def\centerchfplain#1{{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3675 \def\centerparametersmaybe{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3676 \advance\rightskip by 3\rightskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3677 \leftskip = \rightskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3678 \parfillskip = 0pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3679 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3680 \chfplain{#1}{}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3681 }}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3682
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3683 \CHAPFplain % The default
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3684
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3685 \def\unnchfopen #1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3686 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3687 \parindent=0pt\raggedright
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3688 \rm #1\hfill}}\bigskip \par\nobreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3689 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3690
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3691 \def\chfopen #1#2{\chapoddpage {\chapfonts
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3692 \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3693 \par\penalty 5000 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3694 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3695
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3696 \def\centerchfopen #1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3697 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3698 \parindent=0pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3699 \hfill {\rm #1}\hfill}}\bigskip \par\nobreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3700 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3701
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3702 \def\CHAPFopen{
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3703 \global\let\chapmacro=\chfopen
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3704 \global\let\unnumbchapmacro=\unnchfopen
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3705 \global\let\centerchapmacro=\centerchfopen}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3706
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3707
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3708 % Section titles.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3709 \newskip\secheadingskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3710 \def\secheadingbreak{\dobreak \secheadingskip {-1000}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3711 \def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3712 \def\plainsecheading#1{\sectionheading{sec}{}{#1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3713
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3714 % Subsection titles.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3715 \newskip \subsecheadingskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3716 \def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3717 \def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3718 \def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3719
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3720 % Subsubsection titles.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3721 \let\subsubsecheadingskip = \subsecheadingskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3722 \let\subsubsecheadingbreak = \subsecheadingbreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3723 \def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3724 \def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3725
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3726
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3727 % Print any size section title.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3728 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3729 % #1 is the section type (sec/subsec/subsubsec), #2 is the section
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3730 % number (maybe empty), #3 the text.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3731 \def\sectionheading#1#2#3{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3732 {%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3733 \expandafter\advance\csname #1headingskip\endcsname by \parskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3734 \csname #1headingbreak\endcsname
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3735 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3736 {%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3737 % Switch to the right set of fonts.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3738 \csname #1fonts\endcsname \rm
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3739 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3740 % Only insert the separating space if we have a section number.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3741 \def\secnum{#2}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3742 \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3743 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3744 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3745 \hangindent = \wd0 % zero if no section number
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3746 \unhbox0 #3}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3747 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3748 \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3749 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3750
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3751
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3752 \message{toc,}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3753 % Table of contents.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3754 \newwrite\tocfile
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3755
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3756 % Write an entry to the toc file, opening it if necessary.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3757 % Called from @chapter, etc. We supply {\folio} at the end of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3758 % argument, which will end up as the last argument to the \...entry macro.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3759 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3760 % We open the .toc file here instead of at @setfilename or any other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3761 % given time so that @contents can be put in the document anywhere.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3762 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3763 \newif\iftocfileopened
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3764 \def\writetocentry#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3765 \iftocfileopened\else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3766 \immediate\openout\tocfile = \jobname.toc
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3767 \global\tocfileopenedtrue
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3768 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3769 \iflinks \write\tocfile{#1{\folio}}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3770 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3771
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3772 \newskip\contentsrightmargin \contentsrightmargin=1in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3773 \newcount\savepageno
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3774 \newcount\lastnegativepageno \lastnegativepageno = -1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3775
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3776 % Finish up the main text and prepare to read what we've written
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3777 % to \tocfile.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3778 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3779 \def\startcontents#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3780 % If @setchapternewpage on, and @headings double, the contents should
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3781 % start on an odd page, unlike chapters. Thus, we maintain
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3782 % \contentsalignmacro in parallel with \pagealignmacro.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3783 % From: Torbjorn Granlund <tege@matematik.su.se>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3784 \contentsalignmacro
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3785 \immediate\closeout\tocfile
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3786 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3787 % Don't need to put `Contents' or `Short Contents' in the headline.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3788 % It is abundantly clear what they are.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3789 \unnumbchapmacro{#1}\def\thischapter{}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3790 \savepageno = \pageno
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3791 \begingroup % Set up to handle contents files properly.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3792 \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3793 % We can't do this, because then an actual ^ in a section
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3794 % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3795 %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3796 \raggedbottom % Worry more about breakpoints than the bottom.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3797 \advance\hsize by -\contentsrightmargin % Don't use the full line length.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3798 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3799 % Roman numerals for page numbers.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3800 \ifnum \pageno>0 \pageno = \lastnegativepageno \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3801 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3802
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3803
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3804 % Normal (long) toc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3805 \def\contents{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3806 \startcontents{\putwordTOC}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3807 \openin 1 \jobname.toc
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3808 \ifeof 1 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3809 \closein 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3810 \input \jobname.toc
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3811 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3812 \vfill \eject
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3813 \contentsalignmacro % in case @setchapternewpage odd is in effect
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3814 \pdfmakeoutlines
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3815 \endgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3816 \lastnegativepageno = \pageno
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3817 \pageno = \savepageno
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3818 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3819
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3820 % And just the chapters.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3821 \def\summarycontents{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3822 \startcontents{\putwordShortTOC}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3823 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3824 \let\chapentry = \shortchapentry
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3825 \let\unnumbchapentry = \shortunnumberedentry
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3826 % We want a true roman here for the page numbers.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3827 \secfonts
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3828 \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3829 \rm
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3830 \hyphenpenalty = 10000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3831 \advance\baselineskip by 1pt % Open it up a little.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3832 \def\secentry ##1##2##3##4{}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3833 \def\unnumbsecentry ##1##2{}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3834 \def\subsecentry ##1##2##3##4##5{}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3835 \def\unnumbsubsecentry ##1##2{}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3836 \def\subsubsecentry ##1##2##3##4##5##6{}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3837 \def\unnumbsubsubsecentry ##1##2{}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3838 \openin 1 \jobname.toc
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3839 \ifeof 1 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3840 \closein 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3841 \input \jobname.toc
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3842 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3843 \vfill \eject
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3844 \contentsalignmacro % in case @setchapternewpage odd is in effect
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3845 \endgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3846 \lastnegativepageno = \pageno
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3847 \pageno = \savepageno
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3848 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3849 \let\shortcontents = \summarycontents
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3850
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3851 \ifpdf
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3852 \pdfcatalog{/PageMode /UseOutlines}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3853 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3854
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3855 % These macros generate individual entries in the table of contents.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3856 % The first argument is the chapter or section name.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3857 % The last argument is the page number.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3858 % The arguments in between are the chapter number, section number, ...
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3859
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3860 % Chapter-level things, for both the long and short contents.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3861 \def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3862
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3863 % See comments in \dochapentry re vbox and related settings
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3864 \def\shortchapentry#1#2#3{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3865 \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3866 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3867
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3868 % Typeset the label for a chapter or appendix for the short contents.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3869 % The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3870 % We could simplify the code here by writing out an \appendixentry
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3871 % command in the toc file for appendices, instead of using \chapentry
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3872 % for both, but it doesn't seem worth it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3873 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3874 \newdimen\shortappendixwidth
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3875 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3876 \def\shortchaplabel#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3877 % Compute width of word "Appendix", may change with language.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3878 \setbox0 = \hbox{\shortcontrm \putwordAppendix}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3879 \shortappendixwidth = \wd0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3880 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3881 % We typeset #1 in a box of constant width, regardless of the text of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3882 % #1, so the chapter titles will come out aligned.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3883 \setbox0 = \hbox{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3884 \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3885 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3886 % This space should be plenty, since a single number is .5em, and the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3887 % widest letter (M) is 1em, at least in the Computer Modern fonts.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3888 % (This space doesn't include the extra space that gets added after
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3889 % the label; that gets put in by \shortchapentry above.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3890 \advance\dimen0 by 1.1em
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3891 \hbox to \dimen0{#1\hfil}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3892 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3893
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3894 \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3895 \def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno\bgroup#2\egroup}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3896
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3897 % Sections.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3898 \def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3899 \def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3900
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3901 % Subsections.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3902 \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3903 \def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3904
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3905 % And subsubsections.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3906 \def\subsubsecentry#1#2#3#4#5#6{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3907 \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3908 \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3909
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3910 % This parameter controls the indentation of the various levels.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3911 \newdimen\tocindent \tocindent = 3pc
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3912
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3913 % Now for the actual typesetting. In all these, #1 is the text and #2 is the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3914 % page number.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3915 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3916 % If the toc has to be broken over pages, we want it to be at chapters
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3917 % if at all possible; hence the \penalty.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3918 \def\dochapentry#1#2{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3919 \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3920 \begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3921 \chapentryfonts
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3922 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3923 \endgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3924 \nobreak\vskip .25\baselineskip plus.1\baselineskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3925 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3926
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3927 \def\dosecentry#1#2{\begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3928 \secentryfonts \leftskip=\tocindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3929 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3930 \endgroup}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3931
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3932 \def\dosubsecentry#1#2{\begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3933 \subsecentryfonts \leftskip=2\tocindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3934 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3935 \endgroup}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3936
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3937 \def\dosubsubsecentry#1#2{\begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3938 \subsubsecentryfonts \leftskip=3\tocindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3939 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3940 \endgroup}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3941
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3942 % Final typesetting of a toc entry; we use the same \entry macro as for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3943 % the index entries, but we want to suppress hyphenation here. (We
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3944 % can't do that in the \entry macro, since index entries might consist
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3945 % of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3946 \def\tocentry#1#2{\begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3947 \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3948 % Do not use \turnoffactive in these arguments. Since the toc is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3949 % typeset in cmr, so characters such as _ would come out wrong; we
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3950 % have to do the usual translation tricks.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3951 \entry{#1}{#2}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3952 \endgroup}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3953
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3954 % Space between chapter (or whatever) number and the title.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3955 \def\labelspace{\hskip1em \relax}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3956
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3957 \def\dopageno#1{{\rm #1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3958 \def\doshortpageno#1{{\rm #1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3959
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3960 \def\chapentryfonts{\secfonts \rm}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3961 \def\secentryfonts{\textfonts}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3962 \let\subsecentryfonts = \textfonts
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3963 \let\subsubsecentryfonts = \textfonts
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3964
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3965
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3966 \message{environments,}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3967 % @foo ... @end foo.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3968
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3969 % Since these characters are used in examples, it should be an even number of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3970 % \tt widths. Each \tt character is 1en, so two makes it 1em.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3971 % Furthermore, these definitions must come after we define our fonts.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3972 \newbox\dblarrowbox \newbox\longdblarrowbox
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3973 \newbox\pushcharbox \newbox\bullbox
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3974 \newbox\equivbox \newbox\errorbox
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3975
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3976 %{\tentt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3977 %\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3978 %\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3979 %\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3980 %\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3981 % Adapted from the manmac format (p.420 of TeXbook)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3982 %\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3983 % depth .1ex\hfil}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3984 %}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3985
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3986 % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3987 \def\point{$\star$}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3988 \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3989 \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3990 \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3991 \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3992
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3993 % Adapted from the TeXbook's \boxit.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3994 {\tentt \global\dimen0 = 3em}% Width of the box.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3995 \dimen2 = .55pt % Thickness of rules
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3996 % The text. (`r' is open on the right, `e' somewhat less so on the left.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3997 \setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3998
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3999 \global\setbox\errorbox=\hbox to \dimen0{\hfil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4000 \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4001 \advance\hsize by -2\dimen2 % Rules.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4002 \vbox{
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4003 \hrule height\dimen2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4004 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4005 \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4006 \kern3pt\vrule width\dimen2}% Space to right.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4007 \hrule height\dimen2}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4008 \hfil}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4009
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4010 % The @error{} command.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4011 \def\error{\leavevmode\lower.7ex\copy\errorbox}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4012
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4013 % @tex ... @end tex escapes into raw Tex temporarily.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4014 % One exception: @ is still an escape character, so that @end tex works.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4015 % But \@ or @@ will get a plain tex @ character.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4016
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4017 \def\tex{\begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4018 \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4019 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4020 \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4021 \catcode `\%=14
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4022 \catcode 43=12 % plus
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4023 \catcode`\"=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4024 \catcode`\==12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4025 \catcode`\|=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4026 \catcode`\<=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4027 \catcode`\>=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4028 \escapechar=`\\
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4029 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4030 \let\b=\ptexb
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4031 \let\bullet=\ptexbullet
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4032 \let\c=\ptexc
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4033 \let\,=\ptexcomma
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4034 \let\.=\ptexdot
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4035 \let\dots=\ptexdots
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4036 \let\equiv=\ptexequiv
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4037 \let\!=\ptexexclam
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4038 \let\i=\ptexi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4039 \let\{=\ptexlbrace
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4040 \let\+=\tabalign
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4041 \let\}=\ptexrbrace
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4042 \let\*=\ptexstar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4043 \let\t=\ptext
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4044 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4045 \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4046 \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4047 \def\@{@}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4048 \let\Etex=\endgroup}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4049
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4050 % Define @lisp ... @endlisp.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4051 % @lisp does a \begingroup so it can rebind things,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4052 % including the definition of @endlisp (which normally is erroneous).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4053
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4054 % Amount to narrow the margins by for @lisp.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4055 \newskip\lispnarrowing \lispnarrowing=0.4in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4056
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4057 % This is the definition that ^^M gets inside @lisp, @example, and other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4058 % such environments. \null is better than a space, since it doesn't
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4059 % have any width.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4060 \def\lisppar{\null\endgraf}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4061
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4062 % Make each space character in the input produce a normal interword
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4063 % space in the output. Don't allow a line break at this space, as this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4064 % is used only in environments like @example, where each line of input
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4065 % should produce a line of output anyway.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4066 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4067 {\obeyspaces %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4068 \gdef\sepspaces{\obeyspaces\let =\tie}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4069
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4070 % Define \obeyedspace to be our active space, whatever it is. This is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4071 % for use in \parsearg.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4072 {\sepspaces%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4073 \global\let\obeyedspace= }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4074
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4075 % This space is always present above and below environments.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4076 \newskip\envskipamount \envskipamount = 0pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4077
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4078 % Make spacing and below environment symmetrical. We use \parskip here
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4079 % to help in doing that, since in @example-like environments \parskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4080 % is reset to zero; thus the \afterenvbreak inserts no space -- but the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4081 % start of the next paragraph will insert \parskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4082 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4083 \def\aboveenvbreak{{\advance\envskipamount by \parskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4084 \endgraf \ifdim\lastskip<\envskipamount
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4085 \removelastskip \penalty-50 \vskip\envskipamount \fi}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4086
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4087 \let\afterenvbreak = \aboveenvbreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4088
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4089 % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4090 \let\nonarrowing=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4091
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4092 % @cartouche ... @end cartouche: draw rectangle w/rounded corners around
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4093 % environment contents.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4094 \font\circle=lcircle10
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4095 \newdimen\circthick
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4096 \newdimen\cartouter\newdimen\cartinner
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4097 \newskip\normbskip\newskip\normpskip\newskip\normlskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4098 \circthick=\fontdimen8\circle
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4099 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4100 \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4101 \def\ctr{{\hskip 6pt\circle\char'010}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4102 \def\cbl{{\circle\char'012\hskip -6pt}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4103 \def\cbr{{\hskip 6pt\circle\char'011}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4104 \def\carttop{\hbox to \cartouter{\hskip\lskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4105 \ctl\leaders\hrule height\circthick\hfil\ctr
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4106 \hskip\rskip}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4107 \def\cartbot{\hbox to \cartouter{\hskip\lskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4108 \cbl\leaders\hrule height\circthick\hfil\cbr
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4109 \hskip\rskip}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4110 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4111 \newskip\lskip\newskip\rskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4112
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4113 \long\def\cartouche{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4114 \begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4115 \lskip=\leftskip \rskip=\rightskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4116 \leftskip=0pt\rightskip=0pt %we want these *outside*.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4117 \cartinner=\hsize \advance\cartinner by-\lskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4118 \advance\cartinner by-\rskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4119 \cartouter=\hsize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4120 \advance\cartouter by 18.4pt % allow for 3pt kerns on either
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4121 % side, and for 6pt waste from
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4122 % each corner char, and rule thickness
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4123 \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4124 % Flag to tell @lisp, etc., not to narrow margin.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4125 \let\nonarrowing=\comment
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4126 \vbox\bgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4127 \baselineskip=0pt\parskip=0pt\lineskip=0pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4128 \carttop
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4129 \hbox\bgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4130 \hskip\lskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4131 \vrule\kern3pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4132 \vbox\bgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4133 \hsize=\cartinner
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4134 \kern3pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4135 \begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4136 \baselineskip=\normbskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4137 \lineskip=\normlskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4138 \parskip=\normpskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4139 \vskip -\parskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4140 \def\Ecartouche{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4141 \endgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4142 \kern3pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4143 \egroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4144 \kern3pt\vrule
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4145 \hskip\rskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4146 \egroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4147 \cartbot
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4148 \egroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4149 \endgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4150 }}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4151
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4152
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4153 % This macro is called at the beginning of all the @example variants,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4154 % inside a group.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4155 \def\nonfillstart{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4156 \aboveenvbreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4157 \inENV % This group ends at the end of the body
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4158 \hfuzz = 12pt % Don't be fussy
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4159 \sepspaces % Make spaces be word-separators rather than space tokens.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4160 \singlespace
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4161 \let\par = \lisppar % don't ignore blank lines
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4162 \obeylines % each line of input is a line of output
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4163 \parskip = 0pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4164 \parindent = 0pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4165 \emergencystretch = 0pt % don't try to avoid overfull boxes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4166 % @cartouche defines \nonarrowing to inhibit narrowing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4167 % at next level down.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4168 \ifx\nonarrowing\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4169 \advance \leftskip by \lispnarrowing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4170 \exdentamount=\lispnarrowing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4171 \let\exdent=\nofillexdent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4172 \let\nonarrowing=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4173 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4174 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4175
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4176 % Define the \E... control sequence only if we are inside the particular
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4177 % environment, so the error checking in \end will work.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4178 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4179 % To end an @example-like environment, we first end the paragraph (via
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4180 % \afterenvbreak's vertical glue), and then the group. That way we keep
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4181 % the zero \parskip that the environments set -- \parskip glue will be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4182 % inserted at the beginning of the next paragraph in the document, after
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4183 % the environment.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4184 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4185 \def\nonfillfinish{\afterenvbreak\endgroup}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4186
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4187 % @lisp: indented, narrowed, typewriter font.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4188 \def\lisp{\begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4189 \nonfillstart
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4190 \let\Elisp = \nonfillfinish
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4191 \tt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4192 \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4193 \gobble % eat return
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4194 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4195
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4196 % @example: Same as @lisp.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4197 \def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4198
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4199 % @small... is usually equivalent to the non-small (@smallbook
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4200 % redefines). We must call \example (or whatever) last in the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4201 % definition, since it reads the return following the @example (or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4202 % whatever) command.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4203 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4204 % This actually allows (for example) @end display inside an
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4205 % @smalldisplay. Too bad, but makeinfo will catch the error anyway.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4206 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4207 \def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4208 \def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4209 \def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4210 \def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4211
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4212 % Real @smallexample and @smalllisp (when @smallbook): use smaller fonts.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4213 % Originally contributed by Pavel@xerox.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4214 \def\smalllispx{\begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4215 \def\Esmalllisp{\nonfillfinish\endgroup}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4216 \def\Esmallexample{\nonfillfinish\endgroup}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4217 \smallfonts
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4218 \lisp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4219 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4220
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4221 % @display: same as @lisp except keep current font.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4222 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4223 \def\display{\begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4224 \nonfillstart
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4225 \let\Edisplay = \nonfillfinish
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4226 \gobble
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4227 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4228
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4229 % @smalldisplay (when @smallbook): @display plus smaller fonts.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4230 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4231 \def\smalldisplayx{\begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4232 \def\Esmalldisplay{\nonfillfinish\endgroup}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4233 \smallfonts \rm
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4234 \display
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4235 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4236
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4237 % @format: same as @display except don't narrow margins.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4238 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4239 \def\format{\begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4240 \let\nonarrowing = t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4241 \nonfillstart
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4242 \let\Eformat = \nonfillfinish
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4243 \gobble
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4244 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4245
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4246 % @smallformat (when @smallbook): @format plus smaller fonts.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4247 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4248 \def\smallformatx{\begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4249 \def\Esmallformat{\nonfillfinish\endgroup}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4250 \smallfonts \rm
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4251 \format
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4252 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4253
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4254 % @flushleft (same as @format).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4255 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4256 \def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4257
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4258 % @flushright.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4259 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4260 \def\flushright{\begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4261 \let\nonarrowing = t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4262 \nonfillstart
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4263 \let\Eflushright = \nonfillfinish
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4264 \advance\leftskip by 0pt plus 1fill
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4265 \gobble
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4266 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4267
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4268 % @quotation does normal linebreaking (hence we can't use \nonfillstart)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4269 % and narrows the margins.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4270 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4271 \def\quotation{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4272 \begingroup\inENV %This group ends at the end of the @quotation body
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4273 {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4274 \singlespace
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4275 \parindent=0pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4276 % We have retained a nonzero parskip for the environment, since we're
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4277 % doing normal filling. So to avoid extra space below the environment...
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4278 \def\Equotation{\parskip = 0pt \nonfillfinish}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4279 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4280 % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4281 \ifx\nonarrowing\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4282 \advance\leftskip by \lispnarrowing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4283 \advance\rightskip by \lispnarrowing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4284 \exdentamount = \lispnarrowing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4285 \let\nonarrowing = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4286 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4287 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4288
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4289
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4290 \message{defuns,}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4291 % @defun etc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4292
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4293 % Allow user to change definition object font (\df) internally
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4294 \def\setdeffont #1 {\csname DEF#1\endcsname}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4295
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4296 \newskip\defbodyindent \defbodyindent=.4in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4297 \newskip\defargsindent \defargsindent=50pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4298 \newskip\deftypemargin \deftypemargin=12pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4299 \newskip\deflastargmargin \deflastargmargin=18pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4300
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4301 \newcount\parencount
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4302 % define \functionparens, which makes ( and ) and & do special things.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4303 % \functionparens affects the group it is contained in.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4304 \def\activeparens{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4305 \catcode`\(=\active \catcode`\)=\active \catcode`\&=\active
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4306 \catcode`\[=\active \catcode`\]=\active}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4307
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4308 % Make control sequences which act like normal parenthesis chars.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4309 \let\lparen = ( \let\rparen = )
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4310
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4311 {\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4312
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4313 % Be sure that we always have a definition for `(', etc. For example,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4314 % if the fn name has parens in it, \boldbrax will not be in effect yet,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4315 % so TeX would otherwise complain about undefined control sequence.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4316 \global\let(=\lparen \global\let)=\rparen
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4317 \global\let[=\lbrack \global\let]=\rbrack
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4318
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4319 \gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4320 \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4321 % This is used to turn on special parens
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4322 % but make & act ordinary (given that it's active).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4323 \gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4324
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4325 % Definitions of (, ) and & used in args for functions.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4326 % This is the definition of ( outside of all parentheses.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4327 \gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4328 \global\advance\parencount by 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4329 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4330 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4331 % This is the definition of ( when already inside a level of parens.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4332 \gdef\opnested{\char`\(\global\advance\parencount by 1 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4333 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4334 \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4335 % also in that case restore the outer-level definition of (.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4336 \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4337 \global\advance \parencount by -1 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4338 % If we encounter &foo, then turn on ()-hacking afterwards
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4339 \gdef\amprm#1 {{\rm\&#1}\let(=\oprm \let)=\clrm\ }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4340 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4341 \gdef\normalparens{\boldbrax\let&=\ampnr}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4342 } % End of definition inside \activeparens
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4343 %% These parens (in \boldbrax) actually are a little bolder than the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4344 %% contained text. This is especially needed for [ and ]
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4345 \def\opnr{{\sf\char`\(}\global\advance\parencount by 1 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4346 \def\clnr{{\sf\char`\)}\global\advance\parencount by -1 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4347 \let\ampnr = \&
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4348 \def\lbrb{{\bf\char`\[}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4349 \def\rbrb{{\bf\char`\]}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4350
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4351 % Active &'s sneak into the index arguments, so make sure it's defined.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4352 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4353 \catcode`& = 13
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4354 \global\let& = \ampnr
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4355 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4356
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4357 % First, defname, which formats the header line itself.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4358 % #1 should be the function name.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4359 % #2 should be the type of definition, such as "Function".
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4360
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4361 \def\defname #1#2{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4362 % Get the values of \leftskip and \rightskip as they were
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4363 % outside the @def...
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4364 \dimen2=\leftskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4365 \advance\dimen2 by -\defbodyindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4366 \noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4367 \setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4368 \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4369 \dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4370 \parshape 2 0in \dimen0 \defargsindent \dimen1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4371 % Now output arg 2 ("Function" or some such)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4372 % ending at \deftypemargin from the right margin,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4373 % but stuck inside a box of width 0 so it does not interfere with linebreaking
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4374 {% Adjust \hsize to exclude the ambient margins,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4375 % so that \rightline will obey them.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4376 \advance \hsize by -\dimen2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4377 \rlap{\rightline{{\rm #2}\hskip -1.25pc }}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4378 % Make all lines underfull and no complaints:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4379 \tolerance=10000 \hbadness=10000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4380 \advance\leftskip by -\defbodyindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4381 \exdentamount=\defbodyindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4382 {\df #1}\enskip % Generate function name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4383 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4384
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4385 % Actually process the body of a definition
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4386 % #1 should be the terminating control sequence, such as \Edefun.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4387 % #2 should be the "another name" control sequence, such as \defunx.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4388 % #3 should be the control sequence that actually processes the header,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4389 % such as \defunheader.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4390
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4391 \def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4392 \medbreak %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4393 % Define the end token that this defining construct specifies
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4394 % so that it will exit this group.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4395 \def#1{\endgraf\endgroup\medbreak}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4396 \def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4397 \parindent=0in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4398 \advance\leftskip by \defbodyindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4399 \exdentamount=\defbodyindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4400 \begingroup %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4401 \catcode 61=\active % 61 is `='
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4402 \obeylines\activeparens\spacesplit#3}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4403
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4404 % #1 is the \E... control sequence to end the definition (which we define).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4405 % #2 is the \...x control sequence for consecutive fns (which we define).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4406 % #3 is the control sequence to call to resume processing.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4407 % #4, delimited by the space, is the class name.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4408 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4409 \def\defmethparsebody#1#2#3#4 {\begingroup\inENV %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4410 \medbreak %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4411 % Define the end token that this defining construct specifies
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4412 % so that it will exit this group.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4413 \def#1{\endgraf\endgroup\medbreak}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4414 \def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4415 \parindent=0in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4416 \advance\leftskip by \defbodyindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4417 \exdentamount=\defbodyindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4418 \begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4419
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4420 % Used for @deftypemethod and @deftypeivar.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4421 % #1 is the \E... control sequence to end the definition (which we define).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4422 % #2 is the \...x control sequence for consecutive fns (which we define).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4423 % #3 is the control sequence to call to resume processing.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4424 % #4, delimited by a space, is the class name.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4425 % #5 is the method's return type.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4426 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4427 \def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4428 \medbreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4429 \def#1{\endgraf\endgroup\medbreak}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4430 \def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4431 \parindent=0in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4432 \advance\leftskip by \defbodyindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4433 \exdentamount=\defbodyindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4434 \begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4435
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4436 % Used for @deftypeop. The change from \deftypemethparsebody is an
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4437 % extra argument at the beginning which is the `category', instead of it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4438 % being the hardwired string `Method' or `Instance Variable'. We have
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4439 % to account for this both in the \...x definition and in parsing the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4440 % input at hand. Thus also need a control sequence (passed as #5) for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4441 % the \E... definition to assign the category name to.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4442 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4443 \def\deftypeopparsebody#1#2#3#4#5 #6 {\begingroup\inENV
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4444 \medbreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4445 \def#1{\endgraf\endgroup\medbreak}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4446 \def#2##1 ##2 ##3 {%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4447 \def#4{##1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4448 \begingroup\obeylines\activeparens\spacesplit{#3{##2}{##3}}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4449 \parindent=0in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4450 \advance\leftskip by \defbodyindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4451 \exdentamount=\defbodyindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4452 \begingroup\obeylines\activeparens\spacesplit{#3{#5}{#6}}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4453
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4454 \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4455 \medbreak %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4456 % Define the end token that this defining construct specifies
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4457 % so that it will exit this group.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4458 \def#1{\endgraf\endgroup\medbreak}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4459 \def#2##1 ##2 {\def#4{##1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4460 \begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4461 \parindent=0in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4462 \advance\leftskip by \defbodyindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4463 \exdentamount=\defbodyindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4464 \begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4465
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4466 % These parsing functions are similar to the preceding ones
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4467 % except that they do not make parens into active characters.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4468 % These are used for "variables" since they have no arguments.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4469
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4470 \def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4471 \medbreak %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4472 % Define the end token that this defining construct specifies
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4473 % so that it will exit this group.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4474 \def#1{\endgraf\endgroup\medbreak}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4475 \def#2{\begingroup\obeylines\spacesplit#3}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4476 \parindent=0in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4477 \advance\leftskip by \defbodyindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4478 \exdentamount=\defbodyindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4479 \begingroup %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4480 \catcode 61=\active %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4481 \obeylines\spacesplit#3}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4482
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4483 % This is used for \def{tp,vr}parsebody. It could probably be used for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4484 % some of the others, too, with some judicious conditionals.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4485 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4486 \def\parsebodycommon#1#2#3{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4487 \begingroup\inENV %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4488 \medbreak %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4489 % Define the end token that this defining construct specifies
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4490 % so that it will exit this group.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4491 \def#1{\endgraf\endgroup\medbreak}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4492 \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4493 \parindent=0in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4494 \advance\leftskip by \defbodyindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4495 \exdentamount=\defbodyindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4496 \begingroup\obeylines
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4497 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4498
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4499 \def\defvrparsebody#1#2#3#4 {%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4500 \parsebodycommon{#1}{#2}{#3}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4501 \spacesplit{#3{#4}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4502 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4503
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4504 % This loses on `@deftp {Data Type} {struct termios}' -- it thinks the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4505 % type is just `struct', because we lose the braces in `{struct
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4506 % termios}' when \spacesplit reads its undelimited argument. Sigh.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4507 % \let\deftpparsebody=\defvrparsebody
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4508 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4509 % So, to get around this, we put \empty in with the type name. That
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4510 % way, TeX won't find exactly `{...}' as an undelimited argument, and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4511 % won't strip off the braces.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4512 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4513 \def\deftpparsebody #1#2#3#4 {%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4514 \parsebodycommon{#1}{#2}{#3}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4515 \spacesplit{\parsetpheaderline{#3{#4}}}\empty
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4516 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4517
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4518 % Fine, but then we have to eventually remove the \empty *and* the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4519 % braces (if any). That's what this does.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4520 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4521 \def\removeemptybraces\empty#1\relax{#1}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4522
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4523 % After \spacesplit has done its work, this is called -- #1 is the final
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4524 % thing to call, #2 the type name (which starts with \empty), and #3
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4525 % (which might be empty) the arguments.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4526 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4527 \def\parsetpheaderline#1#2#3{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4528 #1{\removeemptybraces#2\relax}{#3}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4529 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4530
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4531 \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4532 \medbreak %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4533 % Define the end token that this defining construct specifies
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4534 % so that it will exit this group.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4535 \def#1{\endgraf\endgroup\medbreak}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4536 \def#2##1 ##2 {\def#4{##1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4537 \begingroup\obeylines\spacesplit{#3{##2}}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4538 \parindent=0in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4539 \advance\leftskip by \defbodyindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4540 \exdentamount=\defbodyindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4541 \begingroup\obeylines\spacesplit{#3{#5}}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4542
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4543 % Split up #2 at the first space token.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4544 % call #1 with two arguments:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4545 % the first is all of #2 before the space token,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4546 % the second is all of #2 after that space token.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4547 % If #2 contains no space token, all of it is passed as the first arg
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4548 % and the second is passed as empty.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4549
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4550 {\obeylines
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4551 \gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4552 \long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4553 \ifx\relax #3%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4554 #1{#2}{}\else #1{#2}{#3#4}\fi}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4555
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4556 % So much for the things common to all kinds of definitions.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4557
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4558 % Define @defun.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4559
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4560 % First, define the processing that is wanted for arguments of \defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4561 % Use this to expand the args and terminate the paragraph they make up
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4562
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4563 \def\defunargs#1{\functionparens \sl
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4564 % Expand, preventing hyphenation at `-' chars.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4565 % Note that groups don't affect changes in \hyphenchar.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4566 % Set the font temporarily and use \font in case \setfont made \tensl a macro.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4567 {\tensl\hyphenchar\font=0}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4568 #1%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4569 {\tensl\hyphenchar\font=45}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4570 \ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4571 \interlinepenalty=10000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4572 \advance\rightskip by 0pt plus 1fil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4573 \endgraf\nobreak\vskip -\parskip\nobreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4574 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4575
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4576 \def\deftypefunargs #1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4577 % Expand, preventing hyphenation at `-' chars.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4578 % Note that groups don't affect changes in \hyphenchar.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4579 % Use \boldbraxnoamp, not \functionparens, so that & is not special.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4580 \boldbraxnoamp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4581 \tclose{#1}% avoid \code because of side effects on active chars
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4582 \interlinepenalty=10000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4583 \advance\rightskip by 0pt plus 1fil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4584 \endgraf\nobreak\vskip -\parskip\nobreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4585 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4586
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4587 % Do complete processing of one @defun or @defunx line already parsed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4588
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4589 % @deffn Command forward-char nchars
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4590
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4591 \def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4592
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4593 \def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4594 \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4595 \catcode 61=\other % Turn off change made in \defparsebody
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4596 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4597
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4598 % @defun == @deffn Function
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4599
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4600 \def\defun{\defparsebody\Edefun\defunx\defunheader}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4601
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4602 \def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4603 \begingroup\defname {#1}{\putwordDeffunc}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4604 \defunargs {#2}\endgroup %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4605 \catcode 61=\other % Turn off change made in \defparsebody
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4606 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4607
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4608 % @deftypefun int foobar (int @var{foo}, float @var{bar})
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4609
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4610 \def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4611
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4612 % #1 is the data type. #2 is the name and args.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4613 \def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4614 % #1 is the data type, #2 the name, #3 the args.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4615 \def\deftypefunheaderx #1#2 #3\relax{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4616 \doind {fn}{\code{#2}}% Make entry in function index
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4617 \begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypefun}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4618 \deftypefunargs {#3}\endgroup %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4619 \catcode 61=\other % Turn off change made in \defparsebody
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4620 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4621
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4622 % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4623
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4624 \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4625
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4626 % \defheaderxcond#1\relax$$$
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4627 % puts #1 in @code, followed by a space, but does nothing if #1 is null.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4628 \def\defheaderxcond#1#2$$${\ifx#1\relax\else\code{#1#2} \fi}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4629
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4630 % #1 is the classification. #2 is the data type. #3 is the name and args.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4631 \def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4632 % #1 is the classification, #2 the data type, #3 the name, #4 the args.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4633 \def\deftypefnheaderx #1#2#3 #4\relax{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4634 \doind {fn}{\code{#3}}% Make entry in function index
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4635 \begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4636 \normalparens % notably, turn off `&' magic, which prevents
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4637 % at least some C++ text from working
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4638 \defname {\defheaderxcond#2\relax$$$#3}{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4639 \deftypefunargs {#4}\endgroup %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4640 \catcode 61=\other % Turn off change made in \defparsebody
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4641 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4642
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4643 % @defmac == @deffn Macro
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4644
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4645 \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4646
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4647 \def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4648 \begingroup\defname {#1}{\putwordDefmac}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4649 \defunargs {#2}\endgroup %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4650 \catcode 61=\other % Turn off change made in \defparsebody
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4651 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4652
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4653 % @defspec == @deffn Special Form
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4654
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4655 \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4656
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4657 \def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4658 \begingroup\defname {#1}{\putwordDefspec}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4659 \defunargs {#2}\endgroup %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4660 \catcode 61=\other % Turn off change made in \defparsebody
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4661 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4662
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4663 % @defop CATEGORY CLASS OPERATION ARG...
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4664 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4665 \def\defop #1 {\def\defoptype{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4666 \defopparsebody\Edefop\defopx\defopheader\defoptype}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4667 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4668 \def\defopheader#1#2#3{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4669 \dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4670 \begingroup\defname {#2}{\defoptype\ \putwordon\ #1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4671 \defunargs {#3}\endgroup %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4672 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4673
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4674 % @deftypeop CATEGORY CLASS TYPE OPERATION ARG...
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4675 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4676 \def\deftypeop #1 {\def\deftypeopcategory{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4677 \deftypeopparsebody\Edeftypeop\deftypeopx\deftypeopheader
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4678 \deftypeopcategory}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4679 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4680 % #1 is the class name, #2 the data type, #3 the operation name, #4 the args.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4681 \def\deftypeopheader#1#2#3#4{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4682 \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4683 \begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4684 \defname{\defheaderxcond#2\relax$$$#3}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4685 {\deftypeopcategory\ \putwordon\ \code{#1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4686 \deftypefunargs{#4}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4687 \endgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4688 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4689
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4690 % @deftypemethod CLASS TYPE METHOD ARG...
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4691 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4692 \def\deftypemethod{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4693 \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4694 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4695 % #1 is the class name, #2 the data type, #3 the method name, #4 the args.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4696 \def\deftypemethodheader#1#2#3#4{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4697 \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4698 \begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4699 \defname{\defheaderxcond#2\relax$$$#3}{\putwordMethodon\ \code{#1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4700 \deftypefunargs{#4}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4701 \endgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4702 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4703
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4704 % @deftypeivar CLASS TYPE VARNAME
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4705 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4706 \def\deftypeivar{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4707 \deftypemethparsebody\Edeftypeivar\deftypeivarx\deftypeivarheader}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4708 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4709 % #1 is the class name, #2 the data type, #3 the variable name.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4710 \def\deftypeivarheader#1#2#3{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4711 \dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4712 \begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4713 \defname{#3}{\putwordInstanceVariableof\ \code{#1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4714 \defvarargs{#3}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4715 \endgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4716 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4717
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4718 % @defmethod == @defop Method
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4719 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4720 \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4721 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4722 % #1 is the class name, #2 the method name, #3 the args.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4723 \def\defmethodheader#1#2#3{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4724 \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4725 \begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4726 \defname{#2}{\putwordMethodon\ \code{#1}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4727 \defunargs{#3}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4728 \endgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4729 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4730
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4731 % @defcv {Class Option} foo-class foo-flag
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4732
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4733 \def\defcv #1 {\def\defcvtype{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4734 \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4735
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4736 \def\defcvarheader #1#2#3{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4737 \dosubind {vr}{\code{#2}}{\putwordof\ #1}% Make entry in var index
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4738 \begingroup\defname {#2}{\defcvtype\ \putwordof\ #1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4739 \defvarargs {#3}\endgroup %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4740 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4741
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4742 % @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4743 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4744 \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4745 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4746 \def\defivarheader#1#2#3{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4747 \dosubind {vr}{\code{#2}}{\putwordof\ #1}% entry in var index
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4748 \begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4749 \defname{#2}{\putwordInstanceVariableof\ #1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4750 \defvarargs{#3}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4751 \endgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4752 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4753
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4754 % @defvar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4755 % First, define the processing that is wanted for arguments of @defvar.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4756 % This is actually simple: just print them in roman.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4757 % This must expand the args and terminate the paragraph they make up
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4758 \def\defvarargs #1{\normalparens #1%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4759 \interlinepenalty=10000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4760 \endgraf\nobreak\vskip -\parskip\nobreak}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4761
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4762 % @defvr Counter foo-count
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4763
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4764 \def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4765
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4766 \def\defvrheader #1#2#3{\doind {vr}{\code{#2}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4767 \begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4768
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4769 % @defvar == @defvr Variable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4770
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4771 \def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4772
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4773 \def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4774 \begingroup\defname {#1}{\putwordDefvar}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4775 \defvarargs {#2}\endgroup %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4776 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4777
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4778 % @defopt == @defvr {User Option}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4779
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4780 \def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4781
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4782 \def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4783 \begingroup\defname {#1}{\putwordDefopt}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4784 \defvarargs {#2}\endgroup %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4785 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4786
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4787 % @deftypevar int foobar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4788
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4789 \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4790
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4791 % #1 is the data type. #2 is the name, perhaps followed by text that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4792 % is actually part of the data type, which should not be put into the index.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4793 \def\deftypevarheader #1#2{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4794 \dovarind#2 \relax% Make entry in variables index
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4795 \begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypevar}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4796 \interlinepenalty=10000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4797 \endgraf\nobreak\vskip -\parskip\nobreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4798 \endgroup}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4799 \def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4800
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4801 % @deftypevr {Global Flag} int enable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4802
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4803 \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4804
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4805 \def\deftypevrheader #1#2#3{\dovarind#3 \relax%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4806 \begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4807 \interlinepenalty=10000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4808 \endgraf\nobreak\vskip -\parskip\nobreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4809 \endgroup}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4810
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4811 % Now define @deftp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4812 % Args are printed in bold, a slight difference from @defvar.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4813
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4814 \def\deftpargs #1{\bf \defvarargs{#1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4815
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4816 % @deftp Class window height width ...
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4817
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4818 \def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4819
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4820 \def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4821 \begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4822
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4823 % These definitions are used if you use @defunx (etc.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4824 % anywhere other than immediately after a @defun or @defunx.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4825 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4826 \def\defcvx#1 {\errmessage{@defcvx in invalid context}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4827 \def\deffnx#1 {\errmessage{@deffnx in invalid context}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4828 \def\defivarx#1 {\errmessage{@defivarx in invalid context}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4829 \def\defmacx#1 {\errmessage{@defmacx in invalid context}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4830 \def\defmethodx#1 {\errmessage{@defmethodx in invalid context}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4831 \def\defoptx #1 {\errmessage{@defoptx in invalid context}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4832 \def\defopx#1 {\errmessage{@defopx in invalid context}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4833 \def\defspecx#1 {\errmessage{@defspecx in invalid context}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4834 \def\deftpx#1 {\errmessage{@deftpx in invalid context}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4835 \def\deftypefnx#1 {\errmessage{@deftypefnx in invalid context}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4836 \def\deftypefunx#1 {\errmessage{@deftypefunx in invalid context}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4837 \def\deftypeivarx#1 {\errmessage{@deftypeivarx in invalid context}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4838 \def\deftypemethodx#1 {\errmessage{@deftypemethodx in invalid context}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4839 \def\deftypeopx#1 {\errmessage{@deftypeopx in invalid context}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4840 \def\deftypevarx#1 {\errmessage{@deftypevarx in invalid context}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4841 \def\deftypevrx#1 {\errmessage{@deftypevrx in invalid context}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4842 \def\defunx#1 {\errmessage{@defunx in invalid context}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4843 \def\defvarx#1 {\errmessage{@defvarx in invalid context}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4844 \def\defvrx#1 {\errmessage{@defvrx in invalid context}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4845
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4846
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4847 \message{macros,}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4848 % @macro.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4849
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4850 % To do this right we need a feature of e-TeX, \scantokens,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4851 % which we arrange to emulate with a temporary file in ordinary TeX.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4852 \ifx\eTeXversion\undefined
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4853 \newwrite\macscribble
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4854 \def\scanmacro#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4855 \begingroup \newlinechar`\^^M
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4856 % Undo catcode changes of \startcontents and \doprintindex
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4857 \catcode`\@=0 \catcode`\\=12 \escapechar=`\@
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4858 % Append \endinput to make sure that TeX does not see the ending newline.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4859 \toks0={#1\endinput}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4860 \immediate\openout\macscribble=\jobname.tmp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4861 \immediate\write\macscribble{\the\toks0}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4862 \immediate\closeout\macscribble
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4863 \let\xeatspaces\eatspaces
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4864 \input \jobname.tmp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4865 \endgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4866 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4867 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4868 \def\scanmacro#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4869 \begingroup \newlinechar`\^^M
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4870 % Undo catcode changes of \startcontents and \doprintindex
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4871 \catcode`\@=0 \catcode`\\=12 \escapechar=`\@
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4872 \let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4873 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4874
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4875 \newcount\paramno % Count of parameters
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4876 \newtoks\macname % Macro name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4877 \newif\ifrecursive % Is it recursive?
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4878 \def\macrolist{} % List of all defined macros in the form
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4879 % \do\macro1\do\macro2...
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4880
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4881 % Utility routines.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4882 % Thisdoes \let #1 = #2, except with \csnames.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4883 \def\cslet#1#2{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4884 \expandafter\expandafter
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4885 \expandafter\let
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4886 \expandafter\expandafter
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4887 \csname#1\endcsname
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4888 \csname#2\endcsname}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4889
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4890 % Trim leading and trailing spaces off a string.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4891 % Concepts from aro-bend problem 15 (see CTAN).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4892 {\catcode`\@=11
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4893 \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4894 \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4895 \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4896 \def\unbrace#1{#1}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4897 \unbrace{\gdef\trim@@@ #1 } #2@{#1}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4898 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4899
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4900 % Trim a single trailing ^^M off a string.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4901 {\catcode`\^^M=12\catcode`\Q=3%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4902 \gdef\eatcr #1{\eatcra #1Q^^MQ}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4903 \gdef\eatcra#1^^MQ{\eatcrb#1Q}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4904 \gdef\eatcrb#1Q#2Q{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4905 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4906
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4907 % Macro bodies are absorbed as an argument in a context where
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4908 % all characters are catcode 10, 11 or 12, except \ which is active
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4909 % (as in normal texinfo). It is necessary to change the definition of \.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4910
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4911 % It's necessary to have hard CRs when the macro is executed. This is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4912 % done by making ^^M (\endlinechar) catcode 12 when reading the macro
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4913 % body, and then making it the \newlinechar in \scanmacro.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4914
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4915 \def\macrobodyctxt{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4916 \catcode`\~=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4917 \catcode`\^=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4918 \catcode`\_=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4919 \catcode`\|=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4920 \catcode`\<=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4921 \catcode`\>=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4922 \catcode`\+=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4923 \catcode`\{=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4924 \catcode`\}=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4925 \catcode`\@=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4926 \catcode`\^^M=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4927 \usembodybackslash}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4928
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4929 \def\macroargctxt{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4930 \catcode`\~=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4931 \catcode`\^=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4932 \catcode`\_=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4933 \catcode`\|=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4934 \catcode`\<=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4935 \catcode`\>=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4936 \catcode`\+=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4937 \catcode`\@=12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4938 \catcode`\\=12}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4939
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4940 % \mbodybackslash is the definition of \ in @macro bodies.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4941 % It maps \foo\ => \csname macarg.foo\endcsname => #N
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4942 % where N is the macro parameter number.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4943 % We define \csname macarg.\endcsname to be \realbackslash, so
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4944 % \\ in macro replacement text gets you a backslash.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4945
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4946 {\catcode`@=0 @catcode`@\=@active
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4947 @gdef@usembodybackslash{@let\=@mbodybackslash}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4948 @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4949 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4950 \expandafter\def\csname macarg.\endcsname{\realbackslash}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4951
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4952 \def\macro{\recursivefalse\parsearg\macroxxx}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4953 \def\rmacro{\recursivetrue\parsearg\macroxxx}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4954
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4955 \def\macroxxx#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4956 \getargs{#1}% now \macname is the macname and \argl the arglist
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4957 \ifx\argl\empty % no arguments
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4958 \paramno=0%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4959 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4960 \expandafter\parsemargdef \argl;%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4961 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4962 \if1\csname ismacro.\the\macname\endcsname
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4963 \message{Warning: redefining \the\macname}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4964 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4965 \expandafter\ifx\csname \the\macname\endcsname \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4966 \else \errmessage{The name \the\macname\space is reserved}\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4967 \global\cslet{macsave.\the\macname}{\the\macname}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4968 \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4969 % Add the macroname to \macrolist
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4970 \toks0 = \expandafter{\macrolist\do}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4971 \xdef\macrolist{\the\toks0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4972 \expandafter\noexpand\csname\the\macname\endcsname}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4973 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4974 \begingroup \macrobodyctxt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4975 \ifrecursive \expandafter\parsermacbody
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4976 \else \expandafter\parsemacbody
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4977 \fi}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4978
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4979 \def\unmacro{\parsearg\unmacroxxx}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4980 \def\unmacroxxx#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4981 \if1\csname ismacro.#1\endcsname
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4982 \global\cslet{#1}{macsave.#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4983 \global\expandafter\let \csname ismacro.#1\endcsname=0%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4984 % Remove the macro name from \macrolist
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4985 \begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4986 \edef\tempa{\expandafter\noexpand\csname#1\endcsname}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4987 \def\do##1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4988 \def\tempb{##1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4989 \ifx\tempa\tempb
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4990 % remove this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4991 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4992 \toks0 = \expandafter{\newmacrolist\do}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4993 \edef\newmacrolist{\the\toks0\expandafter\noexpand\tempa}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4994 \fi}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4995 \def\newmacrolist{}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4996 % Execute macro list to define \newmacrolist
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4997 \macrolist
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4998 \global\let\macrolist\newmacrolist
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4999 \endgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5000 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5001 \errmessage{Macro #1 not defined}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5002 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5003 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5004
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5005 % This makes use of the obscure feature that if the last token of a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5006 % <parameter list> is #, then the preceding argument is delimited by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5007 % an opening brace, and that opening brace is not consumed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5008 \def\getargs#1{\getargsxxx#1{}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5009 \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5010 \def\getmacname #1 #2\relax{\macname={#1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5011 \def\getmacargs#1{\def\argl{#1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5012
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5013 % Parse the optional {params} list. Set up \paramno and \paramlist
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5014 % so \defmacro knows what to do. Define \macarg.blah for each blah
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5015 % in the params list, to be ##N where N is the position in that list.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5016 % That gets used by \mbodybackslash (above).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5017
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5018 % We need to get `macro parameter char #' into several definitions.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5019 % The technique used is stolen from LaTeX: let \hash be something
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5020 % unexpandable, insert that wherever you need a #, and then redefine
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5021 % it to # just before using the token list produced.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5022 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5023 % The same technique is used to protect \eatspaces till just before
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5024 % the macro is used.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5025
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5026 \def\parsemargdef#1;{\paramno=0\def\paramlist{}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5027 \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5028 \def\parsemargdefxxx#1,{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5029 \if#1;\let\next=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5030 \else \let\next=\parsemargdefxxx
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5031 \advance\paramno by 1%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5032 \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5033 {\xeatspaces{\hash\the\paramno}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5034 \edef\paramlist{\paramlist\hash\the\paramno,}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5035 \fi\next}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5036
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5037 % These two commands read recursive and nonrecursive macro bodies.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5038 % (They're different since rec and nonrec macros end differently.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5039
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5040 \long\def\parsemacbody#1@end macro%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5041 {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5042 \long\def\parsermacbody#1@end rmacro%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5043 {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5044
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5045 % This defines the macro itself. There are six cases: recursive and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5046 % nonrecursive macros of zero, one, and many arguments.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5047 % Much magic with \expandafter here.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5048 % \xdef is used so that macro definitions will survive the file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5049 % they're defined in; @include reads the file inside a group.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5050 \def\defmacro{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5051 \let\hash=##% convert placeholders to macro parameter chars
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5052 \ifrecursive
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5053 \ifcase\paramno
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5054 % 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5055 \expandafter\xdef\csname\the\macname\endcsname{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5056 \noexpand\scanmacro{\temp}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5057 \or % 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5058 \expandafter\xdef\csname\the\macname\endcsname{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5059 \bgroup\noexpand\macroargctxt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5060 \noexpand\braceorline
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5061 \expandafter\noexpand\csname\the\macname xxx\endcsname}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5062 \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5063 \egroup\noexpand\scanmacro{\temp}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5064 \else % many
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5065 \expandafter\xdef\csname\the\macname\endcsname{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5066 \bgroup\noexpand\macroargctxt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5067 \noexpand\csname\the\macname xx\endcsname}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5068 \expandafter\xdef\csname\the\macname xx\endcsname##1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5069 \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5070 \expandafter\expandafter
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5071 \expandafter\xdef
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5072 \expandafter\expandafter
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5073 \csname\the\macname xxx\endcsname
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5074 \paramlist{\egroup\noexpand\scanmacro{\temp}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5075 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5076 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5077 \ifcase\paramno
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5078 % 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5079 \expandafter\xdef\csname\the\macname\endcsname{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5080 \noexpand\norecurse{\the\macname}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5081 \noexpand\scanmacro{\temp}\egroup}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5082 \or % 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5083 \expandafter\xdef\csname\the\macname\endcsname{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5084 \bgroup\noexpand\macroargctxt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5085 \noexpand\braceorline
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5086 \expandafter\noexpand\csname\the\macname xxx\endcsname}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5087 \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5088 \egroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5089 \noexpand\norecurse{\the\macname}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5090 \noexpand\scanmacro{\temp}\egroup}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5091 \else % many
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5092 \expandafter\xdef\csname\the\macname\endcsname{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5093 \bgroup\noexpand\macroargctxt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5094 \expandafter\noexpand\csname\the\macname xx\endcsname}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5095 \expandafter\xdef\csname\the\macname xx\endcsname##1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5096 \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5097 \expandafter\expandafter
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5098 \expandafter\xdef
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5099 \expandafter\expandafter
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5100 \csname\the\macname xxx\endcsname
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5101 \paramlist{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5102 \egroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5103 \noexpand\norecurse{\the\macname}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5104 \noexpand\scanmacro{\temp}\egroup}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5105 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5106 \fi}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5107
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5108 \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5109
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5110 % \braceorline decides whether the next nonwhitespace character is a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5111 % {. If so it reads up to the closing }, if not, it reads the whole
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5112 % line. Whatever was read is then fed to the next control sequence
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5113 % as an argument (by \parsebrace or \parsearg)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5114 \def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5115 \def\braceorlinexxx{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5116 \ifx\nchar\bgroup\else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5117 \expandafter\parsearg
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5118 \fi \next}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5119
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5120 % We mant to disable all macros during \shipout so that they are not
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5121 % expanded by \write.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5122 \def\turnoffmacros{\begingroup \def\do##1{\let\noexpand##1=\relax}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5123 \edef\next{\macrolist}\expandafter\endgroup\next}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5124
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5125
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5126 % @alias.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5127 % We need some trickery to remove the optional spaces around the equal
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5128 % sign. Just make them active and then expand them all to nothing.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5129 \def\alias{\begingroup\obeyspaces\parsearg\aliasxxx}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5130 \def\aliasxxx #1{\aliasyyy#1\relax}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5131 \def\aliasyyy #1=#2\relax{\ignoreactivespaces
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5132 \edef\next{\global\let\expandafter\noexpand\csname#1\endcsname=%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5133 \expandafter\noexpand\csname#2\endcsname}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5134 \expandafter\endgroup\next}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5135
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5136
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5137 \message{cross references,}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5138 % @xref etc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5139
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5140 \newwrite\auxfile
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5141
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5142 \newif\ifhavexrefs % True if xref values are known.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5143 \newif\ifwarnedxrefs % True if we warned once that they aren't known.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5144
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5145 % @inforef is relatively simple.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5146 \def\inforef #1{\inforefzzz #1,,,,**}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5147 \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5148 node \samp{\ignorespaces#1{}}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5149
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5150 % @node's job is to define \lastnode.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5151 \def\node{\ENVcheck\parsearg\nodezzz}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5152 \def\nodezzz#1{\nodexxx [#1,]}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5153 \def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5154 \let\nwnode=\node
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5155 \let\lastnode=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5156
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5157 % The sectioning commands (@chapter, etc.) call these.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5158 \def\donoderef{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5159 \ifx\lastnode\relax\else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5160 \expandafter\expandafter\expandafter\setref{\lastnode}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5161 {Ysectionnumberandtype}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5162 \global\let\lastnode=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5163 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5164 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5165 \def\unnumbnoderef{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5166 \ifx\lastnode\relax\else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5167 \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5168 \global\let\lastnode=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5169 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5170 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5171 \def\appendixnoderef{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5172 \ifx\lastnode\relax\else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5173 \expandafter\expandafter\expandafter\setref{\lastnode}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5174 {Yappendixletterandtype}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5175 \global\let\lastnode=\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5176 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5177 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5178
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5179
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5180 % @anchor{NAME} -- define xref target at arbitrary point.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5181 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5182 \newcount\savesfregister
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5183 \gdef\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5184 \gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5185 \gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5186
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5187 % \setref{NAME}{SNT} defines a cross-reference point NAME, namely
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5188 % NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5189 % to set \indexdummies so commands such as @code in a section title
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5190 % aren't expanded. It would be nicer not to expand the titles in the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5191 % first place, but there's so many layers that that is hard to do.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5192 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5193 \def\setref#1#2{{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5194 \indexdummies
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5195 \pdfmkdest{#1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5196 \dosetq{#1-title}{Ytitle}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5197 \dosetq{#1-pg}{Ypagenumber}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5198 \dosetq{#1-snt}{#2}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5199 }}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5200
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5201 % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5202 % the node name, #2 the name of the Info cross-reference, #3 the printed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5203 % node name, #4 the name of the Info file, #5 the name of the printed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5204 % manual. All but the node name can be omitted.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5205 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5206 \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5207 \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5208 \def\ref#1{\xrefX[#1,,,,,,,]}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5209 \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5210 \unsepspaces
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5211 \def\printedmanual{\ignorespaces #5}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5212 \def\printednodename{\ignorespaces #3}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5213 \setbox1=\hbox{\printedmanual}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5214 \setbox0=\hbox{\printednodename}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5215 \ifdim \wd0 = 0pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5216 % No printed node name was explicitly given.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5217 \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5218 % Use the node name inside the square brackets.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5219 \def\printednodename{\ignorespaces #1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5220 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5221 % Use the actual chapter/section title appear inside
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5222 % the square brackets. Use the real section title if we have it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5223 \ifdim \wd1 > 0pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5224 % It is in another manual, so we don't have it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5225 \def\printednodename{\ignorespaces #1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5226 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5227 \ifhavexrefs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5228 % We know the real title if we have the xref values.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5229 \def\printednodename{\refx{#1-title}{}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5230 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5231 % Otherwise just copy the Info node name.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5232 \def\printednodename{\ignorespaces #1}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5233 \fi%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5234 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5235 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5236 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5237 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5238 % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5239 % insert empty discretionaries after hyphens, which means that it will
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5240 % not find a line break at a hyphen in a node names. Since some manuals
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5241 % are best written with fairly long node names, containing hyphens, this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5242 % is a loss. Therefore, we give the text of the node name again, so it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5243 % is as if TeX is seeing it for the first time.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5244 \ifpdf
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5245 \leavevmode
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5246 \getfilename{#4}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5247 \ifnum\filenamelength>0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5248 \startlink attr{/Border [0 0 0]}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5249 goto file{\the\filename.pdf} name{#1@}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5250 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5251 \startlink attr{/Border [0 0 0]}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5252 goto name{#1@}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5253 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5254 \linkcolor
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5255 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5256 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5257 \ifdim \wd1 > 0pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5258 \putwordsection{} ``\printednodename'' \putwordin{} \cite{\printedmanual}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5259 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5260 % _ (for example) has to be the character _ for the purposes of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5261 % control sequence corresponding to the node, but it has to expand
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5262 % into the usual \leavevmode...\vrule stuff for purposes of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5263 % printing. So we \turnoffactive for the \refx-snt, back on for the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5264 % printing, back off for the \refx-pg.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5265 {\normalturnoffactive
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5266 % Only output a following space if the -snt ref is nonempty; for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5267 % @unnumbered and @anchor, it won't be.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5268 \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5269 \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5270 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5271 % [mynode],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5272 [\printednodename],\space
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5273 % page 3
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5274 \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5275 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5276 \endlink
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5277 \endgroup}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5278
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5279 % \dosetq is the interface for calls from other macros
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5280
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5281 % Use \normalturnoffactive so that punctuation chars such as underscore
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5282 % and backslash work in node names. (\turnoffactive doesn't do \.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5283 \def\dosetq#1#2{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5284 {\let\folio=0%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5285 \normalturnoffactive
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5286 \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5287 \iflinks
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5288 \next
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5289 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5290 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5291 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5292
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5293 % \internalsetq {foo}{page} expands into
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5294 % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5295 % When the aux file is read, ' is the escape character
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5296
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5297 \def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5298
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5299 % Things to be expanded by \internalsetq
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5300
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5301 \def\Ypagenumber{\folio}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5302
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5303 \def\Ytitle{\thissection}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5304
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5305 \def\Ynothing{}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5306
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5307 \def\Ysectionnumberandtype{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5308 \ifnum\secno=0 \putwordChapter\xreftie\the\chapno %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5309 \else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5310 \else \ifnum \subsubsecno=0 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5311 \putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5312 \else %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5313 \putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5314 \fi \fi \fi }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5315
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5316 \def\Yappendixletterandtype{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5317 \ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5318 \else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5319 \else \ifnum \subsubsecno=0 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5320 \putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5321 \else %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5322 \putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5323 \fi \fi \fi }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5324
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5325 \gdef\xreftie{'tie}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5326
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5327 % Use TeX 3.0's \inputlineno to get the line number, for better error
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5328 % messages, but if we're using an old version of TeX, don't do anything.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5329 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5330 \ifx\inputlineno\thisisundefined
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5331 \let\linenumber = \empty % Non-3.0.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5332 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5333 \def\linenumber{\the\inputlineno:\space}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5334 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5335
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5336 % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5337 % If its value is nonempty, SUFFIX is output afterward.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5338
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5339 \def\refx#1#2{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5340 \expandafter\ifx\csname X#1\endcsname\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5341 % If not defined, say something at least.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5342 \angleleft un\-de\-fined\angleright
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5343 \iflinks
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5344 \ifhavexrefs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5345 \message{\linenumber Undefined cross reference `#1'.}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5346 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5347 \ifwarnedxrefs\else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5348 \global\warnedxrefstrue
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5349 \message{Cross reference values unknown; you must run TeX again.}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5350 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5351 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5352 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5353 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5354 % It's defined, so just use it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5355 \csname X#1\endcsname
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5356 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5357 #2% Output the suffix in any case.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5358 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5359
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5360 % This is the macro invoked by entries in the aux file.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5361 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5362 \def\xrdef#1{\begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5363 % Reenable \ as an escape while reading the second argument.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5364 \catcode`\\ = 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5365 \afterassignment\endgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5366 \expandafter\gdef\csname X#1\endcsname
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5367 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5368
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5369 % Read the last existing aux file, if any. No error if none exists.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5370 \def\readauxfile{\begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5371 \catcode`\^^@=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5372 \catcode`\^^A=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5373 \catcode`\^^B=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5374 \catcode`\^^C=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5375 \catcode`\^^D=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5376 \catcode`\^^E=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5377 \catcode`\^^F=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5378 \catcode`\^^G=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5379 \catcode`\^^H=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5380 \catcode`\^^K=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5381 \catcode`\^^L=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5382 \catcode`\^^N=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5383 \catcode`\^^P=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5384 \catcode`\^^Q=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5385 \catcode`\^^R=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5386 \catcode`\^^S=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5387 \catcode`\^^T=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5388 \catcode`\^^U=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5389 \catcode`\^^V=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5390 \catcode`\^^W=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5391 \catcode`\^^X=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5392 \catcode`\^^Z=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5393 \catcode`\^^[=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5394 \catcode`\^^\=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5395 \catcode`\^^]=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5396 \catcode`\^^^=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5397 \catcode`\^^_=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5398 \catcode`\@=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5399 \catcode`\^=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5400 % It was suggested to define this as 7, which would allow ^^e4 etc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5401 % in xref tags, i.e., node names. But since ^^e4 notation isn't
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5402 % supported in the main text, it doesn't seem desirable. Furthermore,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5403 % that is not enough: for node names that actually contain a ^
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5404 % character, we would end up writing a line like this: 'xrdef {'hat
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5405 % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5406 % argument, and \hat is not an expandable control sequence. It could
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5407 % all be worked out, but why? Either we support ^^ or we don't.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5408 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5409 % The other change necessary for this was to define \auxhat:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5410 % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5411 % and then to call \auxhat in \setq.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5412 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5413 \catcode`\~=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5414 \catcode`\[=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5415 \catcode`\]=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5416 \catcode`\"=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5417 \catcode`\_=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5418 \catcode`\|=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5419 \catcode`\<=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5420 \catcode`\>=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5421 \catcode`\$=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5422 \catcode`\#=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5423 \catcode`\&=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5424 \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5425 % Make the characters 128-255 be printing characters
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5426 {%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5427 \count 1=128
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5428 \def\loop{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5429 \catcode\count 1=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5430 \advance\count 1 by 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5431 \ifnum \count 1<256 \loop \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5432 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5433 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5434 % The aux file uses ' as the escape (for now).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5435 % Turn off \ as an escape so we do not lose on
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5436 % entries which were dumped with control sequences in their names.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5437 % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5438 % Reference to such entries still does not work the way one would wish,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5439 % but at least they do not bomb out when the aux file is read in.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5440 \catcode`\{=1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5441 \catcode`\}=2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5442 \catcode`\%=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5443 \catcode`\'=0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5444 \catcode`\\=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5445 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5446 \openin 1 \jobname.aux
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5447 \ifeof 1 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5448 \closein 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5449 \input \jobname.aux
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5450 \global\havexrefstrue
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5451 \global\warnedobstrue
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5452 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5453 % Open the new aux file. TeX will close it automatically at exit.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5454 \openout\auxfile=\jobname.aux
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5455 \endgroup}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5456
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5457
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5458 % Footnotes.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5459
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5460 \newcount \footnoteno
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5461
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5462 % The trailing space in the following definition for supereject is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5463 % vital for proper filling; pages come out unaligned when you do a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5464 % pagealignmacro call if that space before the closing brace is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5465 % removed. (Generally, numeric constants should always be followed by a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5466 % space to prevent strange expansion errors.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5467 \def\supereject{\par\penalty -20000\footnoteno =0 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5468
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5469 % @footnotestyle is meaningful for info output only.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5470 \let\footnotestyle=\comment
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5471
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5472 \let\ptexfootnote=\footnote
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5473
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5474 {\catcode `\@=11
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5475 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5476 % Auto-number footnotes. Otherwise like plain.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5477 \gdef\footnote{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5478 \global\advance\footnoteno by \@ne
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5479 \edef\thisfootno{$^{\the\footnoteno}$}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5480 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5481 % In case the footnote comes at the end of a sentence, preserve the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5482 % extra spacing after we do the footnote number.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5483 \let\@sf\empty
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5484 \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5485 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5486 % Remove inadvertent blank space before typesetting the footnote number.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5487 \unskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5488 \thisfootno\@sf
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5489 \footnotezzz
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5490 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5491
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5492 % Don't bother with the trickery in plain.tex to not require the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5493 % footnote text as a parameter. Our footnotes don't need to be so general.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5494 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5495 % Oh yes, they do; otherwise, @ifset and anything else that uses
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5496 % \parseargline fail inside footnotes because the tokens are fixed when
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5497 % the footnote is read. --karl, 16nov96.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5498 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5499 \long\gdef\footnotezzz{\insert\footins\bgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5500 % We want to typeset this text as a normal paragraph, even if the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5501 % footnote reference occurs in (for example) a display environment.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5502 % So reset some parameters.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5503 \interlinepenalty\interfootnotelinepenalty
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5504 \splittopskip\ht\strutbox % top baseline for broken footnotes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5505 \splitmaxdepth\dp\strutbox
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5506 \floatingpenalty\@MM
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5507 \leftskip\z@skip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5508 \rightskip\z@skip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5509 \spaceskip\z@skip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5510 \xspaceskip\z@skip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5511 \parindent\defaultparindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5512 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5513 \smallfonts \rm
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5514 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5515 % Hang the footnote text off the number.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5516 \hang
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5517 \textindent{\thisfootno}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5518 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5519 % Don't crash into the line above the footnote text. Since this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5520 % expands into a box, it must come within the paragraph, lest it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5521 % provide a place where TeX can split the footnote.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5522 \footstrut
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5523 \futurelet\next\fo@t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5524 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5525 \def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5526 \else\let\next\f@t\fi \next}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5527 \def\f@@t{\bgroup\aftergroup\@foot\let\next}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5528 \def\f@t#1{#1\@foot}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5529 \def\@foot{\strut\par\egroup}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5530
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5531 }%end \catcode `\@=11
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5532
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5533 % Set the baselineskip to #1, and the lineskip and strut size
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5534 % correspondingly. There is no deep meaning behind these magic numbers
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5535 % used as factors; they just match (closely enough) what Knuth defined.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5536 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5537 \def\lineskipfactor{.08333}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5538 \def\strutheightpercent{.70833}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5539 \def\strutdepthpercent {.29167}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5540 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5541 \def\setleading#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5542 \normalbaselineskip = #1\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5543 \normallineskip = \lineskipfactor\normalbaselineskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5544 \normalbaselines
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5545 \setbox\strutbox =\hbox{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5546 \vrule width0pt height\strutheightpercent\baselineskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5547 depth \strutdepthpercent \baselineskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5548 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5549 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5550
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5551 % @| inserts a changebar to the left of the current line. It should
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5552 % surround any changed text. This approach does *not* work if the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5553 % change spans more than two lines of output. To handle that, we would
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5554 % have adopt a much more difficult approach (putting marks into the main
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5555 % vertical list for the beginning and end of each change).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5556 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5557 \def\|{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5558 % \vadjust can only be used in horizontal mode.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5559 \leavevmode
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5560 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5561 % Append this vertical mode material after the current line in the output.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5562 \vadjust{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5563 % We want to insert a rule with the height and depth of the current
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5564 % leading; that is exactly what \strutbox is supposed to record.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5565 \vskip-\baselineskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5566 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5567 % \vadjust-items are inserted at the left edge of the type. So
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5568 % the \llap here moves out into the left-hand margin.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5569 \llap{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5570 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5571 % For a thicker or thinner bar, change the `1pt'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5572 \vrule height\baselineskip width1pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5573 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5574 % This is the space between the bar and the text.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5575 \hskip 12pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5576 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5577 }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5578 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5579
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5580 % For a final copy, take out the rectangles
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5581 % that mark overfull boxes (in case you have decided
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5582 % that the text looks ok even though it passes the margin).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5583 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5584 \def\finalout{\overfullrule=0pt}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5585
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5586 % @image. We use the macros from epsf.tex to support this.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5587 % If epsf.tex is not installed and @image is used, we complain.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5588 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5589 % Check for and read epsf.tex up front. If we read it only at @image
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5590 % time, we might be inside a group, and then its definitions would get
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5591 % undone and the next image would fail.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5592 \openin 1 = epsf.tex
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5593 \ifeof 1 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5594 \closein 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5595 % Do not bother showing banner with post-v2.7 epsf.tex (available in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5596 % doc/epsf.tex until it shows up on ctan).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5597 \def\epsfannounce{\toks0 = }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5598 \input epsf.tex
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5599 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5600 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5601 % We will only complain once about lack of epsf.tex.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5602 \newif\ifwarnednoepsf
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5603 \newhelp\noepsfhelp{epsf.tex must be installed for images to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5604 work. It is also included in the Texinfo distribution, or you can get
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5605 it from ftp://tug.org/tex/epsf.tex.}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5606 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5607 \def\image#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5608 \ifx\epsfbox\undefined
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5609 \ifwarnednoepsf \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5610 \errhelp = \noepsfhelp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5611 \errmessage{epsf.tex not found, images will be ignored}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5612 \global\warnednoepsftrue
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5613 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5614 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5615 \imagexxx #1,,,\finish
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5616 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5617 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5618 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5619 % Arguments to @image:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5620 % #1 is (mandatory) image filename; we tack on .eps extension.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5621 % #2 is (optional) width, #3 is (optional) height.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5622 % #4 is just the usual extra ignored arg for parsing this stuff.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5623 \def\imagexxx#1,#2,#3,#4\finish{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5624 \ifpdf
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5625 \centerline{\dopdfimage{#1}{#2}{#3}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5626 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5627 % \epsfbox itself resets \epsf?size at each figure.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5628 \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5629 \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5630 \begingroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5631 \catcode`\^^M = 5 % in case we're inside an example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5632 % If the image is by itself, center it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5633 \ifvmode
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5634 \nobreak\bigskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5635 % Usually we'll have text after the image which will insert
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5636 % \parskip glue, so insert it here too to equalize the space
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5637 % above and below.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5638 \nobreak\vskip\parskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5639 \nobreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5640 \centerline{\epsfbox{#1.eps}}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5641 \bigbreak
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5642 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5643 % In the middle of a paragraph, no extra space.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5644 \epsfbox{#1.eps}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5645 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5646 \endgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5647 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5648 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5649
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5650
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5651 \message{localization,}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5652 % and i18n.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5653
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5654 % @documentlanguage is usually given very early, just after
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5655 % @setfilename. If done too late, it may not override everything
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5656 % properly. Single argument is the language abbreviation.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5657 % It would be nice if we could set up a hyphenation file here.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5658 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5659 \def\documentlanguage{\parsearg\dodocumentlanguage}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5660 \def\dodocumentlanguage#1{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5661 \tex % read txi-??.tex file in plain TeX.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5662 % Read the file if it exists.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5663 \openin 1 txi-#1.tex
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5664 \ifeof1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5665 \errhelp = \nolanghelp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5666 \errmessage{Cannot read language file txi-#1.tex}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5667 \let\temp = \relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5668 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5669 \def\temp{\input txi-#1.tex }%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5670 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5671 \temp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5672 \endgroup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5673 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5674 \newhelp\nolanghelp{The given language definition file cannot be found or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5675 is empty. Maybe you need to install it? In the current directory
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5676 should work if nowhere else does.}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5677
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5678
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5679 % @documentencoding should change something in TeX eventually, most
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5680 % likely, but for now just recognize it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5681 \let\documentencoding = \comment
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5682
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5683
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5684 % Page size parameters.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5685 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5686 \newdimen\defaultparindent \defaultparindent = 15pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5687
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5688 \chapheadingskip = 15pt plus 4pt minus 2pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5689 \secheadingskip = 12pt plus 3pt minus 2pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5690 \subsecheadingskip = 9pt plus 2pt minus 2pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5691
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5692 % Prevent underfull vbox error messages.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5693 \vbadness = 10000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5694
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5695 % Don't be so finicky about underfull hboxes, either.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5696 \hbadness = 2000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5697
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5698 % Following George Bush, just get rid of widows and orphans.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5699 \widowpenalty=10000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5700 \clubpenalty=10000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5701
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5702 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5703 % using an old version of TeX, don't do anything. We want the amount of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5704 % stretch added to depend on the line length, hence the dependence on
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5705 % \hsize. We call this whenever the paper size is set.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5706 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5707 \def\setemergencystretch{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5708 \ifx\emergencystretch\thisisundefined
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5709 % Allow us to assign to \emergencystretch anyway.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5710 \def\emergencystretch{\dimen0}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5711 \else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5712 \emergencystretch = .15\hsize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5713 \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5714 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5715
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5716 % Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5717 % 4) hoffset; 5) binding offset; 6) topskip. Then whoever calls us can
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5718 % set \parskip and call \setleading for \baselineskip.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5719 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5720 \def\internalpagesizes#1#2#3#4#5#6{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5721 \voffset = #3\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5722 \topskip = #6\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5723 \splittopskip = \topskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5724 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5725 \vsize = #1\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5726 \advance\vsize by \topskip
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5727 \outervsize = \vsize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5728 \advance\outervsize by 2\topandbottommargin
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5729 \pageheight = \vsize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5730 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5731 \hsize = #2\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5732 \outerhsize = \hsize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5733 \advance\outerhsize by 0.5in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5734 \pagewidth = \hsize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5735 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5736 \normaloffset = #4\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5737 \bindingoffset = #5\relax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5738 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5739 \parindent = \defaultparindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5740 \setemergencystretch
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5741 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5742
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5743 % @letterpaper (the default).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5744 \def\letterpaper{{\globaldefs = 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5745 \parskip = 3pt plus 2pt minus 1pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5746 \setleading{13.2pt}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5747 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5748 % If page is nothing but text, make it come out even.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5749 \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5750 }}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5751
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5752 % Use @smallbook to reset parameters for 7x9.5 (or so) format.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5753 \def\smallbook{{\globaldefs = 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5754 \parskip = 2pt plus 1pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5755 \setleading{12pt}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5756 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5757 \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5758 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5759 \lispnarrowing = 0.3in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5760 \tolerance = 700
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5761 \hfuzz = 1pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5762 \contentsrightmargin = 0pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5763 \deftypemargin = 0pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5764 \defbodyindent = .5cm
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5765 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5766 \let\smalldisplay = \smalldisplayx
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5767 \let\smallexample = \smalllispx
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5768 \let\smallformat = \smallformatx
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5769 \let\smalllisp = \smalllispx
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5770 }}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5771
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5772 % Use @afourpaper to print on European A4 paper.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5773 \def\afourpaper{{\globaldefs = 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5774 \setleading{12pt}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5775 \parskip = 3pt plus 2pt minus 1pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5776 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5777 \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5778 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5779 \tolerance = 700
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5780 \hfuzz = 1pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5781 }}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5782
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5783 % A specific text layout, 24x15cm overall, intended for A4 paper. Top margin
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5784 % 29mm, hence bottom margin 28mm, nominal side margin 3cm.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5785 \def\afourlatex{{\globaldefs = 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5786 \setleading{13.6pt}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5787 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5788 \afourpaper
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5789 \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5790 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5791 \globaldefs = 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5792 }}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5793
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5794 % Use @afourwide to print on European A4 paper in wide format.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5795 \def\afourwide{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5796 \afourpaper
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5797 \internalpagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5798 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5799 \globaldefs = 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5800 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5801
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5802 % @pagesizes TEXTHEIGHT[,TEXTWIDTH]
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5803 % Perhaps we should allow setting the margins, \topskip, \parskip,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5804 % and/or leading, also. Or perhaps we should compute them somehow.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5805 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5806 \def\pagesizes{\parsearg\pagesizesxxx}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5807 \def\pagesizesxxx#1{\pagesizesyyy #1,,\finish}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5808 \def\pagesizesyyy#1,#2,#3\finish{{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5809 \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5810 \globaldefs = 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5811 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5812 \parskip = 3pt plus 2pt minus 1pt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5813 \setleading{13.2pt}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5814 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5815 \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5816 }}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5817
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5818 % Set default to letter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5819 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5820 \letterpaper
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5821
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5822
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5823 \message{and turning on texinfo input format.}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5824
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5825 % Define macros to output various characters with catcode for normal text.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5826 \catcode`\"=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5827 \catcode`\~=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5828 \catcode`\^=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5829 \catcode`\_=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5830 \catcode`\|=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5831 \catcode`\<=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5832 \catcode`\>=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5833 \catcode`\+=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5834 \catcode`\$=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5835 \def\normaldoublequote{"}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5836 \def\normaltilde{~}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5837 \def\normalcaret{^}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5838 \def\normalunderscore{_}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5839 \def\normalverticalbar{|}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5840 \def\normalless{<}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5841 \def\normalgreater{>}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5842 \def\normalplus{+}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5843 \def\normaldollar{$}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5844
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5845 % This macro is used to make a character print one way in ttfont
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5846 % where it can probably just be output, and another way in other fonts,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5847 % where something hairier probably needs to be done.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5848 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5849 % #1 is what to print if we are indeed using \tt; #2 is what to print
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5850 % otherwise. Since all the Computer Modern typewriter fonts have zero
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5851 % interword stretch (and shrink), and it is reasonable to expect all
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5852 % typewriter fonts to have this, we can check that font parameter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5853 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5854 \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5855
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5856 % Same as above, but check for italic font. Actually this also catches
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5857 % non-italic slanted fonts since it is impossible to distinguish them from
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5858 % italic fonts. But since this is only used by $ and it uses \sl anyway
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5859 % this is not a problem.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5860 \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5861
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5862 % Turn off all special characters except @
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5863 % (and those which the user can use as if they were ordinary).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5864 % Most of these we simply print from the \tt font, but for some, we can
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5865 % use math or other variants that look better in normal text.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5866
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5867 \catcode`\"=\active
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5868 \def\activedoublequote{{\tt\char34}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5869 \let"=\activedoublequote
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5870 \catcode`\~=\active
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5871 \def~{{\tt\char126}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5872 \chardef\hat=`\^
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5873 \catcode`\^=\active
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5874 \def^{{\tt \hat}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5875
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5876 \catcode`\_=\active
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5877 \def_{\ifusingtt\normalunderscore\_}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5878 % Subroutine for the previous macro.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5879 \def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5880
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5881 \catcode`\|=\active
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5882 \def|{{\tt\char124}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5883 \chardef \less=`\<
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5884 \catcode`\<=\active
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5885 \def<{{\tt \less}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5886 \chardef \gtr=`\>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5887 \catcode`\>=\active
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5888 \def>{{\tt \gtr}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5889 \catcode`\+=\active
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5890 \def+{{\tt \char 43}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5891 \catcode`\$=\active
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5892 \def${\ifusingit{{\sl\$}}\normaldollar}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5893 %\catcode 27=\active
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5894 %\def^^[{$\diamondsuit$}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5895
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5896 % Set up an active definition for =, but don't enable it most of the time.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5897 {\catcode`\==\active
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5898 \global\def={{\tt \char 61}}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5899
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5900 \catcode`+=\active
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5901 \catcode`\_=\active
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5902
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5903 % If a .fmt file is being used, characters that might appear in a file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5904 % name cannot be active until we have parsed the command line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5905 % So turn them off again, and have \everyjob (or @setfilename) turn them on.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5906 % \otherifyactive is called near the end of this file.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5907 \def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5908
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5909 \catcode`\@=0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5910
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5911 % \rawbackslashxx output one backslash character in current font
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5912 \global\chardef\rawbackslashxx=`\\
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5913 %{\catcode`\\=\other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5914 %@gdef@rawbackslashxx{\}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5915
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5916 % \rawbackslash redefines \ as input to do \rawbackslashxx.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5917 {\catcode`\\=\active
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5918 @gdef@rawbackslash{@let\=@rawbackslashxx }}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5919
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5920 % \normalbackslash outputs one backslash in fixed width font.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5921 \def\normalbackslash{{\tt\rawbackslashxx}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5922
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5923 % \catcode 17=0 % Define control-q
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5924 \catcode`\\=\active
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5925
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5926 % Used sometimes to turn off (effectively) the active characters
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5927 % even after parsing them.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5928 @def@turnoffactive{@let"=@normaldoublequote
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5929 @let\=@realbackslash
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5930 @let~=@normaltilde
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5931 @let^=@normalcaret
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5932 @let_=@normalunderscore
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5933 @let|=@normalverticalbar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5934 @let<=@normalless
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5935 @let>=@normalgreater
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5936 @let+=@normalplus
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5937 @let$=@normaldollar}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5938
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5939 @def@normalturnoffactive{@let"=@normaldoublequote
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5940 @let\=@normalbackslash
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5941 @let~=@normaltilde
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5942 @let^=@normalcaret
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5943 @let_=@normalunderscore
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5944 @let|=@normalverticalbar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5945 @let<=@normalless
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5946 @let>=@normalgreater
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5947 @let+=@normalplus
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5948 @let$=@normaldollar}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5949
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5950 % Make _ and + \other characters, temporarily.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5951 % This is canceled by @fixbackslash.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5952 @otherifyactive
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5953
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5954 % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5955 % That is what \eatinput is for; after that, the `\' should revert to printing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5956 % a backslash.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5957 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5958 @gdef@eatinput input texinfo{@fixbackslash}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5959 @global@let\ = @eatinput
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5960
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5961 % On the other hand, perhaps the file did not have a `\input texinfo'. Then
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5962 % the first `\{ in the file would cause an error. This macro tries to fix
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5963 % that, assuming it is called before the first `\' could plausibly occur.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5964 % Also back turn on active characters that might appear in the input
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5965 % file name, in case not using a pre-dumped format.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5966 %
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5967 @gdef@fixbackslash{%
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5968 @ifx\@eatinput @let\ = @normalbackslash @fi
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5969 @catcode`+=@active
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5970 @catcode`@_=@active
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5971 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5972
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5973 % Say @foo, not \foo, in error messages.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5974 @escapechar = `@@
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5975
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5976 % These look ok in all fonts, so just make them not special.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5977 @catcode`@& = @other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5978 @catcode`@# = @other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5979 @catcode`@% = @other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5980
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5981 @c Set initial fonts.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5982 @textfonts
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5983 @rm
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5984
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5985
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5986 @c Local variables:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5987 @c eval: (add-hook 'write-file-hooks 'time-stamp)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5988 @c page-delimiter: "^\\\\message"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5989 @c time-stamp-start: "def\\\\texinfoversion{"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5990 @c time-stamp-format: "%:y-%02m-%02d.%02H"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5991 @c time-stamp-end: "}"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5992 @c End: