1 1.1 mrg % texinfo.tex -- TeX macros to handle Texinfo files. 2 1.1.1.5 mrg % 3 1.1 mrg % Load plain if necessary, i.e., if running under initex. 4 1.1 mrg \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi 5 1.1 mrg % 6 1.1.1.5 mrg \def\texinfoversion{2022-12-10.11} 7 1.1 mrg % 8 1.1.1.5 mrg % Copyright 1985, 1986, 1988, 1990-2022 Free Software Foundation, Inc. 9 1.1 mrg % 10 1.1 mrg % This texinfo.tex file is free software: you can redistribute it and/or 11 1.1 mrg % modify it under the terms of the GNU General Public License as 12 1.1 mrg % published by the Free Software Foundation, either version 3 of the 13 1.1 mrg % License, or (at your option) any later version. 14 1.1 mrg % 15 1.1 mrg % This texinfo.tex file is distributed in the hope that it will be 16 1.1 mrg % useful, but WITHOUT ANY WARRANTY; without even the implied warranty 17 1.1 mrg % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 1.1 mrg % General Public License for more details. 19 1.1 mrg % 20 1.1 mrg % You should have received a copy of the GNU General Public License 21 1.1.1.3 mrg % along with this program. If not, see <https://www.gnu.org/licenses/>. 22 1.1 mrg % 23 1.1 mrg % As a special exception, when this file is read by TeX when processing 24 1.1 mrg % a Texinfo source document, you may use the result without 25 1.1.1.2 mrg % restriction. This Exception is an additional permission under section 7 26 1.1.1.2 mrg % of the GNU General Public License, version 3 ("GPLv3"). 27 1.1 mrg % 28 1.1 mrg % Please try the latest version of texinfo.tex before submitting bug 29 1.1 mrg % reports; you can get the latest version from: 30 1.1.1.3 mrg % https://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or 31 1.1.1.3 mrg % https://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or 32 1.1.1.3 mrg % https://www.gnu.org/software/texinfo/ (the Texinfo home page) 33 1.1 mrg % The texinfo.tex in any given distribution could well be out 34 1.1 mrg % of date, so if that's what you're using, please check. 35 1.1 mrg % 36 1.1.1.5 mrg % Send bug reports to bug-texinfo (a] gnu.org. Please include a 37 1.1 mrg % complete document in each bug report with which we can reproduce the 38 1.1 mrg % problem. Patches are, of course, greatly appreciated. 39 1.1 mrg % 40 1.1 mrg % To process a Texinfo manual with TeX, it's most reliable to use the 41 1.1 mrg % texi2dvi shell script that comes with the distribution. For a simple 42 1.1 mrg % manual foo.texi, however, you can get away with this: 43 1.1 mrg % tex foo.texi 44 1.1 mrg % texindex foo.?? 45 1.1 mrg % tex foo.texi 46 1.1 mrg % tex foo.texi 47 1.1 mrg % dvips foo.dvi -o # or whatever; this makes foo.ps. 48 1.1 mrg % The extra TeX runs get the cross-reference information correct. 49 1.1 mrg % Sometimes one run after texindex suffices, and sometimes you need more 50 1.1 mrg % than two; texi2dvi does it as many times as necessary. 51 1.1 mrg % 52 1.1 mrg % It is possible to adapt texinfo.tex for other languages, to some 53 1.1 mrg % extent. You can get the existing language-specific files from the 54 1.1 mrg % full Texinfo distribution. 55 1.1 mrg % 56 1.1.1.3 mrg % The GNU Texinfo home page is https://www.gnu.org/software/texinfo. 57 1.1 mrg 58 1.1 mrg 59 1.1 mrg \message{Loading texinfo [version \texinfoversion]:} 60 1.1 mrg 61 1.1 mrg % If in a .fmt file, print the version number 62 1.1 mrg % and turn on active characters that we couldn't do earlier because 63 1.1 mrg % they might have appeared in the input file name. 64 1.1 mrg \everyjob{\message{[Texinfo version \texinfoversion]}% 65 1.1 mrg \catcode`+=\active \catcode`\_=\active} 66 1.1 mrg 67 1.1.1.3 mrg % LaTeX's \typeout. This ensures that the messages it is used for 68 1.1.1.3 mrg % are identical in format to the corresponding ones from latex/pdflatex. 69 1.1.1.3 mrg \def\typeout{\immediate\write17}% 70 1.1.1.3 mrg 71 1.1 mrg \chardef\other=12 72 1.1 mrg 73 1.1 mrg % We never want plain's \outer definition of \+ in Texinfo. 74 1.1 mrg % For @tex, we can use \tabalign. 75 1.1 mrg \let\+ = \relax 76 1.1 mrg 77 1.1 mrg % Save some plain tex macros whose names we will redefine. 78 1.1 mrg \let\ptexb=\b 79 1.1 mrg \let\ptexbullet=\bullet 80 1.1 mrg \let\ptexc=\c 81 1.1 mrg \let\ptexcomma=\, 82 1.1 mrg \let\ptexdot=\. 83 1.1 mrg \let\ptexdots=\dots 84 1.1 mrg \let\ptexend=\end 85 1.1 mrg \let\ptexequiv=\equiv 86 1.1 mrg \let\ptexexclam=\! 87 1.1 mrg \let\ptexfootnote=\footnote 88 1.1 mrg \let\ptexgtr=> 89 1.1 mrg \let\ptexhat=^ 90 1.1 mrg \let\ptexi=\i 91 1.1 mrg \let\ptexindent=\indent 92 1.1 mrg \let\ptexinsert=\insert 93 1.1 mrg \let\ptexlbrace=\{ 94 1.1 mrg \let\ptexless=< 95 1.1 mrg \let\ptexnewwrite\newwrite 96 1.1 mrg \let\ptexnoindent=\noindent 97 1.1 mrg \let\ptexplus=+ 98 1.1 mrg \let\ptexraggedright=\raggedright 99 1.1 mrg \let\ptexrbrace=\} 100 1.1 mrg \let\ptexslash=\/ 101 1.1.1.3 mrg \let\ptexsp=\sp 102 1.1 mrg \let\ptexstar=\* 103 1.1.1.3 mrg \let\ptexsup=\sup 104 1.1 mrg \let\ptext=\t 105 1.1 mrg \let\ptextop=\top 106 1.1 mrg {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode 107 1.1 mrg 108 1.1 mrg % If this character appears in an error message or help string, it 109 1.1 mrg % starts a new line in the output. 110 1.1 mrg \newlinechar = `^^J 111 1.1 mrg 112 1.1 mrg % Use TeX 3.0's \inputlineno to get the line number, for better error 113 1.1 mrg % messages, but if we're using an old version of TeX, don't do anything. 114 1.1 mrg % 115 1.1 mrg \ifx\inputlineno\thisisundefined 116 1.1 mrg \let\linenumber = \empty % Pre-3.0. 117 1.1 mrg \else 118 1.1 mrg \def\linenumber{l.\the\inputlineno:\space} 119 1.1 mrg \fi 120 1.1 mrg 121 1.1 mrg % Set up fixed words for English if not already set. 122 1.1 mrg \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi 123 1.1 mrg \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi 124 1.1 mrg \ifx\putworderror\undefined \gdef\putworderror{error}\fi 125 1.1 mrg \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi 126 1.1 mrg \ifx\putwordin\undefined \gdef\putwordin{in}\fi 127 1.1 mrg \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi 128 1.1 mrg \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi 129 1.1 mrg \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi 130 1.1 mrg \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi 131 1.1 mrg \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi 132 1.1 mrg \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi 133 1.1 mrg \ifx\putwordof\undefined \gdef\putwordof{of}\fi 134 1.1 mrg \ifx\putwordon\undefined \gdef\putwordon{on}\fi 135 1.1 mrg \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi 136 1.1 mrg \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi 137 1.1 mrg \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi 138 1.1 mrg \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi 139 1.1 mrg \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi 140 1.1 mrg \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi 141 1.1 mrg \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi 142 1.1 mrg % 143 1.1 mrg \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi 144 1.1 mrg \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi 145 1.1 mrg \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi 146 1.1 mrg \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi 147 1.1 mrg \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi 148 1.1 mrg \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi 149 1.1 mrg \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi 150 1.1 mrg \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi 151 1.1 mrg \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi 152 1.1 mrg \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi 153 1.1 mrg \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi 154 1.1 mrg \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi 155 1.1 mrg % 156 1.1 mrg \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi 157 1.1 mrg \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi 158 1.1 mrg \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi 159 1.1 mrg \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi 160 1.1 mrg \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi 161 1.1 mrg 162 1.1.1.3 mrg % Give the space character the catcode for a space. 163 1.1.1.3 mrg \def\spaceisspace{\catcode`\ =10\relax} 164 1.1.1.3 mrg 165 1.1.1.3 mrg % Likewise for ^^M, the end of line character. 166 1.1.1.3 mrg \def\endlineisspace{\catcode13=10\relax} 167 1.1.1.3 mrg 168 1.1 mrg \chardef\dashChar = `\- 169 1.1 mrg \chardef\slashChar = `\/ 170 1.1 mrg \chardef\underChar = `\_ 171 1.1 mrg 172 1.1 mrg % Ignore a token. 173 1.1 mrg % 174 1.1 mrg \def\gobble#1{} 175 1.1 mrg 176 1.1 mrg % The following is used inside several \edef's. 177 1.1 mrg \def\makecsname#1{\expandafter\noexpand\csname#1\endcsname} 178 1.1 mrg 179 1.1 mrg % Hyphenation fixes. 180 1.1 mrg \hyphenation{ 181 1.1 mrg Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script 182 1.1 mrg ap-pen-dix bit-map bit-maps 183 1.1 mrg data-base data-bases eshell fall-ing half-way long-est man-u-script 184 1.1 mrg man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm 185 1.1 mrg par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces 186 1.1 mrg spell-ing spell-ings 187 1.1 mrg stand-alone strong-est time-stamp time-stamps which-ever white-space 188 1.1 mrg wide-spread wrap-around 189 1.1 mrg } 190 1.1 mrg 191 1.1 mrg % Sometimes it is convenient to have everything in the transcript file 192 1.1 mrg % and nothing on the terminal. We don't just call \tracingall here, 193 1.1 mrg % since that produces some useless output on the terminal. We also make 194 1.1 mrg % some effort to order the tracing commands to reduce output in the log 195 1.1 mrg % file; cf. trace.sty in LaTeX. 196 1.1 mrg % 197 1.1 mrg \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% 198 1.1 mrg \def\loggingall{% 199 1.1 mrg \tracingstats2 200 1.1 mrg \tracingpages1 201 1.1 mrg \tracinglostchars2 % 2 gives us more in etex 202 1.1 mrg \tracingparagraphs1 203 1.1 mrg \tracingoutput1 204 1.1 mrg \tracingmacros2 205 1.1 mrg \tracingrestores1 206 1.1 mrg \showboxbreadth\maxdimen \showboxdepth\maxdimen 207 1.1 mrg \ifx\eTeXversion\thisisundefined\else % etex gives us more logging 208 1.1 mrg \tracingscantokens1 209 1.1 mrg \tracingifs1 210 1.1 mrg \tracinggroups1 211 1.1 mrg \tracingnesting2 212 1.1 mrg \tracingassigns1 213 1.1 mrg \fi 214 1.1 mrg \tracingcommands3 % 3 gives us more in etex 215 1.1 mrg \errorcontextlines16 216 1.1 mrg }% 217 1.1 mrg 218 1.1 mrg % @errormsg{MSG}. Do the index-like expansions on MSG, but if things 219 1.1 mrg % aren't perfect, it's not the end of the world, being an error message, 220 1.1 mrg % after all. 221 1.1.1.5 mrg % 222 1.1 mrg \def\errormsg{\begingroup \indexnofonts \doerrormsg} 223 1.1 mrg \def\doerrormsg#1{\errmessage{#1}} 224 1.1 mrg 225 1.1 mrg % add check for \lastpenalty to plain's definitions. If the last thing 226 1.1 mrg % we did was a \nobreak, we don't want to insert more space. 227 1.1 mrg % 228 1.1 mrg \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount 229 1.1 mrg \removelastskip\penalty-50\smallskip\fi\fi} 230 1.1 mrg \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount 231 1.1 mrg \removelastskip\penalty-100\medskip\fi\fi} 232 1.1 mrg \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount 233 1.1 mrg \removelastskip\penalty-200\bigskip\fi\fi} 234 1.1 mrg 235 1.1.1.3 mrg % Output routine 237 1.1.1.3 mrg % 238 1.1.1.3 mrg 239 1.1.1.3 mrg % For a final copy, take out the rectangles 240 1.1.1.3 mrg % that mark overfull boxes (in case you have decided 241 1.1.1.3 mrg % that the text looks ok even though it passes the margin). 242 1.1.1.3 mrg % 243 1.1.1.3 mrg \def\finalout{\overfullrule=0pt } 244 1.1 mrg 245 1.1 mrg % Output a mark which sets \thischapter, \thissection and \thiscolor. 246 1.1 mrg % We dump everything together because we only have one kind of mark. 247 1.1 mrg % This works because we only use \botmark / \topmark, not \firstmark. 248 1.1 mrg % 249 1.1 mrg % A mark contains a subexpression of the \ifcase ... \fi construct. 250 1.1 mrg % \get*marks macros below extract the needed part using \ifcase. 251 1.1 mrg % 252 1.1 mrg % Another complication is to let the user choose whether \thischapter 253 1.1.1.3 mrg % (\thissection) refers to the chapter (section) in effect at the top 254 1.1.1.3 mrg % of a page, or that at the bottom of a page. 255 1.1.1.3 mrg 256 1.1.1.3 mrg % \domark is called twice inside \chapmacro, to add one 257 1.1.1.4 mrg % mark before the section break, and one after. 258 1.1.1.4 mrg % In the second call \prevchapterdefs is the same as \currentchapterdefs, 259 1.1.1.3 mrg % and \prevsectiondefs is the same as \currentsectiondefs. 260 1.1.1.3 mrg % Then if the page is not broken at the mark, some of the previous 261 1.1.1.3 mrg % section appears on the page, and we can get the name of this section 262 1.1.1.3 mrg % from \firstmark for @everyheadingmarks top. 263 1.1.1.3 mrg % @everyheadingmarks bottom uses \botmark. 264 1.1.1.3 mrg % 265 1.1 mrg % See page 260 of The TeXbook. 266 1.1.1.4 mrg \def\domark{% 267 1.1.1.4 mrg \toks0=\expandafter{\currentchapterdefs}% 268 1.1 mrg \toks2=\expandafter{\currentsectiondefs}% 269 1.1 mrg \toks4=\expandafter{\prevchapterdefs}% 270 1.1.1.4 mrg \toks6=\expandafter{\prevsectiondefs}% 271 1.1 mrg \toks8=\expandafter{\currentcolordefs}% 272 1.1.1.3 mrg \mark{% 273 1.1.1.3 mrg \the\toks0 \the\toks2 % 0: marks for @everyheadingmarks top 274 1.1.1.3 mrg \noexpand\or \the\toks4 \the\toks6 % 1: for @everyheadingmarks bottom 275 1.1 mrg \noexpand\else \the\toks8 % 2: color marks 276 1.1 mrg }% 277 1.1.1.3 mrg } 278 1.1.1.3 mrg 279 1.1.1.3 mrg % \gettopheadingmarks, \getbottomheadingmarks, 280 1.1.1.3 mrg % \getcolormarks - extract needed part of mark. 281 1.1 mrg % 282 1.1 mrg % \topmark doesn't work for the very first chapter (after the title 283 1.1 mrg % page or the contents), so we use \firstmark there -- this gets us 284 1.1 mrg % the mark with the chapter defs, unless the user sneaks in, e.g., 285 1.1 mrg % @setcolor (or @url, or @link, etc.) between @contents and the very 286 1.1 mrg % first @chapter. 287 1.1.1.4 mrg \def\gettopheadingmarks{% 288 1.1 mrg \ifcase0\the\savedtopmark\fi 289 1.1 mrg \ifx\thischapter\empty \ifcase0\firstmark\fi \fi 290 1.1 mrg } 291 1.1.1.4 mrg \def\getbottomheadingmarks{\ifcase1\botmark\fi} 292 1.1 mrg \def\getcolormarks{\ifcase2\the\savedtopmark\fi} 293 1.1 mrg 294 1.1.1.4 mrg % Avoid "undefined control sequence" errors. 295 1.1.1.4 mrg \def\currentchapterdefs{} 296 1.1.1.4 mrg \def\currentsectiondefs{} 297 1.1 mrg \def\currentsection{} 298 1.1 mrg \def\prevchapterdefs{} 299 1.1.1.4 mrg \def\prevsectiondefs{} 300 1.1 mrg \def\currentcolordefs{} 301 1.1.1.3 mrg 302 1.1.1.3 mrg % Margin to add to right of even pages, to left of odd pages. 303 1.1.1.3 mrg \newdimen\bindingoffset 304 1.1.1.3 mrg \newdimen\normaloffset 305 1.1.1.3 mrg \newdimen\txipagewidth \newdimen\txipageheight 306 1.1 mrg 307 1.1.1.3 mrg % Main output routine. 308 1.1 mrg % 309 1.1.1.4 mrg \chardef\PAGE = 255 310 1.1.1.4 mrg \newtoks\defaultoutput 311 1.1.1.4 mrg \defaultoutput = {\savetopmark\onepageout{\pagecontents\PAGE}} 312 1.1 mrg \output=\expandafter{\the\defaultoutput} 313 1.1 mrg 314 1.1 mrg \newbox\headlinebox 315 1.1 mrg \newbox\footlinebox 316 1.1.1.4 mrg 317 1.1.1.5 mrg % When outputting the double column layout for indices, an output routine 318 1.1.1.5 mrg % is run several times, hiding the original value of \topmark. Hence, save 319 1.1.1.4 mrg % \topmark at the beginning. 320 1.1.1.4 mrg % 321 1.1.1.4 mrg \newtoks\savedtopmark 322 1.1.1.4 mrg \newif\iftopmarksaved 323 1.1.1.4 mrg \topmarksavedtrue 324 1.1.1.4 mrg \def\savetopmark{% 325 1.1.1.4 mrg \iftopmarksaved\else 326 1.1.1.4 mrg \global\savedtopmark=\expandafter{\topmark}% 327 1.1.1.4 mrg \global\topmarksavedtrue 328 1.1.1.4 mrg \fi 329 1.1.1.4 mrg } 330 1.1.1.3 mrg 331 1.1.1.4 mrg % \onepageout takes a vbox as an argument. 332 1.1.1.4 mrg % \shipout a vbox for a single page, adding an optional header, footer 333 1.1.1.4 mrg % and footnote. This also causes index entries for this page to be written 334 1.1.1.3 mrg % to the auxiliary files. 335 1.1 mrg % 336 1.1.1.4 mrg \def\onepageout#1{% 337 1.1 mrg \hoffset=\normaloffset 338 1.1 mrg % 339 1.1 mrg \ifodd\pageno \advance\hoffset by \bindingoffset 340 1.1 mrg \else \advance\hoffset by -\bindingoffset\fi 341 1.1.1.5 mrg % 342 1.1.1.3 mrg \checkchapterpage 343 1.1.1.5 mrg % 344 1.1.1.5 mrg % Make the heading and footing. \makeheadline and \makefootline 345 1.1.1.4 mrg % use the contents of \headline and \footline. 346 1.1.1.5 mrg \def\commonheadfootline{\let\hsize=\txipagewidth \texinfochars} 347 1.1.1.4 mrg \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi 348 1.1.1.4 mrg \global\setbox\headlinebox = \vbox{\commonheadfootline \makeheadline}% 349 1.1.1.4 mrg \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi 350 1.1 mrg \global\setbox\footlinebox = \vbox{\commonheadfootline \makefootline}% 351 1.1 mrg % 352 1.1.1.3 mrg {% 353 1.1 mrg % Set context for writing to auxiliary files like index files. 354 1.1 mrg % Have to do this stuff outside the \shipout because we want it to 355 1.1 mrg % take effect in \write's, yet the group defined by the \vbox ends 356 1.1 mrg % before the \shipout runs. 357 1.1.1.4 mrg % 358 1.1.1.4 mrg \atdummies % don't expand commands in the output. 359 1.1 mrg \turnoffactive 360 1.1 mrg \shipout\vbox{% 361 1.1 mrg % Do this early so pdf references go to the beginning of the page. 362 1.1 mrg \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi 363 1.1 mrg % 364 1.1 mrg \unvbox\headlinebox 365 1.1 mrg \pagebody{#1}% 366 1.1 mrg \ifdim\ht\footlinebox > 0pt 367 1.1 mrg % Only leave this space if the footline is nonempty. 368 1.1 mrg % (We lessened \vsize for it in \oddfootingyyy.) 369 1.1 mrg % The \baselineskip=24pt in plain's \makefootline has no effect. 370 1.1 mrg \vskip 24pt 371 1.1 mrg \unvbox\footlinebox 372 1.1 mrg \fi 373 1.1.1.4 mrg % 374 1.1.1.4 mrg }% 375 1.1.1.4 mrg }% 376 1.1 mrg \global\topmarksavedfalse 377 1.1 mrg \advancepageno 378 1.1 mrg \ifnum\outputpenalty>-20000 \else\dosupereject\fi 379 1.1 mrg } 380 1.1 mrg 381 1.1 mrg \newinsert\margin \dimen\margin=\maxdimen 382 1.1.1.3 mrg 383 1.1.1.3 mrg % Main part of page, including any footnotes 384 1.1 mrg \def\pagebody#1{\vbox to\txipageheight{\boxmaxdepth=\maxdepth #1}} 385 1.1 mrg {\catcode`\@ =11 386 1.1 mrg \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi 387 1.1 mrg % marginal hacks, juha (a] viisa.uucp (Juha Takala) 388 1.1 mrg \ifvoid\margin\else % marginal info is present 389 1.1 mrg \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi 390 1.1 mrg \dimen@=\dp#1\relax \unvbox#1\relax 391 1.1 mrg \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi 392 1.1 mrg \ifr@ggedbottom \kern-\dimen@ \vfil \fi} 393 1.1 mrg } 394 1.1.1.5 mrg 395 1.1.1.5 mrg % Check if we are on the first page of a chapter. Used for printing headings. 396 1.1.1.5 mrg \newif\ifchapterpage 397 1.1.1.5 mrg \def\checkchapterpage{% 398 1.1.1.5 mrg % Get the chapter that was current at the end of the last page 399 1.1.1.5 mrg \ifcase1\the\savedtopmark\fi 400 1.1.1.5 mrg \let\prevchaptername\thischaptername 401 1.1.1.5 mrg % 402 1.1.1.5 mrg \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi 403 1.1.1.5 mrg \let\curchaptername\thischaptername 404 1.1.1.5 mrg % 405 1.1.1.5 mrg \ifx\curchaptername\prevchaptername 406 1.1.1.5 mrg \chapterpagefalse 407 1.1.1.5 mrg \else 408 1.1.1.5 mrg \chapterpagetrue 409 1.1.1.5 mrg \fi 410 1.1.1.3 mrg } 411 1.1.1.3 mrg 412 1.1.1.3 mrg % Argument parsing 413 1.1 mrg 414 1.1 mrg % Parse an argument, then pass it to #1. The argument is the rest of 415 1.1 mrg % the input line (except we remove a trailing comment). #1 should be a 416 1.1.1.3 mrg % macro which expects an ordinary undelimited TeX argument. 417 1.1 mrg % For example, \def\foo{\parsearg\fooxxx}. 418 1.1 mrg % 419 1.1 mrg \def\parsearg{\parseargusing{}} 420 1.1 mrg \def\parseargusing#1#2{% 421 1.1 mrg \def\argtorun{#2}% 422 1.1 mrg \begingroup 423 1.1 mrg \obeylines 424 1.1 mrg \spaceisspace 425 1.1 mrg #1% 426 1.1 mrg \parseargline\empty% Insert the \empty token, see \finishparsearg below. 427 1.1 mrg } 428 1.1 mrg 429 1.1 mrg {\obeylines % 430 1.1 mrg \gdef\parseargline#1^^M{% 431 1.1 mrg \endgroup % End of the group started in \parsearg. 432 1.1 mrg \argremovecomment #1\comment\ArgTerm% 433 1.1 mrg }% 434 1.1 mrg } 435 1.1.1.5 mrg 436 1.1.1.4 mrg % First remove any @comment, then any @c comment. Pass the result on to 437 1.1 mrg % \argcheckspaces. 438 1.1.1.4 mrg \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} 439 1.1 mrg \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} 440 1.1 mrg 441 1.1 mrg % Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space. 442 1.1 mrg % 443 1.1 mrg % \argremovec might leave us with trailing space, e.g., 444 1.1 mrg % @end itemize @c foo 445 1.1 mrg % This space token undergoes the same procedure and is eventually removed 446 1.1 mrg % by \finishparsearg. 447 1.1 mrg % 448 1.1 mrg \def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M} 449 1.1 mrg \def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M} 450 1.1 mrg \def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% 451 1.1 mrg \def\temp{#3}% 452 1.1 mrg \ifx\temp\empty 453 1.1 mrg % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp: 454 1.1 mrg \let\temp\finishparsearg 455 1.1 mrg \else 456 1.1 mrg \let\temp\argcheckspaces 457 1.1 mrg \fi 458 1.1 mrg % Put the space token in: 459 1.1 mrg \temp#1 #3\ArgTerm 460 1.1 mrg } 461 1.1 mrg 462 1.1 mrg % If a _delimited_ argument is enclosed in braces, they get stripped; so 463 1.1 mrg % to get _exactly_ the rest of the line, we had to prevent such situation. 464 1.1 mrg % We prepended an \empty token at the very beginning and we expand it now, 465 1.1 mrg % just before passing the control to \argtorun. 466 1.1 mrg % (Similarly, we have to think about #3 of \argcheckspacesY above: it is 467 1.1 mrg % either the null string, or it ends with \^^M---thus there is no danger 468 1.1 mrg % that a pair of braces would be stripped. 469 1.1 mrg % 470 1.1 mrg % But first, we have to remove the trailing space token. 471 1.1 mrg % 472 1.1 mrg \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}} 473 1.1.1.3 mrg 474 1.1.1.3 mrg 475 1.1.1.3 mrg % \parseargdef - define a command taking an argument on the line 476 1.1 mrg % 477 1.1 mrg % \parseargdef\foo{...} 478 1.1 mrg % is roughly equivalent to 479 1.1 mrg % \def\foo{\parsearg\Xfoo} 480 1.1 mrg % \def\Xfoo#1{...} 481 1.1 mrg \def\parseargdef#1{% 482 1.1 mrg \expandafter \doparseargdef \csname\string#1\endcsname #1% 483 1.1 mrg } 484 1.1 mrg \def\doparseargdef#1#2{% 485 1.1 mrg \def#2{\parsearg#1}% 486 1.1 mrg \def#1##1% 487 1.1 mrg } 488 1.1 mrg 489 1.1 mrg % Several utility definitions with active space: 490 1.1 mrg { 491 1.1 mrg \obeyspaces 492 1.1 mrg \gdef\obeyedspace{ } 493 1.1 mrg 494 1.1 mrg % Make each space character in the input produce a normal interword 495 1.1 mrg % space in the output. Don't allow a line break at this space, as this 496 1.1 mrg % is used only in environments like @example, where each line of input 497 1.1 mrg % should produce a line of output anyway. 498 1.1 mrg % 499 1.1 mrg \gdef\sepspaces{\obeyspaces\let =\tie} 500 1.1 mrg 501 1.1 mrg % If an index command is used in an @example environment, any spaces 502 1.1 mrg % therein should become regular spaces in the raw index file, not the 503 1.1 mrg % expansion of \tie (\leavevmode \penalty \@M \ ). 504 1.1 mrg \gdef\unsepspaces{\let =\space} 505 1.1 mrg } 506 1.1 mrg 507 1.1 mrg 508 1.1 mrg \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} 509 1.1 mrg 510 1.1 mrg % Define the framework for environments in texinfo.tex. It's used like this: 511 1.1 mrg % 512 1.1 mrg % \envdef\foo{...} 513 1.1 mrg % \def\Efoo{...} 514 1.1 mrg % 515 1.1 mrg % It's the responsibility of \envdef to insert \begingroup before the 516 1.1 mrg % actual body; @end closes the group after calling \Efoo. \envdef also 517 1.1 mrg % defines \thisenv, so the current environment is known; @end checks 518 1.1 mrg % whether the environment name matches. The \checkenv macro can also be 519 1.1 mrg % used to check whether the current environment is the one expected. 520 1.1 mrg % 521 1.1 mrg % Non-false conditionals (@iftex, @ifset) don't fit into this, so they 522 1.1 mrg % are not treated as environments; they don't open a group. (The 523 1.1 mrg % implementation of @end takes care not to call \endgroup in this 524 1.1 mrg % special case.) 525 1.1 mrg 526 1.1 mrg 527 1.1 mrg % At run-time, environments start with this: 528 1.1 mrg \def\startenvironment#1{\begingroup\def\thisenv{#1}} 529 1.1 mrg % initialize 530 1.1 mrg \let\thisenv\empty 531 1.1 mrg 532 1.1 mrg % ... but they get defined via ``\envdef\foo{...}'': 533 1.1 mrg \long\def\envdef#1#2{\def#1{\startenvironment#1#2}} 534 1.1 mrg \def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}} 535 1.1 mrg 536 1.1 mrg % Check whether we're in the right environment: 537 1.1 mrg \def\checkenv#1{% 538 1.1 mrg \def\temp{#1}% 539 1.1 mrg \ifx\thisenv\temp 540 1.1 mrg \else 541 1.1 mrg \badenverr 542 1.1 mrg \fi 543 1.1 mrg } 544 1.1 mrg 545 1.1 mrg % Environment mismatch, #1 expected: 546 1.1 mrg \def\badenverr{% 547 1.1 mrg \errhelp = \EMsimple 548 1.1 mrg \errmessage{This command can appear only \inenvironment\temp, 549 1.1 mrg not \inenvironment\thisenv}% 550 1.1 mrg } 551 1.1 mrg \def\inenvironment#1{% 552 1.1 mrg \ifx#1\empty 553 1.1 mrg outside of any environment% 554 1.1 mrg \else 555 1.1 mrg in environment \expandafter\string#1% 556 1.1 mrg \fi 557 1.1 mrg } 558 1.1.1.5 mrg 559 1.1.1.5 mrg 560 1.1 mrg % @end foo calls \checkenv and executes the definition of \Efoo. 561 1.1 mrg \parseargdef\end{% 562 1.1 mrg \if 1\csname iscond.#1\endcsname 563 1.1 mrg \else 564 1.1 mrg % The general wording of \badenverr may not be ideal. 565 1.1 mrg \expandafter\checkenv\csname#1\endcsname 566 1.1 mrg \csname E#1\endcsname 567 1.1 mrg \endgroup 568 1.1 mrg \fi 569 1.1 mrg } 570 1.1 mrg 571 1.1 mrg \newhelp\EMsimple{Press RETURN to continue.} 572 1.1 mrg 573 1.1 mrg 574 1.1 mrg % Be sure we're in horizontal mode when doing a tie, since we make space 575 1.1 mrg % equivalent to this in @example-like environments. Otherwise, a space 576 1.1 mrg % at the beginning of a line will start with \penalty -- and 577 1.1 mrg % since \penalty is valid in vertical mode, we'd end up putting the 578 1.1 mrg % penalty on the vertical list instead of in the new paragraph. 579 1.1 mrg {\catcode`@ = 11 580 1.1 mrg % Avoid using \@M directly, because that causes trouble 581 1.1 mrg % if the definition is written into an index file. 582 1.1 mrg \global\let\tiepenalty = \@M 583 1.1 mrg \gdef\tie{\leavevmode\penalty\tiepenalty\ } 584 1.1 mrg } 585 1.1 mrg 586 1.1 mrg % @: forces normal size whitespace following. 587 1.1 mrg \def\:{\spacefactor=1000 } 588 1.1 mrg 589 1.1.1.2 mrg % @* forces a line break. 590 1.1 mrg \def\*{\unskip\hfil\break\hbox{}\ignorespaces} 591 1.1 mrg 592 1.1 mrg % @/ allows a line break. 593 1.1 mrg \let\/=\allowbreak 594 1.1 mrg 595 1.1 mrg % @. is an end-of-sentence period. 596 1.1 mrg \def\.{.\spacefactor=\endofsentencespacefactor\space} 597 1.1 mrg 598 1.1 mrg % @! is an end-of-sentence bang. 599 1.1 mrg \def\!{!\spacefactor=\endofsentencespacefactor\space} 600 1.1 mrg 601 1.1 mrg % @? is an end-of-sentence query. 602 1.1 mrg \def\?{?\spacefactor=\endofsentencespacefactor\space} 603 1.1 mrg 604 1.1 mrg % @w prevents a word break. Without the \leavevmode, @w at the 605 1.1 mrg % beginning of a paragraph, when TeX is still in vertical mode, would 606 1.1 mrg % produce a whole line of output instead of starting the paragraph. 607 1.1 mrg \def\w#1{\leavevmode\hbox{#1}} 608 1.1 mrg 609 1.1 mrg % @group ... @end group forces ... to be all on one page, by enclosing 610 1.1 mrg % it in a TeX vbox. We use \vtop instead of \vbox to construct the box 611 1.1 mrg % to keep its height that of a normal line. According to the rules for 612 1.1 mrg % \topskip (p.114 of the TeXbook), the glue inserted is 613 1.1 mrg % max (\topskip - \ht (first item), 0). If that height is large, 614 1.1 mrg % therefore, no glue is inserted, and the space between the headline and 615 1.1 mrg % the text is small, which looks bad. 616 1.1 mrg % 617 1.1 mrg % Another complication is that the group might be very large. This can 618 1.1 mrg % cause the glue on the previous page to be unduly stretched, because it 619 1.1 mrg % does not have much material. In this case, it's better to add an 620 1.1 mrg % explicit \vfill so that the extra space is at the bottom. The 621 1.1 mrg % threshold for doing this is if the group is more than \vfilllimit 622 1.1 mrg % percent of a page (\vfilllimit can be changed inside of @tex). 623 1.1 mrg % 624 1.1 mrg \newbox\groupbox 625 1.1 mrg \def\vfilllimit{0.7} 626 1.1 mrg % 627 1.1 mrg \envdef\group{% 628 1.1 mrg \ifnum\catcode`\^^M=\active \else 629 1.1 mrg \errhelp = \groupinvalidhelp 630 1.1 mrg \errmessage{@group invalid in context where filling is enabled}% 631 1.1 mrg \fi 632 1.1 mrg \startsavinginserts 633 1.1 mrg % 634 1.1 mrg \setbox\groupbox = \vtop\bgroup 635 1.1 mrg % Do @comment since we are called inside an environment such as 636 1.1 mrg % @example, where each end-of-line in the input causes an 637 1.1 mrg % end-of-line in the output. We don't want the end-of-line after 638 1.1 mrg % the `@group' to put extra space in the output. Since @group 639 1.1 mrg % should appear on a line by itself (according to the Texinfo 640 1.1 mrg % manual), we don't worry about eating any user text. 641 1.1 mrg \comment 642 1.1 mrg } 643 1.1 mrg % 644 1.1 mrg % The \vtop produces a box with normal height and large depth; thus, TeX puts 645 1.1 mrg % \baselineskip glue before it, and (when the next line of text is done) 646 1.1 mrg % \lineskip glue after it. Thus, space below is not quite equal to space 647 1.1 mrg % above. But it's pretty close. 648 1.1 mrg \def\Egroup{% 649 1.1 mrg % To get correct interline space between the last line of the group 650 1.1 mrg % and the first line afterwards, we have to propagate \prevdepth. 651 1.1 mrg \endgraf % Not \par, as it may have been set to \lisppar. 652 1.1 mrg \global\dimen1 = \prevdepth 653 1.1.1.3 mrg \egroup % End the \vtop. 654 1.1.1.3 mrg \addgroupbox 655 1.1.1.3 mrg \prevdepth = \dimen1 656 1.1.1.3 mrg \checkinserts 657 1.1.1.3 mrg } 658 1.1.1.3 mrg 659 1.1 mrg \def\addgroupbox{ 660 1.1 mrg % \dimen0 is the vertical size of the group's box. 661 1.1 mrg \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox 662 1.1.1.3 mrg % \dimen2 is how much space is left on the page (more or less). 663 1.1 mrg \dimen2 = \txipageheight \advance\dimen2 by -\pagetotal 664 1.1 mrg % if the group doesn't fit on the current page, and it's a big big 665 1.1 mrg % group, force a page break. 666 1.1.1.3 mrg \ifdim \dimen0 > \dimen2 667 1.1 mrg \ifdim \pagetotal < \vfilllimit\txipageheight 668 1.1 mrg \page 669 1.1 mrg \fi 670 1.1 mrg \fi 671 1.1 mrg \box\groupbox 672 1.1.1.3 mrg } 673 1.1 mrg 674 1.1 mrg % 675 1.1 mrg % TeX puts in an \escapechar (i.e., `@') at the beginning of the help 676 1.1 mrg % message, so this ends up printing `@group can only ...'. 677 1.1 mrg % 678 1.1 mrg \newhelp\groupinvalidhelp{% 679 1.1 mrg group can only be used in environments such as @example,^^J% 680 1.1 mrg where each line of input produces a line of output.} 681 1.1 mrg 682 1.1 mrg % @need space-in-mils 683 1.1 mrg % forces a page break if there is not space-in-mils remaining. 684 1.1 mrg 685 1.1 mrg \newdimen\mil \mil=0.001in 686 1.1 mrg 687 1.1 mrg \parseargdef\need{% 688 1.1 mrg % Ensure vertical mode, so we don't make a big box in the middle of a 689 1.1 mrg % paragraph. 690 1.1 mrg \par 691 1.1 mrg % 692 1.1 mrg % If the @need value is less than one line space, it's useless. 693 1.1 mrg \dimen0 = #1\mil 694 1.1 mrg \dimen2 = \ht\strutbox 695 1.1 mrg \advance\dimen2 by \dp\strutbox 696 1.1.1.5 mrg \ifdim\dimen0 > \dimen2 697 1.1.1.5 mrg % This is similar to the 'needspace' module in LaTeX. 698 1.1.1.5 mrg % The first penalty allows a break if the end of the page is 699 1.1.1.5 mrg % not too far away. Following penalties and skips are discarded. 700 1.1.1.5 mrg % Otherwise, require at least \dimen0 of vertical space. 701 1.1.1.5 mrg % 702 1.1.1.5 mrg % (We used to use a \vtop to reserve space, but this had spacing issues 703 1.1.1.5 mrg % when followed by a section heading, as it was not a "discardable item". 704 1.1.1.5 mrg % This also has the benefit of providing glue before the page break if 705 1.1.1.5 mrg % there isn't enough space.) 706 1.1.1.5 mrg \vskip0pt plus \dimen0 707 1.1.1.5 mrg \penalty-100 708 1.1.1.5 mrg \vskip0pt plus -\dimen0 709 1.1 mrg \vskip \dimen0 710 1.1.1.5 mrg \penalty9999 711 1.1.1.5 mrg \vskip -\dimen0 712 1.1 mrg \penalty0\relax % this hides the above glue from \safewhatsit and \dobreak 713 1.1 mrg \fi 714 1.1 mrg } 715 1.1 mrg 716 1.1 mrg % @br forces paragraph break (and is undocumented). 717 1.1 mrg 718 1.1 mrg \let\br = \par 719 1.1 mrg 720 1.1 mrg % @page forces the start of a new page. 721 1.1 mrg % 722 1.1 mrg \def\page{\par\vfill\supereject} 723 1.1 mrg 724 1.1 mrg % @exdent text.... 725 1.1 mrg % outputs text on separate line in roman font, starting at standard page margin 726 1.1 mrg 727 1.1 mrg % This records the amount of indent in the innermost environment. 728 1.1 mrg % That's how much \exdent should take out. 729 1.1 mrg \newskip\exdentamount 730 1.1 mrg 731 1.1 mrg % This defn is used inside fill environments such as @defun. 732 1.1 mrg \parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break} 733 1.1 mrg 734 1.1 mrg % This defn is used inside nofill environments such as @example. 735 1.1 mrg \parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount 736 1.1 mrg \leftline{\hskip\leftskip{\rm#1}}}} 737 1.1 mrg 738 1.1 mrg % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current 739 1.1 mrg % paragraph. For more general purposes, use the \margin insertion 740 1.1 mrg % class. WHICH is `l' or `r'. Not documented, written for gawk manual. 741 1.1 mrg % 742 1.1 mrg \newskip\inmarginspacing \inmarginspacing=1cm 743 1.1 mrg \def\strutdepth{\dp\strutbox} 744 1.1 mrg % 745 1.1 mrg \def\doinmargin#1#2{\strut\vadjust{% 746 1.1 mrg \nobreak 747 1.1 mrg \kern-\strutdepth 748 1.1 mrg \vtop to \strutdepth{% 749 1.1 mrg \baselineskip=\strutdepth 750 1.1 mrg \vss 751 1.1 mrg % if you have multiple lines of stuff to put here, you'll need to 752 1.1 mrg % make the vbox yourself of the appropriate size. 753 1.1 mrg \ifx#1l% 754 1.1 mrg \llap{\ignorespaces #2\hskip\inmarginspacing}% 755 1.1 mrg \else 756 1.1 mrg \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}% 757 1.1 mrg \fi 758 1.1 mrg \null 759 1.1 mrg }% 760 1.1 mrg }} 761 1.1 mrg \def\inleftmargin{\doinmargin l} 762 1.1 mrg \def\inrightmargin{\doinmargin r} 763 1.1 mrg % 764 1.1 mrg % @inmargin{TEXT [, RIGHT-TEXT]} 765 1.1 mrg % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; 766 1.1 mrg % else use TEXT for both). 767 1.1 mrg % 768 1.1 mrg \def\inmargin#1{\parseinmargin #1,,\finish} 769 1.1 mrg \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. 770 1.1 mrg \setbox0 = \hbox{\ignorespaces #2}% 771 1.1 mrg \ifdim\wd0 > 0pt 772 1.1 mrg \def\lefttext{#1}% have both texts 773 1.1 mrg \def\righttext{#2}% 774 1.1 mrg \else 775 1.1 mrg \def\lefttext{#1}% have only one text 776 1.1 mrg \def\righttext{#1}% 777 1.1 mrg \fi 778 1.1 mrg % 779 1.1 mrg \ifodd\pageno 780 1.1 mrg \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin 781 1.1 mrg \else 782 1.1 mrg \def\temp{\inleftmargin\lefttext}% 783 1.1 mrg \fi 784 1.1 mrg \temp 785 1.1 mrg } 786 1.1 mrg 787 1.1 mrg % @include FILE -- \input text of FILE. 788 1.1 mrg % 789 1.1 mrg \def\include{\parseargusing\filenamecatcodes\includezzz} 790 1.1 mrg \def\includezzz#1{% 791 1.1 mrg \pushthisfilestack 792 1.1 mrg \def\thisfile{#1}% 793 1.1 mrg {% 794 1.1 mrg \makevalueexpandable % we want to expand any @value in FILE. 795 1.1 mrg \turnoffactive % and allow special characters in the expansion 796 1.1 mrg \indexnofonts % Allow `@@' and other weird things in file names. 797 1.1 mrg \wlog{texinfo.tex: doing @include of #1^^J}% 798 1.1 mrg \edef\temp{\noexpand\input #1 }% 799 1.1 mrg % 800 1.1 mrg % This trickery is to read FILE outside of a group, in case it makes 801 1.1 mrg % definitions, etc. 802 1.1 mrg \expandafter 803 1.1 mrg }\temp 804 1.1 mrg \popthisfilestack 805 1.1 mrg } 806 1.1 mrg \def\filenamecatcodes{% 807 1.1 mrg \catcode`\\=\other 808 1.1 mrg \catcode`~=\other 809 1.1 mrg \catcode`^=\other 810 1.1 mrg \catcode`_=\other 811 1.1 mrg \catcode`|=\other 812 1.1 mrg \catcode`<=\other 813 1.1 mrg \catcode`>=\other 814 1.1 mrg \catcode`+=\other 815 1.1 mrg \catcode`-=\other 816 1.1 mrg \catcode`\`=\other 817 1.1 mrg \catcode`\'=\other 818 1.1 mrg } 819 1.1 mrg 820 1.1 mrg \def\pushthisfilestack{% 821 1.1 mrg \expandafter\pushthisfilestackX\popthisfilestack\StackTerm 822 1.1 mrg } 823 1.1 mrg \def\pushthisfilestackX{% 824 1.1 mrg \expandafter\pushthisfilestackY\thisfile\StackTerm 825 1.1 mrg } 826 1.1 mrg \def\pushthisfilestackY #1\StackTerm #2\StackTerm {% 827 1.1 mrg \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}% 828 1.1 mrg } 829 1.1 mrg 830 1.1 mrg \def\popthisfilestack{\errthisfilestackempty} 831 1.1 mrg \def\errthisfilestackempty{\errmessage{Internal error: 832 1.1 mrg the stack of filenames is empty.}} 833 1.1 mrg % 834 1.1 mrg \def\thisfile{} 835 1.1 mrg 836 1.1 mrg % @center line 837 1.1 mrg % outputs that line, centered. 838 1.1 mrg % 839 1.1 mrg \parseargdef\center{% 840 1.1 mrg \ifhmode 841 1.1 mrg \let\centersub\centerH 842 1.1 mrg \else 843 1.1 mrg \let\centersub\centerV 844 1.1 mrg \fi 845 1.1 mrg \centersub{\hfil \ignorespaces#1\unskip \hfil}% 846 1.1 mrg \let\centersub\relax % don't let the definition persist, just in case 847 1.1 mrg } 848 1.1 mrg \def\centerH#1{{% 849 1.1 mrg \hfil\break 850 1.1 mrg \advance\hsize by -\leftskip 851 1.1 mrg \advance\hsize by -\rightskip 852 1.1 mrg \line{#1}% 853 1.1 mrg \break 854 1.1 mrg }} 855 1.1 mrg % 856 1.1 mrg \newcount\centerpenalty 857 1.1 mrg \def\centerV#1{% 858 1.1 mrg % The idea here is the same as in \startdefun, \cartouche, etc.: if 859 1.1 mrg % @center is the first thing after a section heading, we need to wipe 860 1.1 mrg % out the negative parskip inserted by \sectionheading, but still 861 1.1 mrg % prevent a page break here. 862 1.1 mrg \centerpenalty = \lastpenalty 863 1.1 mrg \ifnum\centerpenalty>10000 \vskip\parskip \fi 864 1.1 mrg \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi 865 1.1 mrg \line{\kern\leftskip #1\kern\rightskip}% 866 1.1 mrg } 867 1.1 mrg 868 1.1 mrg % @sp n outputs n lines of vertical space 869 1.1 mrg % 870 1.1 mrg \parseargdef\sp{\vskip #1\baselineskip} 871 1.1 mrg 872 1.1 mrg % @comment ...line which is ignored... 873 1.1 mrg % @c is the same as @comment 874 1.1.1.3 mrg % @ignore ... @end ignore is another way to write a comment 875 1.1.1.3 mrg 876 1.1.1.3 mrg 877 1.1 mrg \def\c{\begingroup \catcode`\^^M=\active% 878 1.1.1.3 mrg \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% 879 1.1.1.3 mrg \cxxx} 880 1.1 mrg {\catcode`\^^M=\active \gdef\cxxx#1^^M{\endgroup}} 881 1.1.1.3 mrg % 882 1.1 mrg \let\comment\c 883 1.1 mrg 884 1.1 mrg % @paragraphindent NCHARS 885 1.1 mrg % We'll use ems for NCHARS, close enough. 886 1.1 mrg % NCHARS can also be the word `asis' or `none'. 887 1.1 mrg % We cannot feasibly implement @paragraphindent asis, though. 888 1.1 mrg % 889 1.1 mrg \def\asisword{asis} % no translation, these are keywords 890 1.1 mrg \def\noneword{none} 891 1.1 mrg % 892 1.1 mrg \parseargdef\paragraphindent{% 893 1.1 mrg \def\temp{#1}% 894 1.1 mrg \ifx\temp\asisword 895 1.1 mrg \else 896 1.1 mrg \ifx\temp\noneword 897 1.1 mrg \defaultparindent = 0pt 898 1.1 mrg \else 899 1.1 mrg \defaultparindent = #1em 900 1.1 mrg \fi 901 1.1 mrg \fi 902 1.1 mrg \parindent = \defaultparindent 903 1.1 mrg } 904 1.1 mrg 905 1.1 mrg % @exampleindent NCHARS 906 1.1 mrg % We'll use ems for NCHARS like @paragraphindent. 907 1.1 mrg % It seems @exampleindent asis isn't necessary, but 908 1.1 mrg % I preserve it to make it similar to @paragraphindent. 909 1.1 mrg \parseargdef\exampleindent{% 910 1.1 mrg \def\temp{#1}% 911 1.1 mrg \ifx\temp\asisword 912 1.1 mrg \else 913 1.1 mrg \ifx\temp\noneword 914 1.1 mrg \lispnarrowing = 0pt 915 1.1 mrg \else 916 1.1 mrg \lispnarrowing = #1em 917 1.1 mrg \fi 918 1.1 mrg \fi 919 1.1 mrg } 920 1.1 mrg 921 1.1 mrg % @firstparagraphindent WORD 922 1.1 mrg % If WORD is `none', then suppress indentation of the first paragraph 923 1.1 mrg % after a section heading. If WORD is `insert', then do indent at such 924 1.1 mrg % paragraphs. 925 1.1 mrg % 926 1.1 mrg % The paragraph indentation is suppressed or not by calling 927 1.1 mrg % \suppressfirstparagraphindent, which the sectioning commands do. 928 1.1 mrg % We switch the definition of this back and forth according to WORD. 929 1.1 mrg % By default, we suppress indentation. 930 1.1 mrg % 931 1.1 mrg \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} 932 1.1 mrg \def\insertword{insert} 933 1.1 mrg % 934 1.1 mrg \parseargdef\firstparagraphindent{% 935 1.1 mrg \def\temp{#1}% 936 1.1 mrg \ifx\temp\noneword 937 1.1 mrg \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent 938 1.1 mrg \else\ifx\temp\insertword 939 1.1 mrg \let\suppressfirstparagraphindent = \relax 940 1.1 mrg \else 941 1.1 mrg \errhelp = \EMsimple 942 1.1 mrg \errmessage{Unknown @firstparagraphindent option `\temp'}% 943 1.1 mrg \fi\fi 944 1.1 mrg } 945 1.1 mrg 946 1.1 mrg % Here is how we actually suppress indentation. Redefine \everypar to 947 1.1 mrg % \kern backwards by \parindent, and then reset itself to empty. 948 1.1 mrg % 949 1.1 mrg % We also make \indent itself not actually do anything until the next 950 1.1 mrg % paragraph. 951 1.1 mrg % 952 1.1.1.3 mrg \gdef\dosuppressfirstparagraphindent{% 953 1.1.1.3 mrg \gdef\indent {\restorefirstparagraphindent \indent}% 954 1.1.1.3 mrg \gdef\noindent{\restorefirstparagraphindent \noindent}% 955 1.1 mrg \global\everypar = {\kern -\parindent \restorefirstparagraphindent}% 956 1.1.1.3 mrg } 957 1.1 mrg % 958 1.1.1.3 mrg \gdef\restorefirstparagraphindent{% 959 1.1.1.3 mrg \global\let\indent = \ptexindent 960 1.1.1.3 mrg \global\let\noindent = \ptexnoindent 961 1.1 mrg \global\everypar = {}% 962 1.1 mrg } 963 1.1.1.5 mrg 964 1.1.1.5 mrg % leave vertical mode without cancelling any first paragraph indent 965 1.1.1.5 mrg \gdef\imageindent{% 966 1.1.1.5 mrg \toks0=\everypar 967 1.1.1.5 mrg \everypar={}% 968 1.1.1.5 mrg \ptexnoindent 969 1.1.1.5 mrg \global\everypar=\toks0 970 1.1.1.5 mrg } 971 1.1 mrg 972 1.1 mrg 973 1.1 mrg % @refill is a no-op. 974 1.1 mrg \let\refill=\relax 975 1.1.1.3 mrg 976 1.1.1.3 mrg % @setfilename INFO-FILENAME - ignored 977 1.1 mrg \let\setfilename=\comment 978 1.1 mrg 979 1.1.1.5 mrg % @bye. 980 1.1 mrg \outer\def\bye{\chappager\pagelabels\tracingstats=1\ptexend} 981 1.1 mrg 982 1.1 mrg 983 1.1 mrg \message{pdf,} 984 1.1 mrg % adobe `portable' document format 985 1.1 mrg \newcount\tempnum 986 1.1 mrg \newcount\lnkcount 987 1.1 mrg \newtoks\filename 988 1.1 mrg \newcount\filenamelength 989 1.1 mrg \newcount\pgn 990 1.1 mrg \newtoks\toksA 991 1.1 mrg \newtoks\toksB 992 1.1 mrg \newtoks\toksC 993 1.1 mrg \newtoks\toksD 994 1.1.1.3 mrg \newbox\boxA 995 1.1 mrg \newbox\boxB 996 1.1 mrg \newcount\countA 997 1.1 mrg \newif\ifpdf 998 1.1 mrg \newif\ifpdfmakepagedest 999 1.1.1.3 mrg 1000 1.1.1.3 mrg % 1001 1.1.1.3 mrg % For LuaTeX 1002 1.1.1.3 mrg % 1003 1.1.1.3 mrg 1004 1.1.1.3 mrg \newif\iftxiuseunicodedestname 1005 1.1.1.3 mrg \txiuseunicodedestnamefalse % For pdfTeX etc. 1006 1.1.1.3 mrg 1007 1.1.1.3 mrg \ifx\luatexversion\thisisundefined 1008 1.1.1.3 mrg \else 1009 1.1.1.3 mrg % Use Unicode destination names 1010 1.1.1.3 mrg \txiuseunicodedestnametrue 1011 1.1.1.3 mrg % Escape PDF strings with converting UTF-16 from UTF-8 1012 1.1.1.3 mrg \begingroup 1013 1.1.1.3 mrg \catcode`\%=12 1014 1.1.1.3 mrg \directlua{ 1015 1.1.1.3 mrg function UTF16oct(str) 1016 1.1.1.3 mrg tex.sprint(string.char(0x5c) .. '376' .. string.char(0x5c) .. '377') 1017 1.1.1.3 mrg for c in string.utfvalues(str) do 1018 1.1.1.3 mrg if c < 0x10000 then 1019 1.1.1.3 mrg tex.sprint( 1020 1.1.1.3 mrg string.format(string.char(0x5c) .. string.char(0x25) .. '03o' .. 1021 1.1.1.4 mrg string.char(0x5c) .. string.char(0x25) .. '03o', 1022 1.1.1.3 mrg math.floor(c / 256), math.floor(c % 256))) 1023 1.1.1.3 mrg else 1024 1.1.1.3 mrg c = c - 0x10000 1025 1.1.1.3 mrg local c_hi = c / 1024 + 0xd800 1026 1.1.1.3 mrg local c_lo = c % 1024 + 0xdc00 1027 1.1.1.3 mrg tex.sprint( 1028 1.1.1.3 mrg string.format(string.char(0x5c) .. string.char(0x25) .. '03o' .. 1029 1.1.1.3 mrg string.char(0x5c) .. string.char(0x25) .. '03o' .. 1030 1.1.1.3 mrg string.char(0x5c) .. string.char(0x25) .. '03o' .. 1031 1.1.1.4 mrg string.char(0x5c) .. string.char(0x25) .. '03o', 1032 1.1.1.4 mrg math.floor(c_hi / 256), math.floor(c_hi % 256), 1033 1.1.1.3 mrg math.floor(c_lo / 256), math.floor(c_lo % 256))) 1034 1.1.1.3 mrg end 1035 1.1.1.3 mrg end 1036 1.1.1.3 mrg end 1037 1.1.1.3 mrg } 1038 1.1.1.3 mrg \endgroup 1039 1.1.1.3 mrg \def\pdfescapestrutfsixteen#1{\directlua{UTF16oct('\luaescapestring{#1}')}} 1040 1.1.1.3 mrg % Escape PDF strings without converting 1041 1.1.1.3 mrg \begingroup 1042 1.1.1.3 mrg \directlua{ 1043 1.1.1.3 mrg function PDFescstr(str) 1044 1.1.1.3 mrg for c in string.bytes(str) do 1045 1.1.1.4 mrg if c <= 0x20 or c >= 0x80 or c == 0x28 or c == 0x29 or c == 0x5c then 1046 1.1.1.3 mrg tex.sprint(-2, 1047 1.1.1.3 mrg string.format(string.char(0x5c) .. string.char(0x25) .. '03o', 1048 1.1.1.3 mrg c)) 1049 1.1.1.4 mrg else 1050 1.1.1.3 mrg tex.sprint(-2, string.char(c)) 1051 1.1.1.3 mrg end 1052 1.1.1.3 mrg end 1053 1.1.1.3 mrg end 1054 1.1.1.5 mrg } 1055 1.1.1.5 mrg % The -2 in the arguments here gives all the input to TeX catcode 12 1056 1.1.1.4 mrg % (other) or 10 (space), preventing undefined control sequence errors. See 1057 1.1.1.4 mrg % https://lists.gnu.org/archive/html/bug-texinfo/2019-08/msg00031.html 1058 1.1.1.3 mrg % 1059 1.1.1.3 mrg \endgroup 1060 1.1.1.3 mrg \def\pdfescapestring#1{\directlua{PDFescstr('\luaescapestring{#1}')}} 1061 1.1.1.3 mrg \ifnum\luatexversion>84 1062 1.1.1.3 mrg % For LuaTeX >= 0.85 1063 1.1.1.3 mrg \def\pdfdest{\pdfextension dest} 1064 1.1.1.3 mrg \let\pdfoutput\outputmode 1065 1.1.1.3 mrg \def\pdfliteral{\pdfextension literal} 1066 1.1.1.3 mrg \def\pdfcatalog{\pdfextension catalog} 1067 1.1.1.3 mrg \def\pdftexversion{\numexpr\pdffeedback version\relax} 1068 1.1.1.3 mrg \let\pdfximage\saveimageresource 1069 1.1.1.3 mrg \let\pdfrefximage\useimageresource 1070 1.1.1.3 mrg \let\pdflastximage\lastsavedimageresourceindex 1071 1.1.1.3 mrg \def\pdfendlink{\pdfextension endlink\relax} 1072 1.1.1.3 mrg \def\pdfoutline{\pdfextension outline} 1073 1.1.1.3 mrg \def\pdfstartlink{\pdfextension startlink} 1074 1.1.1.3 mrg \def\pdffontattr{\pdfextension fontattr} 1075 1.1.1.3 mrg \def\pdfobj{\pdfextension obj} 1076 1.1.1.3 mrg \def\pdflastobj{\numexpr\pdffeedback lastobj\relax} 1077 1.1.1.3 mrg \let\pdfpagewidth\pagewidth 1078 1.1.1.3 mrg \let\pdfpageheight\pageheight 1079 1.1.1.3 mrg \edef\pdfhorigin{\pdfvariable horigin} 1080 1.1.1.3 mrg \edef\pdfvorigin{\pdfvariable vorigin} 1081 1.1.1.3 mrg \fi 1082 1.1.1.3 mrg \fi 1083 1.1 mrg 1084 1.1 mrg % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 1085 1.1 mrg % can be set). So we test for \relax and 0 as well as being undefined. 1086 1.1 mrg \ifx\pdfoutput\thisisundefined 1087 1.1 mrg \else 1088 1.1 mrg \ifx\pdfoutput\relax 1089 1.1 mrg \else 1090 1.1 mrg \ifcase\pdfoutput 1091 1.1 mrg \else 1092 1.1 mrg \pdftrue 1093 1.1 mrg \fi 1094 1.1 mrg \fi 1095 1.1 mrg \fi 1096 1.1.1.4 mrg 1097 1.1.1.4 mrg \newif\ifpdforxetex 1098 1.1.1.4 mrg \pdforxetexfalse 1099 1.1.1.4 mrg \ifpdf 1100 1.1.1.4 mrg \pdforxetextrue 1101 1.1.1.4 mrg \fi 1102 1.1.1.4 mrg \ifx\XeTeXrevision\thisisundefined\else 1103 1.1.1.4 mrg \pdforxetextrue 1104 1.1.1.4 mrg \fi 1105 1.1.1.4 mrg 1106 1.1.1.5 mrg 1107 1.1.1.5 mrg % Output page labels information. 1108 1.1.1.5 mrg % See PDF reference v.1.7 p.594, section 8.3.1. 1109 1.1.1.5 mrg \ifpdf 1110 1.1.1.5 mrg \def\pagelabels{% 1111 1.1.1.5 mrg \def\title{0 << /P (T-) /S /D >>}% 1112 1.1.1.5 mrg \edef\roman{\the\romancount << /S /r >>}% 1113 1.1.1.5 mrg \edef\arabic{\the\arabiccount << /S /D >>}% 1114 1.1.1.5 mrg % 1115 1.1.1.5 mrg % Page label ranges must be increasing. Remove any duplicates. 1116 1.1.1.5 mrg % (There is a slight chance of this being wrong if e.g. there is 1117 1.1.1.5 mrg % a @contents but no @titlepage, etc.) 1118 1.1.1.5 mrg % 1119 1.1.1.5 mrg \ifnum\romancount=0 \def\roman{}\fi 1120 1.1.1.5 mrg \ifnum\arabiccount=0 \def\title{}% 1121 1.1.1.5 mrg \else 1122 1.1.1.5 mrg \ifnum\romancount=\arabiccount \def\roman{}\fi 1123 1.1.1.5 mrg \fi 1124 1.1.1.5 mrg % 1125 1.1.1.5 mrg \ifnum\romancount<\arabiccount 1126 1.1.1.5 mrg \pdfcatalog{/PageLabels << /Nums [\title \roman \arabic ] >> }\relax 1127 1.1.1.5 mrg \else 1128 1.1.1.5 mrg \pdfcatalog{/PageLabels << /Nums [\title \arabic \roman ] >> }\relax 1129 1.1.1.5 mrg \fi 1130 1.1.1.5 mrg } 1131 1.1.1.5 mrg \else 1132 1.1.1.5 mrg \let\pagelabels\relax 1133 1.1.1.5 mrg \fi 1134 1.1.1.5 mrg 1135 1.1.1.5 mrg \newcount\pagecount \pagecount=0 1136 1.1.1.5 mrg \newcount\romancount \romancount=0 1137 1.1.1.5 mrg \newcount\arabiccount \arabiccount=0 1138 1.1.1.5 mrg \ifpdf 1139 1.1.1.5 mrg \let\ptxadvancepageno\advancepageno 1140 1.1.1.5 mrg \def\advancepageno{% 1141 1.1.1.5 mrg \ptxadvancepageno\global\advance\pagecount by 1 1142 1.1.1.5 mrg } 1143 1.1.1.5 mrg \fi 1144 1.1.1.5 mrg 1145 1.1 mrg 1146 1.1 mrg % PDF uses PostScript string constants for the names of xref targets, 1147 1.1 mrg % for display in the outlines, and in other places. Thus, we have to 1148 1.1 mrg % double any backslashes. Otherwise, a name like "\node" will be 1149 1.1.1.5 mrg % interpreted as a newline (\n), followed by o, d, e. Not good. 1150 1.1 mrg % 1151 1.1 mrg % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and 1152 1.1 mrg % related messages. The final outcome is that it is up to the TeX user 1153 1.1 mrg % to double the backslashes and otherwise make the string valid, so 1154 1.1 mrg % that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to 1155 1.1 mrg % do this reliably, so we use it. 1156 1.1 mrg 1157 1.1 mrg % #1 is a control sequence in which to do the replacements, 1158 1.1 mrg % which we \xdef. 1159 1.1.1.2 mrg \def\txiescapepdf#1{% 1160 1.1 mrg \ifx\pdfescapestring\thisisundefined 1161 1.1 mrg % No primitive available; should we give a warning or log? 1162 1.1.1.3 mrg % Many times it won't matter. 1163 1.1 mrg \xdef#1{#1}% 1164 1.1 mrg \else 1165 1.1 mrg % The expandable \pdfescapestring primitive escapes parentheses, 1166 1.1 mrg % backslashes, and other special chars. 1167 1.1 mrg \xdef#1{\pdfescapestring{#1}}% 1168 1.1 mrg \fi 1169 1.1.1.3 mrg } 1170 1.1.1.3 mrg \def\txiescapepdfutfsixteen#1{% 1171 1.1.1.3 mrg \ifx\pdfescapestrutfsixteen\thisisundefined 1172 1.1.1.3 mrg % No UTF-16 converting macro available. 1173 1.1.1.3 mrg \txiescapepdf{#1}% 1174 1.1.1.3 mrg \else 1175 1.1.1.3 mrg \xdef#1{\pdfescapestrutfsixteen{#1}}% 1176 1.1.1.3 mrg \fi 1177 1.1 mrg } 1178 1.1 mrg 1179 1.1 mrg \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images 1180 1.1 mrg with PDF output, and none of those formats could be found. (.eps cannot 1181 1.1 mrg be supported due to the design of the PDF format; use regular TeX (DVI 1182 1.1 mrg output) for that.)} 1183 1.1 mrg 1184 1.1 mrg \ifpdf 1185 1.1.1.3 mrg % 1186 1.1 mrg % Color manipulation macros using ideas from pdfcolor.tex, 1187 1.1 mrg % except using rgb instead of cmyk; the latter is said to render as a 1188 1.1.1.3 mrg % very dark gray on-screen and a very dark halftone in print, instead 1189 1.1.1.3 mrg % of actual black. The dark red here is dark enough to print on paper as 1190 1.1.1.3 mrg % nearly black, but still distinguishable for online viewing. We use 1191 1.1 mrg % black by default, though. 1192 1.1 mrg \def\rgbDarkRed{0.50 0.09 0.12} 1193 1.1 mrg \def\rgbBlack{0 0 0} 1194 1.1.1.3 mrg % 1195 1.1.1.3 mrg % rg sets the color for filling (usual text, etc.); 1196 1.1 mrg % RG sets the color for stroking (thin rules, e.g., normal _'s). 1197 1.1 mrg \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}} 1198 1.1 mrg % 1199 1.1 mrg % Set color, and create a mark which defines \thiscolor accordingly, 1200 1.1 mrg % so that \makeheadline knows which color to restore. 1201 1.1.1.4 mrg \def\setcolor#1{% 1202 1.1 mrg \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}% 1203 1.1 mrg \domark 1204 1.1 mrg \pdfsetcolor{#1}% 1205 1.1 mrg } 1206 1.1 mrg % 1207 1.1 mrg \def\maincolor{\rgbBlack} 1208 1.1 mrg \pdfsetcolor{\maincolor} 1209 1.1.1.4 mrg \edef\thiscolor{\maincolor} 1210 1.1 mrg \def\currentcolordefs{} 1211 1.1 mrg % 1212 1.1 mrg \def\makefootline{% 1213 1.1 mrg \baselineskip24pt 1214 1.1 mrg \line{\pdfsetcolor{\maincolor}\the\footline}% 1215 1.1 mrg } 1216 1.1 mrg % 1217 1.1 mrg \def\makeheadline{% 1218 1.1 mrg \vbox to 0pt{% 1219 1.1 mrg \vskip-22.5pt 1220 1.1 mrg \line{% 1221 1.1 mrg \vbox to8.5pt{}% 1222 1.1 mrg % Extract \thiscolor definition from the marks. 1223 1.1 mrg \getcolormarks 1224 1.1 mrg % Typeset the headline with \maincolor, then restore the color. 1225 1.1 mrg \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% 1226 1.1 mrg }% 1227 1.1 mrg \vss 1228 1.1 mrg }% 1229 1.1 mrg \nointerlineskip 1230 1.1 mrg } 1231 1.1 mrg % 1232 1.1 mrg % 1233 1.1 mrg \pdfcatalog{/PageMode /UseOutlines} 1234 1.1 mrg % 1235 1.1 mrg % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). 1236 1.1 mrg \def\dopdfimage#1#2#3{% 1237 1.1 mrg \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% 1238 1.1 mrg \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% 1239 1.1 mrg % 1240 1.1 mrg % pdftex (and the PDF format) support .pdf, .png, .jpg (among 1241 1.1 mrg % others). Let's try in that order, PDF first since if 1242 1.1 mrg % someone has a scalable image, presumably better to use that than a 1243 1.1 mrg % bitmap. 1244 1.1 mrg \let\pdfimgext=\empty 1245 1.1 mrg \begingroup 1246 1.1 mrg \openin 1 #1.pdf \ifeof 1 1247 1.1 mrg \openin 1 #1.PDF \ifeof 1 1248 1.1 mrg \openin 1 #1.png \ifeof 1 1249 1.1 mrg \openin 1 #1.jpg \ifeof 1 1250 1.1 mrg \openin 1 #1.jpeg \ifeof 1 1251 1.1 mrg \openin 1 #1.JPG \ifeof 1 1252 1.1 mrg \errhelp = \nopdfimagehelp 1253 1.1 mrg \errmessage{Could not find image file #1 for pdf}% 1254 1.1 mrg \else \gdef\pdfimgext{JPG}% 1255 1.1 mrg \fi 1256 1.1 mrg \else \gdef\pdfimgext{jpeg}% 1257 1.1 mrg \fi 1258 1.1 mrg \else \gdef\pdfimgext{jpg}% 1259 1.1 mrg \fi 1260 1.1 mrg \else \gdef\pdfimgext{png}% 1261 1.1 mrg \fi 1262 1.1 mrg \else \gdef\pdfimgext{PDF}% 1263 1.1 mrg \fi 1264 1.1 mrg \else \gdef\pdfimgext{pdf}% 1265 1.1 mrg \fi 1266 1.1 mrg \closein 1 1267 1.1 mrg \endgroup 1268 1.1 mrg % 1269 1.1 mrg % without \immediate, ancient pdftex seg faults when the same image is 1270 1.1 mrg % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) 1271 1.1 mrg \ifnum\pdftexversion < 14 1272 1.1 mrg \immediate\pdfimage 1273 1.1 mrg \else 1274 1.1 mrg \immediate\pdfximage 1275 1.1 mrg \fi 1276 1.1 mrg \ifdim \wd0 >0pt width \pdfimagewidth \fi 1277 1.1 mrg \ifdim \wd2 >0pt height \pdfimageheight \fi 1278 1.1 mrg \ifnum\pdftexversion<13 1279 1.1 mrg #1.\pdfimgext 1280 1.1 mrg \else 1281 1.1 mrg {#1.\pdfimgext}% 1282 1.1 mrg \fi 1283 1.1 mrg \ifnum\pdftexversion < 14 \else 1284 1.1 mrg \pdfrefximage \pdflastximage 1285 1.1 mrg \fi} 1286 1.1.1.3 mrg % 1287 1.1 mrg \def\setpdfdestname#1{{% 1288 1.1 mrg % We have to set dummies so commands such as @code, and characters 1289 1.1 mrg % such as \, aren't expanded when present in a section title. 1290 1.1 mrg \indexnofonts 1291 1.1.1.3 mrg \makevalueexpandable 1292 1.1.1.3 mrg \turnoffactive 1293 1.1.1.3 mrg \iftxiuseunicodedestname 1294 1.1.1.3 mrg \ifx \declaredencoding \latone 1295 1.1.1.3 mrg % Pass through Latin-1 characters. 1296 1.1.1.3 mrg % LuaTeX with byte wise I/O converts Latin-1 characters to Unicode. 1297 1.1.1.3 mrg \else 1298 1.1.1.3 mrg \ifx \declaredencoding \utfeight 1299 1.1.1.3 mrg % Pass through Unicode characters. 1300 1.1.1.3 mrg \else 1301 1.1.1.3 mrg % Use ASCII approximations in destination names. 1302 1.1.1.3 mrg \passthroughcharsfalse 1303 1.1.1.3 mrg \fi 1304 1.1.1.3 mrg \fi 1305 1.1.1.3 mrg \else 1306 1.1.1.3 mrg % Use ASCII approximations in destination names. 1307 1.1.1.3 mrg \passthroughcharsfalse 1308 1.1 mrg \fi 1309 1.1 mrg \def\pdfdestname{#1}% 1310 1.1 mrg \txiescapepdf\pdfdestname 1311 1.1 mrg }} 1312 1.1.1.3 mrg % 1313 1.1.1.3 mrg \def\setpdfoutlinetext#1{{% 1314 1.1.1.3 mrg \indexnofonts 1315 1.1.1.3 mrg \makevalueexpandable 1316 1.1.1.3 mrg \turnoffactive 1317 1.1.1.3 mrg \ifx \declaredencoding \latone 1318 1.1.1.3 mrg % The PDF format can use an extended form of Latin-1 in bookmark 1319 1.1.1.3 mrg % strings. See Appendix D of the PDF Reference, Sixth Edition, for 1320 1.1.1.3 mrg % the "PDFDocEncoding". 1321 1.1.1.3 mrg \passthroughcharstrue 1322 1.1.1.3 mrg % Pass through Latin-1 characters. 1323 1.1.1.3 mrg % LuaTeX: Convert to Unicode 1324 1.1.1.3 mrg % pdfTeX: Use Latin-1 as PDFDocEncoding 1325 1.1.1.3 mrg \def\pdfoutlinetext{#1}% 1326 1.1.1.3 mrg \else 1327 1.1.1.3 mrg \ifx \declaredencoding \utfeight 1328 1.1.1.3 mrg \ifx\luatexversion\thisisundefined 1329 1.1.1.3 mrg % For pdfTeX with UTF-8. 1330 1.1.1.3 mrg % TODO: the PDF format can use UTF-16 in bookmark strings, 1331 1.1.1.3 mrg % but the code for this isn't done yet. 1332 1.1.1.3 mrg % Use ASCII approximations. 1333 1.1.1.3 mrg \passthroughcharsfalse 1334 1.1.1.3 mrg \def\pdfoutlinetext{#1}% 1335 1.1.1.3 mrg \else 1336 1.1.1.3 mrg % For LuaTeX with UTF-8. 1337 1.1.1.3 mrg % Pass through Unicode characters for title texts. 1338 1.1.1.3 mrg \passthroughcharstrue 1339 1.1.1.3 mrg \def\pdfoutlinetext{#1}% 1340 1.1.1.3 mrg \fi 1341 1.1.1.3 mrg \else 1342 1.1.1.3 mrg % For non-Latin-1 or non-UTF-8 encodings. 1343 1.1.1.3 mrg % Use ASCII approximations. 1344 1.1.1.3 mrg \passthroughcharsfalse 1345 1.1.1.3 mrg \def\pdfoutlinetext{#1}% 1346 1.1.1.3 mrg \fi 1347 1.1.1.3 mrg \fi 1348 1.1.1.3 mrg % LuaTeX: Convert to UTF-16 1349 1.1.1.3 mrg % pdfTeX: Use Latin-1 as PDFDocEncoding 1350 1.1.1.3 mrg \txiescapepdfutfsixteen\pdfoutlinetext 1351 1.1.1.3 mrg }} 1352 1.1.1.3 mrg % 1353 1.1.1.3 mrg \def\pdfmkdest#1{% 1354 1.1.1.3 mrg \setpdfdestname{#1}% 1355 1.1.1.3 mrg \safewhatsit{\pdfdest name{\pdfdestname} xyz}% 1356 1.1.1.3 mrg } 1357 1.1 mrg % 1358 1.1 mrg % used to mark target names; must be expandable. 1359 1.1 mrg \def\pdfmkpgn#1{#1} 1360 1.1.1.3 mrg % 1361 1.1.1.3 mrg % by default, use black for everything. 1362 1.1.1.3 mrg \def\urlcolor{\rgbBlack} 1363 1.1 mrg \def\linkcolor{\rgbBlack} 1364 1.1 mrg \def\endlink{\setcolor{\maincolor}\pdfendlink} 1365 1.1 mrg % 1366 1.1 mrg % Adding outlines to PDF; macros for calculating structure of outlines 1367 1.1 mrg % come from Petr Olsak 1368 1.1 mrg \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% 1369 1.1 mrg \else \csname#1\endcsname \fi} 1370 1.1 mrg \def\advancenumber#1{\tempnum=\expnumber{#1}\relax 1371 1.1 mrg \advance\tempnum by 1 1372 1.1 mrg \expandafter\xdef\csname#1\endcsname{\the\tempnum}} 1373 1.1 mrg % 1374 1.1 mrg % #1 is the section text, which is what will be displayed in the 1375 1.1 mrg % outline by the pdf viewer. #2 is the pdf expression for the number 1376 1.1 mrg % of subentries (or empty, for subsubsections). #3 is the node text, 1377 1.1 mrg % which might be empty if this toc entry had no corresponding node. 1378 1.1 mrg % #4 is the page number 1379 1.1 mrg % 1380 1.1 mrg \def\dopdfoutline#1#2#3#4{% 1381 1.1 mrg % Generate a link to the node text if that exists; else, use the 1382 1.1 mrg % page number. We could generate a destination for the section 1383 1.1 mrg % text in the case where a section has no node, but it doesn't 1384 1.1.1.3 mrg % seem worth the trouble, since most documents are normally structured. 1385 1.1.1.3 mrg \setpdfoutlinetext{#1} 1386 1.1.1.3 mrg \setpdfdestname{#3} 1387 1.1.1.3 mrg \ifx\pdfdestname\empty 1388 1.1 mrg \def\pdfdestname{#4}% 1389 1.1 mrg \fi 1390 1.1.1.3 mrg % 1391 1.1 mrg \pdfoutline goto name{\pdfmkpgn{\pdfdestname}}#2{\pdfoutlinetext}% 1392 1.1 mrg } 1393 1.1 mrg % 1394 1.1 mrg \def\pdfmakeoutlines{% 1395 1.1 mrg \begingroup 1396 1.1 mrg % Read toc silently, to get counts of subentries for \pdfoutline. 1397 1.1 mrg \def\partentry##1##2##3##4{}% ignore parts in the outlines 1398 1.1 mrg \def\numchapentry##1##2##3##4{% 1399 1.1 mrg \def\thischapnum{##2}% 1400 1.1 mrg \def\thissecnum{0}% 1401 1.1 mrg \def\thissubsecnum{0}% 1402 1.1 mrg }% 1403 1.1 mrg \def\numsecentry##1##2##3##4{% 1404 1.1 mrg \advancenumber{chap\thischapnum}% 1405 1.1 mrg \def\thissecnum{##2}% 1406 1.1 mrg \def\thissubsecnum{0}% 1407 1.1 mrg }% 1408 1.1 mrg \def\numsubsecentry##1##2##3##4{% 1409 1.1 mrg \advancenumber{sec\thissecnum}% 1410 1.1 mrg \def\thissubsecnum{##2}% 1411 1.1 mrg }% 1412 1.1 mrg \def\numsubsubsecentry##1##2##3##4{% 1413 1.1 mrg \advancenumber{subsec\thissubsecnum}% 1414 1.1 mrg }% 1415 1.1 mrg \def\thischapnum{0}% 1416 1.1 mrg \def\thissecnum{0}% 1417 1.1 mrg \def\thissubsecnum{0}% 1418 1.1 mrg % 1419 1.1 mrg % use \def rather than \let here because we redefine \chapentry et 1420 1.1 mrg % al. a second time, below. 1421 1.1 mrg \def\appentry{\numchapentry}% 1422 1.1 mrg \def\appsecentry{\numsecentry}% 1423 1.1 mrg \def\appsubsecentry{\numsubsecentry}% 1424 1.1 mrg \def\appsubsubsecentry{\numsubsubsecentry}% 1425 1.1 mrg \def\unnchapentry{\numchapentry}% 1426 1.1 mrg \def\unnsecentry{\numsecentry}% 1427 1.1 mrg \def\unnsubsecentry{\numsubsecentry}% 1428 1.1 mrg \def\unnsubsubsecentry{\numsubsubsecentry}% 1429 1.1 mrg \readdatafile{toc}% 1430 1.1 mrg % 1431 1.1 mrg % Read toc second time, this time actually producing the outlines. 1432 1.1 mrg % The `-' means take the \expnumber as the absolute number of 1433 1.1 mrg % subentries, which we calculated on our first read of the .toc above. 1434 1.1 mrg % 1435 1.1.1.5 mrg % We use the node names as the destinations. 1436 1.1.1.5 mrg % 1437 1.1.1.5 mrg % Currently we prefix the section name with the section number 1438 1.1.1.5 mrg % for chapter and appendix headings only in order to avoid too much 1439 1.1 mrg % horizontal space being required in the PDF viewer. 1440 1.1.1.5 mrg \def\numchapentry##1##2##3##4{% 1441 1.1.1.5 mrg \dopdfoutline{##2 ##1}{count-\expnumber{chap##2}}{##3}{##4}}% 1442 1.1 mrg \def\unnchapentry##1##2##3##4{% 1443 1.1 mrg \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% 1444 1.1 mrg \def\numsecentry##1##2##3##4{% 1445 1.1 mrg \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% 1446 1.1 mrg \def\numsubsecentry##1##2##3##4{% 1447 1.1 mrg \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}% 1448 1.1 mrg \def\numsubsubsecentry##1##2##3##4{% count is always zero 1449 1.1 mrg \dopdfoutline{##1}{}{##3}{##4}}% 1450 1.1 mrg % 1451 1.1 mrg % PDF outlines are displayed using system fonts, instead of 1452 1.1 mrg % document fonts. Therefore we cannot use special characters, 1453 1.1 mrg % since the encoding is unknown. For example, the eogonek from 1454 1.1 mrg % Latin 2 (0xea) gets translated to a | character. Info from 1455 1.1 mrg % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. 1456 1.1 mrg % 1457 1.1 mrg % TODO this right, we have to translate 8-bit characters to 1458 1.1 mrg % their "best" equivalent, based on the @documentencoding. Too 1459 1.1 mrg % much work for too little return. Just use the ASCII equivalents 1460 1.1.1.5 mrg % we use for the index sort strings. 1461 1.1 mrg % 1462 1.1 mrg \indexnofonts 1463 1.1 mrg \setupdatafile 1464 1.1 mrg % We can have normal brace characters in the PDF outlines, unlike 1465 1.1 mrg % Texinfo index files. So set that up. 1466 1.1 mrg \def\{{\lbracecharliteral}% 1467 1.1 mrg \def\}{\rbracecharliteral}% 1468 1.1 mrg \catcode`\\=\active \otherbackslash 1469 1.1 mrg \input \tocreadfilename 1470 1.1 mrg \endgroup 1471 1.1 mrg } 1472 1.1 mrg {\catcode`[=1 \catcode`]=2 1473 1.1 mrg \catcode`{=\other \catcode`}=\other 1474 1.1 mrg \gdef\lbracecharliteral[{]% 1475 1.1 mrg \gdef\rbracecharliteral[}]% 1476 1.1 mrg ] 1477 1.1 mrg % 1478 1.1 mrg \def\skipspaces#1{\def\PP{#1}\def\D{|}% 1479 1.1 mrg \ifx\PP\D\let\nextsp\relax 1480 1.1.1.2 mrg \else\let\nextsp\skipspaces 1481 1.1.1.2 mrg \addtokens{\filename}{\PP}% 1482 1.1 mrg \advance\filenamelength by 1 1483 1.1 mrg \fi 1484 1.1 mrg \nextsp} 1485 1.1 mrg \def\getfilename#1{% 1486 1.1 mrg \filenamelength=0 1487 1.1 mrg % If we don't expand the argument now, \skipspaces will get 1488 1.1 mrg % snagged on things like "@value{foo}". 1489 1.1 mrg \edef\temp{#1}% 1490 1.1 mrg \expandafter\skipspaces\temp|\relax 1491 1.1 mrg } 1492 1.1 mrg \ifnum\pdftexversion < 14 1493 1.1 mrg \let \startlink \pdfannotlink 1494 1.1 mrg \else 1495 1.1 mrg \let \startlink \pdfstartlink 1496 1.1 mrg \fi 1497 1.1 mrg % make a live url in pdf output. 1498 1.1 mrg \def\pdfurl#1{% 1499 1.1 mrg \begingroup 1500 1.1 mrg % it seems we really need yet another set of dummies; have not 1501 1.1 mrg % tried to figure out what each command should do in the context 1502 1.1 mrg % of @url. for now, just make @/ a no-op, that's the only one 1503 1.1 mrg % people have actually reported a problem with. 1504 1.1 mrg % 1505 1.1 mrg \normalturnoffactive 1506 1.1 mrg \def\@{@}% 1507 1.1 mrg \let\/=\empty 1508 1.1 mrg \makevalueexpandable 1509 1.1 mrg % do we want to go so far as to use \indexnofonts instead of just 1510 1.1 mrg % special-casing \var here? 1511 1.1 mrg \def\var##1{##1}% 1512 1.1 mrg % 1513 1.1 mrg \leavevmode\setcolor{\urlcolor}% 1514 1.1 mrg \startlink attr{/Border [0 0 0]}% 1515 1.1 mrg user{/Subtype /Link /A << /S /URI /URI (#1) >>}% 1516 1.1.1.4 mrg \endgroup} 1517 1.1.1.4 mrg % \pdfgettoks - Surround page numbers in #1 with @pdflink. #1 may 1518 1.1.1.4 mrg % be a simple number, or a list of numbers in the case of an index 1519 1.1 mrg % entry. 1520 1.1 mrg \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} 1521 1.1 mrg \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} 1522 1.1 mrg \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} 1523 1.1 mrg \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} 1524 1.1 mrg \def\maketoks{% 1525 1.1 mrg \expandafter\poptoks\the\toksA|ENDTOKS|\relax 1526 1.1 mrg \ifx\first0\adn0 1527 1.1 mrg \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 1528 1.1 mrg \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 1529 1.1 mrg \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 1530 1.1 mrg \else 1531 1.1 mrg \ifnum0=\countA\else\makelink\fi 1532 1.1 mrg \ifx\first.\let\next=\done\else 1533 1.1 mrg \let\next=\maketoks 1534 1.1 mrg \addtokens{\toksB}{\the\toksD} 1535 1.1 mrg \ifx\first,\addtokens{\toksB}{\space}\fi 1536 1.1 mrg \fi 1537 1.1 mrg \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi 1538 1.1 mrg \next} 1539 1.1 mrg \def\makelink{\addtokens{\toksB}% 1540 1.1.1.5 mrg {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} 1541 1.1.1.5 mrg \def\pdflink#1{\pdflinkpage{#1}{#1}}% 1542 1.1 mrg \def\pdflinkpage#1#2{% 1543 1.1.1.5 mrg \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} 1544 1.1 mrg \setcolor{\linkcolor}#2\endlink} 1545 1.1 mrg \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} 1546 1.1 mrg \else 1547 1.1 mrg % non-pdf mode 1548 1.1 mrg \let\pdfmkdest = \gobble 1549 1.1 mrg \let\pdfurl = \gobble 1550 1.1 mrg \let\endlink = \relax 1551 1.1 mrg \let\setcolor = \gobble 1552 1.1 mrg \let\pdfsetcolor = \gobble 1553 1.1 mrg \let\pdfmakeoutlines = \relax 1554 1.1 mrg \fi % \ifx\pdfoutput 1555 1.1 mrg 1556 1.1.1.3 mrg % 1557 1.1 mrg % For XeTeX 1558 1.1.1.3 mrg % 1559 1.1.1.3 mrg \ifx\XeTeXrevision\thisisundefined 1560 1.1.1.3 mrg \else 1561 1.1.1.3 mrg % 1562 1.1.1.3 mrg % XeTeX version check 1563 1.1.1.3 mrg % 1564 1.1.1.3 mrg \ifnum\strcmp{\the\XeTeXversion\XeTeXrevision}{0.99996}>-1 1565 1.1.1.3 mrg % TeX Live 2016 contains XeTeX 0.99996 and xdvipdfmx 20160307. 1566 1.1.1.3 mrg % It can use the `dvipdfmx:config' special (from TeX Live SVN r40941). 1567 1.1.1.3 mrg % For avoiding PDF destination name replacement, we use this special 1568 1.1.1.3 mrg % instead of xdvipdfmx's command line option `-C 0x0010'. 1569 1.1.1.3 mrg \special{dvipdfmx:config C 0x0010} 1570 1.1.1.3 mrg % XeTeX 0.99995+ comes with xdvipdfmx 20160307+. 1571 1.1.1.3 mrg % It can handle Unicode destination names for PDF. 1572 1.1.1.3 mrg \txiuseunicodedestnametrue 1573 1.1.1.3 mrg \else 1574 1.1.1.3 mrg % XeTeX < 0.99996 (TeX Live < 2016) cannot use the 1575 1.1.1.3 mrg % `dvipdfmx:config' special. 1576 1.1.1.3 mrg % So for avoiding PDF destination name replacement, 1577 1.1.1.3 mrg % xdvipdfmx's command line option `-C 0x0010' is necessary. 1578 1.1.1.3 mrg % 1579 1.1.1.3 mrg % XeTeX < 0.99995 can not handle Unicode destination names for PDF 1580 1.1.1.3 mrg % because xdvipdfmx 20150315 has a UTF-16 conversion issue. 1581 1.1.1.3 mrg % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753). 1582 1.1.1.3 mrg \txiuseunicodedestnamefalse 1583 1.1.1.3 mrg \fi 1584 1.1.1.3 mrg % 1585 1.1.1.3 mrg % Color support 1586 1.1.1.3 mrg % 1587 1.1.1.3 mrg \def\rgbDarkRed{0.50 0.09 0.12} 1588 1.1.1.3 mrg \def\rgbBlack{0 0 0} 1589 1.1.1.3 mrg % 1590 1.1.1.3 mrg \def\pdfsetcolor#1{\special{pdf:scolor [#1]}} 1591 1.1.1.3 mrg % 1592 1.1.1.3 mrg % Set color, and create a mark which defines \thiscolor accordingly, 1593 1.1.1.3 mrg % so that \makeheadline knows which color to restore. 1594 1.1.1.4 mrg \def\setcolor#1{% 1595 1.1.1.3 mrg \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}% 1596 1.1.1.3 mrg \domark 1597 1.1.1.3 mrg \pdfsetcolor{#1}% 1598 1.1.1.3 mrg } 1599 1.1.1.3 mrg % 1600 1.1.1.3 mrg \def\maincolor{\rgbBlack} 1601 1.1.1.3 mrg \pdfsetcolor{\maincolor} 1602 1.1.1.4 mrg \edef\thiscolor{\maincolor} 1603 1.1.1.3 mrg \def\currentcolordefs{} 1604 1.1.1.3 mrg % 1605 1.1.1.3 mrg \def\makefootline{% 1606 1.1.1.3 mrg \baselineskip24pt 1607 1.1.1.3 mrg \line{\pdfsetcolor{\maincolor}\the\footline}% 1608 1.1.1.3 mrg } 1609 1.1.1.3 mrg % 1610 1.1.1.3 mrg \def\makeheadline{% 1611 1.1.1.3 mrg \vbox to 0pt{% 1612 1.1.1.3 mrg \vskip-22.5pt 1613 1.1.1.3 mrg \line{% 1614 1.1.1.3 mrg \vbox to8.5pt{}% 1615 1.1.1.3 mrg % Extract \thiscolor definition from the marks. 1616 1.1.1.3 mrg \getcolormarks 1617 1.1.1.3 mrg % Typeset the headline with \maincolor, then restore the color. 1618 1.1.1.3 mrg \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% 1619 1.1.1.3 mrg }% 1620 1.1.1.3 mrg \vss 1621 1.1.1.3 mrg }% 1622 1.1.1.3 mrg \nointerlineskip 1623 1.1.1.3 mrg } 1624 1.1.1.3 mrg % 1625 1.1.1.3 mrg % PDF outline support 1626 1.1.1.3 mrg % 1627 1.1.1.3 mrg % Emulate pdfTeX primitive 1628 1.1.1.3 mrg \def\pdfdest name#1 xyz{% 1629 1.1.1.3 mrg \special{pdf:dest (#1) [@thispage /XYZ @xpos @ypos null]}% 1630 1.1.1.3 mrg } 1631 1.1.1.3 mrg % 1632 1.1.1.3 mrg \def\setpdfdestname#1{{% 1633 1.1.1.3 mrg % We have to set dummies so commands such as @code, and characters 1634 1.1.1.3 mrg % such as \, aren't expanded when present in a section title. 1635 1.1.1.3 mrg \indexnofonts 1636 1.1.1.3 mrg \makevalueexpandable 1637 1.1.1.3 mrg \turnoffactive 1638 1.1.1.3 mrg \iftxiuseunicodedestname 1639 1.1.1.3 mrg % Pass through Unicode characters. 1640 1.1.1.3 mrg \else 1641 1.1.1.3 mrg % Use ASCII approximations in destination names. 1642 1.1.1.3 mrg \passthroughcharsfalse 1643 1.1.1.3 mrg \fi 1644 1.1.1.3 mrg \def\pdfdestname{#1}% 1645 1.1.1.3 mrg \txiescapepdf\pdfdestname 1646 1.1.1.3 mrg }} 1647 1.1.1.3 mrg % 1648 1.1.1.3 mrg \def\setpdfoutlinetext#1{{% 1649 1.1.1.3 mrg \turnoffactive 1650 1.1.1.3 mrg % Always use Unicode characters in title texts. 1651 1.1.1.3 mrg \def\pdfoutlinetext{#1}% 1652 1.1.1.3 mrg % For XeTeX, xdvipdfmx converts to UTF-16. 1653 1.1.1.3 mrg % So we do not convert. 1654 1.1.1.3 mrg \txiescapepdf\pdfoutlinetext 1655 1.1.1.3 mrg }} 1656 1.1.1.3 mrg % 1657 1.1.1.3 mrg \def\pdfmkdest#1{% 1658 1.1.1.3 mrg \setpdfdestname{#1}% 1659 1.1.1.3 mrg \safewhatsit{\pdfdest name{\pdfdestname} xyz}% 1660 1.1.1.3 mrg } 1661 1.1.1.3 mrg % 1662 1.1.1.3 mrg % by default, use black for everything. 1663 1.1.1.3 mrg \def\urlcolor{\rgbBlack} 1664 1.1.1.3 mrg \def\linkcolor{\rgbBlack} 1665 1.1.1.3 mrg \def\endlink{\setcolor{\maincolor}\pdfendlink} 1666 1.1.1.3 mrg % 1667 1.1.1.3 mrg \def\dopdfoutline#1#2#3#4{% 1668 1.1.1.3 mrg \setpdfoutlinetext{#1} 1669 1.1.1.3 mrg \setpdfdestname{#3} 1670 1.1.1.3 mrg \ifx\pdfdestname\empty 1671 1.1.1.3 mrg \def\pdfdestname{#4}% 1672 1.1.1.3 mrg \fi 1673 1.1.1.3 mrg % 1674 1.1.1.3 mrg \special{pdf:out [-] #2 << /Title (\pdfoutlinetext) /A 1675 1.1.1.3 mrg << /S /GoTo /D (\pdfdestname) >> >> }% 1676 1.1.1.3 mrg } 1677 1.1.1.3 mrg % 1678 1.1.1.3 mrg \def\pdfmakeoutlines{% 1679 1.1.1.3 mrg \begingroup 1680 1.1.1.3 mrg % 1681 1.1.1.3 mrg % For XeTeX, counts of subentries are not necessary. 1682 1.1.1.3 mrg % Therefore, we read toc only once. 1683 1.1.1.3 mrg % 1684 1.1.1.5 mrg % We use node names as destinations. 1685 1.1.1.5 mrg % 1686 1.1.1.5 mrg % Currently we prefix the section name with the section number 1687 1.1.1.5 mrg % for chapter and appendix headings only in order to avoid too much 1688 1.1.1.3 mrg % horizontal space being required in the PDF viewer. 1689 1.1.1.3 mrg \def\partentry##1##2##3##4{}% ignore parts in the outlines 1690 1.1.1.5 mrg \def\numchapentry##1##2##3##4{% 1691 1.1.1.3 mrg \dopdfoutline{##2 ##1}{1}{##3}{##4}}% 1692 1.1.1.3 mrg \def\numsecentry##1##2##3##4{% 1693 1.1.1.3 mrg \dopdfoutline{##1}{2}{##3}{##4}}% 1694 1.1.1.3 mrg \def\numsubsecentry##1##2##3##4{% 1695 1.1.1.3 mrg \dopdfoutline{##1}{3}{##3}{##4}}% 1696 1.1.1.3 mrg \def\numsubsubsecentry##1##2##3##4{% 1697 1.1.1.3 mrg \dopdfoutline{##1}{4}{##3}{##4}}% 1698 1.1.1.3 mrg % 1699 1.1.1.3 mrg \let\appentry\numchapentry% 1700 1.1.1.3 mrg \let\appsecentry\numsecentry% 1701 1.1.1.3 mrg \let\appsubsecentry\numsubsecentry% 1702 1.1.1.5 mrg \let\appsubsubsecentry\numsubsubsecentry% 1703 1.1.1.5 mrg \def\unnchapentry##1##2##3##4{% 1704 1.1.1.3 mrg \dopdfoutline{##1}{1}{##3}{##4}}% 1705 1.1.1.3 mrg \let\unnsecentry\numsecentry% 1706 1.1.1.3 mrg \let\unnsubsecentry\numsubsecentry% 1707 1.1.1.3 mrg \let\unnsubsubsecentry\numsubsubsecentry% 1708 1.1.1.3 mrg % 1709 1.1.1.3 mrg % For XeTeX, xdvipdfmx converts strings to UTF-16. 1710 1.1.1.3 mrg % Therefore, the encoding and the language may not be considered. 1711 1.1.1.3 mrg % 1712 1.1.1.3 mrg \indexnofonts 1713 1.1.1.3 mrg \setupdatafile 1714 1.1.1.3 mrg % We can have normal brace characters in the PDF outlines, unlike 1715 1.1.1.3 mrg % Texinfo index files. So set that up. 1716 1.1.1.3 mrg \def\{{\lbracecharliteral}% 1717 1.1.1.3 mrg \def\}{\rbracecharliteral}% 1718 1.1.1.3 mrg \catcode`\\=\active \otherbackslash 1719 1.1.1.3 mrg \input \tocreadfilename 1720 1.1.1.3 mrg \endgroup 1721 1.1.1.3 mrg } 1722 1.1.1.3 mrg {\catcode`[=1 \catcode`]=2 1723 1.1.1.3 mrg \catcode`{=\other \catcode`}=\other 1724 1.1.1.3 mrg \gdef\lbracecharliteral[{]% 1725 1.1.1.3 mrg \gdef\rbracecharliteral[}]% 1726 1.1 mrg ] 1727 1.1.1.3 mrg 1728 1.1.1.3 mrg \special{pdf:docview << /PageMode /UseOutlines >> } 1729 1.1.1.3 mrg % ``\special{pdf:tounicode ...}'' is not necessary 1730 1.1.1.3 mrg % because xdvipdfmx converts strings from UTF-8 to UTF-16 without it. 1731 1.1.1.3 mrg % However, due to a UTF-16 conversion issue of xdvipdfmx 20150315, 1732 1.1.1.3 mrg % ``\special{pdf:dest ...}'' cannot handle non-ASCII strings. 1733 1.1.1.3 mrg % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753). 1734 1.1.1.3 mrg % 1735 1.1.1.3 mrg \def\skipspaces#1{\def\PP{#1}\def\D{|}% 1736 1.1.1.3 mrg \ifx\PP\D\let\nextsp\relax 1737 1.1.1.3 mrg \else\let\nextsp\skipspaces 1738 1.1.1.3 mrg \addtokens{\filename}{\PP}% 1739 1.1.1.3 mrg \advance\filenamelength by 1 1740 1.1.1.3 mrg \fi 1741 1.1.1.3 mrg \nextsp} 1742 1.1.1.3 mrg \def\getfilename#1{% 1743 1.1.1.3 mrg \filenamelength=0 1744 1.1.1.3 mrg % If we don't expand the argument now, \skipspaces will get 1745 1.1.1.3 mrg % snagged on things like "@value{foo}". 1746 1.1.1.3 mrg \edef\temp{#1}% 1747 1.1.1.3 mrg \expandafter\skipspaces\temp|\relax 1748 1.1.1.3 mrg } 1749 1.1.1.3 mrg % make a live url in pdf output. 1750 1.1.1.3 mrg \def\pdfurl#1{% 1751 1.1.1.3 mrg \begingroup 1752 1.1.1.3 mrg % it seems we really need yet another set of dummies; have not 1753 1.1.1.3 mrg % tried to figure out what each command should do in the context 1754 1.1.1.3 mrg % of @url. for now, just make @/ a no-op, that's the only one 1755 1.1.1.3 mrg % people have actually reported a problem with. 1756 1.1.1.3 mrg % 1757 1.1.1.3 mrg \normalturnoffactive 1758 1.1.1.3 mrg \def\@{@}% 1759 1.1.1.3 mrg \let\/=\empty 1760 1.1.1.3 mrg \makevalueexpandable 1761 1.1.1.3 mrg % do we want to go so far as to use \indexnofonts instead of just 1762 1.1.1.3 mrg % special-casing \var here? 1763 1.1.1.3 mrg \def\var##1{##1}% 1764 1.1.1.3 mrg % 1765 1.1.1.3 mrg \leavevmode\setcolor{\urlcolor}% 1766 1.1.1.3 mrg \special{pdf:bann << /Border [0 0 0] 1767 1.1.1.3 mrg /Subtype /Link /A << /S /URI /URI (#1) >> >>}% 1768 1.1.1.3 mrg \endgroup} 1769 1.1.1.3 mrg \def\endlink{\setcolor{\maincolor}\special{pdf:eann}} 1770 1.1.1.3 mrg \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} 1771 1.1.1.3 mrg \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} 1772 1.1.1.3 mrg \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} 1773 1.1.1.3 mrg \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} 1774 1.1.1.3 mrg \def\maketoks{% 1775 1.1.1.3 mrg \expandafter\poptoks\the\toksA|ENDTOKS|\relax 1776 1.1.1.3 mrg \ifx\first0\adn0 1777 1.1.1.3 mrg \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 1778 1.1.1.3 mrg \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 1779 1.1.1.3 mrg \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 1780 1.1.1.3 mrg \else 1781 1.1.1.3 mrg \ifnum0=\countA\else\makelink\fi 1782 1.1.1.3 mrg \ifx\first.\let\next=\done\else 1783 1.1.1.3 mrg \let\next=\maketoks 1784 1.1.1.3 mrg \addtokens{\toksB}{\the\toksD} 1785 1.1.1.3 mrg \ifx\first,\addtokens{\toksB}{\space}\fi 1786 1.1.1.3 mrg \fi 1787 1.1.1.3 mrg \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi 1788 1.1.1.3 mrg \next} 1789 1.1.1.3 mrg \def\makelink{\addtokens{\toksB}% 1790 1.1.1.5 mrg {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} 1791 1.1.1.5 mrg \def\pdflink#1{\pdflinkpage{#1}{#1}}% 1792 1.1.1.3 mrg \def\pdflinkpage#1#2{% 1793 1.1.1.3 mrg \special{pdf:bann << /Border [0 0 0] 1794 1.1.1.5 mrg /Type /Annot /Subtype /Link /A << /S /GoTo /D (#1) >> >>}% 1795 1.1.1.3 mrg \setcolor{\linkcolor}#2\endlink} 1796 1.1.1.3 mrg \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} 1797 1.1.1.3 mrg % 1798 1.1.1.3 mrg % 1799 1.1.1.3 mrg % @image support 1800 1.1.1.3 mrg % 1801 1.1.1.3 mrg % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). 1802 1.1.1.3 mrg \def\doxeteximage#1#2#3{% 1803 1.1.1.3 mrg \def\xeteximagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% 1804 1.1.1.3 mrg \def\xeteximageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% 1805 1.1.1.3 mrg % 1806 1.1.1.3 mrg % XeTeX (and the PDF format) supports .pdf, .png, .jpg (among 1807 1.1.1.3 mrg % others). Let's try in that order, PDF first since if 1808 1.1.1.3 mrg % someone has a scalable image, presumably better to use that than a 1809 1.1.1.3 mrg % bitmap. 1810 1.1.1.3 mrg \let\xeteximgext=\empty 1811 1.1.1.3 mrg \begingroup 1812 1.1.1.3 mrg \openin 1 #1.pdf \ifeof 1 1813 1.1.1.3 mrg \openin 1 #1.PDF \ifeof 1 1814 1.1.1.3 mrg \openin 1 #1.png \ifeof 1 1815 1.1.1.3 mrg \openin 1 #1.jpg \ifeof 1 1816 1.1.1.3 mrg \openin 1 #1.jpeg \ifeof 1 1817 1.1.1.3 mrg \openin 1 #1.JPG \ifeof 1 1818 1.1.1.3 mrg \errmessage{Could not find image file #1 for XeTeX}% 1819 1.1.1.3 mrg \else \gdef\xeteximgext{JPG}% 1820 1.1.1.3 mrg \fi 1821 1.1.1.3 mrg \else \gdef\xeteximgext{jpeg}% 1822 1.1.1.3 mrg \fi 1823 1.1.1.3 mrg \else \gdef\xeteximgext{jpg}% 1824 1.1.1.3 mrg \fi 1825 1.1.1.3 mrg \else \gdef\xeteximgext{png}% 1826 1.1.1.3 mrg \fi 1827 1.1.1.3 mrg \else \gdef\xeteximgext{PDF}% 1828 1.1.1.3 mrg \fi 1829 1.1.1.3 mrg \else \gdef\xeteximgext{pdf}% 1830 1.1.1.3 mrg \fi 1831 1.1.1.3 mrg \closein 1 1832 1.1.1.3 mrg \endgroup 1833 1.1.1.5 mrg % 1834 1.1.1.5 mrg % Putting an \hbox around the image can prevent an over-long line 1835 1.1.1.5 mrg % after the image. 1836 1.1.1.5 mrg \hbox\bgroup 1837 1.1.1.3 mrg \def\xetexpdfext{pdf}% 1838 1.1.1.3 mrg \ifx\xeteximgext\xetexpdfext 1839 1.1.1.3 mrg \XeTeXpdffile "#1".\xeteximgext "" 1840 1.1.1.5 mrg \else 1841 1.1.1.5 mrg \def\xetexpdfext{PDF}% 1842 1.1.1.5 mrg \ifx\xeteximgext\xetexpdfext 1843 1.1.1.5 mrg \XeTeXpdffile "#1".\xeteximgext "" 1844 1.1.1.5 mrg \else 1845 1.1.1.5 mrg \XeTeXpicfile "#1".\xeteximgext "" 1846 1.1.1.3 mrg \fi 1847 1.1.1.5 mrg \fi 1848 1.1.1.5 mrg \ifdim \wd0 >0pt width \xeteximagewidth \fi 1849 1.1.1.5 mrg \ifdim \wd2 >0pt height \xeteximageheight \fi \relax 1850 1.1.1.3 mrg \egroup 1851 1.1.1.3 mrg } 1852 1.1 mrg \fi 1853 1.1 mrg 1854 1.1.1.3 mrg 1855 1.1.1.3 mrg % 1856 1.1 mrg \message{fonts,} 1857 1.1 mrg 1858 1.1 mrg % Set the baselineskip to #1, and the lineskip and strut size 1859 1.1 mrg % correspondingly. There is no deep meaning behind these magic numbers 1860 1.1 mrg % used as factors; they just match (closely enough) what Knuth defined. 1861 1.1 mrg % 1862 1.1 mrg \def\lineskipfactor{.08333} 1863 1.1 mrg \def\strutheightpercent{.70833} 1864 1.1 mrg \def\strutdepthpercent {.29167} 1865 1.1 mrg % 1866 1.1 mrg % can get a sort of poor man's double spacing by redefining this. 1867 1.1 mrg \def\baselinefactor{1} 1868 1.1.1.2 mrg % 1869 1.1 mrg \newdimen\textleading 1870 1.1 mrg \def\setleading#1{% 1871 1.1 mrg \dimen0 = #1\relax 1872 1.1 mrg \normalbaselineskip = \baselinefactor\dimen0 1873 1.1 mrg \normallineskip = \lineskipfactor\normalbaselineskip 1874 1.1 mrg \normalbaselines 1875 1.1 mrg \setbox\strutbox =\hbox{% 1876 1.1 mrg \vrule width0pt height\strutheightpercent\baselineskip 1877 1.1 mrg depth \strutdepthpercent \baselineskip 1878 1.1 mrg }% 1879 1.1 mrg } 1880 1.1 mrg 1881 1.1 mrg % PDF CMaps. See also LaTeX's t1.cmap. 1882 1.1 mrg % 1883 1.1 mrg % do nothing with this by default. 1884 1.1 mrg \expandafter\let\csname cmapOT1\endcsname\gobble 1885 1.1 mrg \expandafter\let\csname cmapOT1IT\endcsname\gobble 1886 1.1 mrg \expandafter\let\csname cmapOT1TT\endcsname\gobble 1887 1.1 mrg 1888 1.1 mrg % if we are producing pdf, and we have \pdffontattr, then define cmaps. 1889 1.1 mrg % (\pdffontattr was introduced many years ago, but people still run 1890 1.1 mrg % older pdftex's; it's easy to conditionalize, so we do.) 1891 1.1 mrg \ifpdf \ifx\pdffontattr\thisisundefined \else 1892 1.1 mrg \begingroup 1893 1.1 mrg \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. 1894 1.1 mrg \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap 1895 1.1 mrg %%DocumentNeededResources: ProcSet (CIDInit) 1896 1.1 mrg %%IncludeResource: ProcSet (CIDInit) 1897 1.1 mrg %%BeginResource: CMap (TeX-OT1-0) 1898 1.1 mrg %%Title: (TeX-OT1-0 TeX OT1 0) 1899 1.1 mrg %%Version: 1.000 1900 1.1 mrg %%EndComments 1901 1.1 mrg /CIDInit /ProcSet findresource begin 1902 1.1 mrg 12 dict begin 1903 1.1 mrg begincmap 1904 1.1 mrg /CIDSystemInfo 1905 1.1 mrg << /Registry (TeX) 1906 1.1 mrg /Ordering (OT1) 1907 1.1 mrg /Supplement 0 1908 1.1 mrg >> def 1909 1.1 mrg /CMapName /TeX-OT1-0 def 1910 1.1 mrg /CMapType 2 def 1911 1.1 mrg 1 begincodespacerange 1912 1.1 mrg <00> <7F> 1913 1.1 mrg endcodespacerange 1914 1.1 mrg 8 beginbfrange 1915 1.1 mrg <00> <01> <0393> 1916 1.1 mrg <09> <0A> <03A8> 1917 1.1 mrg <23> <26> <0023> 1918 1.1 mrg <28> <3B> <0028> 1919 1.1 mrg <3F> <5B> <003F> 1920 1.1 mrg <5D> <5E> <005D> 1921 1.1 mrg <61> <7A> <0061> 1922 1.1 mrg <7B> <7C> <2013> 1923 1.1 mrg endbfrange 1924 1.1 mrg 40 beginbfchar 1925 1.1 mrg <02> <0398> 1926 1.1 mrg <03> <039B> 1927 1.1 mrg <04> <039E> 1928 1.1 mrg <05> <03A0> 1929 1.1 mrg <06> <03A3> 1930 1.1 mrg <07> <03D2> 1931 1.1 mrg <08> <03A6> 1932 1.1 mrg <0B> <00660066> 1933 1.1 mrg <0C> <00660069> 1934 1.1 mrg <0D> <0066006C> 1935 1.1 mrg <0E> <006600660069> 1936 1.1 mrg <0F> <00660066006C> 1937 1.1 mrg <10> <0131> 1938 1.1 mrg <11> <0237> 1939 1.1 mrg <12> <0060> 1940 1.1 mrg <13> <00B4> 1941 1.1 mrg <14> <02C7> 1942 1.1 mrg <15> <02D8> 1943 1.1 mrg <16> <00AF> 1944 1.1 mrg <17> <02DA> 1945 1.1 mrg <18> <00B8> 1946 1.1 mrg <19> <00DF> 1947 1.1 mrg <1A> <00E6> 1948 1.1 mrg <1B> <0153> 1949 1.1 mrg <1C> <00F8> 1950 1.1 mrg <1D> <00C6> 1951 1.1 mrg <1E> <0152> 1952 1.1 mrg <1F> <00D8> 1953 1.1 mrg <21> <0021> 1954 1.1 mrg <22> <201D> 1955 1.1 mrg <27> <2019> 1956 1.1 mrg <3C> <00A1> 1957 1.1 mrg <3D> <003D> 1958 1.1 mrg <3E> <00BF> 1959 1.1 mrg <5C> <201C> 1960 1.1 mrg <5F> <02D9> 1961 1.1 mrg <60> <2018> 1962 1.1 mrg <7D> <02DD> 1963 1.1 mrg <7E> <007E> 1964 1.1 mrg <7F> <00A8> 1965 1.1 mrg endbfchar 1966 1.1 mrg endcmap 1967 1.1 mrg CMapName currentdict /CMap defineresource pop 1968 1.1 mrg end 1969 1.1 mrg end 1970 1.1 mrg %%EndResource 1971 1.1 mrg %%EOF 1972 1.1 mrg }\endgroup 1973 1.1 mrg \expandafter\edef\csname cmapOT1\endcsname#1{% 1974 1.1 mrg \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% 1975 1.1 mrg }% 1976 1.1 mrg % 1977 1.1 mrg % \cmapOT1IT 1978 1.1 mrg \begingroup 1979 1.1 mrg \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. 1980 1.1 mrg \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap 1981 1.1 mrg %%DocumentNeededResources: ProcSet (CIDInit) 1982 1.1 mrg %%IncludeResource: ProcSet (CIDInit) 1983 1.1 mrg %%BeginResource: CMap (TeX-OT1IT-0) 1984 1.1 mrg %%Title: (TeX-OT1IT-0 TeX OT1IT 0) 1985 1.1 mrg %%Version: 1.000 1986 1.1 mrg %%EndComments 1987 1.1 mrg /CIDInit /ProcSet findresource begin 1988 1.1 mrg 12 dict begin 1989 1.1 mrg begincmap 1990 1.1 mrg /CIDSystemInfo 1991 1.1 mrg << /Registry (TeX) 1992 1.1 mrg /Ordering (OT1IT) 1993 1.1 mrg /Supplement 0 1994 1.1 mrg >> def 1995 1.1 mrg /CMapName /TeX-OT1IT-0 def 1996 1.1 mrg /CMapType 2 def 1997 1.1 mrg 1 begincodespacerange 1998 1.1 mrg <00> <7F> 1999 1.1 mrg endcodespacerange 2000 1.1 mrg 8 beginbfrange 2001 1.1 mrg <00> <01> <0393> 2002 1.1 mrg <09> <0A> <03A8> 2003 1.1 mrg <25> <26> <0025> 2004 1.1 mrg <28> <3B> <0028> 2005 1.1 mrg <3F> <5B> <003F> 2006 1.1 mrg <5D> <5E> <005D> 2007 1.1 mrg <61> <7A> <0061> 2008 1.1 mrg <7B> <7C> <2013> 2009 1.1 mrg endbfrange 2010 1.1 mrg 42 beginbfchar 2011 1.1 mrg <02> <0398> 2012 1.1 mrg <03> <039B> 2013 1.1 mrg <04> <039E> 2014 1.1 mrg <05> <03A0> 2015 1.1 mrg <06> <03A3> 2016 1.1 mrg <07> <03D2> 2017 1.1 mrg <08> <03A6> 2018 1.1 mrg <0B> <00660066> 2019 1.1 mrg <0C> <00660069> 2020 1.1 mrg <0D> <0066006C> 2021 1.1 mrg <0E> <006600660069> 2022 1.1 mrg <0F> <00660066006C> 2023 1.1 mrg <10> <0131> 2024 1.1 mrg <11> <0237> 2025 1.1 mrg <12> <0060> 2026 1.1 mrg <13> <00B4> 2027 1.1 mrg <14> <02C7> 2028 1.1 mrg <15> <02D8> 2029 1.1 mrg <16> <00AF> 2030 1.1 mrg <17> <02DA> 2031 1.1 mrg <18> <00B8> 2032 1.1 mrg <19> <00DF> 2033 1.1 mrg <1A> <00E6> 2034 1.1 mrg <1B> <0153> 2035 1.1 mrg <1C> <00F8> 2036 1.1 mrg <1D> <00C6> 2037 1.1 mrg <1E> <0152> 2038 1.1 mrg <1F> <00D8> 2039 1.1 mrg <21> <0021> 2040 1.1 mrg <22> <201D> 2041 1.1 mrg <23> <0023> 2042 1.1 mrg <24> <00A3> 2043 1.1 mrg <27> <2019> 2044 1.1 mrg <3C> <00A1> 2045 1.1 mrg <3D> <003D> 2046 1.1 mrg <3E> <00BF> 2047 1.1 mrg <5C> <201C> 2048 1.1 mrg <5F> <02D9> 2049 1.1 mrg <60> <2018> 2050 1.1 mrg <7D> <02DD> 2051 1.1 mrg <7E> <007E> 2052 1.1 mrg <7F> <00A8> 2053 1.1 mrg endbfchar 2054 1.1 mrg endcmap 2055 1.1 mrg CMapName currentdict /CMap defineresource pop 2056 1.1 mrg end 2057 1.1 mrg end 2058 1.1 mrg %%EndResource 2059 1.1 mrg %%EOF 2060 1.1 mrg }\endgroup 2061 1.1 mrg \expandafter\edef\csname cmapOT1IT\endcsname#1{% 2062 1.1 mrg \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% 2063 1.1 mrg }% 2064 1.1 mrg % 2065 1.1 mrg % \cmapOT1TT 2066 1.1 mrg \begingroup 2067 1.1 mrg \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. 2068 1.1 mrg \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap 2069 1.1 mrg %%DocumentNeededResources: ProcSet (CIDInit) 2070 1.1 mrg %%IncludeResource: ProcSet (CIDInit) 2071 1.1 mrg %%BeginResource: CMap (TeX-OT1TT-0) 2072 1.1 mrg %%Title: (TeX-OT1TT-0 TeX OT1TT 0) 2073 1.1 mrg %%Version: 1.000 2074 1.1 mrg %%EndComments 2075 1.1 mrg /CIDInit /ProcSet findresource begin 2076 1.1 mrg 12 dict begin 2077 1.1 mrg begincmap 2078 1.1 mrg /CIDSystemInfo 2079 1.1 mrg << /Registry (TeX) 2080 1.1 mrg /Ordering (OT1TT) 2081 1.1 mrg /Supplement 0 2082 1.1 mrg >> def 2083 1.1 mrg /CMapName /TeX-OT1TT-0 def 2084 1.1 mrg /CMapType 2 def 2085 1.1 mrg 1 begincodespacerange 2086 1.1 mrg <00> <7F> 2087 1.1 mrg endcodespacerange 2088 1.1 mrg 5 beginbfrange 2089 1.1 mrg <00> <01> <0393> 2090 1.1 mrg <09> <0A> <03A8> 2091 1.1 mrg <21> <26> <0021> 2092 1.1 mrg <28> <5F> <0028> 2093 1.1 mrg <61> <7E> <0061> 2094 1.1 mrg endbfrange 2095 1.1 mrg 32 beginbfchar 2096 1.1 mrg <02> <0398> 2097 1.1 mrg <03> <039B> 2098 1.1 mrg <04> <039E> 2099 1.1 mrg <05> <03A0> 2100 1.1 mrg <06> <03A3> 2101 1.1 mrg <07> <03D2> 2102 1.1 mrg <08> <03A6> 2103 1.1 mrg <0B> <2191> 2104 1.1 mrg <0C> <2193> 2105 1.1 mrg <0D> <0027> 2106 1.1 mrg <0E> <00A1> 2107 1.1 mrg <0F> <00BF> 2108 1.1 mrg <10> <0131> 2109 1.1 mrg <11> <0237> 2110 1.1 mrg <12> <0060> 2111 1.1 mrg <13> <00B4> 2112 1.1 mrg <14> <02C7> 2113 1.1 mrg <15> <02D8> 2114 1.1 mrg <16> <00AF> 2115 1.1 mrg <17> <02DA> 2116 1.1 mrg <18> <00B8> 2117 1.1 mrg <19> <00DF> 2118 1.1 mrg <1A> <00E6> 2119 1.1 mrg <1B> <0153> 2120 1.1 mrg <1C> <00F8> 2121 1.1 mrg <1D> <00C6> 2122 1.1 mrg <1E> <0152> 2123 1.1 mrg <1F> <00D8> 2124 1.1 mrg <20> <2423> 2125 1.1 mrg <27> <2019> 2126 1.1 mrg <60> <2018> 2127 1.1 mrg <7F> <00A8> 2128 1.1 mrg endbfchar 2129 1.1 mrg endcmap 2130 1.1 mrg CMapName currentdict /CMap defineresource pop 2131 1.1 mrg end 2132 1.1 mrg end 2133 1.1 mrg %%EndResource 2134 1.1 mrg %%EOF 2135 1.1 mrg }\endgroup 2136 1.1 mrg \expandafter\edef\csname cmapOT1TT\endcsname#1{% 2137 1.1 mrg \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% 2138 1.1 mrg }% 2139 1.1 mrg \fi\fi 2140 1.1 mrg 2141 1.1.1.2 mrg 2142 1.1 mrg % Set the font macro #1 to the font named \fontprefix#2. 2143 1.1.1.2 mrg % #3 is the font's design size, #4 is a scale factor, #5 is the CMap 2144 1.1.1.2 mrg % encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit). 2145 1.1.1.2 mrg % Example: 2146 1.1.1.2 mrg % #1 = \textrm 2147 1.1.1.2 mrg % #2 = \rmshape 2148 1.1.1.2 mrg % #3 = 10 2149 1.1.1.2 mrg % #4 = \mainmagstep 2150 1.1.1.2 mrg % #5 = OT1 2151 1.1 mrg % 2152 1.1 mrg \def\setfont#1#2#3#4#5{% 2153 1.1 mrg \font#1=\fontprefix#2#3 scaled #4 2154 1.1 mrg \csname cmap#5\endcsname#1% 2155 1.1 mrg } 2156 1.1 mrg % This is what gets called when #5 of \setfont is empty. 2157 1.1.1.2 mrg \let\cmap\gobble 2158 1.1.1.2 mrg % 2159 1.1 mrg % (end of cmaps) 2160 1.1 mrg 2161 1.1 mrg % Use cm as the default font prefix. 2162 1.1 mrg % To specify the font prefix, you must define \fontprefix 2163 1.1 mrg % before you read in texinfo.tex. 2164 1.1 mrg \ifx\fontprefix\thisisundefined 2165 1.1 mrg \def\fontprefix{cm} 2166 1.1 mrg \fi 2167 1.1 mrg % Support font families that don't use the same naming scheme as CM. 2168 1.1.1.2 mrg \def\rmshape{r} 2169 1.1 mrg \def\rmbshape{bx} % where the normal face is bold 2170 1.1 mrg \def\bfshape{b} 2171 1.1 mrg \def\bxshape{bx} 2172 1.1 mrg \def\ttshape{tt} 2173 1.1 mrg \def\ttbshape{tt} 2174 1.1 mrg \def\ttslshape{sltt} 2175 1.1 mrg \def\itshape{ti} 2176 1.1 mrg \def\itbshape{bxti} 2177 1.1 mrg \def\slshape{sl} 2178 1.1 mrg \def\slbshape{bxsl} 2179 1.1 mrg \def\sfshape{ss} 2180 1.1 mrg \def\sfbshape{ss} 2181 1.1 mrg \def\scshape{csc} 2182 1.1 mrg \def\scbshape{csc} 2183 1.1.1.2 mrg 2184 1.1 mrg % Definitions for a main text size of 11pt. (The default in Texinfo.) 2185 1.1 mrg % 2186 1.1 mrg \def\definetextfontsizexi{% 2187 1.1 mrg % Text fonts (11.2pt, magstep1). 2188 1.1 mrg \def\textnominalsize{11pt} 2189 1.1 mrg \edef\mainmagstep{\magstephalf} 2190 1.1 mrg \setfont\textrm\rmshape{10}{\mainmagstep}{OT1} 2191 1.1 mrg \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} 2192 1.1 mrg \setfont\textbf\bfshape{10}{\mainmagstep}{OT1} 2193 1.1 mrg \setfont\textit\itshape{10}{\mainmagstep}{OT1IT} 2194 1.1 mrg \setfont\textsl\slshape{10}{\mainmagstep}{OT1} 2195 1.1 mrg \setfont\textsf\sfshape{10}{\mainmagstep}{OT1} 2196 1.1 mrg \setfont\textsc\scshape{10}{\mainmagstep}{OT1} 2197 1.1 mrg \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} 2198 1.1 mrg \font\texti=cmmi10 scaled \mainmagstep 2199 1.1 mrg \font\textsy=cmsy10 scaled \mainmagstep 2200 1.1 mrg \def\textecsize{1095} 2201 1.1 mrg 2202 1.1 mrg % A few fonts for @defun names and args. 2203 1.1 mrg \setfont\defbf\bfshape{10}{\magstep1}{OT1} 2204 1.1.1.4 mrg \setfont\deftt\ttshape{10}{\magstep1}{OT1TT} 2205 1.1 mrg \setfont\defsl\slshape{10}{\magstep1}{OT1} 2206 1.1.1.3 mrg \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} 2207 1.1.1.3 mrg \def\df{\let\ttfont=\deftt \let\bffont = \defbf 2208 1.1 mrg \let\ttslfont=\defttsl \let\slfont=\defsl \bf} 2209 1.1 mrg 2210 1.1 mrg % Fonts for indices, footnotes, small examples (9pt). 2211 1.1 mrg \def\smallnominalsize{9pt} 2212 1.1 mrg \setfont\smallrm\rmshape{9}{1000}{OT1} 2213 1.1 mrg \setfont\smalltt\ttshape{9}{1000}{OT1TT} 2214 1.1 mrg \setfont\smallbf\bfshape{10}{900}{OT1} 2215 1.1 mrg \setfont\smallit\itshape{9}{1000}{OT1IT} 2216 1.1 mrg \setfont\smallsl\slshape{9}{1000}{OT1} 2217 1.1 mrg \setfont\smallsf\sfshape{9}{1000}{OT1} 2218 1.1 mrg \setfont\smallsc\scshape{10}{900}{OT1} 2219 1.1 mrg \setfont\smallttsl\ttslshape{10}{900}{OT1TT} 2220 1.1 mrg \font\smalli=cmmi9 2221 1.1 mrg \font\smallsy=cmsy9 2222 1.1 mrg \def\smallecsize{0900} 2223 1.1 mrg 2224 1.1 mrg % Fonts for small examples (8pt). 2225 1.1 mrg \def\smallernominalsize{8pt} 2226 1.1 mrg \setfont\smallerrm\rmshape{8}{1000}{OT1} 2227 1.1 mrg \setfont\smallertt\ttshape{8}{1000}{OT1TT} 2228 1.1 mrg \setfont\smallerbf\bfshape{10}{800}{OT1} 2229 1.1 mrg \setfont\smallerit\itshape{8}{1000}{OT1IT} 2230 1.1 mrg \setfont\smallersl\slshape{8}{1000}{OT1} 2231 1.1 mrg \setfont\smallersf\sfshape{8}{1000}{OT1} 2232 1.1 mrg \setfont\smallersc\scshape{10}{800}{OT1} 2233 1.1 mrg \setfont\smallerttsl\ttslshape{10}{800}{OT1TT} 2234 1.1 mrg \font\smalleri=cmmi8 2235 1.1 mrg \font\smallersy=cmsy8 2236 1.1 mrg \def\smallerecsize{0800} 2237 1.1.1.3 mrg 2238 1.1.1.3 mrg % Fonts for math mode superscripts (7pt). 2239 1.1.1.3 mrg \def\sevennominalsize{7pt} 2240 1.1.1.3 mrg \setfont\sevenrm\rmshape{7}{1000}{OT1} 2241 1.1.1.3 mrg \setfont\seventt\ttshape{10}{700}{OT1TT} 2242 1.1.1.3 mrg \setfont\sevenbf\bfshape{10}{700}{OT1} 2243 1.1.1.3 mrg \setfont\sevenit\itshape{7}{1000}{OT1IT} 2244 1.1.1.3 mrg \setfont\sevensl\slshape{10}{700}{OT1} 2245 1.1.1.3 mrg \setfont\sevensf\sfshape{10}{700}{OT1} 2246 1.1.1.3 mrg \setfont\sevensc\scshape{10}{700}{OT1} 2247 1.1.1.3 mrg \setfont\seventtsl\ttslshape{10}{700}{OT1TT} 2248 1.1.1.3 mrg \font\seveni=cmmi7 2249 1.1.1.3 mrg \font\sevensy=cmsy7 2250 1.1.1.3 mrg \def\sevenecsize{0700} 2251 1.1 mrg 2252 1.1 mrg % Fonts for title page (20.4pt): 2253 1.1 mrg \def\titlenominalsize{20pt} 2254 1.1 mrg \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} 2255 1.1 mrg \setfont\titleit\itbshape{10}{\magstep4}{OT1IT} 2256 1.1 mrg \setfont\titlesl\slbshape{10}{\magstep4}{OT1} 2257 1.1 mrg \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} 2258 1.1 mrg \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} 2259 1.1 mrg \setfont\titlesf\sfbshape{17}{\magstep1}{OT1} 2260 1.1 mrg \let\titlebf=\titlerm 2261 1.1 mrg \setfont\titlesc\scbshape{10}{\magstep4}{OT1} 2262 1.1 mrg \font\titlei=cmmi12 scaled \magstep3 2263 1.1 mrg \font\titlesy=cmsy10 scaled \magstep4 2264 1.1 mrg \def\titleecsize{2074} 2265 1.1 mrg 2266 1.1 mrg % Chapter (and unnumbered) fonts (17.28pt). 2267 1.1 mrg \def\chapnominalsize{17pt} 2268 1.1 mrg \setfont\chaprm\rmbshape{12}{\magstep2}{OT1} 2269 1.1 mrg \setfont\chapit\itbshape{10}{\magstep3}{OT1IT} 2270 1.1 mrg \setfont\chapsl\slbshape{10}{\magstep3}{OT1} 2271 1.1 mrg \setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT} 2272 1.1 mrg \setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT} 2273 1.1 mrg \setfont\chapsf\sfbshape{17}{1000}{OT1} 2274 1.1 mrg \let\chapbf=\chaprm 2275 1.1 mrg \setfont\chapsc\scbshape{10}{\magstep3}{OT1} 2276 1.1 mrg \font\chapi=cmmi12 scaled \magstep2 2277 1.1 mrg \font\chapsy=cmsy10 scaled \magstep3 2278 1.1 mrg \def\chapecsize{1728} 2279 1.1 mrg 2280 1.1 mrg % Section fonts (14.4pt). 2281 1.1 mrg \def\secnominalsize{14pt} 2282 1.1.1.3 mrg \setfont\secrm\rmbshape{12}{\magstep1}{OT1} 2283 1.1 mrg \setfont\secrmnotbold\rmshape{12}{\magstep1}{OT1} 2284 1.1 mrg \setfont\secit\itbshape{10}{\magstep2}{OT1IT} 2285 1.1 mrg \setfont\secsl\slbshape{10}{\magstep2}{OT1} 2286 1.1 mrg \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT} 2287 1.1 mrg \setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT} 2288 1.1 mrg \setfont\secsf\sfbshape{12}{\magstep1}{OT1} 2289 1.1 mrg \let\secbf\secrm 2290 1.1 mrg \setfont\secsc\scbshape{10}{\magstep2}{OT1} 2291 1.1 mrg \font\seci=cmmi12 scaled \magstep1 2292 1.1 mrg \font\secsy=cmsy10 scaled \magstep2 2293 1.1 mrg \def\sececsize{1440} 2294 1.1 mrg 2295 1.1 mrg % Subsection fonts (13.15pt). 2296 1.1 mrg \def\ssecnominalsize{13pt} 2297 1.1 mrg \setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1} 2298 1.1 mrg \setfont\ssecit\itbshape{10}{1315}{OT1IT} 2299 1.1 mrg \setfont\ssecsl\slbshape{10}{1315}{OT1} 2300 1.1 mrg \setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT} 2301 1.1 mrg \setfont\ssecttsl\ttslshape{10}{1315}{OT1TT} 2302 1.1 mrg \setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1} 2303 1.1 mrg \let\ssecbf\ssecrm 2304 1.1 mrg \setfont\ssecsc\scbshape{10}{1315}{OT1} 2305 1.1 mrg \font\sseci=cmmi12 scaled \magstephalf 2306 1.1 mrg \font\ssecsy=cmsy10 scaled 1315 2307 1.1 mrg \def\ssececsize{1200} 2308 1.1.1.3 mrg 2309 1.1 mrg % Reduced fonts for @acronym in text (10pt). 2310 1.1 mrg \def\reducednominalsize{10pt} 2311 1.1 mrg \setfont\reducedrm\rmshape{10}{1000}{OT1} 2312 1.1 mrg \setfont\reducedtt\ttshape{10}{1000}{OT1TT} 2313 1.1 mrg \setfont\reducedbf\bfshape{10}{1000}{OT1} 2314 1.1 mrg \setfont\reducedit\itshape{10}{1000}{OT1IT} 2315 1.1 mrg \setfont\reducedsl\slshape{10}{1000}{OT1} 2316 1.1 mrg \setfont\reducedsf\sfshape{10}{1000}{OT1} 2317 1.1 mrg \setfont\reducedsc\scshape{10}{1000}{OT1} 2318 1.1 mrg \setfont\reducedttsl\ttslshape{10}{1000}{OT1TT} 2319 1.1 mrg \font\reducedi=cmmi10 2320 1.1 mrg \font\reducedsy=cmsy10 2321 1.1 mrg \def\reducedecsize{1000} 2322 1.1 mrg 2323 1.1 mrg \textleading = 13.2pt % line spacing for 11pt CM 2324 1.1 mrg \textfonts % reset the current fonts 2325 1.1.1.2 mrg \rm 2326 1.1 mrg } % end of 11pt text font size definitions, \definetextfontsizexi 2327 1.1 mrg 2328 1.1 mrg 2329 1.1 mrg % Definitions to make the main text be 10pt Computer Modern, with 2330 1.1 mrg % section, chapter, etc., sizes following suit. This is for the GNU 2331 1.1 mrg % Press printing of the Emacs 22 manual. Maybe other manuals in the 2332 1.1 mrg % future. Used with @smallbook, which sets the leading to 12pt. 2333 1.1 mrg % 2334 1.1 mrg \def\definetextfontsizex{% 2335 1.1 mrg % Text fonts (10pt). 2336 1.1 mrg \def\textnominalsize{10pt} 2337 1.1 mrg \edef\mainmagstep{1000} 2338 1.1 mrg \setfont\textrm\rmshape{10}{\mainmagstep}{OT1} 2339 1.1 mrg \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} 2340 1.1 mrg \setfont\textbf\bfshape{10}{\mainmagstep}{OT1} 2341 1.1 mrg \setfont\textit\itshape{10}{\mainmagstep}{OT1IT} 2342 1.1 mrg \setfont\textsl\slshape{10}{\mainmagstep}{OT1} 2343 1.1 mrg \setfont\textsf\sfshape{10}{\mainmagstep}{OT1} 2344 1.1 mrg \setfont\textsc\scshape{10}{\mainmagstep}{OT1} 2345 1.1 mrg \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} 2346 1.1 mrg \font\texti=cmmi10 scaled \mainmagstep 2347 1.1 mrg \font\textsy=cmsy10 scaled \mainmagstep 2348 1.1 mrg \def\textecsize{1000} 2349 1.1 mrg 2350 1.1 mrg % A few fonts for @defun names and args. 2351 1.1 mrg \setfont\defbf\bfshape{10}{\magstephalf}{OT1} 2352 1.1.1.4 mrg \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} 2353 1.1 mrg \setfont\defsl\slshape{10}{\magstephalf}{OT1} 2354 1.1.1.3 mrg \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} 2355 1.1.1.3 mrg \def\df{\let\ttfont=\deftt \let\bffont = \defbf 2356 1.1 mrg \let\slfont=\defsl \let\ttslfont=\defttsl \bf} 2357 1.1 mrg 2358 1.1 mrg % Fonts for indices, footnotes, small examples (9pt). 2359 1.1 mrg \def\smallnominalsize{9pt} 2360 1.1 mrg \setfont\smallrm\rmshape{9}{1000}{OT1} 2361 1.1 mrg \setfont\smalltt\ttshape{9}{1000}{OT1TT} 2362 1.1 mrg \setfont\smallbf\bfshape{10}{900}{OT1} 2363 1.1 mrg \setfont\smallit\itshape{9}{1000}{OT1IT} 2364 1.1 mrg \setfont\smallsl\slshape{9}{1000}{OT1} 2365 1.1 mrg \setfont\smallsf\sfshape{9}{1000}{OT1} 2366 1.1 mrg \setfont\smallsc\scshape{10}{900}{OT1} 2367 1.1 mrg \setfont\smallttsl\ttslshape{10}{900}{OT1TT} 2368 1.1 mrg \font\smalli=cmmi9 2369 1.1 mrg \font\smallsy=cmsy9 2370 1.1 mrg \def\smallecsize{0900} 2371 1.1 mrg 2372 1.1 mrg % Fonts for small examples (8pt). 2373 1.1 mrg \def\smallernominalsize{8pt} 2374 1.1 mrg \setfont\smallerrm\rmshape{8}{1000}{OT1} 2375 1.1 mrg \setfont\smallertt\ttshape{8}{1000}{OT1TT} 2376 1.1 mrg \setfont\smallerbf\bfshape{10}{800}{OT1} 2377 1.1 mrg \setfont\smallerit\itshape{8}{1000}{OT1IT} 2378 1.1 mrg \setfont\smallersl\slshape{8}{1000}{OT1} 2379 1.1 mrg \setfont\smallersf\sfshape{8}{1000}{OT1} 2380 1.1 mrg \setfont\smallersc\scshape{10}{800}{OT1} 2381 1.1 mrg \setfont\smallerttsl\ttslshape{10}{800}{OT1TT} 2382 1.1 mrg \font\smalleri=cmmi8 2383 1.1 mrg \font\smallersy=cmsy8 2384 1.1 mrg \def\smallerecsize{0800} 2385 1.1.1.3 mrg 2386 1.1.1.3 mrg % Fonts for math mode superscripts (7pt). 2387 1.1.1.3 mrg \def\sevennominalsize{7pt} 2388 1.1.1.3 mrg \setfont\sevenrm\rmshape{7}{1000}{OT1} 2389 1.1.1.3 mrg \setfont\seventt\ttshape{10}{700}{OT1TT} 2390 1.1.1.3 mrg \setfont\sevenbf\bfshape{10}{700}{OT1} 2391 1.1.1.3 mrg \setfont\sevenit\itshape{7}{1000}{OT1IT} 2392 1.1.1.3 mrg \setfont\sevensl\slshape{10}{700}{OT1} 2393 1.1.1.3 mrg \setfont\sevensf\sfshape{10}{700}{OT1} 2394 1.1.1.3 mrg \setfont\sevensc\scshape{10}{700}{OT1} 2395 1.1.1.3 mrg \setfont\seventtsl\ttslshape{10}{700}{OT1TT} 2396 1.1.1.3 mrg \font\seveni=cmmi7 2397 1.1.1.3 mrg \font\sevensy=cmsy7 2398 1.1.1.3 mrg \def\sevenecsize{0700} 2399 1.1 mrg 2400 1.1 mrg % Fonts for title page (20.4pt): 2401 1.1 mrg \def\titlenominalsize{20pt} 2402 1.1 mrg \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} 2403 1.1 mrg \setfont\titleit\itbshape{10}{\magstep4}{OT1IT} 2404 1.1 mrg \setfont\titlesl\slbshape{10}{\magstep4}{OT1} 2405 1.1 mrg \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} 2406 1.1 mrg \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} 2407 1.1 mrg \setfont\titlesf\sfbshape{17}{\magstep1}{OT1} 2408 1.1 mrg \let\titlebf=\titlerm 2409 1.1 mrg \setfont\titlesc\scbshape{10}{\magstep4}{OT1} 2410 1.1 mrg \font\titlei=cmmi12 scaled \magstep3 2411 1.1 mrg \font\titlesy=cmsy10 scaled \magstep4 2412 1.1 mrg \def\titleecsize{2074} 2413 1.1 mrg 2414 1.1 mrg % Chapter fonts (14.4pt). 2415 1.1 mrg \def\chapnominalsize{14pt} 2416 1.1 mrg \setfont\chaprm\rmbshape{12}{\magstep1}{OT1} 2417 1.1 mrg \setfont\chapit\itbshape{10}{\magstep2}{OT1IT} 2418 1.1 mrg \setfont\chapsl\slbshape{10}{\magstep2}{OT1} 2419 1.1 mrg \setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT} 2420 1.1 mrg \setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT} 2421 1.1 mrg \setfont\chapsf\sfbshape{12}{\magstep1}{OT1} 2422 1.1 mrg \let\chapbf\chaprm 2423 1.1 mrg \setfont\chapsc\scbshape{10}{\magstep2}{OT1} 2424 1.1 mrg \font\chapi=cmmi12 scaled \magstep1 2425 1.1 mrg \font\chapsy=cmsy10 scaled \magstep2 2426 1.1 mrg \def\chapecsize{1440} 2427 1.1 mrg 2428 1.1 mrg % Section fonts (12pt). 2429 1.1 mrg \def\secnominalsize{12pt} 2430 1.1 mrg \setfont\secrm\rmbshape{12}{1000}{OT1} 2431 1.1 mrg \setfont\secit\itbshape{10}{\magstep1}{OT1IT} 2432 1.1 mrg \setfont\secsl\slbshape{10}{\magstep1}{OT1} 2433 1.1 mrg \setfont\sectt\ttbshape{12}{1000}{OT1TT} 2434 1.1 mrg \setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT} 2435 1.1 mrg \setfont\secsf\sfbshape{12}{1000}{OT1} 2436 1.1 mrg \let\secbf\secrm 2437 1.1 mrg \setfont\secsc\scbshape{10}{\magstep1}{OT1} 2438 1.1 mrg \font\seci=cmmi12 2439 1.1 mrg \font\secsy=cmsy10 scaled \magstep1 2440 1.1 mrg \def\sececsize{1200} 2441 1.1 mrg 2442 1.1 mrg % Subsection fonts (10pt). 2443 1.1 mrg \def\ssecnominalsize{10pt} 2444 1.1 mrg \setfont\ssecrm\rmbshape{10}{1000}{OT1} 2445 1.1 mrg \setfont\ssecit\itbshape{10}{1000}{OT1IT} 2446 1.1 mrg \setfont\ssecsl\slbshape{10}{1000}{OT1} 2447 1.1 mrg \setfont\ssectt\ttbshape{10}{1000}{OT1TT} 2448 1.1 mrg \setfont\ssecttsl\ttslshape{10}{1000}{OT1TT} 2449 1.1 mrg \setfont\ssecsf\sfbshape{10}{1000}{OT1} 2450 1.1 mrg \let\ssecbf\ssecrm 2451 1.1 mrg \setfont\ssecsc\scbshape{10}{1000}{OT1} 2452 1.1 mrg \font\sseci=cmmi10 2453 1.1 mrg \font\ssecsy=cmsy10 2454 1.1 mrg \def\ssececsize{1000} 2455 1.1.1.3 mrg 2456 1.1 mrg % Reduced fonts for @acronym in text (9pt). 2457 1.1 mrg \def\reducednominalsize{9pt} 2458 1.1 mrg \setfont\reducedrm\rmshape{9}{1000}{OT1} 2459 1.1 mrg \setfont\reducedtt\ttshape{9}{1000}{OT1TT} 2460 1.1 mrg \setfont\reducedbf\bfshape{10}{900}{OT1} 2461 1.1 mrg \setfont\reducedit\itshape{9}{1000}{OT1IT} 2462 1.1 mrg \setfont\reducedsl\slshape{9}{1000}{OT1} 2463 1.1 mrg \setfont\reducedsf\sfshape{9}{1000}{OT1} 2464 1.1 mrg \setfont\reducedsc\scshape{10}{900}{OT1} 2465 1.1 mrg \setfont\reducedttsl\ttslshape{10}{900}{OT1TT} 2466 1.1 mrg \font\reducedi=cmmi9 2467 1.1 mrg \font\reducedsy=cmsy9 2468 1.1 mrg \def\reducedecsize{0900} 2469 1.1 mrg 2470 1.1 mrg \divide\parskip by 2 % reduce space between paragraphs 2471 1.1 mrg \textleading = 12pt % line spacing for 10pt CM 2472 1.1 mrg \textfonts % reset the current fonts 2473 1.1.1.2 mrg \rm 2474 1.1 mrg } % end of 10pt text font size definitions, \definetextfontsizex 2475 1.1.1.3 mrg 2476 1.1.1.3 mrg % Fonts for short table of contents. 2477 1.1.1.3 mrg \setfont\shortcontrm\rmshape{12}{1000}{OT1} 2478 1.1.1.3 mrg \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 2479 1.1.1.3 mrg \setfont\shortcontsl\slshape{12}{1000}{OT1} 2480 1.1.1.3 mrg \setfont\shortconttt\ttshape{12}{1000}{OT1TT} 2481 1.1 mrg 2482 1.1 mrg 2483 1.1 mrg % We provide the user-level command 2484 1.1 mrg % @fonttextsize 10 2485 1.1 mrg % (or 11) to redefine the text font size. pt is assumed. 2486 1.1 mrg % 2487 1.1 mrg \def\xiword{11} 2488 1.1 mrg \def\xword{10} 2489 1.1 mrg \def\xwordpt{10pt} 2490 1.1 mrg % 2491 1.1 mrg \parseargdef\fonttextsize{% 2492 1.1 mrg \def\textsizearg{#1}% 2493 1.1 mrg %\wlog{doing @fonttextsize \textsizearg}% 2494 1.1 mrg % 2495 1.1 mrg % Set \globaldefs so that documents can use this inside @tex, since 2496 1.1 mrg % makeinfo 4.8 does not support it, but we need it nonetheless. 2497 1.1 mrg % 2498 1.1 mrg \begingroup \globaldefs=1 2499 1.1 mrg \ifx\textsizearg\xword \definetextfontsizex 2500 1.1 mrg \else \ifx\textsizearg\xiword \definetextfontsizexi 2501 1.1 mrg \else 2502 1.1 mrg \errhelp=\EMsimple 2503 1.1 mrg \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'} 2504 1.1 mrg \fi\fi 2505 1.1 mrg \endgroup 2506 1.1 mrg } 2507 1.1.1.3 mrg 2508 1.1.1.3 mrg % 2509 1.1.1.3 mrg % Change the current font style to #1, remembering it in \curfontstyle. 2510 1.1.1.3 mrg % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in 2511 1.1.1.3 mrg % italics, not bold italics. 2512 1.1.1.3 mrg % 2513 1.1.1.3 mrg \def\setfontstyle#1{% 2514 1.1.1.3 mrg \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. 2515 1.1.1.3 mrg \csname #1font\endcsname % change the current font 2516 1.1.1.3 mrg } 2517 1.1.1.3 mrg 2518 1.1.1.3 mrg \def\rm{\fam=0 \setfontstyle{rm}} 2519 1.1.1.3 mrg \def\it{\fam=\itfam \setfontstyle{it}} 2520 1.1.1.3 mrg \def\sl{\fam=\slfam \setfontstyle{sl}} 2521 1.1.1.3 mrg \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} 2522 1.1.1.3 mrg \def\tt{\fam=\ttfam \setfontstyle{tt}} 2523 1.1.1.3 mrg 2524 1.1.1.3 mrg % Texinfo sort of supports the sans serif font style, which plain TeX does not. 2525 1.1.1.3 mrg % So we set up a \sf. 2526 1.1.1.3 mrg \newfam\sffam 2527 1.1.1.3 mrg \def\sf{\fam=\sffam \setfontstyle{sf}} 2528 1.1.1.3 mrg 2529 1.1.1.3 mrg % We don't need math for this font style. 2530 1.1.1.3 mrg \def\ttsl{\setfontstyle{ttsl}} 2531 1.1 mrg 2532 1.1 mrg 2533 1.1.1.3 mrg % In order for the font changes to affect most math symbols and letters, 2534 1.1.1.3 mrg % we have to define the \textfont of the standard families. 2535 1.1 mrg % We don't bother to reset \scriptscriptfont; awaiting user need. 2536 1.1 mrg % 2537 1.1.1.3 mrg \def\resetmathfonts{% 2538 1.1.1.3 mrg \textfont0=\rmfont \textfont1=\ifont \textfont2=\syfont 2539 1.1.1.3 mrg \textfont\itfam=\itfont \textfont\slfam=\slfont \textfont\bffam=\bffont 2540 1.1.1.3 mrg \textfont\ttfam=\ttfont \textfont\sffam=\sffont 2541 1.1.1.3 mrg % 2542 1.1.1.3 mrg % Fonts for superscript. Note that the 7pt fonts are used regardless 2543 1.1.1.3 mrg % of the current font size. 2544 1.1.1.3 mrg \scriptfont0=\sevenrm \scriptfont1=\seveni \scriptfont2=\sevensy 2545 1.1.1.3 mrg \scriptfont\itfam=\sevenit \scriptfont\slfam=\sevensl 2546 1.1.1.3 mrg \scriptfont\bffam=\sevenbf \scriptfont\ttfam=\seventt 2547 1.1 mrg \scriptfont\sffam=\sevensf 2548 1.1 mrg } 2549 1.1.1.3 mrg 2550 1.1.1.5 mrg 2551 1.1.1.5 mrg 2552 1.1.1.5 mrg % \defineassignfonts{SIZE} - 2553 1.1.1.5 mrg % Define sequence \assignfontsSIZE, which switches between font sizes 2554 1.1.1.5 mrg % by redefining the meanings of \STYLEfont. (Just \STYLE additionally sets 2555 1.1.1.5 mrg % the current \fam for math mode.) 2556 1.1.1.5 mrg % 2557 1.1.1.5 mrg \def\defineassignfonts#1{% 2558 1.1.1.5 mrg \expandafter\edef\csname assignfonts#1\endcsname{% 2559 1.1.1.5 mrg \let\noexpand\rmfont\csname #1rm\endcsname 2560 1.1.1.5 mrg \let\noexpand\itfont\csname #1it\endcsname 2561 1.1.1.5 mrg \let\noexpand\slfont\csname #1sl\endcsname 2562 1.1.1.5 mrg \let\noexpand\bffont\csname #1bf\endcsname 2563 1.1.1.5 mrg \let\noexpand\ttfont\csname #1tt\endcsname 2564 1.1.1.5 mrg \let\noexpand\smallcaps\csname #1sc\endcsname 2565 1.1.1.5 mrg \let\noexpand\sffont \csname #1sf\endcsname 2566 1.1.1.5 mrg \let\noexpand\ifont \csname #1i\endcsname 2567 1.1.1.5 mrg \let\noexpand\syfont \csname #1sy\endcsname 2568 1.1.1.5 mrg \let\noexpand\ttslfont\csname #1ttsl\endcsname 2569 1.1.1.5 mrg } 2570 1.1 mrg } 2571 1.1.1.3 mrg 2572 1.1.1.5 mrg \def\assignfonts#1{% 2573 1.1.1.3 mrg \csname assignfonts#1\endcsname 2574 1.1.1.3 mrg } 2575 1.1.1.3 mrg 2576 1.1.1.3 mrg \newif\ifrmisbold 2577 1.1.1.3 mrg 2578 1.1.1.3 mrg % Select smaller font size with the current style. Used to change font size 2579 1.1.1.3 mrg % in, e.g., the LaTeX logo and acronyms. If we are using bold fonts for 2580 1.1.1.3 mrg % normal roman text, also use bold fonts for roman text in the smaller size. 2581 1.1.1.3 mrg \def\switchtolllsize{% 2582 1.1.1.3 mrg \expandafter\assignfonts\expandafter{\lllsize}% 2583 1.1.1.3 mrg \ifrmisbold 2584 1.1.1.3 mrg \let\rmfont\bffont 2585 1.1.1.3 mrg \fi 2586 1.1.1.3 mrg \csname\curfontstyle\endcsname 2587 1.1.1.3 mrg }% 2588 1.1.1.3 mrg 2589 1.1.1.3 mrg \def\switchtolsize{% 2590 1.1.1.3 mrg \expandafter\assignfonts\expandafter{\lsize}% 2591 1.1.1.3 mrg \ifrmisbold 2592 1.1.1.3 mrg \let\rmfont\bffont 2593 1.1.1.3 mrg \fi 2594 1.1.1.3 mrg \csname\curfontstyle\endcsname 2595 1.1.1.3 mrg }% 2596 1.1.1.5 mrg 2597 1.1.1.5 mrg % Define the font-changing commands (all called \...fonts). 2598 1.1.1.5 mrg % Each font-changing command also sets the names \lsize (one size lower) 2599 1.1.1.5 mrg % and \lllsize (three sizes lower). These relative commands are used 2600 1.1.1.5 mrg % in, e.g., the LaTeX logo and acronyms. 2601 1.1.1.5 mrg % 2602 1.1.1.5 mrg % Note: The fonts used for \ifont are for "math italics" (\itfont is for 2603 1.1.1.5 mrg % italics in regular text). \syfont is also used in math mode only. 2604 1.1.1.3 mrg % 2605 1.1.1.5 mrg \def\definefontsetatsize#1#2#3#4#5{% 2606 1.1.1.3 mrg \defineassignfonts{#1}% 2607 1.1.1.3 mrg \expandafter\def\csname #1fonts\endcsname{% 2608 1.1.1.3 mrg \def\curfontsize{#1}% 2609 1.1.1.3 mrg \def\lsize{#2}\def\lllsize{#3}% 2610 1.1.1.5 mrg \csname rmisbold#5\endcsname 2611 1.1.1.3 mrg \csname assignfonts#1\endcsname 2612 1.1.1.3 mrg \resetmathfonts 2613 1.1.1.3 mrg \setleading{#4}% 2614 1.1.1.3 mrg }} 2615 1.1.1.3 mrg 2616 1.1.1.3 mrg \definefontsetatsize{text} {reduced}{smaller}{\textleading}{false} 2617 1.1.1.3 mrg \definefontsetatsize{title} {chap} {subsec} {27pt} {true} 2618 1.1.1.3 mrg \definefontsetatsize{chap} {sec} {text} {19pt} {true} 2619 1.1.1.3 mrg \definefontsetatsize{sec} {subsec} {reduced}{17pt} {true} 2620 1.1.1.3 mrg \definefontsetatsize{ssec} {text} {small} {15pt} {true} 2621 1.1.1.3 mrg \definefontsetatsize{reduced}{small} {smaller}{10.5pt}{false} 2622 1.1.1.3 mrg \definefontsetatsize{small} {smaller}{smaller}{10.5pt}{false} 2623 1.1.1.3 mrg \definefontsetatsize{smaller}{smaller}{smaller}{9.5pt} {false} 2624 1.1.1.3 mrg 2625 1.1.1.3 mrg \def\titlefont#1{{\titlefonts\rm #1}} 2626 1.1.1.3 mrg \let\subsecfonts = \ssecfonts 2627 1.1 mrg \let\subsubsecfonts = \ssecfonts 2628 1.1 mrg 2629 1.1 mrg % Define these just so they can be easily changed for other fonts. 2630 1.1 mrg \def\angleleft{$\langle$} 2631 1.1 mrg \def\angleright{$\rangle$} 2632 1.1 mrg 2633 1.1 mrg % Set the fonts to use with the @small... environments. 2634 1.1 mrg \let\smallexamplefonts = \smallfonts 2635 1.1 mrg 2636 1.1 mrg % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample 2637 1.1 mrg % can fit this many characters: 2638 1.1 mrg % 8.5x11=86 smallbook=72 a4=90 a5=69 2639 1.1 mrg % If we use \scriptfonts (8pt), then we can fit this many characters: 2640 1.1 mrg % 8.5x11=90+ smallbook=80 a4=90+ a5=77 2641 1.1 mrg % For me, subjectively, the few extra characters that fit aren't worth 2642 1.1 mrg % the additional smallness of 8pt. So I'm making the default 9pt. 2643 1.1 mrg % 2644 1.1 mrg % By the way, for comparison, here's what fits with @example (10pt): 2645 1.1 mrg % 8.5x11=71 smallbook=60 a4=75 a5=58 2646 1.1 mrg % --karl, 24jan03. 2647 1.1 mrg 2648 1.1 mrg % Set up the default fonts, so we can use them for creating boxes. 2649 1.1 mrg % 2650 1.1 mrg \definetextfontsizexi 2651 1.1 mrg 2652 1.1 mrg 2653 1.1 mrg % Check if we are currently using a typewriter font. Since all the 2654 1.1 mrg % Computer Modern typewriter fonts have zero interword stretch (and 2655 1.1.1.5 mrg % shrink), and it is reasonable to expect all typewriter fonts to have 2656 1.1.1.5 mrg % this property, we can check that font parameter. #1 is what to 2657 1.1.1.5 mrg % print if we are indeed using \tt; #2 is what to print otherwise. 2658 1.1 mrg \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} 2659 1.1.1.5 mrg 2660 1.1.1.5 mrg % Same as above, but check for italic font. Actually this also catches 2661 1.1.1.5 mrg % non-italic slanted fonts since it is impossible to distinguish them from 2662 1.1.1.5 mrg % italic fonts. But since this is only used by $ and it uses \sl anyway 2663 1.1.1.5 mrg % this is not a problem. 2664 1.1 mrg \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} 2665 1.1 mrg 2666 1.1.1.5 mrg 2667 1.1.1.5 mrg % Check if internal flag is clear, i.e. has not been @set. 2668 1.1.1.5 mrg \def\ifflagclear#1#2#3{% 2669 1.1.1.5 mrg \expandafter\ifx\csname SET#1\endcsname\relax 2670 1.1 mrg #2\else#3\fi 2671 1.1 mrg } 2672 1.1 mrg 2673 1.1 mrg { 2674 1.1 mrg \catcode`\'=\active 2675 1.1 mrg \catcode`\`=\active 2676 1.1.1.5 mrg 2677 1.1.1.5 mrg \gdef\setcodequotes{\let`\codequoteleft \let'\codequoteright} 2678 1.1 mrg \gdef\setregularquotes{\let`\lq \let'\rq} 2679 1.1 mrg } 2680 1.1 mrg 2681 1.1 mrg % Allow an option to not use regular directed right quote/apostrophe 2682 1.1 mrg % (char 0x27), but instead the undirected quote from cmtt (char 0x0d). 2683 1.1 mrg % The undirected quote is ugly, so don't make it the default, but it 2684 1.1 mrg % works for pasting with more pdf viewers (at least evince), the 2685 1.1 mrg % lilypond developers report. xpdf does work with the regular 0x27. 2686 1.1 mrg % 2687 1.1.1.5 mrg \def\codequoteright{% 2688 1.1.1.5 mrg \ifusingtt 2689 1.1.1.5 mrg {\ifflagclear{txicodequoteundirected}% 2690 1.1.1.5 mrg {\ifflagclear{codequoteundirected}% 2691 1.1.1.5 mrg {'}% 2692 1.1.1.5 mrg {\char'15 }}% 2693 1.1.1.5 mrg {\char'15 }}% 2694 1.1 mrg {'}% 2695 1.1.1.5 mrg } 2696 1.1 mrg 2697 1.1 mrg % and a similar option for the left quote char vs. a grave accent. 2698 1.1 mrg % Modern fonts display ASCII 0x60 as a grave accent, so some people like 2699 1.1.1.5 mrg % the code environments to do likewise. 2700 1.1 mrg % \relax disables Spanish ligatures ?` and !` of \tt font. 2701 1.1 mrg % 2702 1.1.1.5 mrg \def\codequoteleft{% 2703 1.1.1.5 mrg \ifusingtt 2704 1.1.1.5 mrg {\ifflagclear{txicodequotebacktick}% 2705 1.1.1.5 mrg {\ifflagclear{codequotebacktick}% 2706 1.1.1.5 mrg {\relax`}% 2707 1.1.1.5 mrg {\char'22 }}% 2708 1.1.1.5 mrg {\char'22 }}% 2709 1.1 mrg {\relax`}% 2710 1.1 mrg } 2711 1.1 mrg 2712 1.1.1.5 mrg % Commands to set the quote options. 2713 1.1 mrg % 2714 1.1 mrg \parseargdef\codequoteundirected{% 2715 1.1 mrg \def\temp{#1}% 2716 1.1 mrg \ifx\temp\onword 2717 1.1 mrg \expandafter\let\csname SETtxicodequoteundirected\endcsname 2718 1.1 mrg = t% 2719 1.1 mrg \else\ifx\temp\offword 2720 1.1 mrg \expandafter\let\csname SETtxicodequoteundirected\endcsname 2721 1.1 mrg = \relax 2722 1.1 mrg \else 2723 1.1 mrg \errhelp = \EMsimple 2724 1.1 mrg \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}% 2725 1.1 mrg \fi\fi 2726 1.1 mrg } 2727 1.1 mrg % 2728 1.1 mrg \parseargdef\codequotebacktick{% 2729 1.1 mrg \def\temp{#1}% 2730 1.1 mrg \ifx\temp\onword 2731 1.1 mrg \expandafter\let\csname SETtxicodequotebacktick\endcsname 2732 1.1 mrg = t% 2733 1.1 mrg \else\ifx\temp\offword 2734 1.1 mrg \expandafter\let\csname SETtxicodequotebacktick\endcsname 2735 1.1 mrg = \relax 2736 1.1 mrg \else 2737 1.1 mrg \errhelp = \EMsimple 2738 1.1 mrg \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}% 2739 1.1 mrg \fi\fi 2740 1.1 mrg } 2741 1.1 mrg 2742 1.1 mrg % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font. 2743 1.1 mrg \def\noligaturesquoteleft{\relax\lq} 2744 1.1 mrg 2745 1.1 mrg % Count depth in font-changes, for error checks 2746 1.1 mrg \newcount\fontdepth \fontdepth=0 2747 1.1 mrg 2748 1.1 mrg % Font commands. 2749 1.1 mrg 2750 1.1 mrg % #1 is the font command (\sl or \it), #2 is the text to slant. 2751 1.1 mrg % If we are in a monospaced environment, however, 1) always use \ttsl, 2752 1.1 mrg % and 2) do not add an italic correction. 2753 1.1.1.5 mrg \def\dosmartslant#1#2{% 2754 1.1 mrg \ifusingtt 2755 1.1.1.5 mrg {{\ttsl #2}\let\next=\relax}% 2756 1.1 mrg {\def\next{{#1#2}\smartitaliccorrection}}% 2757 1.1 mrg \next 2758 1.1 mrg } 2759 1.1 mrg \def\smartslanted{\dosmartslant\sl} 2760 1.1 mrg \def\smartitalic{\dosmartslant\it} 2761 1.1.1.5 mrg 2762 1.1.1.5 mrg % Output an italic correction unless the following character is such as 2763 1.1.1.5 mrg % not to need one. 2764 1.1.1.5 mrg \def\smartitaliccorrection{\futurelet\next\smartitaliccorrectionx} 2765 1.1 mrg \def\smartitaliccorrectionx{% 2766 1.1 mrg \ifx\next,% 2767 1.1 mrg \else\ifx\next-% 2768 1.1.1.3 mrg \else\ifx\next.% 2769 1.1.1.3 mrg \else\ifx\next\.% 2770 1.1 mrg \else\ifx\next\comma% 2771 1.1.1.3 mrg \else\ptexslash 2772 1.1 mrg \fi\fi\fi\fi\fi 2773 1.1 mrg \aftersmartic 2774 1.1 mrg } 2775 1.1.1.5 mrg 2776 1.1.1.5 mrg % @cite unconditionally uses \sl with \smartitaliccorrection. 2777 1.1 mrg \def\cite#1{{\sl #1}\smartitaliccorrection} 2778 1.1.1.5 mrg 2779 1.1.1.5 mrg % @var unconditionally uses \sl. This gives consistency for 2780 1.1.1.5 mrg % parameter names whether they are in @def, @table @code or a 2781 1.1.1.5 mrg % regular paragraph. 2782 1.1.1.5 mrg % To get ttsl font for @var when used in code context, @set txicodevaristt. 2783 1.1 mrg % The \null is to reset \spacefactor. 2784 1.1 mrg \def\aftersmartic{} 2785 1.1 mrg \def\var#1{% 2786 1.1 mrg \let\saveaftersmartic = \aftersmartic 2787 1.1.1.5 mrg \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}% 2788 1.1.1.5 mrg % 2789 1.1.1.5 mrg \ifflagclear{txicodevaristt}% 2790 1.1.1.5 mrg {\def\varnext{{{\sl #1}}\smartitaliccorrection}}% 2791 1.1.1.5 mrg {\def\varnext{\smartslanted{#1}}}% 2792 1.1 mrg \varnext 2793 1.1 mrg } 2794 1.1.1.5 mrg 2795 1.1.1.5 mrg % To be removed after next release 2796 1.1.1.5 mrg \def\SETtxicodevaristt{}% @set txicodevaristt 2797 1.1 mrg 2798 1.1 mrg \let\i=\smartitalic 2799 1.1 mrg \let\slanted=\smartslanted 2800 1.1 mrg \let\dfn=\smartslanted 2801 1.1 mrg \let\emph=\smartitalic 2802 1.1.1.5 mrg 2803 1.1.1.5 mrg % @r for roman font, used for code comment 2804 1.1.1.5 mrg \def\r#1{{% 2805 1.1.1.5 mrg \usenormaldash % get --, --- ligatures even if in @code 2806 1.1.1.5 mrg \defcharsdefault % in case on def line 2807 1.1.1.5 mrg \rm #1}} 2808 1.1.1.5 mrg {\catcode`-=\active \gdef\usenormaldash{\let-\normaldash}} 2809 1.1.1.5 mrg 2810 1.1 mrg % @sc, undocumented @ii. 2811 1.1 mrg \def\sc#1{{\smallcaps#1}} % smallcaps font 2812 1.1 mrg \def\ii#1{{\it #1}} % italic font 2813 1.1 mrg 2814 1.1 mrg % @b, explicit bold. Also @strong. 2815 1.1 mrg \def\b#1{{\bf #1}} 2816 1.1 mrg \let\strong=\b 2817 1.1 mrg 2818 1.1 mrg % @sansserif, explicit sans. 2819 1.1 mrg \def\sansserif#1{{\sf #1}} 2820 1.1 mrg 2821 1.1 mrg % We can't just use \exhyphenpenalty, because that only has effect at 2822 1.1 mrg % the end of a paragraph. Restore normal hyphenation at the end of the 2823 1.1 mrg % group within which \nohyphenation is presumably called. 2824 1.1 mrg % 2825 1.1 mrg \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} 2826 1.1 mrg \def\restorehyphenation{\hyphenchar\font = `- } 2827 1.1.1.5 mrg 2828 1.1.1.5 mrg \newif\iffrenchspacing 2829 1.1.1.5 mrg \frenchspacingfalse 2830 1.1 mrg 2831 1.1 mrg % Set sfcode to normal for the chars that usually have another value. 2832 1.1 mrg % Can't use plain's \frenchspacing because it uses the `\x notation, and 2833 1.1 mrg % sometimes \x has an active definition that messes things up. 2834 1.1 mrg % 2835 1.1 mrg \catcode`@=11 2836 1.1.1.5 mrg \def\plainfrenchspacing{% 2837 1.1.1.5 mrg \iffrenchspacing\else 2838 1.1.1.5 mrg \frenchspacingtrue 2839 1.1.1.5 mrg \sfcode`\.=\@m \sfcode`\?=\@m \sfcode`\!=\@m 2840 1.1.1.5 mrg \sfcode`\:=\@m \sfcode`\;=\@m \sfcode`\,=\@m 2841 1.1.1.5 mrg \def\endofsentencespacefactor{1000}% for @. and friends 2842 1.1 mrg \fi 2843 1.1 mrg } 2844 1.1.1.5 mrg \def\plainnonfrenchspacing{% 2845 1.1.1.5 mrg \iffrenchspacing 2846 1.1.1.5 mrg \frenchspacingfalse 2847 1.1.1.5 mrg \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000 2848 1.1.1.5 mrg \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250 2849 1.1.1.5 mrg \def\endofsentencespacefactor{3000}% for @. and friends 2850 1.1 mrg \fi 2851 1.1 mrg } 2852 1.1 mrg \catcode`@=\other 2853 1.1 mrg \def\endofsentencespacefactor{3000}% default 2854 1.1.1.5 mrg 2855 1.1.1.5 mrg % @frenchspacing on|off says whether to put extra space after punctuation. 2856 1.1.1.5 mrg % 2857 1.1.1.5 mrg \def\onword{on} 2858 1.1.1.5 mrg \def\offword{off} 2859 1.1.1.5 mrg % 2860 1.1.1.5 mrg \let\frenchspacingsetting\plainnonfrenchspacing % used in output routine 2861 1.1.1.5 mrg \parseargdef\frenchspacing{% 2862 1.1.1.5 mrg \def\temp{#1}% 2863 1.1.1.5 mrg \ifx\temp\onword \let\frenchspacingsetting\plainfrenchspacing 2864 1.1.1.5 mrg \else\ifx\temp\offword \let\frenchspacingsetting\plainnonfrenchspacing 2865 1.1.1.5 mrg \else 2866 1.1.1.5 mrg \errhelp = \EMsimple 2867 1.1.1.5 mrg \errmessage{Unknown @frenchspacing option `\temp', must be on|off}% 2868 1.1.1.5 mrg \fi\fi 2869 1.1.1.5 mrg \frenchspacingsetting 2870 1.1.1.5 mrg } 2871 1.1.1.5 mrg 2872 1.1 mrg 2873 1.1 mrg % @t, explicit typewriter. 2874 1.1.1.5 mrg \def\t#1{% 2875 1.1 mrg {\tt \defcharsdefault \plainfrenchspacing #1}% 2876 1.1 mrg \null 2877 1.1 mrg } 2878 1.1 mrg 2879 1.1.1.5 mrg % @samp. 2880 1.1 mrg \def\samp#1{{\setcodequotes\lq\tclose{#1}\rq\null}} 2881 1.1.1.2 mrg 2882 1.1.1.2 mrg % @indicateurl is \samp, that is, with quotes. 2883 1.1 mrg \let\indicateurl=\samp 2884 1.1.1.2 mrg 2885 1.1.1.2 mrg % @code (and similar) prints in typewriter, but with spaces the same 2886 1.1.1.2 mrg % size as normal in the surrounding text, without hyphenation, etc. 2887 1.1 mrg % This is a subroutine for that. 2888 1.1 mrg \def\tclose#1{% 2889 1.1 mrg {% 2890 1.1 mrg % Change normal interword space to be same as for the current font. 2891 1.1 mrg \spaceskip = \fontdimen2\font 2892 1.1 mrg % 2893 1.1 mrg % Switch to typewriter. 2894 1.1 mrg \tt 2895 1.1 mrg % 2896 1.1 mrg % But `\ ' produces the large typewriter interword space. 2897 1.1 mrg \def\ {{\spaceskip = 0pt{} }}% 2898 1.1 mrg % 2899 1.1 mrg % Turn off hyphenation. 2900 1.1 mrg \nohyphenation 2901 1.1 mrg % 2902 1.1 mrg \plainfrenchspacing 2903 1.1 mrg #1% 2904 1.1 mrg }% 2905 1.1 mrg \null % reset spacefactor to 1000 2906 1.1 mrg } 2907 1.1 mrg 2908 1.1.1.3 mrg % We *must* turn on hyphenation at `-' and `_' in @code. 2909 1.1 mrg % (But see \codedashfinish below.) 2910 1.1 mrg % Otherwise, it is too hard to avoid overfull hboxes 2911 1.1.1.2 mrg % in the Emacs manual, the Library manual, etc. 2912 1.1 mrg % 2913 1.1 mrg % Unfortunately, TeX uses one parameter (\hyphenchar) to control 2914 1.1 mrg % both hyphenation at - and hyphenation within words. 2915 1.1.1.3 mrg % We must therefore turn them both off (\tclose does that) 2916 1.1 mrg % and arrange explicitly to hyphenate at a dash. -- rms. 2917 1.1 mrg { 2918 1.1 mrg \catcode`\-=\active \catcode`\_=\active 2919 1.1 mrg \catcode`\'=\active \catcode`\`=\active 2920 1.1 mrg \global\let'=\rq \global\let`=\lq % default definitions 2921 1.1 mrg % 2922 1.1.1.5 mrg \global\def\code{\begingroup 2923 1.1 mrg \setcodequotes 2924 1.1 mrg \catcode\dashChar=\active \catcode\underChar=\active 2925 1.1 mrg \ifallowcodebreaks 2926 1.1 mrg \let-\codedash 2927 1.1 mrg \let_\codeunder 2928 1.1.1.2 mrg \else 2929 1.1 mrg \let-\normaldash 2930 1.1 mrg \let_\realunder 2931 1.1.1.3 mrg \fi 2932 1.1.1.3 mrg % Given -foo (with a single dash), we do not want to allow a break 2933 1.1.1.3 mrg % after the hyphen. 2934 1.1.1.3 mrg \global\let\codedashprev=\codedash 2935 1.1 mrg % 2936 1.1 mrg \codex 2937 1.1.1.3 mrg } 2938 1.1.1.3 mrg % 2939 1.1.1.3 mrg \gdef\codedash{\futurelet\next\codedashfinish} 2940 1.1.1.3 mrg \gdef\codedashfinish{% 2941 1.1.1.5 mrg \normaldash % always output the dash character itself. 2942 1.1.1.3 mrg % 2943 1.1.1.3 mrg % Now, output a discretionary to allow a line break, unless 2944 1.1.1.3 mrg % (a) the next character is a -, or 2945 1.1.1.3 mrg % (b) the preceding character is a -. 2946 1.1.1.3 mrg % E.g., given --posix, we do not want to allow a break after either -. 2947 1.1.1.3 mrg % Given --foo-bar, we do want to allow a break between the - and the b. 2948 1.1.1.5 mrg \ifx\next\codedash \else 2949 1.1.1.3 mrg \ifx\codedashprev\codedash 2950 1.1.1.3 mrg \else \discretionary{}{}{}\fi 2951 1.1.1.3 mrg \fi 2952 1.1.1.3 mrg % we need the space after the = for the case when \next itself is a 2953 1.1.1.3 mrg % space token; it would get swallowed otherwise. As in @code{- a}. 2954 1.1.1.3 mrg \global\let\codedashprev= \next 2955 1.1 mrg } 2956 1.1.1.3 mrg } 2957 1.1.1.3 mrg \def\normaldash{-} 2958 1.1 mrg % 2959 1.1 mrg \def\codex #1{\tclose{#1}\endgroup} 2960 1.1 mrg 2961 1.1 mrg \def\codeunder{% 2962 1.1 mrg % this is all so @math{@code{var_name}+1} can work. In math mode, _ 2963 1.1 mrg % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) 2964 1.1 mrg % will therefore expand the active definition of _, which is us 2965 1.1 mrg % (inside @code that is), therefore an endless loop. 2966 1.1 mrg \ifusingtt{\ifmmode 2967 1.1 mrg \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_. 2968 1.1 mrg \else\normalunderscore \fi 2969 1.1 mrg \discretionary{}{}{}}% 2970 1.1 mrg {\_}% 2971 1.1 mrg } 2972 1.1 mrg 2973 1.1.1.2 mrg % An additional complication: the above will allow breaks after, e.g., 2974 1.1.1.2 mrg % each of the four underscores in __typeof__. This is bad. 2975 1.1.1.2 mrg % @allowcodebreaks provides a document-level way to turn breaking at - 2976 1.1 mrg % and _ on and off. 2977 1.1 mrg % 2978 1.1 mrg \newif\ifallowcodebreaks \allowcodebreakstrue 2979 1.1 mrg 2980 1.1 mrg \def\keywordtrue{true} 2981 1.1 mrg \def\keywordfalse{false} 2982 1.1 mrg 2983 1.1 mrg \parseargdef\allowcodebreaks{% 2984 1.1 mrg \def\txiarg{#1}% 2985 1.1 mrg \ifx\txiarg\keywordtrue 2986 1.1 mrg \allowcodebreakstrue 2987 1.1 mrg \else\ifx\txiarg\keywordfalse 2988 1.1 mrg \allowcodebreaksfalse 2989 1.1 mrg \else 2990 1.1 mrg \errhelp = \EMsimple 2991 1.1 mrg \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}% 2992 1.1 mrg \fi\fi 2993 1.1 mrg } 2994 1.1.1.2 mrg 2995 1.1.1.2 mrg % For @command, @env, @file, @option quotes seem unnecessary, 2996 1.1.1.2 mrg % so use \code rather than \samp. 2997 1.1.1.2 mrg \let\command=\code 2998 1.1.1.2 mrg \let\env=\code 2999 1.1.1.2 mrg \let\file=\code 3000 1.1.1.2 mrg \let\option=\code 3001 1.1.1.3 mrg 3002 1.1.1.3 mrg % @uref (abbreviation for `urlref') aka @url takes an optional 3003 1.1.1.3 mrg % (comma-separated) second argument specifying the text to display and 3004 1.1.1.3 mrg % an optional third arg as text to display instead of (rather than in 3005 1.1.1.3 mrg % addition to) the url itself. First (mandatory) arg is the url. 3006 1.1.1.3 mrg 3007 1.1.1.3 mrg % TeX-only option to allow changing PDF output to show only the second 3008 1.1.1.3 mrg % arg (if given), and not the url (which is then just the link target). 3009 1.1.1.3 mrg \newif\ifurefurlonlylink 3010 1.1.1.5 mrg 3011 1.1.1.5 mrg % The default \pretolerance setting stops the penalty inserted in 3012 1.1.1.5 mrg % \urefallowbreak being a discouragement to line breaking. Set it to 3013 1.1.1.5 mrg % a negative value for this paragraph only. Hopefully this does not 3014 1.1.1.5 mrg % conflict with redefinitions of \par done elsewhere. 3015 1.1.1.5 mrg \def\nopretolerance{% 3016 1.1.1.5 mrg \pretolerance=-1 3017 1.1.1.5 mrg \def\par{\endgraf\pretolerance=100 \let\par\endgraf}% 3018 1.1.1.5 mrg } 3019 1.1.1.3 mrg 3020 1.1.1.5 mrg % The main macro is \urefbreak, which allows breaking at expected 3021 1.1.1.5 mrg % places within the url. 3022 1.1 mrg \def\urefbreak{\nopretolerance \begingroup \urefcatcodes \dourefbreak} 3023 1.1.1.3 mrg \let\uref=\urefbreak 3024 1.1 mrg % 3025 1.1 mrg \def\dourefbreak#1{\urefbreakfinish #1,,,\finish} 3026 1.1 mrg \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example 3027 1.1 mrg \unsepspaces 3028 1.1 mrg \pdfurl{#1}% 3029 1.1 mrg \setbox0 = \hbox{\ignorespaces #3}% 3030 1.1 mrg \ifdim\wd0 > 0pt 3031 1.1 mrg \unhbox0 % third arg given, show only that 3032 1.1.1.3 mrg \else 3033 1.1 mrg \setbox0 = \hbox{\ignorespaces #2}% look for second arg 3034 1.1 mrg \ifdim\wd0 > 0pt 3035 1.1.1.3 mrg \ifpdf 3036 1.1.1.3 mrg % For pdfTeX and LuaTeX 3037 1.1.1.3 mrg \ifurefurlonlylink 3038 1.1.1.5 mrg % PDF plus option to not display url, show just arg 3039 1.1.1.3 mrg \unhbox0 3040 1.1.1.3 mrg \else 3041 1.1.1.3 mrg % PDF, normally display both arg and url for consistency, 3042 1.1.1.3 mrg % visibility, if the pdf is eventually used to print, etc. 3043 1.1.1.3 mrg \unhbox0\ (\urefcode{#1})% 3044 1.1 mrg \fi 3045 1.1.1.3 mrg \else 3046 1.1.1.3 mrg \ifx\XeTeXrevision\thisisundefined 3047 1.1.1.3 mrg \unhbox0\ (\urefcode{#1})% DVI, always show arg and url 3048 1.1.1.3 mrg \else 3049 1.1.1.3 mrg % For XeTeX 3050 1.1.1.3 mrg \ifurefurlonlylink 3051 1.1.1.5 mrg % PDF plus option to not display url, show just arg 3052 1.1.1.3 mrg \unhbox0 3053 1.1.1.3 mrg \else 3054 1.1.1.3 mrg % PDF, normally display both arg and url for consistency, 3055 1.1.1.3 mrg % visibility, if the pdf is eventually used to print, etc. 3056 1.1.1.3 mrg \unhbox0\ (\urefcode{#1})% 3057 1.1.1.3 mrg \fi 3058 1.1 mrg \fi 3059 1.1 mrg \fi 3060 1.1 mrg \else 3061 1.1 mrg \urefcode{#1}% only url given, so show it 3062 1.1 mrg \fi 3063 1.1 mrg \fi 3064 1.1 mrg \endlink 3065 1.1 mrg \endgroup} 3066 1.1 mrg 3067 1.1 mrg % Allow line breaks around only a few characters (only). 3068 1.1.1.3 mrg \def\urefcatcodes{% 3069 1.1.1.3 mrg \catcode`\&=\active \catcode`\.=\active 3070 1.1.1.3 mrg \catcode`\#=\active \catcode`\?=\active 3071 1.1 mrg \catcode`\/=\active 3072 1.1 mrg } 3073 1.1 mrg { 3074 1.1 mrg \urefcatcodes 3075 1.1 mrg % 3076 1.1.1.5 mrg \global\def\urefcode{\begingroup 3077 1.1 mrg \setcodequotes 3078 1.1 mrg \urefcatcodes 3079 1.1 mrg \let&\urefcodeamp 3080 1.1 mrg \let.\urefcodedot 3081 1.1 mrg \let#\urefcodehash 3082 1.1 mrg \let?\urefcodequest 3083 1.1 mrg \let/\urefcodeslash 3084 1.1 mrg \codex 3085 1.1 mrg } 3086 1.1 mrg % 3087 1.1 mrg % By default, they are just regular characters. 3088 1.1 mrg \global\def&{\normalamp} 3089 1.1 mrg \global\def.{\normaldot} 3090 1.1 mrg \global\def#{\normalhash} 3091 1.1 mrg \global\def?{\normalquest} 3092 1.1 mrg \global\def/{\normalslash} 3093 1.1 mrg } 3094 1.1.1.4 mrg 3095 1.1.1.4 mrg \def\urefcodeamp{\urefprebreak \&\urefpostbreak} 3096 1.1.1.4 mrg \def\urefcodedot{\urefprebreak .\urefpostbreak} 3097 1.1.1.4 mrg \def\urefcodehash{\urefprebreak \#\urefpostbreak} 3098 1.1 mrg \def\urefcodequest{\urefprebreak ?\urefpostbreak} 3099 1.1 mrg \def\urefcodeslash{\futurelet\next\urefcodeslashfinish} 3100 1.1 mrg { 3101 1.1 mrg \catcode`\/=\active 3102 1.1.1.4 mrg \global\def\urefcodeslashfinish{% 3103 1.1 mrg \urefprebreak \slashChar 3104 1.1 mrg % Allow line break only after the final / in a sequence of 3105 1.1.1.4 mrg % slashes, to avoid line break between the slashes in http://. 3106 1.1 mrg \ifx\next/\else \urefpostbreak \fi 3107 1.1 mrg } 3108 1.1 mrg } 3109 1.1.1.5 mrg 3110 1.1.1.5 mrg % By default we'll break after the special characters, but some people like to 3111 1.1.1.4 mrg % break before the special chars, so allow that. Also allow no breaking at 3112 1.1.1.5 mrg % all, for manual control. 3113 1.1 mrg % 3114 1.1 mrg \parseargdef\urefbreakstyle{% 3115 1.1 mrg \def\txiarg{#1}% 3116 1.1 mrg \ifx\txiarg\wordnone 3117 1.1 mrg \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak} 3118 1.1.1.4 mrg \else\ifx\txiarg\wordbefore 3119 1.1 mrg \def\urefprebreak{\urefallowbreak}\def\urefpostbreak{\nobreak} 3120 1.1.1.4 mrg \else\ifx\txiarg\wordafter 3121 1.1 mrg \def\urefprebreak{\nobreak}\def\urefpostbreak{\urefallowbreak} 3122 1.1 mrg \else 3123 1.1 mrg \errhelp = \EMsimple 3124 1.1 mrg \errmessage{Unknown @urefbreakstyle setting `\txiarg'}% 3125 1.1 mrg \fi\fi\fi 3126 1.1 mrg } 3127 1.1 mrg \def\wordafter{after} 3128 1.1 mrg \def\wordbefore{before} 3129 1.1 mrg \def\wordnone{none} 3130 1.1.1.4 mrg 3131 1.1.1.5 mrg % Allow a ragged right output to aid breaking long URL's. There can 3132 1.1.1.5 mrg % be a break at the \allowbreak with no extra glue (if the existing stretch in 3133 1.1.1.4 mrg % the line is sufficient), a break at the \penalty with extra glue added 3134 1.1.1.5 mrg % at the end of the line, or no break at all here. 3135 1.1.1.5 mrg % Changing the value of the penalty and/or the amount of stretch affects how 3136 1.1.1.4 mrg % preferable one choice is over the other. 3137 1.1.1.5 mrg \def\urefallowbreak{% 3138 1.1.1.4 mrg \penalty0\relax 3139 1.1.1.5 mrg \hskip 0pt plus 2 em\relax 3140 1.1.1.4 mrg \penalty1000\relax 3141 1.1.1.4 mrg \hskip 0pt plus -2 em\relax 3142 1.1.1.4 mrg } 3143 1.1 mrg 3144 1.1 mrg \urefbreakstyle after 3145 1.1 mrg 3146 1.1 mrg % @url synonym for @uref, since that's how everyone uses it. 3147 1.1 mrg % 3148 1.1 mrg \let\url=\uref 3149 1.1 mrg 3150 1.1 mrg % rms does not like angle brackets --karl, 17may97. 3151 1.1 mrg % So now @email is just like @uref, unless we are pdf. 3152 1.1 mrg % 3153 1.1.1.4 mrg %\def\email#1{\angleleft{\tt #1}\angleright} 3154 1.1 mrg \ifpdforxetex 3155 1.1 mrg \def\email#1{\doemail#1,,\finish} 3156 1.1 mrg \def\doemail#1,#2,#3\finish{\begingroup 3157 1.1 mrg \unsepspaces 3158 1.1 mrg \pdfurl{mailto:#1}% 3159 1.1 mrg \setbox0 = \hbox{\ignorespaces #2}% 3160 1.1 mrg \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi 3161 1.1 mrg \endlink 3162 1.1 mrg \endgroup} 3163 1.1.1.4 mrg \else 3164 1.1 mrg \let\email=\uref 3165 1.1 mrg \fi 3166 1.1 mrg 3167 1.1 mrg % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), 3168 1.1 mrg % `example' (@kbd uses ttsl only inside of @example and friends), 3169 1.1 mrg % or `code' (@kbd uses normal tty font always). 3170 1.1 mrg \parseargdef\kbdinputstyle{% 3171 1.1 mrg \def\txiarg{#1}% 3172 1.1 mrg \ifx\txiarg\worddistinct 3173 1.1 mrg \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% 3174 1.1 mrg \else\ifx\txiarg\wordexample 3175 1.1 mrg \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% 3176 1.1 mrg \else\ifx\txiarg\wordcode 3177 1.1 mrg \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% 3178 1.1 mrg \else 3179 1.1 mrg \errhelp = \EMsimple 3180 1.1 mrg \errmessage{Unknown @kbdinputstyle setting `\txiarg'}% 3181 1.1 mrg \fi\fi\fi 3182 1.1 mrg } 3183 1.1 mrg \def\worddistinct{distinct} 3184 1.1 mrg \def\wordexample{example} 3185 1.1 mrg \def\wordcode{code} 3186 1.1 mrg 3187 1.1 mrg % Default is `distinct'. 3188 1.1 mrg \kbdinputstyle distinct 3189 1.1.1.5 mrg 3190 1.1.1.5 mrg \def\kbd#1{% 3191 1.1.1.2 mrg \tclose{\kbdfont\setcodequotes#1}% 3192 1.1 mrg } 3193 1.1.1.2 mrg 3194 1.1.1.2 mrg % definition of @key that produces a lozenge. Doesn't adjust to text size. 3195 1.1.1.2 mrg %\setfont\keyrm\rmshape{8}{1000}{OT1} 3196 1.1.1.2 mrg %\font\keysy=cmsy9 3197 1.1.1.2 mrg %\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% 3198 1.1.1.2 mrg % \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% 3199 1.1.1.2 mrg % \vbox{\hrule\kern-0.4pt 3200 1.1.1.2 mrg % \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% 3201 1.1.1.2 mrg % \kern-0.4pt\hrule}% 3202 1.1.1.2 mrg % \kern-.06em\raise0.4pt\hbox{\angleright}}}} 3203 1.1.1.5 mrg 3204 1.1.1.2 mrg % definition of @key with no lozenge. 3205 1.1.1.5 mrg % 3206 1.1 mrg \def\key#1{{\setregularquotes \nohyphenation \tt #1}\null} 3207 1.1 mrg 3208 1.1 mrg % @clicksequence{File @click{} Open ...} 3209 1.1 mrg \def\clicksequence#1{\begingroup #1\endgroup} 3210 1.1 mrg 3211 1.1 mrg % @clickstyle @arrow (by default) 3212 1.1 mrg \parseargdef\clickstyle{\def\click{#1}} 3213 1.1 mrg \def\click{\arrow} 3214 1.1 mrg 3215 1.1 mrg % Typeset a dimension, e.g., `in' or `pt'. The only reason for the 3216 1.1 mrg % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. 3217 1.1 mrg % 3218 1.1 mrg \def\dmn#1{\thinspace #1} 3219 1.1 mrg 3220 1.1 mrg % @acronym for "FBI", "NATO", and the like. 3221 1.1 mrg % We print this one point size smaller, since it's intended for 3222 1.1 mrg % all-uppercase. 3223 1.1 mrg % 3224 1.1 mrg \def\acronym#1{\doacronym #1,,\finish} 3225 1.1.1.3 mrg \def\doacronym#1,#2,#3\finish{% 3226 1.1 mrg {\switchtolsize #1}% 3227 1.1 mrg \def\temp{#2}% 3228 1.1 mrg \ifx\temp\empty \else 3229 1.1 mrg \space ({\unsepspaces \ignorespaces \temp \unskip})% 3230 1.1 mrg \fi 3231 1.1 mrg \null % reset \spacefactor=1000 3232 1.1 mrg } 3233 1.1 mrg 3234 1.1 mrg % @abbr for "Comput. J." and the like. 3235 1.1 mrg % No font change, but don't do end-of-sentence spacing. 3236 1.1 mrg % 3237 1.1 mrg \def\abbr#1{\doabbr #1,,\finish} 3238 1.1 mrg \def\doabbr#1,#2,#3\finish{% 3239 1.1 mrg {\plainfrenchspacing #1}% 3240 1.1 mrg \def\temp{#2}% 3241 1.1 mrg \ifx\temp\empty \else 3242 1.1 mrg \space ({\unsepspaces \ignorespaces \temp \unskip})% 3243 1.1 mrg \fi 3244 1.1 mrg \null % reset \spacefactor=1000 3245 1.1 mrg } 3246 1.1 mrg 3247 1.1 mrg % @asis just yields its argument. Used with @table, for example. 3248 1.1 mrg % 3249 1.1 mrg \def\asis#1{#1} 3250 1.1 mrg 3251 1.1 mrg % @math outputs its argument in math mode. 3252 1.1 mrg % 3253 1.1 mrg % One complication: _ usually means subscripts, but it could also mean 3254 1.1 mrg % an actual _ character, as in @math{@var{some_variable} + 1}. So make 3255 1.1 mrg % _ active, and distinguish by seeing if the current family is \slfam, 3256 1.1 mrg % which is what @var uses. 3257 1.1 mrg { 3258 1.1 mrg \catcode`\_ = \active 3259 1.1 mrg \gdef\mathunderscore{% 3260 1.1 mrg \catcode`\_=\active 3261 1.1 mrg \def_{\ifnum\fam=\slfam \_\else\sb\fi}% 3262 1.1 mrg } 3263 1.1 mrg } 3264 1.1 mrg % Another complication: we want \\ (and @\) to output a math (or tt) \. 3265 1.1 mrg % FYI, plain.tex uses \\ as a temporary control sequence (for no 3266 1.1 mrg % particular reason), but this is not advertised and we don't care. 3267 1.1 mrg % 3268 1.1 mrg % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. 3269 1.1 mrg \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} 3270 1.1 mrg % 3271 1.1.1.3 mrg \def\math{% 3272 1.1.1.3 mrg \ifmmode\else % only go into math if not in math mode already 3273 1.1.1.3 mrg \tex 3274 1.1.1.3 mrg \mathunderscore 3275 1.1.1.3 mrg \let\\ = \mathbackslash 3276 1.1.1.3 mrg \mathactive 3277 1.1.1.3 mrg % make the texinfo accent commands work in math mode 3278 1.1.1.3 mrg \let\"=\ddot 3279 1.1.1.3 mrg \let\'=\acute 3280 1.1.1.3 mrg \let\==\bar 3281 1.1.1.3 mrg \let\^=\hat 3282 1.1.1.3 mrg \let\`=\grave 3283 1.1.1.3 mrg \let\u=\breve 3284 1.1.1.3 mrg \let\v=\check 3285 1.1.1.3 mrg \let\~=\tilde 3286 1.1.1.3 mrg \let\dotaccent=\dot 3287 1.1.1.3 mrg % have to provide another name for sup operator 3288 1.1.1.3 mrg \let\mathopsup=\sup 3289 1.1 mrg $\expandafter\finishmath\fi 3290 1.1 mrg } 3291 1.1 mrg \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. 3292 1.1 mrg 3293 1.1 mrg % Some active characters (such as <) are spaced differently in math. 3294 1.1 mrg % We have to reset their definitions in case the @math was an argument 3295 1.1 mrg % to a command which sets the catcodes (such as @item or @section). 3296 1.1 mrg % 3297 1.1 mrg { 3298 1.1 mrg \catcode`^ = \active 3299 1.1 mrg \catcode`< = \active 3300 1.1 mrg \catcode`> = \active 3301 1.1 mrg \catcode`+ = \active 3302 1.1 mrg \catcode`' = \active 3303 1.1 mrg \gdef\mathactive{% 3304 1.1 mrg \let^ = \ptexhat 3305 1.1 mrg \let< = \ptexless 3306 1.1 mrg \let> = \ptexgtr 3307 1.1 mrg \let+ = \ptexplus 3308 1.1 mrg \let' = \ptexquoteright 3309 1.1 mrg } 3310 1.1 mrg } 3311 1.1.1.3 mrg 3312 1.1.1.3 mrg % for @sub and @sup, if in math mode, just do a normal sub/superscript. 3313 1.1.1.3 mrg % If in text, use math to place as sub/superscript, but switch 3314 1.1.1.3 mrg % into text mode, with smaller fonts. This is a different font than the 3315 1.1.1.3 mrg % one used for real math sub/superscripts (8pt vs. 7pt), but let's not 3316 1.1.1.3 mrg % fix it (significant additions to font machinery) until someone notices. 3317 1.1.1.3 mrg % 3318 1.1.1.3 mrg \def\sub{\ifmmode \expandafter\sb \else \expandafter\finishsub\fi} 3319 1.1.1.3 mrg \def\finishsub#1{$\sb{\hbox{\switchtolllsize #1}}$}% 3320 1.1.1.3 mrg % 3321 1.1.1.3 mrg \def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi} 3322 1.1.1.2 mrg \def\finishsup#1{$\ptexsp{\hbox{\switchtolllsize #1}}$}% 3323 1.1.1.5 mrg 3324 1.1.1.5 mrg % provide this command from LaTeX as it is very common 3325 1.1.1.5 mrg \def\frac#1#2{{{#1}\over{#2}}} 3326 1.1.1.5 mrg 3327 1.1.1.5 mrg % @displaymath. 3328 1.1.1.5 mrg % \globaldefs is needed to recognize the end lines in \tex and 3329 1.1.1.5 mrg % \end tex. Set \thisenv as @end displaymath is seen before @end tex. 3330 1.1.1.5 mrg {\obeylines 3331 1.1.1.5 mrg \globaldefs=1 3332 1.1.1.5 mrg \envdef\displaymath{% 3333 1.1.1.5 mrg \tex% 3334 1.1.1.5 mrg \def\thisenv{\displaymath}% 3335 1.1.1.5 mrg \begingroup\let\end\displaymathend% 3336 1.1.1.5 mrg $$% 3337 1.1.1.5 mrg } 3338 1.1.1.5 mrg 3339 1.1.1.5 mrg \def\displaymathend{$$\endgroup\end}% 3340 1.1.1.5 mrg 3341 1.1.1.5 mrg \def\Edisplaymath{% 3342 1.1.1.5 mrg \def\thisenv{\tex}% 3343 1.1.1.5 mrg \end tex 3344 1.1.1.5 mrg }} 3345 1.1.1.5 mrg 3346 1.1 mrg 3347 1.1 mrg % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. 3348 1.1 mrg % Ignore unless FMTNAME == tex; then it is like @iftex and @tex, 3349 1.1.1.5 mrg % except specified as a normal braced arg, so no newlines to worry about. 3350 1.1 mrg % 3351 1.1 mrg \def\outfmtnametex{tex} 3352 1.1 mrg % 3353 1.1 mrg \long\def\inlinefmt#1{\doinlinefmt #1,\finish} 3354 1.1 mrg \long\def\doinlinefmt#1,#2,\finish{% 3355 1.1 mrg \def\inlinefmtname{#1}% 3356 1.1 mrg \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi 3357 1.1.1.5 mrg } 3358 1.1.1.3 mrg % 3359 1.1.1.3 mrg % @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if 3360 1.1.1.3 mrg % FMTNAME is tex, else ELSE-TEXT. 3361 1.1.1.3 mrg \long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish} 3362 1.1.1.3 mrg \long\def\doinlinefmtifelse#1,#2,#3,#4,\finish{% 3363 1.1.1.3 mrg \def\inlinefmtname{#1}% 3364 1.1.1.3 mrg \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\else \ignorespaces #3\fi 3365 1.1.1.3 mrg } 3366 1.1 mrg % 3367 1.1 mrg % For raw, must switch into @tex before parsing the argument, to avoid 3368 1.1 mrg % setting catcodes prematurely. Doing it this way means that, for 3369 1.1 mrg % example, @inlineraw{html, foo{bar} gets a parse error instead of being 3370 1.1 mrg % ignored. But this isn't important because if people want a literal 3371 1.1 mrg % *right* brace they would have to use a command anyway, so they may as 3372 1.1 mrg % well use a command to get a left brace too. We could re-use the 3373 1.1.1.5 mrg % delimiter character idea from \verb, but it seems like overkill. 3374 1.1 mrg % 3375 1.1 mrg \long\def\inlineraw{\tex \doinlineraw} 3376 1.1 mrg \long\def\doinlineraw#1{\doinlinerawtwo #1,\finish} 3377 1.1 mrg \def\doinlinerawtwo#1,#2,\finish{% 3378 1.1 mrg \def\inlinerawname{#1}% 3379 1.1 mrg \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi 3380 1.1 mrg \endgroup % close group opened by \tex. 3381 1.1 mrg } 3382 1.1.1.3 mrg 3383 1.1.1.3 mrg % @inlineifset{VAR, TEXT} expands TEXT if VAR is @set. 3384 1.1.1.3 mrg % 3385 1.1.1.3 mrg \long\def\inlineifset#1{\doinlineifset #1,\finish} 3386 1.1.1.3 mrg \long\def\doinlineifset#1,#2,\finish{% 3387 1.1.1.3 mrg \def\inlinevarname{#1}% 3388 1.1.1.3 mrg \expandafter\ifx\csname SET\inlinevarname\endcsname\relax 3389 1.1.1.3 mrg \else\ignorespaces#2\fi 3390 1.1.1.3 mrg } 3391 1.1.1.3 mrg 3392 1.1.1.3 mrg % @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set. 3393 1.1.1.3 mrg % 3394 1.1.1.3 mrg \long\def\inlineifclear#1{\doinlineifclear #1,\finish} 3395 1.1.1.3 mrg \long\def\doinlineifclear#1,#2,\finish{% 3396 1.1.1.3 mrg \def\inlinevarname{#1}% 3397 1.1.1.3 mrg \expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces#2\fi 3398 1.1.1.3 mrg } 3399 1.1 mrg 3400 1.1 mrg 3401 1.1 mrg \message{glyphs,} 3402 1.1 mrg % and logos. 3403 1.1 mrg 3404 1.1 mrg % @@ prints an @, as does @atchar{}. 3405 1.1 mrg \def\@{\char64 } 3406 1.1 mrg \let\atchar=\@ 3407 1.1 mrg 3408 1.1.1.5 mrg % @{ @} @lbracechar{} @rbracechar{} all generate brace characters. 3409 1.1.1.5 mrg \def\lbracechar{{\ifusingtt{\char123}{\ensuremath\lbrace}}} 3410 1.1.1.3 mrg \def\rbracechar{{\ifusingtt{\char125}{\ensuremath\rbrace}}} 3411 1.1.1.3 mrg \let\{=\lbracechar 3412 1.1 mrg \let\}=\rbracechar 3413 1.1 mrg 3414 1.1 mrg % @comma{} to avoid , parsing problems. 3415 1.1 mrg \let\comma = , 3416 1.1 mrg 3417 1.1 mrg % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent 3418 1.1 mrg % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. 3419 1.1 mrg \let\, = \ptexc 3420 1.1 mrg \let\dotaccent = \ptexdot 3421 1.1 mrg \def\ringaccent#1{{\accent23 #1}} 3422 1.1 mrg \let\tieaccent = \ptext 3423 1.1 mrg \let\ubaraccent = \ptexb 3424 1.1 mrg \let\udotaccent = \d 3425 1.1 mrg 3426 1.1 mrg % Other special characters: @questiondown @exclamdown @ordf @ordm 3427 1.1 mrg % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. 3428 1.1 mrg \def\questiondown{?`} 3429 1.1.1.3 mrg \def\exclamdown{!`} 3430 1.1.1.3 mrg \def\ordf{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{a}}} 3431 1.1 mrg \def\ordm{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{o}}} 3432 1.1 mrg 3433 1.1 mrg % Dotless i and dotless j, used for accents. 3434 1.1 mrg \def\imacro{i} 3435 1.1 mrg \def\jmacro{j} 3436 1.1 mrg \def\dotless#1{% 3437 1.1 mrg \def\temp{#1}% 3438 1.1 mrg \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi 3439 1.1 mrg \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi 3440 1.1 mrg \else \errmessage{@dotless can be used only with i or j}% 3441 1.1 mrg \fi\fi 3442 1.1 mrg } 3443 1.1 mrg 3444 1.1 mrg % The \TeX{} logo, as in plain, but resetting the spacing so that a 3445 1.1 mrg % period following counts as ending a sentence. (Idea found in latex.) 3446 1.1 mrg % 3447 1.1 mrg \edef\TeX{\TeX \spacefactor=1000 } 3448 1.1 mrg 3449 1.1 mrg % @LaTeX{} logo. Not quite the same results as the definition in 3450 1.1 mrg % latex.ltx, since we use a different font for the raised A; it's most 3451 1.1 mrg % convenient for us to use an explicitly smaller font, rather than using 3452 1.1 mrg % the \scriptstyle font (since we don't reset \scriptstyle and 3453 1.1 mrg % \scriptscriptstyle). 3454 1.1 mrg % 3455 1.1 mrg \def\LaTeX{% 3456 1.1 mrg L\kern-.36em 3457 1.1 mrg {\setbox0=\hbox{T}% 3458 1.1 mrg \vbox to \ht0{\hbox{% 3459 1.1.1.3 mrg \ifx\textnominalsize\xwordpt 3460 1.1 mrg % for 10pt running text, lllsize (8pt) is too small for the A in LaTeX. 3461 1.1 mrg % Revert to plain's \scriptsize, which is 7pt. 3462 1.1 mrg \count255=\the\fam $\fam\count255 \scriptstyle A$% 3463 1.1.1.5 mrg \else 3464 1.1.1.5 mrg \ifx\curfontsize\smallword 3465 1.1.1.5 mrg % For footnotes and indices 3466 1.1.1.5 mrg \count255=\the\fam $\fam\count255 \scriptstyle A$% 3467 1.1.1.5 mrg \else 3468 1.1.1.5 mrg % For 11pt, we can use our lllsize. 3469 1.1.1.5 mrg \switchtolllsize A% 3470 1.1 mrg \fi 3471 1.1 mrg \fi 3472 1.1 mrg }% 3473 1.1 mrg \vss 3474 1.1 mrg }}% 3475 1.1 mrg \kern-.15em 3476 1.1 mrg \TeX 3477 1.1.1.5 mrg } 3478 1.1 mrg \def\smallword{small} 3479 1.1.1.3 mrg 3480 1.1.1.3 mrg % Some math mode symbols. Define \ensuremath to switch into math mode 3481 1.1.1.3 mrg % unless we are already there. Expansion tricks may not be needed here, 3482 1.1.1.3 mrg % but safer, and can't hurt. 3483 1.1.1.3 mrg \def\ensuremath{\ifmmode \expandafter\asis \else\expandafter\ensuredmath \fi} 3484 1.1.1.3 mrg \def\ensuredmath#1{$\relax#1$} 3485 1.1.1.3 mrg % 3486 1.1.1.3 mrg \def\bullet{\ensuremath\ptexbullet} 3487 1.1.1.3 mrg \def\geq{\ensuremath\ge} 3488 1.1.1.3 mrg \def\leq{\ensuremath\le} 3489 1.1 mrg \def\minus{\ensuremath-} 3490 1.1 mrg 3491 1.1 mrg % @dots{} outputs an ellipsis using the current font. 3492 1.1 mrg % We do .5em per period so that it has the same spacing in the cm 3493 1.1 mrg % typewriter fonts as three actual period characters; on the other hand, 3494 1.1 mrg % in other typewriter fonts three periods are wider than 1.5em. So do 3495 1.1 mrg % whichever is larger. 3496 1.1 mrg % 3497 1.1 mrg \def\dots{% 3498 1.1 mrg \leavevmode 3499 1.1 mrg \setbox0=\hbox{...}% get width of three periods 3500 1.1 mrg \ifdim\wd0 > 1.5em 3501 1.1 mrg \dimen0 = \wd0 3502 1.1 mrg \else 3503 1.1 mrg \dimen0 = 1.5em 3504 1.1 mrg \fi 3505 1.1 mrg \hbox to \dimen0{% 3506 1.1 mrg \hskip 0pt plus.25fil 3507 1.1 mrg .\hskip 0pt plus1fil 3508 1.1 mrg .\hskip 0pt plus1fil 3509 1.1 mrg .\hskip 0pt plus.5fil 3510 1.1 mrg }% 3511 1.1 mrg } 3512 1.1 mrg 3513 1.1 mrg % @enddots{} is an end-of-sentence ellipsis. 3514 1.1 mrg % 3515 1.1 mrg \def\enddots{% 3516 1.1 mrg \dots 3517 1.1 mrg \spacefactor=\endofsentencespacefactor 3518 1.1 mrg } 3519 1.1 mrg 3520 1.1 mrg % @point{}, @result{}, @expansion{}, @print{}, @equiv{}. 3521 1.1 mrg % 3522 1.1 mrg % Since these characters are used in examples, they should be an even number of 3523 1.1 mrg % \tt widths. Each \tt character is 1en, so two makes it 1em. 3524 1.1 mrg % 3525 1.1 mrg \def\point{$\star$} 3526 1.1 mrg \def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}} 3527 1.1 mrg \def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} 3528 1.1 mrg \def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}} 3529 1.1 mrg \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} 3530 1.1 mrg \def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}} 3531 1.1 mrg 3532 1.1 mrg % The @error{} command. 3533 1.1 mrg % Adapted from the TeXbook's \boxit. 3534 1.1 mrg % 3535 1.1 mrg \newbox\errorbox 3536 1.1.1.3 mrg % 3537 1.1 mrg {\ttfont \global\dimen0 = 3em}% Width of the box. 3538 1.1 mrg \dimen2 = .55pt % Thickness of rules 3539 1.1 mrg % The text. (`r' is open on the right, `e' somewhat less so on the left.) 3540 1.1 mrg \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt} 3541 1.1 mrg % 3542 1.1 mrg \setbox\errorbox=\hbox to \dimen0{\hfil 3543 1.1 mrg \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. 3544 1.1 mrg \advance\hsize by -2\dimen2 % Rules. 3545 1.1 mrg \vbox{% 3546 1.1 mrg \hrule height\dimen2 3547 1.1 mrg \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. 3548 1.1 mrg \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. 3549 1.1 mrg \kern3pt\vrule width\dimen2}% Space to right. 3550 1.1 mrg \hrule height\dimen2} 3551 1.1 mrg \hfil} 3552 1.1 mrg % 3553 1.1 mrg \def\error{\leavevmode\lower.7ex\copy\errorbox} 3554 1.1 mrg 3555 1.1 mrg % @pounds{} is a sterling sign, which Knuth put in the CM italic font. 3556 1.1.1.5 mrg % 3557 1.1 mrg \def\pounds{{\ifusingtt{\ecfont\char"BF}{\it\$}}} 3558 1.1 mrg 3559 1.1 mrg % @euro{} comes from a separate font, depending on the current style. 3560 1.1 mrg % We use the free feym* fonts from the eurosym package by Henrik 3561 1.1 mrg % Theiling, which support regular, slanted, bold and bold slanted (and 3562 1.1 mrg % "outlined" (blackboard board, sort of) versions, which we don't need). 3563 1.1 mrg % It is available from http://www.ctan.org/tex-archive/fonts/eurosym. 3564 1.1 mrg % 3565 1.1 mrg % Although only regular is the truly official Euro symbol, we ignore 3566 1.1 mrg % that. The Euro is designed to be slightly taller than the regular 3567 1.1 mrg % font height. 3568 1.1 mrg % 3569 1.1 mrg % feymr - regular 3570 1.1 mrg % feymo - slanted 3571 1.1 mrg % feybr - bold 3572 1.1 mrg % feybo - bold slanted 3573 1.1 mrg % 3574 1.1 mrg % There is no good (free) typewriter version, to my knowledge. 3575 1.1 mrg % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide. 3576 1.1 mrg % Hmm. 3577 1.1 mrg % 3578 1.1 mrg % Also doesn't work in math. Do we need to do math with euro symbols? 3579 1.1 mrg % Hope not. 3580 1.1 mrg % 3581 1.1 mrg % 3582 1.1 mrg \def\euro{{\eurofont e}} 3583 1.1 mrg \def\eurofont{% 3584 1.1 mrg % We set the font at each command, rather than predefining it in 3585 1.1 mrg % \textfonts and the other font-switching commands, so that 3586 1.1 mrg % installations which never need the symbol don't have to have the 3587 1.1 mrg % font installed. 3588 1.1 mrg % 3589 1.1 mrg % There is only one designed size (nominal 10pt), so we always scale 3590 1.1 mrg % that to the current nominal size. 3591 1.1 mrg % 3592 1.1 mrg % By the way, simply using "at 1em" works for cmr10 and the like, but 3593 1.1 mrg % does not work for cmbx10 and other extended/shrunken fonts. 3594 1.1 mrg % 3595 1.1 mrg \def\eurosize{\csname\curfontsize nominalsize\endcsname}% 3596 1.1 mrg % 3597 1.1 mrg \ifx\curfontstyle\bfstylename 3598 1.1 mrg % bold: 3599 1.1 mrg \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize 3600 1.1 mrg \else 3601 1.1 mrg % regular: 3602 1.1 mrg \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize 3603 1.1 mrg \fi 3604 1.1 mrg \thiseurofont 3605 1.1 mrg } 3606 1.1 mrg 3607 1.1 mrg % Glyphs from the EC fonts. We don't use \let for the aliases, because 3608 1.1 mrg % sometimes we redefine the original macro, and the alias should reflect 3609 1.1 mrg % the redefinition. 3610 1.1 mrg % 3611 1.1 mrg % Use LaTeX names for the Icelandic letters. 3612 1.1 mrg \def\DH{{\ecfont \char"D0}} % Eth 3613 1.1 mrg \def\dh{{\ecfont \char"F0}} % eth 3614 1.1 mrg \def\TH{{\ecfont \char"DE}} % Thorn 3615 1.1 mrg \def\th{{\ecfont \char"FE}} % thorn 3616 1.1 mrg % 3617 1.1 mrg \def\guillemetleft{{\ecfont \char"13}} 3618 1.1 mrg \def\guillemotleft{\guillemetleft} 3619 1.1 mrg \def\guillemetright{{\ecfont \char"14}} 3620 1.1 mrg \def\guillemotright{\guillemetright} 3621 1.1 mrg \def\guilsinglleft{{\ecfont \char"0E}} 3622 1.1 mrg \def\guilsinglright{{\ecfont \char"0F}} 3623 1.1 mrg \def\quotedblbase{{\ecfont \char"12}} 3624 1.1 mrg \def\quotesinglbase{{\ecfont \char"0D}} 3625 1.1.1.5 mrg % 3626 1.1.1.5 mrg \def\L{{\ecfont \char"8A}} % L with stroke 3627 1.1.1.5 mrg \def\l{{\ecfont \char"AA}} % l with stroke 3628 1.1 mrg % 3629 1.1 mrg % This positioning is not perfect (see the ogonek LaTeX package), but 3630 1.1 mrg % we have the precomposed glyphs for the most common cases. We put the 3631 1.1 mrg % tests to use those glyphs in the single \ogonek macro so we have fewer 3632 1.1 mrg % dummy definitions to worry about for index entries, etc. 3633 1.1 mrg % 3634 1.1 mrg % ogonek is also used with other letters in Lithuanian (IOU), but using 3635 1.1 mrg % the precomposed glyphs for those is not so easy since they aren't in 3636 1.1 mrg % the same EC font. 3637 1.1 mrg \def\ogonek#1{{% 3638 1.1 mrg \def\temp{#1}% 3639 1.1 mrg \ifx\temp\macrocharA\Aogonek 3640 1.1 mrg \else\ifx\temp\macrochara\aogonek 3641 1.1 mrg \else\ifx\temp\macrocharE\Eogonek 3642 1.1 mrg \else\ifx\temp\macrochare\eogonek 3643 1.1 mrg \else 3644 1.1 mrg \ecfont \setbox0=\hbox{#1}% 3645 1.1 mrg \ifdim\ht0=1ex\accent"0C #1% 3646 1.1 mrg \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}% 3647 1.1 mrg \fi 3648 1.1 mrg \fi\fi\fi\fi 3649 1.1 mrg }% 3650 1.1 mrg } 3651 1.1 mrg \def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A} 3652 1.1 mrg \def\aogonek{{\ecfont \char"A1}}\def\macrochara{a} 3653 1.1 mrg \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E} 3654 1.1 mrg \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e} 3655 1.1.1.3 mrg % 3656 1.1.1.3 mrg % Use the European Computer Modern fonts (cm-super in outline format) 3657 1.1.1.3 mrg % for non-CM glyphs. That is ec* for regular text and tc* for the text 3658 1.1.1.3 mrg % companion symbols (LaTeX TS1 encoding). Both are part of the ec 3659 1.1.1.5 mrg % package and follow the same conventions. 3660 1.1.1.3 mrg % 3661 1.1.1.3 mrg \def\ecfont{\etcfont{e}} 3662 1.1.1.3 mrg \def\tcfont{\etcfont{t}} 3663 1.1.1.3 mrg % 3664 1.1 mrg \def\etcfont#1{% 3665 1.1 mrg % We can't distinguish serif/sans and italic/slanted, but this 3666 1.1 mrg % is used for crude hacks anyway (like adding French and German 3667 1.1 mrg % quotes to documents typeset with CM, where we lose kerning), so 3668 1.1 mrg % hopefully nobody will notice/care. 3669 1.1 mrg \edef\ecsize{\csname\curfontsize ecsize\endcsname}% 3670 1.1.1.5 mrg \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% 3671 1.1.1.5 mrg \ifusingtt 3672 1.1.1.5 mrg % typewriter: 3673 1.1.1.5 mrg {\font\thisecfont = #1ctt\ecsize \space at \nominalsize}% 3674 1.1.1.5 mrg % else 3675 1.1.1.5 mrg {\ifx\curfontstyle\bfstylename 3676 1.1.1.5 mrg % bold: 3677 1.1.1.5 mrg \font\thisecfont = #1cb\ifusingit{i}{x}\ecsize \space at \nominalsize 3678 1.1.1.5 mrg \else 3679 1.1.1.5 mrg % regular: 3680 1.1.1.5 mrg \font\thisecfont = #1c\ifusingit{ti}{rm}\ecsize \space at \nominalsize 3681 1.1 mrg \fi}% 3682 1.1 mrg \thisecfont 3683 1.1 mrg } 3684 1.1 mrg 3685 1.1 mrg % @registeredsymbol - R in a circle. The font for the R should really 3686 1.1 mrg % be smaller yet, but lllsize is the best we can do for now. 3687 1.1 mrg % Adapted from the plain.tex definition of \copyright. 3688 1.1 mrg % 3689 1.1.1.3 mrg \def\registeredsymbol{% 3690 1.1 mrg $^{{\ooalign{\hfil\raise.07ex\hbox{\switchtolllsize R}% 3691 1.1 mrg \hfil\crcr\Orb}}% 3692 1.1 mrg }$% 3693 1.1 mrg } 3694 1.1 mrg 3695 1.1 mrg % @textdegree - the normal degrees sign. 3696 1.1.1.5 mrg % 3697 1.1.1.5 mrg \def\textdegree{% 3698 1.1.1.5 mrg \ifmmode ^\circ 3699 1.1.1.5 mrg \else {\tcfont \char 176}% 3700 1.1 mrg \fi} 3701 1.1 mrg 3702 1.1 mrg % Laurent Siebenmann reports \Orb undefined with: 3703 1.1 mrg % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 3704 1.1 mrg % so we'll define it if necessary. 3705 1.1 mrg % 3706 1.1 mrg \ifx\Orb\thisisundefined 3707 1.1 mrg \def\Orb{\mathhexbox20D} 3708 1.1 mrg \fi 3709 1.1 mrg 3710 1.1 mrg % Quotes. 3711 1.1 mrg \chardef\quoteleft=`\` 3712 1.1 mrg \chardef\quoteright=`\' 3713 1.1.1.5 mrg 3714 1.1.1.5 mrg % only change font for tt for correct kerning and to avoid using 3715 1.1.1.5 mrg % \ecfont unless necessary. 3716 1.1.1.5 mrg \def\quotedblleft{% 3717 1.1.1.5 mrg \ifusingtt{{\ecfont\char"10}}{{\char"5C}}% 3718 1.1.1.5 mrg } 3719 1.1.1.5 mrg 3720 1.1.1.5 mrg \def\quotedblright{% 3721 1.1.1.5 mrg \ifusingtt{{\ecfont\char"11}}{{\char`\"}}% 3722 1.1.1.5 mrg } 3723 1.1 mrg 3724 1.1 mrg 3725 1.1 mrg \message{page headings,} 3726 1.1 mrg 3727 1.1 mrg \newskip\titlepagetopglue \titlepagetopglue = 1.5in 3728 1.1 mrg \newskip\titlepagebottomglue \titlepagebottomglue = 2pc 3729 1.1 mrg 3730 1.1 mrg % First the title page. Must do @settitle before @titlepage. 3731 1.1 mrg \newif\ifseenauthor 3732 1.1 mrg \newif\iffinishedtitlepage 3733 1.1.1.3 mrg 3734 1.1.1.3 mrg % @setcontentsaftertitlepage used to do an implicit @contents or 3735 1.1.1.3 mrg % @shortcontents after @end titlepage, but it is now obsolete. 3736 1.1.1.3 mrg \def\setcontentsaftertitlepage{% 3737 1.1.1.3 mrg \errmessage{@setcontentsaftertitlepage has been removed as a Texinfo 3738 1.1.1.3 mrg command; move your @contents command if you want the contents 3739 1.1.1.3 mrg after the title page.}}% 3740 1.1.1.3 mrg \def\setshortcontentsaftertitlepage{% 3741 1.1.1.5 mrg \errmessage{@setshortcontentsaftertitlepage has been removed as a Texinfo 3742 1.1.1.3 mrg command; move your @shortcontents and @contents commands if you 3743 1.1 mrg want the contents after the title page.}}% 3744 1.1 mrg 3745 1.1 mrg \parseargdef\shorttitlepage{% 3746 1.1 mrg \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}% 3747 1.1 mrg \endgroup\page\hbox{}\page} 3748 1.1 mrg 3749 1.1 mrg \envdef\titlepage{% 3750 1.1 mrg % Open one extra group, as we want to close it in the middle of \Etitlepage. 3751 1.1 mrg \begingroup 3752 1.1.1.5 mrg \parindent=0pt \textfonts 3753 1.1 mrg \headingsoff 3754 1.1 mrg % Leave some space at the very top of the page. 3755 1.1 mrg \vglue\titlepagetopglue 3756 1.1 mrg % No rule at page bottom unless we print one at the top with @title. 3757 1.1 mrg \finishedtitlepagetrue 3758 1.1 mrg % 3759 1.1 mrg % Most title ``pages'' are actually two pages long, with space 3760 1.1 mrg % at the top of the second. We don't want the ragged left on the second. 3761 1.1 mrg \let\oldpage = \page 3762 1.1 mrg \def\page{% 3763 1.1 mrg \iffinishedtitlepage\else 3764 1.1 mrg \finishtitlepage 3765 1.1 mrg \fi 3766 1.1 mrg \let\page = \oldpage 3767 1.1 mrg \page 3768 1.1 mrg \null 3769 1.1 mrg }% 3770 1.1 mrg } 3771 1.1 mrg 3772 1.1 mrg \def\Etitlepage{% 3773 1.1 mrg \iffinishedtitlepage\else 3774 1.1 mrg \finishtitlepage 3775 1.1 mrg \fi 3776 1.1 mrg % It is important to do the page break before ending the group, 3777 1.1 mrg % because the headline and footline are only empty inside the group. 3778 1.1 mrg % If we use the new definition of \page, we always get a blank page 3779 1.1 mrg % after the title page, which we certainly don't want. 3780 1.1.1.5 mrg \oldpage 3781 1.1 mrg \pageone 3782 1.1 mrg \endgroup 3783 1.1 mrg % 3784 1.1 mrg } 3785 1.1 mrg 3786 1.1 mrg \def\finishtitlepage{% 3787 1.1 mrg \vskip4pt \hrule height 2pt width \hsize 3788 1.1 mrg \vskip\titlepagebottomglue 3789 1.1 mrg \finishedtitlepagetrue 3790 1.1 mrg } 3791 1.1.1.2 mrg 3792 1.1.1.2 mrg % Settings used for typesetting titles: no hyphenation, no indentation, 3793 1.1.1.3 mrg % don't worry much about spacing, ragged right. This should be used 3794 1.1.1.3 mrg % inside a \vbox, and fonts need to be set appropriately first. \par should 3795 1.1.1.5 mrg % be specified before the end of the \vbox, since a vbox is a group. 3796 1.1.1.2 mrg % 3797 1.1.1.3 mrg \def\raggedtitlesettings{% 3798 1.1.1.2 mrg \rm 3799 1.1.1.2 mrg \hyphenpenalty=10000 3800 1.1.1.2 mrg \parindent=0pt 3801 1.1.1.2 mrg \tolerance=5000 3802 1.1.1.2 mrg \ptexraggedright 3803 1.1.1.2 mrg } 3804 1.1 mrg 3805 1.1 mrg % Macros to be used within @titlepage: 3806 1.1.1.3 mrg 3807 1.1 mrg \let\subtitlerm=\rmfont 3808 1.1 mrg \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} 3809 1.1 mrg 3810 1.1 mrg \parseargdef\title{% 3811 1.1.1.2 mrg \checkenv\titlepage 3812 1.1 mrg \vbox{\titlefonts \raggedtitlesettings #1\par}% 3813 1.1 mrg % print a rule at the page bottom also. 3814 1.1 mrg \finishedtitlepagefalse 3815 1.1 mrg \vskip4pt \hrule height 4pt width \hsize \vskip4pt 3816 1.1 mrg } 3817 1.1 mrg 3818 1.1 mrg \parseargdef\subtitle{% 3819 1.1 mrg \checkenv\titlepage 3820 1.1 mrg {\subtitlefont \rightline{#1}}% 3821 1.1 mrg } 3822 1.1 mrg 3823 1.1 mrg % @author should come last, but may come many times. 3824 1.1 mrg % It can also be used inside @quotation. 3825 1.1 mrg % 3826 1.1 mrg \parseargdef\author{% 3827 1.1 mrg \def\temp{\quotation}% 3828 1.1 mrg \ifx\thisenv\temp 3829 1.1 mrg \def\quotationauthor{#1}% printed in \Equotation. 3830 1.1 mrg \else 3831 1.1 mrg \checkenv\titlepage 3832 1.1.1.3 mrg \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi 3833 1.1 mrg {\secfonts\rm \leftline{#1}}% 3834 1.1 mrg \fi 3835 1.1 mrg } 3836 1.1 mrg 3837 1.1 mrg 3838 1.1 mrg % Set up page headings and footings. 3839 1.1 mrg 3840 1.1 mrg \let\thispage=\folio 3841 1.1 mrg 3842 1.1 mrg \newtoks\evenheadline % headline on even pages 3843 1.1.1.5 mrg \newtoks\oddheadline % headline on odd pages 3844 1.1.1.5 mrg \newtoks\evenchapheadline% headline on even pages with a new chapter 3845 1.1 mrg \newtoks\oddchapheadline % headline on odd pages with a new chapter 3846 1.1 mrg \newtoks\evenfootline % footline on even pages 3847 1.1 mrg \newtoks\oddfootline % footline on odd pages 3848 1.1.1.3 mrg 3849 1.1.1.5 mrg % Now make \makeheadline and \makefootline in Plain TeX use those variables 3850 1.1.1.5 mrg \headline={{\textfonts\rm\frenchspacingsetting 3851 1.1.1.5 mrg \ifchapterpage 3852 1.1.1.5 mrg \ifodd\pageno\the\oddchapheadline\else\the\evenchapheadline\fi 3853 1.1.1.5 mrg \else 3854 1.1.1.5 mrg \ifodd\pageno\the\oddheadline\else\the\evenheadline\fi 3855 1.1.1.5 mrg \fi}} 3856 1.1.1.5 mrg 3857 1.1.1.5 mrg \footline={{\textfonts\rm\frenchspacingsetting 3858 1.1.1.5 mrg \ifodd\pageno \the\oddfootline \else \the\evenfootline \fi}% 3859 1.1 mrg \HEADINGShook} 3860 1.1 mrg \let\HEADINGShook=\relax 3861 1.1 mrg 3862 1.1 mrg % Commands to set those variables. 3863 1.1 mrg % For example, this is what @headings on does 3864 1.1 mrg % @evenheading @thistitle|@thispage|@thischapter 3865 1.1 mrg % @oddheading @thischapter|@thispage|@thistitle 3866 1.1 mrg % @evenfooting @thisfile|| 3867 1.1 mrg % @oddfooting ||@thisfile 3868 1.1 mrg 3869 1.1 mrg 3870 1.1 mrg \def\evenheading{\parsearg\evenheadingxxx} 3871 1.1 mrg \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} 3872 1.1.1.5 mrg \def\evenheadingyyy #1\|#2\|#3\|#4\finish{% 3873 1.1.1.5 mrg \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}} 3874 1.1 mrg \global\evenchapheadline=\evenheadline} 3875 1.1 mrg 3876 1.1 mrg \def\oddheading{\parsearg\oddheadingxxx} 3877 1.1 mrg \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} 3878 1.1.1.5 mrg \def\oddheadingyyy #1\|#2\|#3\|#4\finish{% 3879 1.1.1.5 mrg \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}% 3880 1.1 mrg \global\oddchapheadline=\oddheadline} 3881 1.1 mrg 3882 1.1 mrg \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% 3883 1.1 mrg 3884 1.1 mrg \def\evenfooting{\parsearg\evenfootingxxx} 3885 1.1 mrg \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish} 3886 1.1 mrg \def\evenfootingyyy #1\|#2\|#3\|#4\finish{% 3887 1.1 mrg \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} 3888 1.1 mrg 3889 1.1 mrg \def\oddfooting{\parsearg\oddfootingxxx} 3890 1.1 mrg \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish} 3891 1.1 mrg \def\oddfootingyyy #1\|#2\|#3\|#4\finish{% 3892 1.1 mrg \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% 3893 1.1 mrg % 3894 1.1 mrg % Leave some space for the footline. Hopefully ok to assume 3895 1.1.1.3 mrg % @evenfooting will not be used by itself. 3896 1.1 mrg \global\advance\txipageheight by -12pt 3897 1.1 mrg \global\advance\vsize by -12pt 3898 1.1 mrg } 3899 1.1 mrg 3900 1.1 mrg \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} 3901 1.1 mrg 3902 1.1 mrg % @evenheadingmarks top \thischapter <- chapter at the top of a page 3903 1.1 mrg % @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page 3904 1.1 mrg % 3905 1.1 mrg % The same set of arguments for: 3906 1.1 mrg % 3907 1.1 mrg % @oddheadingmarks 3908 1.1 mrg % @evenfootingmarks 3909 1.1 mrg % @oddfootingmarks 3910 1.1 mrg % @everyheadingmarks 3911 1.1 mrg % @everyfootingmarks 3912 1.1.1.3 mrg 3913 1.1.1.3 mrg % These define \getoddheadingmarks, \getevenheadingmarks, 3914 1.1.1.3 mrg % \getoddfootingmarks, and \getevenfootingmarks, each to one of 3915 1.1.1.3 mrg % \gettopheadingmarks, \getbottomheadingmarks. 3916 1.1 mrg % 3917 1.1 mrg \def\evenheadingmarks{\headingmarks{even}{heading}} 3918 1.1 mrg \def\oddheadingmarks{\headingmarks{odd}{heading}} 3919 1.1 mrg \def\evenfootingmarks{\headingmarks{even}{footing}} 3920 1.1.1.3 mrg \def\oddfootingmarks{\headingmarks{odd}{footing}} 3921 1.1 mrg \parseargdef\everyheadingmarks{\headingmarks{even}{heading}{#1} 3922 1.1.1.3 mrg \headingmarks{odd}{heading}{#1} } 3923 1.1 mrg \parseargdef\everyfootingmarks{\headingmarks{even}{footing}{#1} 3924 1.1 mrg \headingmarks{odd}{footing}{#1} } 3925 1.1 mrg % #1 = even/odd, #2 = heading/footing, #3 = top/bottom. 3926 1.1 mrg \def\headingmarks#1#2#3 {% 3927 1.1 mrg \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname 3928 1.1 mrg \global\expandafter\let\csname get#1#2marks\endcsname \temp 3929 1.1 mrg } 3930 1.1 mrg 3931 1.1 mrg \everyheadingmarks bottom 3932 1.1 mrg \everyfootingmarks bottom 3933 1.1 mrg 3934 1.1 mrg % @headings double turns headings on for double-sided printing. 3935 1.1 mrg % @headings single turns headings on for single-sided printing. 3936 1.1 mrg % @headings off turns them off. 3937 1.1 mrg % @headings on same as @headings double, retained for compatibility. 3938 1.1 mrg % @headings after turns on double-sided headings after this page. 3939 1.1 mrg % @headings doubleafter turns on double-sided headings after this page. 3940 1.1 mrg % @headings singleafter turns on single-sided headings after this page. 3941 1.1 mrg % By default, they are off at the start of a document, 3942 1.1 mrg % and turned `on' after @end titlepage. 3943 1.1.1.3 mrg 3944 1.1 mrg \parseargdef\headings{\csname HEADINGS#1\endcsname} 3945 1.1 mrg 3946 1.1.1.5 mrg \def\headingsoff{% non-global headings elimination 3947 1.1.1.5 mrg \evenheadline={\hfil}\evenfootline={\hfil}\evenchapheadline={\hfil}% 3948 1.1 mrg \oddheadline={\hfil}\oddfootline={\hfil}\oddchapheadline={\hfil}% 3949 1.1 mrg } 3950 1.1 mrg 3951 1.1 mrg \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting 3952 1.1 mrg 3953 1.1.1.5 mrg % When we turn headings on, set the page number to 1. 3954 1.1.1.5 mrg \def\pageone{ 3955 1.1.1.5 mrg \global\pageno=1 3956 1.1.1.5 mrg \global\arabiccount = \pagecount 3957 1.1.1.5 mrg } 3958 1.1 mrg 3959 1.1 mrg % For double-sided printing, put current file name in lower left corner, 3960 1.1 mrg % chapter name on inside top of right hand pages, document 3961 1.1 mrg % title on inside top of left hand pages, and page numbers on outside top 3962 1.1 mrg % edge of all pages. 3963 1.1.1.5 mrg \def\HEADINGSdouble{% 3964 1.1.1.5 mrg \pageone 3965 1.1 mrg \HEADINGSdoublex 3966 1.1 mrg } 3967 1.1 mrg \let\contentsalignmacro = \chappager 3968 1.1 mrg 3969 1.1 mrg % For single-sided printing, chapter title goes across top left of page, 3970 1.1 mrg % page number on top right. 3971 1.1.1.5 mrg \def\HEADINGSsingle{% 3972 1.1.1.5 mrg \pageone 3973 1.1 mrg \HEADINGSsinglex 3974 1.1.1.5 mrg } 3975 1.1 mrg % \def\HEADINGSon{\HEADINGSdouble} % defined by \CHAPPAGon 3976 1.1 mrg 3977 1.1 mrg \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} 3978 1.1 mrg \let\HEADINGSdoubleafter=\HEADINGSafter 3979 1.1 mrg \def\HEADINGSdoublex{% 3980 1.1 mrg \global\evenfootline={\hfil} 3981 1.1 mrg \global\oddfootline={\hfil} 3982 1.1.1.5 mrg \global\evenheadline={\line{\folio\hfil\thistitle}} 3983 1.1.1.5 mrg \global\oddheadline={\line{\thischapter\hfil\folio}} 3984 1.1.1.5 mrg \global\evenchapheadline={\line{\folio\hfil\thistitle}} 3985 1.1 mrg \global\oddchapheadline={\line{\hfil\folio}} 3986 1.1 mrg \global\let\contentsalignmacro = \chapoddpage 3987 1.1 mrg } 3988 1.1 mrg 3989 1.1 mrg \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} 3990 1.1 mrg \def\HEADINGSsinglex{% 3991 1.1 mrg \global\evenfootline={\hfil} 3992 1.1.1.5 mrg \global\oddfootline={\hfil} 3993 1.1.1.5 mrg \global\evenheadline={\line{\thischapter\hfil\folio}} 3994 1.1.1.5 mrg \global\oddheadline={\line{\thischapter\hfil\folio}} 3995 1.1.1.5 mrg \global\evenchapheadline={\line{\hfil\folio}} 3996 1.1.1.5 mrg \global\oddchapheadline={\line{\hfil\folio}} 3997 1.1.1.5 mrg \global\let\contentsalignmacro = \chappager 3998 1.1.1.5 mrg } 3999 1.1.1.5 mrg 4000 1.1.1.5 mrg % for @setchapternewpage off 4001 1.1.1.5 mrg \def\HEADINGSsinglechapoff{% 4002 1.1.1.5 mrg \pageone 4003 1.1.1.5 mrg \global\evenfootline={\hfil} 4004 1.1.1.5 mrg \global\oddfootline={\hfil} 4005 1.1.1.5 mrg \global\evenheadline={\line{\thischapter\hfil\folio}} 4006 1.1.1.5 mrg \global\oddheadline={\line{\thischapter\hfil\folio}} 4007 1.1.1.5 mrg \global\evenchapheadline=\evenheadline 4008 1.1 mrg \global\oddchapheadline=\oddheadline 4009 1.1 mrg \global\let\contentsalignmacro = \chappager 4010 1.1 mrg } 4011 1.1 mrg 4012 1.1 mrg % Subroutines used in generating headings 4013 1.1 mrg % This produces Day Month Year style of output. 4014 1.1 mrg % Only define if not already defined, in case a txi-??.tex file has set 4015 1.1 mrg % up a different format (e.g., txi-cs.tex does this). 4016 1.1 mrg \ifx\today\thisisundefined 4017 1.1 mrg \def\today{% 4018 1.1 mrg \number\day\space 4019 1.1 mrg \ifcase\month 4020 1.1 mrg \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr 4021 1.1 mrg \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug 4022 1.1 mrg \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec 4023 1.1 mrg \fi 4024 1.1 mrg \space\number\year} 4025 1.1 mrg \fi 4026 1.1 mrg 4027 1.1 mrg % @settitle line... specifies the title of the document, for headings. 4028 1.1 mrg % It generates no output of its own. 4029 1.1 mrg \def\thistitle{\putwordNoTitle} 4030 1.1 mrg \def\settitle{\parsearg{\gdef\thistitle}} 4031 1.1 mrg 4032 1.1 mrg 4033 1.1 mrg \message{tables,} 4034 1.1 mrg % Tables -- @table, @ftable, @vtable, @item(x). 4035 1.1 mrg 4036 1.1 mrg % default indentation of table text 4037 1.1 mrg \newdimen\tableindent \tableindent=.8in 4038 1.1 mrg % default indentation of @itemize and @enumerate text 4039 1.1 mrg \newdimen\itemindent \itemindent=.3in 4040 1.1 mrg % margin between end of table item and start of table text. 4041 1.1 mrg \newdimen\itemmargin \itemmargin=.1in 4042 1.1 mrg 4043 1.1 mrg % used internally for \itemindent minus \itemmargin 4044 1.1 mrg \newdimen\itemmax 4045 1.1 mrg 4046 1.1 mrg % Note @table, @ftable, and @vtable define @item, @itemx, etc., with 4047 1.1 mrg % these defs. 4048 1.1 mrg % They also define \itemindex 4049 1.1 mrg % to index the item name in whatever manner is desired (perhaps none). 4050 1.1 mrg 4051 1.1 mrg \newif\ifitemxneedsnegativevskip 4052 1.1 mrg 4053 1.1 mrg \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} 4054 1.1 mrg 4055 1.1 mrg \def\internalBitem{\smallbreak \parsearg\itemzzz} 4056 1.1 mrg \def\internalBitemx{\itemxpar \parsearg\itemzzz} 4057 1.1 mrg 4058 1.1 mrg \def\itemzzz #1{\begingroup % 4059 1.1 mrg \advance\hsize by -\rightskip 4060 1.1 mrg \advance\hsize by -\tableindent 4061 1.1 mrg \setbox0=\hbox{\itemindicate{#1}}% 4062 1.1 mrg \itemindex{#1}% 4063 1.1 mrg \nobreak % This prevents a break before @itemx. 4064 1.1 mrg % 4065 1.1 mrg % If the item text does not fit in the space we have, put it on a line 4066 1.1 mrg % by itself, and do not allow a page break either before or after that 4067 1.1 mrg % line. We do not start a paragraph here because then if the next 4068 1.1 mrg % command is, e.g., @kindex, the whatsit would get put into the 4069 1.1 mrg % horizontal list on a line by itself, resulting in extra blank space. 4070 1.1 mrg \ifdim \wd0>\itemmax 4071 1.1 mrg % 4072 1.1 mrg % Make this a paragraph so we get the \parskip glue and wrapping, 4073 1.1 mrg % but leave it ragged-right. 4074 1.1 mrg \begingroup 4075 1.1 mrg \advance\leftskip by-\tableindent 4076 1.1 mrg \advance\hsize by\tableindent 4077 1.1 mrg \advance\rightskip by0pt plus1fil\relax 4078 1.1 mrg \leavevmode\unhbox0\par 4079 1.1 mrg \endgroup 4080 1.1 mrg % 4081 1.1 mrg % We're going to be starting a paragraph, but we don't want the 4082 1.1 mrg % \parskip glue -- logically it's part of the @item we just started. 4083 1.1 mrg \nobreak \vskip-\parskip 4084 1.1 mrg % 4085 1.1 mrg % Stop a page break at the \parskip glue coming up. However, if 4086 1.1 mrg % what follows is an environment such as @example, there will be no 4087 1.1 mrg % \parskip glue; then the negative vskip we just inserted would 4088 1.1 mrg % cause the example and the item to crash together. So we use this 4089 1.1 mrg % bizarre value of 10001 as a signal to \aboveenvbreak to insert 4090 1.1 mrg % \parskip glue after all. Section titles are handled this way also. 4091 1.1 mrg % 4092 1.1 mrg \penalty 10001 4093 1.1 mrg \endgroup 4094 1.1 mrg \itemxneedsnegativevskipfalse 4095 1.1 mrg \else 4096 1.1 mrg % The item text fits into the space. Start a paragraph, so that the 4097 1.1 mrg % following text (if any) will end up on the same line. 4098 1.1 mrg \noindent 4099 1.1 mrg % Do this with kerns and \unhbox so that if there is a footnote in 4100 1.1 mrg % the item text, it can migrate to the main vertical list and 4101 1.1 mrg % eventually be printed. 4102 1.1 mrg \nobreak\kern-\tableindent 4103 1.1 mrg \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 4104 1.1 mrg \unhbox0 4105 1.1 mrg \nobreak\kern\dimen0 4106 1.1 mrg \endgroup 4107 1.1 mrg \itemxneedsnegativevskiptrue 4108 1.1 mrg \fi 4109 1.1 mrg } 4110 1.1 mrg 4111 1.1 mrg \def\item{\errmessage{@item while not in a list environment}} 4112 1.1 mrg \def\itemx{\errmessage{@itemx while not in a list environment}} 4113 1.1 mrg 4114 1.1 mrg % @table, @ftable, @vtable. 4115 1.1 mrg \envdef\table{% 4116 1.1 mrg \let\itemindex\gobble 4117 1.1 mrg \tablecheck{table}% 4118 1.1 mrg } 4119 1.1 mrg \envdef\ftable{% 4120 1.1 mrg \def\itemindex ##1{\doind {fn}{\code{##1}}}% 4121 1.1 mrg \tablecheck{ftable}% 4122 1.1 mrg } 4123 1.1 mrg \envdef\vtable{% 4124 1.1 mrg \def\itemindex ##1{\doind {vr}{\code{##1}}}% 4125 1.1 mrg \tablecheck{vtable}% 4126 1.1 mrg } 4127 1.1 mrg \def\tablecheck#1{% 4128 1.1 mrg \ifnum \the\catcode`\^^M=\active 4129 1.1 mrg \endgroup 4130 1.1 mrg \errmessage{This command won't work in this context; perhaps the problem is 4131 1.1 mrg that we are \inenvironment\thisenv}% 4132 1.1 mrg \def\next{\doignore{#1}}% 4133 1.1 mrg \else 4134 1.1 mrg \let\next\tablex 4135 1.1 mrg \fi 4136 1.1 mrg \next 4137 1.1 mrg } 4138 1.1 mrg \def\tablex#1{% 4139 1.1 mrg \def\itemindicate{#1}% 4140 1.1 mrg \parsearg\tabley 4141 1.1 mrg } 4142 1.1 mrg \def\tabley#1{% 4143 1.1 mrg {% 4144 1.1 mrg \makevalueexpandable 4145 1.1 mrg \edef\temp{\noexpand\tablez #1\space\space\space}% 4146 1.1 mrg \expandafter 4147 1.1 mrg }\temp \endtablez 4148 1.1 mrg } 4149 1.1 mrg \def\tablez #1 #2 #3 #4\endtablez{% 4150 1.1 mrg \aboveenvbreak 4151 1.1 mrg \ifnum 0#1>0 \advance \leftskip by #1\mil \fi 4152 1.1 mrg \ifnum 0#2>0 \tableindent=#2\mil \fi 4153 1.1 mrg \ifnum 0#3>0 \advance \rightskip by #3\mil \fi 4154 1.1 mrg \itemmax=\tableindent 4155 1.1 mrg \advance \itemmax by -\itemmargin 4156 1.1 mrg \advance \leftskip by \tableindent 4157 1.1 mrg \exdentamount=\tableindent 4158 1.1 mrg \parindent = 0pt 4159 1.1 mrg \parskip = \smallskipamount 4160 1.1 mrg \ifdim \parskip=0pt \parskip=2pt \fi 4161 1.1 mrg \let\item = \internalBitem 4162 1.1 mrg \let\itemx = \internalBitemx 4163 1.1 mrg } 4164 1.1 mrg \def\Etable{\endgraf\afterenvbreak} 4165 1.1 mrg \let\Eftable\Etable 4166 1.1 mrg \let\Evtable\Etable 4167 1.1 mrg \let\Eitemize\Etable 4168 1.1 mrg \let\Eenumerate\Etable 4169 1.1 mrg 4170 1.1 mrg % This is the counter used by @enumerate, which is really @itemize 4171 1.1 mrg 4172 1.1 mrg \newcount \itemno 4173 1.1 mrg 4174 1.1 mrg \envdef\itemize{\parsearg\doitemize} 4175 1.1 mrg 4176 1.1 mrg \def\doitemize#1{% 4177 1.1 mrg \aboveenvbreak 4178 1.1 mrg \itemmax=\itemindent 4179 1.1 mrg \advance\itemmax by -\itemmargin 4180 1.1 mrg \advance\leftskip by \itemindent 4181 1.1 mrg \exdentamount=\itemindent 4182 1.1 mrg \parindent=0pt 4183 1.1 mrg \parskip=\smallskipamount 4184 1.1 mrg \ifdim\parskip=0pt \parskip=2pt \fi 4185 1.1.1.3 mrg % 4186 1.1 mrg % Try typesetting the item mark so that if the document erroneously says 4187 1.1 mrg % something like @itemize @samp (intending @table), there's an error 4188 1.1 mrg % right away at the @itemize. It's not the best error message in the 4189 1.1 mrg % world, but it's better than leaving it to the @item. This means if 4190 1.1 mrg % the user wants an empty mark, they have to say @w{} not just @w. 4191 1.1 mrg \def\itemcontents{#1}% 4192 1.1 mrg \setbox0 = \hbox{\itemcontents}% 4193 1.1 mrg % 4194 1.1 mrg % @itemize with no arg is equivalent to @itemize @bullet. 4195 1.1 mrg \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi 4196 1.1 mrg % 4197 1.1 mrg \let\item=\itemizeitem 4198 1.1 mrg } 4199 1.1 mrg 4200 1.1 mrg % Definition of @item while inside @itemize and @enumerate. 4201 1.1 mrg % 4202 1.1 mrg \def\itemizeitem{% 4203 1.1 mrg \advance\itemno by 1 % for enumerations 4204 1.1 mrg {\let\par=\endgraf \smallbreak}% reasonable place to break 4205 1.1 mrg {% 4206 1.1 mrg % If the document has an @itemize directly after a section title, a 4207 1.1 mrg % \nobreak will be last on the list, and \sectionheading will have 4208 1.1 mrg % done a \vskip-\parskip. In that case, we don't want to zero 4209 1.1 mrg % parskip, or the item text will crash with the heading. On the 4210 1.1 mrg % other hand, when there is normal text preceding the item (as there 4211 1.1 mrg % usually is), we do want to zero parskip, or there would be too much 4212 1.1 mrg % space. In that case, we won't have a \nobreak before. At least 4213 1.1 mrg % that's the theory. 4214 1.1 mrg \ifnum\lastpenalty<10000 \parskip=0in \fi 4215 1.1 mrg \noindent 4216 1.1 mrg \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% 4217 1.1.1.3 mrg % 4218 1.1.1.3 mrg \ifinner\else 4219 1.1.1.3 mrg \vadjust{\penalty 1200}% not good to break after first line of item. 4220 1.1.1.3 mrg \fi 4221 1.1.1.3 mrg % We can be in inner vertical mode in a footnote, although an 4222 1.1.1.3 mrg % @itemize looks awful there. 4223 1.1 mrg }% 4224 1.1 mrg \flushcr 4225 1.1 mrg } 4226 1.1 mrg 4227 1.1 mrg % \splitoff TOKENS\endmark defines \first to be the first token in 4228 1.1 mrg % TOKENS, and \rest to be the remainder. 4229 1.1 mrg % 4230 1.1 mrg \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% 4231 1.1 mrg 4232 1.1 mrg % Allow an optional argument of an uppercase letter, lowercase letter, 4233 1.1 mrg % or number, to specify the first label in the enumerated list. No 4234 1.1 mrg % argument is the same as `1'. 4235 1.1 mrg % 4236 1.1 mrg \envparseargdef\enumerate{\enumeratey #1 \endenumeratey} 4237 1.1 mrg \def\enumeratey #1 #2\endenumeratey{% 4238 1.1 mrg % If we were given no argument, pretend we were given `1'. 4239 1.1 mrg \def\thearg{#1}% 4240 1.1 mrg \ifx\thearg\empty \def\thearg{1}\fi 4241 1.1 mrg % 4242 1.1 mrg % Detect if the argument is a single token. If so, it might be a 4243 1.1 mrg % letter. Otherwise, the only valid thing it can be is a number. 4244 1.1 mrg % (We will always have one token, because of the test we just made. 4245 1.1 mrg % This is a good thing, since \splitoff doesn't work given nothing at 4246 1.1 mrg % all -- the first parameter is undelimited.) 4247 1.1 mrg \expandafter\splitoff\thearg\endmark 4248 1.1 mrg \ifx\rest\empty 4249 1.1 mrg % Only one token in the argument. It could still be anything. 4250 1.1 mrg % A ``lowercase letter'' is one whose \lccode is nonzero. 4251 1.1 mrg % An ``uppercase letter'' is one whose \lccode is both nonzero, and 4252 1.1 mrg % not equal to itself. 4253 1.1 mrg % Otherwise, we assume it's a number. 4254 1.1 mrg % 4255 1.1 mrg % We need the \relax at the end of the \ifnum lines to stop TeX from 4256 1.1 mrg % continuing to look for a <number>. 4257 1.1 mrg % 4258 1.1 mrg \ifnum\lccode\expandafter`\thearg=0\relax 4259 1.1 mrg \numericenumerate % a number (we hope) 4260 1.1 mrg \else 4261 1.1 mrg % It's a letter. 4262 1.1 mrg \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax 4263 1.1 mrg \lowercaseenumerate % lowercase letter 4264 1.1 mrg \else 4265 1.1 mrg \uppercaseenumerate % uppercase letter 4266 1.1 mrg \fi 4267 1.1 mrg \fi 4268 1.1 mrg \else 4269 1.1 mrg % Multiple tokens in the argument. We hope it's a number. 4270 1.1 mrg \numericenumerate 4271 1.1 mrg \fi 4272 1.1 mrg } 4273 1.1 mrg 4274 1.1 mrg % An @enumerate whose labels are integers. The starting integer is 4275 1.1 mrg % given in \thearg. 4276 1.1 mrg % 4277 1.1 mrg \def\numericenumerate{% 4278 1.1 mrg \itemno = \thearg 4279 1.1 mrg \startenumeration{\the\itemno}% 4280 1.1 mrg } 4281 1.1 mrg 4282 1.1 mrg % The starting (lowercase) letter is in \thearg. 4283 1.1 mrg \def\lowercaseenumerate{% 4284 1.1 mrg \itemno = \expandafter`\thearg 4285 1.1 mrg \startenumeration{% 4286 1.1 mrg % Be sure we're not beyond the end of the alphabet. 4287 1.1 mrg \ifnum\itemno=0 4288 1.1 mrg \errmessage{No more lowercase letters in @enumerate; get a bigger 4289 1.1 mrg alphabet}% 4290 1.1 mrg \fi 4291 1.1 mrg \char\lccode\itemno 4292 1.1 mrg }% 4293 1.1 mrg } 4294 1.1 mrg 4295 1.1 mrg % The starting (uppercase) letter is in \thearg. 4296 1.1 mrg \def\uppercaseenumerate{% 4297 1.1 mrg \itemno = \expandafter`\thearg 4298 1.1 mrg \startenumeration{% 4299 1.1 mrg % Be sure we're not beyond the end of the alphabet. 4300 1.1 mrg \ifnum\itemno=0 4301 1.1 mrg \errmessage{No more uppercase letters in @enumerate; get a bigger 4302 1.1 mrg alphabet} 4303 1.1 mrg \fi 4304 1.1 mrg \char\uccode\itemno 4305 1.1 mrg }% 4306 1.1 mrg } 4307 1.1 mrg 4308 1.1 mrg % Call \doitemize, adding a period to the first argument and supplying the 4309 1.1 mrg % common last two arguments. Also subtract one from the initial value in 4310 1.1 mrg % \itemno, since @item increments \itemno. 4311 1.1 mrg % 4312 1.1 mrg \def\startenumeration#1{% 4313 1.1 mrg \advance\itemno by -1 4314 1.1 mrg \doitemize{#1.}\flushcr 4315 1.1 mrg } 4316 1.1 mrg 4317 1.1 mrg 4318 1.1 mrg % @multitable macros 4319 1.1 mrg 4320 1.1 mrg % Macros used to set up halign preamble: 4321 1.1 mrg % 4322 1.1 mrg \let\endsetuptable\relax 4323 1.1 mrg \def\xendsetuptable{\endsetuptable} 4324 1.1 mrg \let\columnfractions\relax 4325 1.1 mrg \def\xcolumnfractions{\columnfractions} 4326 1.1 mrg \newif\ifsetpercent 4327 1.1 mrg 4328 1.1 mrg % #1 is the @columnfraction, usually a decimal number like .5, but might 4329 1.1 mrg % be just 1. We just use it, whatever it is. 4330 1.1 mrg % 4331 1.1 mrg \def\pickupwholefraction#1 {% 4332 1.1 mrg \global\advance\colcount by 1 4333 1.1 mrg \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}% 4334 1.1 mrg \setuptable 4335 1.1 mrg } 4336 1.1 mrg 4337 1.1 mrg \newcount\colcount 4338 1.1 mrg \def\setuptable#1{% 4339 1.1 mrg \def\firstarg{#1}% 4340 1.1 mrg \ifx\firstarg\xendsetuptable 4341 1.1 mrg \let\go = \relax 4342 1.1 mrg \else 4343 1.1 mrg \ifx\firstarg\xcolumnfractions 4344 1.1 mrg \global\setpercenttrue 4345 1.1 mrg \else 4346 1.1 mrg \ifsetpercent 4347 1.1 mrg \let\go\pickupwholefraction 4348 1.1 mrg \else 4349 1.1 mrg \global\advance\colcount by 1 4350 1.1 mrg \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a 4351 1.1 mrg % separator; typically that is always in the input, anyway. 4352 1.1 mrg \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% 4353 1.1 mrg \fi 4354 1.1 mrg \fi 4355 1.1 mrg \ifx\go\pickupwholefraction 4356 1.1 mrg % Put the argument back for the \pickupwholefraction call, so 4357 1.1 mrg % we'll always have a period there to be parsed. 4358 1.1 mrg \def\go{\pickupwholefraction#1}% 4359 1.1 mrg \else 4360 1.1 mrg \let\go = \setuptable 4361 1.1 mrg \fi% 4362 1.1 mrg \fi 4363 1.1 mrg \go 4364 1.1 mrg } 4365 1.1.1.3 mrg 4366 1.1.1.3 mrg % @headitem starts a heading row, which we typeset in bold. Assignments 4367 1.1.1.3 mrg % have to be global since we are inside the implicit group of an 4368 1.1 mrg % alignment entry. \everycr below resets \everytab so we don't have to 4369 1.1 mrg % undo it ourselves. 4370 1.1 mrg \def\headitemfont{\b}% for people to use in the template row; not changeable 4371 1.1.1.5 mrg \def\headitem{% 4372 1.1.1.3 mrg \crcr % must appear first 4373 1.1 mrg \gdef\headitemcrhook{\nobreak}% attempt to avoid page break after headings 4374 1.1 mrg \global\everytab={\bf}% can't use \headitemfont since the parsing differs 4375 1.1 mrg \the\everytab % for the first item 4376 1.1 mrg }% 4377 1.1.1.3 mrg % 4378 1.1.1.3 mrg % default for tables with no headings. 4379 1.1.1.3 mrg \let\headitemcrhook=\relax 4380 1.1 mrg % 4381 1.1 mrg \def\tab{\checkenv\multitable &\the\everytab}% 4382 1.1 mrg 4383 1.1 mrg \newtoks\everytab % insert after every tab. 4384 1.1 mrg % 4385 1.1 mrg \envdef\multitable{% 4386 1.1 mrg \vskip\parskip 4387 1.1 mrg \startsavinginserts 4388 1.1 mrg % 4389 1.1 mrg % @item within a multitable starts a normal row. 4390 1.1 mrg % We use \def instead of \let so that if one of the multitable entries 4391 1.1 mrg % contains an @itemize, we don't choke on the \item (seen as \crcr aka 4392 1.1 mrg % \endtemplate) expanding \doitemize. 4393 1.1 mrg \def\item{\crcr}% 4394 1.1 mrg % 4395 1.1 mrg \tolerance=9500 4396 1.1.1.5 mrg \hbadness=9500 4397 1.1.1.5 mrg \parskip=0pt 4398 1.1 mrg \parindent=6pt 4399 1.1 mrg \overfullrule=0pt 4400 1.1 mrg \global\colcount=0 4401 1.1 mrg % 4402 1.1 mrg \everycr = {% 4403 1.1.1.3 mrg \noalign{% 4404 1.1 mrg \global\everytab={}% Reset from possible headitem. 4405 1.1.1.3 mrg \global\colcount=0 % Reset the column counter. 4406 1.1.1.3 mrg % 4407 1.1 mrg % Check for saved footnotes, etc.: 4408 1.1.1.3 mrg \checkinserts 4409 1.1.1.3 mrg % 4410 1.1.1.3 mrg % Perhaps a \nobreak, then reset: 4411 1.1.1.3 mrg \headitemcrhook 4412 1.1 mrg \global\let\headitemcrhook=\relax 4413 1.1 mrg }% 4414 1.1 mrg }% 4415 1.1 mrg % 4416 1.1 mrg \parsearg\domultitable 4417 1.1 mrg } 4418 1.1 mrg \def\domultitable#1{% 4419 1.1 mrg % To parse everything between @multitable and @item: 4420 1.1 mrg \setuptable#1 \endsetuptable 4421 1.1 mrg % 4422 1.1 mrg % This preamble sets up a generic column definition, which will 4423 1.1 mrg % be used as many times as user calls for columns. 4424 1.1 mrg % \vtop will set a single line and will also let text wrap and 4425 1.1 mrg % continue for many paragraphs if desired. 4426 1.1 mrg \halign\bgroup &% 4427 1.1.1.5 mrg \global\advance\colcount by 1 4428 1.1 mrg \strut 4429 1.1.1.5 mrg \vtop{% 4430 1.1.1.5 mrg \advance\hsize by -1\leftskip 4431 1.1 mrg % Find the correct column width 4432 1.1 mrg \hsize=\expandafter\csname col\the\colcount\endcsname 4433 1.1.1.5 mrg % 4434 1.1 mrg \advance\rightskip by -1\rightskip % Zero leaving only any stretch 4435 1.1.1.5 mrg \ifnum\colcount=1 4436 1.1 mrg \advance\hsize by\leftskip % Add indent of surrounding text 4437 1.1.1.5 mrg \else 4438 1.1.1.5 mrg % In order to keep entries from bumping into each other. 4439 1.1.1.5 mrg \leftskip=12pt 4440 1.1.1.5 mrg \ifsetpercent \else 4441 1.1.1.5 mrg % If a template has been used 4442 1.1.1.5 mrg \advance\hsize by \leftskip 4443 1.1 mrg \fi 4444 1.1.1.5 mrg \fi 4445 1.1 mrg \noindent\ignorespaces##\unskip\strut 4446 1.1 mrg }\cr 4447 1.1 mrg } 4448 1.1 mrg \def\Emultitable{% 4449 1.1 mrg \crcr 4450 1.1 mrg \egroup % end the \halign 4451 1.1 mrg \global\setpercentfalse 4452 1.1 mrg } 4453 1.1 mrg 4454 1.1 mrg 4455 1.1 mrg \message{conditionals,} 4456 1.1.1.5 mrg 4457 1.1 mrg % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotlatex, @ifnotplaintext, 4458 1.1 mrg % @ifnotxml always succeed. They currently do nothing; we don't 4459 1.1 mrg % attempt to check whether the conditionals are properly nested. But we 4460 1.1 mrg % have to remember that they are conditionals, so that @end doesn't 4461 1.1 mrg % attempt to close an environment group. 4462 1.1 mrg % 4463 1.1 mrg \def\makecond#1{% 4464 1.1 mrg \expandafter\let\csname #1\endcsname = \relax 4465 1.1 mrg \expandafter\let\csname iscond.#1\endcsname = 1 4466 1.1 mrg } 4467 1.1 mrg \makecond{iftex} 4468 1.1 mrg \makecond{ifnotdocbook} 4469 1.1 mrg \makecond{ifnothtml} 4470 1.1.1.5 mrg \makecond{ifnotinfo} 4471 1.1 mrg \makecond{ifnotlatex} 4472 1.1 mrg \makecond{ifnotplaintext} 4473 1.1 mrg \makecond{ifnotxml} 4474 1.1 mrg 4475 1.1 mrg % Ignore @ignore, @ifhtml, @ifinfo, and the like. 4476 1.1 mrg % 4477 1.1 mrg \def\direntry{\doignore{direntry}} 4478 1.1 mrg \def\documentdescription{\doignore{documentdescription}} 4479 1.1 mrg \def\docbook{\doignore{docbook}} 4480 1.1 mrg \def\html{\doignore{html}} 4481 1.1 mrg \def\ifdocbook{\doignore{ifdocbook}} 4482 1.1 mrg \def\ifhtml{\doignore{ifhtml}} 4483 1.1.1.5 mrg \def\ifinfo{\doignore{ifinfo}} 4484 1.1 mrg \def\iflatex{\doignore{iflatex}} 4485 1.1 mrg \def\ifnottex{\doignore{ifnottex}} 4486 1.1 mrg \def\ifplaintext{\doignore{ifplaintext}} 4487 1.1 mrg \def\ifxml{\doignore{ifxml}} 4488 1.1.1.5 mrg \def\ignore{\doignore{ignore}} 4489 1.1 mrg \def\latex{\doignore{latex}} 4490 1.1 mrg \def\menu{\doignore{menu}} 4491 1.1 mrg \def\xml{\doignore{xml}} 4492 1.1 mrg 4493 1.1 mrg % Ignore text until a line `@end #1', keeping track of nested conditionals. 4494 1.1 mrg % 4495 1.1 mrg % A count to remember the depth of nesting. 4496 1.1 mrg \newcount\doignorecount 4497 1.1 mrg 4498 1.1 mrg \def\doignore#1{\begingroup 4499 1.1 mrg % Scan in ``verbatim'' mode: 4500 1.1 mrg \obeylines 4501 1.1 mrg \catcode`\@ = \other 4502 1.1 mrg \catcode`\{ = \other 4503 1.1 mrg \catcode`\} = \other 4504 1.1 mrg % 4505 1.1 mrg % Make sure that spaces turn into tokens that match what \doignoretext wants. 4506 1.1 mrg \spaceisspace 4507 1.1 mrg % 4508 1.1 mrg % Count number of #1's that we've seen. 4509 1.1 mrg \doignorecount = 0 4510 1.1 mrg % 4511 1.1 mrg % Swallow text until we reach the matching `@end #1'. 4512 1.1 mrg \dodoignore{#1}% 4513 1.1 mrg } 4514 1.1 mrg 4515 1.1 mrg { \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source. 4516 1.1 mrg \obeylines % 4517 1.1 mrg % 4518 1.1 mrg \gdef\dodoignore#1{% 4519 1.1 mrg % #1 contains the command name as a string, e.g., `ifinfo'. 4520 1.1 mrg % 4521 1.1 mrg % Define a command to find the next `@end #1'. 4522 1.1 mrg \long\def\doignoretext##1^^M@end #1{% 4523 1.1 mrg \doignoretextyyy##1^^M@#1\_STOP_}% 4524 1.1 mrg % 4525 1.1 mrg % And this command to find another #1 command, at the beginning of a 4526 1.1 mrg % line. (Otherwise, we would consider a line `@c @ifset', for 4527 1.1 mrg % example, to count as an @ifset for nesting.) 4528 1.1 mrg \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}% 4529 1.1 mrg % 4530 1.1 mrg % And now expand that command. 4531 1.1 mrg \doignoretext ^^M% 4532 1.1 mrg }% 4533 1.1 mrg } 4534 1.1 mrg 4535 1.1 mrg \def\doignoreyyy#1{% 4536 1.1 mrg \def\temp{#1}% 4537 1.1 mrg \ifx\temp\empty % Nothing found. 4538 1.1 mrg \let\next\doignoretextzzz 4539 1.1 mrg \else % Found a nested condition, ... 4540 1.1 mrg \advance\doignorecount by 1 4541 1.1 mrg \let\next\doignoretextyyy % ..., look for another. 4542 1.1 mrg % If we're here, #1 ends with ^^M\ifinfo (for example). 4543 1.1 mrg \fi 4544 1.1 mrg \next #1% the token \_STOP_ is present just after this macro. 4545 1.1 mrg } 4546 1.1 mrg 4547 1.1 mrg % We have to swallow the remaining "\_STOP_". 4548 1.1 mrg % 4549 1.1 mrg \def\doignoretextzzz#1{% 4550 1.1 mrg \ifnum\doignorecount = 0 % We have just found the outermost @end. 4551 1.1 mrg \let\next\enddoignore 4552 1.1 mrg \else % Still inside a nested condition. 4553 1.1 mrg \advance\doignorecount by -1 4554 1.1 mrg \let\next\doignoretext % Look for the next @end. 4555 1.1 mrg \fi 4556 1.1 mrg \next 4557 1.1 mrg } 4558 1.1 mrg 4559 1.1 mrg % Finish off ignored text. 4560 1.1 mrg { \obeylines% 4561 1.1 mrg % Ignore anything after the last `@end #1'; this matters in verbatim 4562 1.1 mrg % environments, where otherwise the newline after an ignored conditional 4563 1.1 mrg % would result in a blank line in the output. 4564 1.1 mrg \gdef\enddoignore#1^^M{\endgroup\ignorespaces}% 4565 1.1 mrg } 4566 1.1 mrg 4567 1.1 mrg 4568 1.1 mrg % @set VAR sets the variable VAR to an empty value. 4569 1.1 mrg % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. 4570 1.1 mrg % 4571 1.1 mrg % Since we want to separate VAR from REST-OF-LINE (which might be 4572 1.1 mrg % empty), we can't just use \parsearg; we have to insert a space of our 4573 1.1 mrg % own to delimit the rest of the line, and then take it out again if we 4574 1.1 mrg % didn't need it. 4575 1.1 mrg % We rely on the fact that \parsearg sets \catcode`\ =10. 4576 1.1 mrg % 4577 1.1 mrg \parseargdef\set{\setyyy#1 \endsetyyy} 4578 1.1 mrg \def\setyyy#1 #2\endsetyyy{% 4579 1.1 mrg {% 4580 1.1 mrg \makevalueexpandable 4581 1.1 mrg \def\temp{#2}% 4582 1.1 mrg \edef\next{\gdef\makecsname{SET#1}}% 4583 1.1 mrg \ifx\temp\empty 4584 1.1 mrg \next{}% 4585 1.1 mrg \else 4586 1.1 mrg \setzzz#2\endsetzzz 4587 1.1 mrg \fi 4588 1.1 mrg }% 4589 1.1 mrg } 4590 1.1 mrg % Remove the trailing space \setxxx inserted. 4591 1.1 mrg \def\setzzz#1 \endsetzzz{\next{#1}} 4592 1.1 mrg 4593 1.1 mrg % @clear VAR clears (i.e., unsets) the variable VAR. 4594 1.1 mrg % 4595 1.1 mrg \parseargdef\clear{% 4596 1.1 mrg {% 4597 1.1 mrg \makevalueexpandable 4598 1.1 mrg \global\expandafter\let\csname SET#1\endcsname=\relax 4599 1.1 mrg }% 4600 1.1 mrg } 4601 1.1 mrg 4602 1.1 mrg % @value{foo} gets the text saved in variable foo. 4603 1.1 mrg \def\value{\begingroup\makevalueexpandable\valuexxx} 4604 1.1 mrg \def\valuexxx#1{\expandablevalue{#1}\endgroup} 4605 1.1.1.3 mrg { 4606 1.1 mrg \catcode`\-=\active \catcode`\_=\active 4607 1.1 mrg % 4608 1.1 mrg \gdef\makevalueexpandable{% 4609 1.1 mrg \let\value = \expandablevalue 4610 1.1 mrg % We don't want these characters active, ... 4611 1.1 mrg \catcode`\-=\other \catcode`\_=\other 4612 1.1 mrg % ..., but we might end up with active ones in the argument if 4613 1.1 mrg % we're called from @code, as @code{@value{foo-bar_}}, though. 4614 1.1.1.2 mrg % So \let them to their normal equivalents. 4615 1.1 mrg \let-\normaldash \let_\normalunderscore 4616 1.1 mrg } 4617 1.1 mrg } 4618 1.1 mrg 4619 1.1 mrg \def\expandablevalue#1{% 4620 1.1 mrg \expandafter\ifx\csname SET#1\endcsname\relax 4621 1.1 mrg {[No value for ``#1'']}% 4622 1.1 mrg \message{Variable `#1', used in @value, is not set.}% 4623 1.1 mrg \else 4624 1.1 mrg \csname SET#1\endcsname 4625 1.1 mrg \fi 4626 1.1 mrg } 4627 1.1.1.3 mrg 4628 1.1.1.3 mrg % Like \expandablevalue, but completely expandable (the \message in the 4629 1.1.1.3 mrg % definition above operates at the execution level of TeX). Used when 4630 1.1.1.5 mrg % writing to auxiliary files, due to the expansion that \write does. 4631 1.1.1.3 mrg % If flag is undefined, pass through an unexpanded @value command: maybe it 4632 1.1.1.3 mrg % will be set by the time it is read back in. 4633 1.1.1.3 mrg % 4634 1.1.1.3 mrg % NB flag names containing - or _ may not work here. 4635 1.1.1.3 mrg \def\dummyvalue#1{% 4636 1.1.1.4 mrg \expandafter\ifx\csname SET#1\endcsname\relax 4637 1.1.1.3 mrg \string\value{#1}% 4638 1.1.1.3 mrg \else 4639 1.1.1.3 mrg \csname SET#1\endcsname 4640 1.1.1.3 mrg \fi 4641 1.1.1.3 mrg } 4642 1.1.1.3 mrg 4643 1.1.1.3 mrg % Used for @value's in index entries to form the sort key: expand the @value 4644 1.1.1.3 mrg % if possible, otherwise sort late. 4645 1.1.1.3 mrg \def\indexnofontsvalue#1{% 4646 1.1.1.4 mrg \expandafter\ifx\csname SET#1\endcsname\relax 4647 1.1.1.3 mrg ZZZZZZZ% 4648 1.1.1.3 mrg \else 4649 1.1.1.3 mrg \csname SET#1\endcsname 4650 1.1.1.3 mrg \fi 4651 1.1.1.3 mrg } 4652 1.1 mrg 4653 1.1 mrg % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined 4654 1.1.1.5 mrg % with @set. 4655 1.1.1.3 mrg % 4656 1.1.1.3 mrg % To get the special treatment we need for `@end ifset,' we call 4657 1.1 mrg % \makecond and then redefine. 4658 1.1 mrg % 4659 1.1 mrg \makecond{ifset} 4660 1.1 mrg \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}} 4661 1.1 mrg \def\doifset#1#2{% 4662 1.1 mrg {% 4663 1.1 mrg \makevalueexpandable 4664 1.1 mrg \let\next=\empty 4665 1.1 mrg \expandafter\ifx\csname SET#2\endcsname\relax 4666 1.1 mrg #1% If not set, redefine \next. 4667 1.1 mrg \fi 4668 1.1 mrg \expandafter 4669 1.1 mrg }\next 4670 1.1 mrg } 4671 1.1 mrg \def\ifsetfail{\doignore{ifset}} 4672 1.1.1.2 mrg 4673 1.1 mrg % @ifclear VAR ... @end executes the `...' iff VAR has never been 4674 1.1 mrg % defined with @set, or has been undefined with @clear. 4675 1.1 mrg % 4676 1.1 mrg % The `\else' inside the `\doifset' parameter is a trick to reuse the 4677 1.1 mrg % above code: if the variable is not set, do nothing, if it is set, 4678 1.1 mrg % then redefine \next to \ifclearfail. 4679 1.1 mrg % 4680 1.1 mrg \makecond{ifclear} 4681 1.1 mrg \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} 4682 1.1 mrg \def\ifclearfail{\doignore{ifclear}} 4683 1.1.1.2 mrg 4684 1.1.1.2 mrg % @ifcommandisdefined CMD ... @end executes the `...' if CMD (written 4685 1.1.1.2 mrg % without the @) is in fact defined. We can only feasibly check at the 4686 1.1.1.2 mrg % TeX level, so something like `mathcode' is going to considered 4687 1.1.1.5 mrg % defined even though it is not a Texinfo command. 4688 1.1.1.2 mrg % 4689 1.1.1.2 mrg \makecond{ifcommanddefined} 4690 1.1.1.2 mrg \def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}} 4691 1.1.1.2 mrg % 4692 1.1.1.2 mrg \def\doifcmddefined#1#2{{% 4693 1.1.1.2 mrg \makevalueexpandable 4694 1.1.1.2 mrg \let\next=\empty 4695 1.1.1.2 mrg \expandafter\ifx\csname #2\endcsname\relax 4696 1.1.1.2 mrg #1% If not defined, \let\next as above. 4697 1.1.1.2 mrg \fi 4698 1.1.1.2 mrg \expandafter 4699 1.1.1.2 mrg }\next 4700 1.1.1.2 mrg } 4701 1.1.1.2 mrg \def\ifcmddefinedfail{\doignore{ifcommanddefined}} 4702 1.1.1.2 mrg 4703 1.1.1.2 mrg % @ifcommandnotdefined CMD ... handled similar to @ifclear above. 4704 1.1.1.2 mrg \makecond{ifcommandnotdefined} 4705 1.1.1.2 mrg \def\ifcommandnotdefined{% 4706 1.1.1.2 mrg \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}} 4707 1.1.1.2 mrg \def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}} 4708 1.1.1.2 mrg 4709 1.1.1.2 mrg % Set the `txicommandconditionals' variable, so documents have a way to 4710 1.1.1.2 mrg % test if the @ifcommand...defined conditionals are available. 4711 1.1.1.2 mrg \set txicommandconditionals 4712 1.1 mrg 4713 1.1 mrg % @dircategory CATEGORY -- specify a category of the dir file 4714 1.1 mrg % which this file should belong to. Ignore this in TeX. 4715 1.1 mrg \let\dircategory=\comment 4716 1.1 mrg 4717 1.1 mrg % @defininfoenclose. 4718 1.1 mrg \let\definfoenclose=\comment 4719 1.1 mrg 4720 1.1 mrg 4721 1.1 mrg \message{indexing,} 4722 1.1 mrg % Index generation facilities 4723 1.1 mrg 4724 1.1 mrg % Define \newwrite to be identical to plain tex's \newwrite 4725 1.1 mrg % except not \outer, so it can be used within macros and \if's. 4726 1.1 mrg \edef\newwrite{\makecsname{ptexnewwrite}} 4727 1.1.1.3 mrg 4728 1.1.1.3 mrg % \newindex {foo} defines an index named IX. 4729 1.1.1.3 mrg % It automatically defines \IXindex such that 4730 1.1.1.3 mrg % \IXindex ...rest of line... puts an entry in the index IX. 4731 1.1.1.3 mrg % It also defines \IXindfile to be the number of the output channel for 4732 1.1 mrg % the file that accumulates this index. The file's extension is IX. 4733 1.1 mrg % The name of an index should be no more than 2 characters long 4734 1.1 mrg % for the sake of vms. 4735 1.1 mrg % 4736 1.1.1.3 mrg \def\newindex#1{% 4737 1.1 mrg \expandafter\chardef\csname#1indfile\endcsname=0 4738 1.1 mrg \expandafter\xdef\csname#1index\endcsname{% % Define @#1index 4739 1.1 mrg \noexpand\doindex{#1}} 4740 1.1 mrg } 4741 1.1 mrg 4742 1.1 mrg % @defindex foo == \newindex{foo} 4743 1.1 mrg % 4744 1.1 mrg \def\defindex{\parsearg\newindex} 4745 1.1 mrg 4746 1.1 mrg % Define @defcodeindex, like @defindex except put all entries in @code. 4747 1.1 mrg % 4748 1.1 mrg \def\defcodeindex{\parsearg\newcodeindex} 4749 1.1 mrg % 4750 1.1.1.3 mrg \def\newcodeindex#1{% 4751 1.1 mrg \expandafter\chardef\csname#1indfile\endcsname=0 4752 1.1 mrg \expandafter\xdef\csname#1index\endcsname{% 4753 1.1 mrg \noexpand\docodeindex{#1}}% 4754 1.1 mrg } 4755 1.1.1.3 mrg 4756 1.1.1.3 mrg % The default indices: 4757 1.1.1.3 mrg \newindex{cp}% concepts, 4758 1.1.1.3 mrg \newcodeindex{fn}% functions, 4759 1.1.1.3 mrg \newcodeindex{vr}% variables, 4760 1.1.1.3 mrg \newcodeindex{tp}% types, 4761 1.1.1.3 mrg \newcodeindex{ky}% keys 4762 1.1.1.3 mrg \newcodeindex{pg}% and programs. 4763 1.1 mrg 4764 1.1 mrg 4765 1.1 mrg % @synindex foo bar makes index foo feed into index bar. 4766 1.1 mrg % Do this instead of @defindex foo if you don't want it as a separate index. 4767 1.1 mrg % 4768 1.1 mrg % @syncodeindex foo bar similar, but put all entries made for index foo 4769 1.1 mrg % inside @code. 4770 1.1 mrg % 4771 1.1 mrg \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} 4772 1.1 mrg \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} 4773 1.1 mrg 4774 1.1 mrg % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), 4775 1.1 mrg % #3 the target index (bar). 4776 1.1.1.3 mrg \def\dosynindex#1#2#3{% 4777 1.1 mrg \requireopenindexfile{#3}% 4778 1.1 mrg % redefine \fooindfile: 4779 1.1 mrg \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname 4780 1.1 mrg \expandafter\let\csname#2indfile\endcsname=\temp 4781 1.1 mrg % redefine \fooindex: 4782 1.1 mrg \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% 4783 1.1 mrg } 4784 1.1.1.3 mrg 4785 1.1 mrg % Define \doindex, the driver for all index macros. 4786 1.1.1.3 mrg % Argument #1 is generated by the calling \fooindex macro, 4787 1.1 mrg % and it is the two-letter name of the index. 4788 1.1.1.3 mrg 4789 1.1.1.3 mrg \def\doindex#1{\edef\indexname{#1}\parsearg\doindexxxx} 4790 1.1 mrg \def\doindexxxx #1{\doind{\indexname}{#1}} 4791 1.1 mrg 4792 1.1.1.3 mrg % like the previous two, but they put @code around the argument. 4793 1.1.1.5 mrg \def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx} 4794 1.1 mrg \def\docodeindexxxx #1{\docind{\indexname}{#1}} 4795 1.1.1.5 mrg 4796 1.1.1.5 mrg 4798 1.1 mrg % Used for the aux, toc and index files to prevent expansion of Texinfo 4799 1.1 mrg % commands. 4800 1.1.1.3 mrg % 4801 1.1.1.3 mrg \def\atdummies{% 4802 1.1.1.3 mrg \definedummyletter\@% 4803 1.1.1.3 mrg \definedummyletter\ % 4804 1.1.1.4 mrg \definedummyletter\{% 4805 1.1 mrg \definedummyletter\}% 4806 1.1 mrg \definedummyletter\&% 4807 1.1.1.3 mrg % 4808 1.1 mrg % Do the redefinitions. 4809 1.1 mrg \definedummies 4810 1.1 mrg \otherbackslash 4811 1.1.1.3 mrg } 4812 1.1.1.3 mrg 4813 1.1.1.3 mrg % \definedummyword defines \#1 as \string\#1\space, thus effectively 4814 1.1.1.3 mrg % preventing its expansion. This is used only for control words, 4815 1.1.1.3 mrg % not control letters, because the \space would be incorrect for 4816 1.1.1.3 mrg % control characters, but is needed to separate the control word 4817 1.1.1.3 mrg % from whatever follows. 4818 1.1.1.3 mrg % 4819 1.1.1.3 mrg % These can be used both for control words that take an argument and 4820 1.1.1.3 mrg % those that do not. If it is followed by {arg} in the input, then 4821 1.1.1.3 mrg % that will dutifully get written to the index (or wherever). 4822 1.1.1.3 mrg % 4823 1.1.1.3 mrg % For control letters, we have \definedummyletter, which omits the 4824 1.1.1.3 mrg % space. 4825 1.1.1.3 mrg % 4826 1.1.1.3 mrg \def\definedummyword #1{\def#1{\string#1\space}}% 4827 1.1.1.3 mrg \def\definedummyletter#1{\def#1{\string#1}}% 4828 1.1.1.4 mrg \let\definedummyaccent\definedummyletter 4829 1.1.1.3 mrg 4830 1.1.1.3 mrg % Called from \atdummies to prevent the expansion of commands. 4831 1.1.1.3 mrg % 4832 1.1.1.3 mrg \def\definedummies{% 4833 1.1.1.3 mrg % 4834 1.1.1.3 mrg \let\commondummyword\definedummyword 4835 1.1 mrg \let\commondummyletter\definedummyletter 4836 1.1 mrg \let\commondummyaccent\definedummyaccent 4837 1.1 mrg \commondummiesnofonts 4838 1.1 mrg % 4839 1.1 mrg \definedummyletter\_% 4840 1.1 mrg \definedummyletter\-% 4841 1.1 mrg % 4842 1.1 mrg % Non-English letters. 4843 1.1 mrg \definedummyword\AA 4844 1.1 mrg \definedummyword\AE 4845 1.1 mrg \definedummyword\DH 4846 1.1 mrg \definedummyword\L 4847 1.1 mrg \definedummyword\O 4848 1.1 mrg \definedummyword\OE 4849 1.1 mrg \definedummyword\TH 4850 1.1 mrg \definedummyword\aa 4851 1.1 mrg \definedummyword\ae 4852 1.1 mrg \definedummyword\dh 4853 1.1 mrg \definedummyword\exclamdown 4854 1.1 mrg \definedummyword\l 4855 1.1 mrg \definedummyword\o 4856 1.1 mrg \definedummyword\oe 4857 1.1 mrg \definedummyword\ordf 4858 1.1 mrg \definedummyword\ordm 4859 1.1 mrg \definedummyword\questiondown 4860 1.1 mrg \definedummyword\ss 4861 1.1 mrg \definedummyword\th 4862 1.1 mrg % 4863 1.1 mrg % Although these internal commands shouldn't show up, sometimes they do. 4864 1.1 mrg \definedummyword\bf 4865 1.1 mrg \definedummyword\gtr 4866 1.1 mrg \definedummyword\hat 4867 1.1 mrg \definedummyword\less 4868 1.1 mrg \definedummyword\sf 4869 1.1 mrg \definedummyword\sl 4870 1.1 mrg \definedummyword\tclose 4871 1.1 mrg \definedummyword\tt 4872 1.1 mrg % 4873 1.1 mrg \definedummyword\LaTeX 4874 1.1 mrg \definedummyword\TeX 4875 1.1.1.4 mrg % 4876 1.1.1.3 mrg % Assorted special characters. 4877 1.1 mrg \definedummyword\ampchar 4878 1.1.1.4 mrg \definedummyword\atchar 4879 1.1 mrg \definedummyword\arrow 4880 1.1 mrg \definedummyword\backslashchar 4881 1.1 mrg \definedummyword\bullet 4882 1.1 mrg \definedummyword\comma 4883 1.1 mrg \definedummyword\copyright 4884 1.1 mrg \definedummyword\registeredsymbol 4885 1.1 mrg \definedummyword\dots 4886 1.1 mrg \definedummyword\enddots 4887 1.1 mrg \definedummyword\entrybreak 4888 1.1 mrg \definedummyword\equiv 4889 1.1 mrg \definedummyword\error 4890 1.1 mrg \definedummyword\euro 4891 1.1 mrg \definedummyword\expansion 4892 1.1 mrg \definedummyword\geq 4893 1.1 mrg \definedummyword\guillemetleft 4894 1.1 mrg \definedummyword\guillemetright 4895 1.1.1.2 mrg \definedummyword\guilsinglleft 4896 1.1 mrg \definedummyword\guilsinglright 4897 1.1.1.3 mrg \definedummyword\lbracechar 4898 1.1 mrg \definedummyword\leq 4899 1.1 mrg \definedummyword\mathopsup 4900 1.1 mrg \definedummyword\minus 4901 1.1 mrg \definedummyword\ogonek 4902 1.1 mrg \definedummyword\pounds 4903 1.1 mrg \definedummyword\point 4904 1.1 mrg \definedummyword\print 4905 1.1 mrg \definedummyword\quotedblbase 4906 1.1 mrg \definedummyword\quotedblleft 4907 1.1 mrg \definedummyword\quotedblright 4908 1.1 mrg \definedummyword\quoteleft 4909 1.1.1.2 mrg \definedummyword\quoteright 4910 1.1 mrg \definedummyword\quotesinglbase 4911 1.1.1.3 mrg \definedummyword\rbracechar 4912 1.1.1.3 mrg \definedummyword\result 4913 1.1 mrg \definedummyword\sub 4914 1.1 mrg \definedummyword\sup 4915 1.1.1.4 mrg \definedummyword\textdegree 4916 1.1.1.4 mrg % 4917 1.1 mrg \definedummyword\subentry 4918 1.1 mrg % 4919 1.1.1.3 mrg % We want to disable all macros so that they are not expanded by \write. 4920 1.1 mrg \macrolist 4921 1.1 mrg \let\value\dummyvalue 4922 1.1 mrg % 4923 1.1 mrg \normalturnoffactive 4924 1.1.1.3 mrg } 4925 1.1.1.3 mrg 4926 1.1.1.3 mrg % \commondummiesnofonts: common to \definedummies and \indexnofonts. 4927 1.1 mrg % Define \commondummyletter, \commondummyaccent and \commondummyword before 4928 1.1 mrg % using. Used for accents, font commands, and various control letters. 4929 1.1 mrg % 4930 1.1.1.3 mrg \def\commondummiesnofonts{% 4931 1.1.1.3 mrg % Control letters and accents. 4932 1.1.1.3 mrg \commondummyletter\!% 4933 1.1.1.3 mrg \commondummyaccent\"% 4934 1.1.1.3 mrg \commondummyaccent\'% 4935 1.1.1.3 mrg \commondummyletter\*% 4936 1.1.1.3 mrg \commondummyaccent\,% 4937 1.1.1.3 mrg \commondummyletter\.% 4938 1.1.1.3 mrg \commondummyletter\/% 4939 1.1.1.3 mrg \commondummyletter\:% 4940 1.1.1.3 mrg \commondummyaccent\=% 4941 1.1.1.3 mrg \commondummyletter\?% 4942 1.1.1.3 mrg \commondummyaccent\^% 4943 1.1.1.3 mrg \commondummyaccent\`% 4944 1.1.1.3 mrg \commondummyaccent\~% 4945 1.1.1.3 mrg \commondummyword\u 4946 1.1.1.3 mrg \commondummyword\v 4947 1.1.1.3 mrg \commondummyword\H 4948 1.1.1.3 mrg \commondummyword\dotaccent 4949 1.1.1.3 mrg \commondummyword\ogonek 4950 1.1.1.3 mrg \commondummyword\ringaccent 4951 1.1.1.3 mrg \commondummyword\tieaccent 4952 1.1.1.3 mrg \commondummyword\ubaraccent 4953 1.1 mrg \commondummyword\udotaccent 4954 1.1 mrg \commondummyword\dotless 4955 1.1.1.3 mrg % 4956 1.1.1.3 mrg % Texinfo font commands. 4957 1.1.1.3 mrg \commondummyword\b 4958 1.1.1.3 mrg \commondummyword\i 4959 1.1.1.3 mrg \commondummyword\r 4960 1.1.1.3 mrg \commondummyword\sansserif 4961 1.1.1.3 mrg \commondummyword\sc 4962 1.1 mrg \commondummyword\slanted 4963 1.1 mrg \commondummyword\t 4964 1.1.1.3 mrg % 4965 1.1.1.3 mrg % Commands that take arguments. 4966 1.1.1.3 mrg \commondummyword\abbr 4967 1.1.1.3 mrg \commondummyword\acronym 4968 1.1.1.3 mrg \commondummyword\anchor 4969 1.1.1.3 mrg \commondummyword\cite 4970 1.1.1.3 mrg \commondummyword\code 4971 1.1.1.3 mrg \commondummyword\command 4972 1.1.1.3 mrg \commondummyword\dfn 4973 1.1.1.3 mrg \commondummyword\dmn 4974 1.1.1.3 mrg \commondummyword\email 4975 1.1.1.3 mrg \commondummyword\emph 4976 1.1.1.3 mrg \commondummyword\env 4977 1.1.1.3 mrg \commondummyword\file 4978 1.1.1.3 mrg \commondummyword\image 4979 1.1.1.3 mrg \commondummyword\indicateurl 4980 1.1.1.3 mrg \commondummyword\inforef 4981 1.1.1.3 mrg \commondummyword\kbd 4982 1.1.1.3 mrg \commondummyword\key 4983 1.1.1.3 mrg \commondummyword\math 4984 1.1.1.3 mrg \commondummyword\option 4985 1.1.1.3 mrg \commondummyword\pxref 4986 1.1.1.3 mrg \commondummyword\ref 4987 1.1.1.3 mrg \commondummyword\samp 4988 1.1.1.3 mrg \commondummyword\strong 4989 1.1.1.3 mrg \commondummyword\tie 4990 1.1.1.3 mrg \commondummyword\U 4991 1.1.1.3 mrg \commondummyword\uref 4992 1.1.1.3 mrg \commondummyword\url 4993 1.1.1.3 mrg \commondummyword\var 4994 1.1.1.3 mrg \commondummyword\verb 4995 1.1.1.3 mrg \commondummyword\w 4996 1.1.1.3 mrg \commondummyword\xref 4997 1.1.1.3 mrg } 4998 1.1.1.3 mrg 4999 1.1.1.4 mrg \let\indexlbrace\relax 5000 1.1.1.4 mrg \let\indexrbrace\relax 5001 1.1.1.3 mrg \let\indexatchar\relax 5002 1.1.1.3 mrg \let\indexbackslash\relax 5003 1.1.1.3 mrg 5004 1.1.1.3 mrg {\catcode`\@=0 5005 1.1.1.3 mrg \catcode`\\=13 5006 1.1.1.3 mrg @gdef@backslashdisappear{@def\{}} 5007 1.1.1.3 mrg } 5008 1.1.1.3 mrg 5009 1.1.1.3 mrg { 5010 1.1.1.3 mrg \catcode`\<=13 5011 1.1.1.3 mrg \catcode`\-=13 5012 1.1.1.5 mrg \catcode`\`=13 5013 1.1.1.3 mrg \gdef\indexnonalnumdisappear{% 5014 1.1.1.3 mrg \ifflagclear{txiindexlquoteignore}{}{% 5015 1.1.1.3 mrg % @set txiindexlquoteignore makes us ignore left quotes in the sort term. 5016 1.1.1.5 mrg % (Introduced for FSFS 2nd ed.) 5017 1.1.1.3 mrg \let`=\empty 5018 1.1.1.5 mrg }% 5019 1.1.1.3 mrg % 5020 1.1.1.5 mrg \ifflagclear{txiindexbackslashignore}{}{% 5021 1.1.1.5 mrg \backslashdisappear 5022 1.1.1.3 mrg }% 5023 1.1.1.5 mrg \ifflagclear{txiindexhyphenignore}{}{% 5024 1.1.1.5 mrg \def-{}% 5025 1.1.1.3 mrg }% 5026 1.1.1.5 mrg \ifflagclear{txiindexlessthanignore}{}{% 5027 1.1.1.5 mrg \def<{}% 5028 1.1.1.3 mrg }% 5029 1.1.1.5 mrg \ifflagclear{txiindexatsignignore}{}{% 5030 1.1.1.3 mrg \def\@{}% 5031 1.1.1.3 mrg }% 5032 1.1.1.3 mrg } 5033 1.1.1.3 mrg 5034 1.1.1.3 mrg \gdef\indexnonalnumreappear{% 5035 1.1.1.3 mrg \let-\normaldash 5036 1.1 mrg \let<\normalless 5037 1.1 mrg } 5038 1.1.1.3 mrg } 5039 1.1 mrg 5040 1.1 mrg 5041 1.1 mrg % \indexnofonts is used when outputting the strings to sort the index 5042 1.1 mrg % by, and when constructing control sequence names. It eliminates all 5043 1.1 mrg % control sequences and just writes whatever the best ASCII sort string 5044 1.1 mrg % would be for a given command (usually its argument). 5045 1.1 mrg % 5046 1.1.1.3 mrg \def\indexnofonts{% 5047 1.1 mrg % Accent commands should become @asis. 5048 1.1.1.3 mrg \def\commondummyaccent##1{\let##1\asis}% 5049 1.1 mrg % We can just ignore other control letters. 5050 1.1.1.3 mrg \def\commondummyletter##1{\let##1\empty}% 5051 1.1 mrg % All control words become @asis by default; overrides below. 5052 1.1 mrg \let\commondummyword\commondummyaccent 5053 1.1 mrg \commondummiesnofonts 5054 1.1 mrg % 5055 1.1 mrg % Don't no-op \tt, since it isn't a user-level command 5056 1.1 mrg % and is used in the definitions of the active chars like <, >, |, etc. 5057 1.1 mrg % Likewise with the other plain tex font commands. 5058 1.1 mrg %\let\tt=\asis 5059 1.1 mrg % 5060 1.1 mrg \def\ { }% 5061 1.1 mrg \def\@{@}% 5062 1.1 mrg \def\_{\normalunderscore}% 5063 1.1.1.3 mrg \def\-{}% @- shouldn't affect sorting 5064 1.1.1.3 mrg % 5065 1.1.1.3 mrg \uccode`\1=`\{ \uppercase{\def\{{1}}% 5066 1.1.1.3 mrg \uccode`\1=`\} \uppercase{\def\}{1}}% 5067 1.1 mrg \let\lbracechar\{% 5068 1.1 mrg \let\rbracechar\}% 5069 1.1 mrg % 5070 1.1 mrg % Non-English letters. 5071 1.1 mrg \def\AA{AA}% 5072 1.1 mrg \def\AE{AE}% 5073 1.1 mrg \def\DH{DZZ}% 5074 1.1 mrg \def\L{L}% 5075 1.1.1.3 mrg \def\OE{OE}% 5076 1.1 mrg \def\O{O}% 5077 1.1 mrg \def\TH{TH}% 5078 1.1 mrg \def\aa{aa}% 5079 1.1 mrg \def\ae{ae}% 5080 1.1 mrg \def\dh{dzz}% 5081 1.1 mrg \def\exclamdown{!}% 5082 1.1 mrg \def\l{l}% 5083 1.1 mrg \def\oe{oe}% 5084 1.1 mrg \def\ordf{a}% 5085 1.1 mrg \def\ordm{o}% 5086 1.1 mrg \def\o{o}% 5087 1.1.1.3 mrg \def\questiondown{?}% 5088 1.1 mrg \def\ss{ss}% 5089 1.1.1.5 mrg \def\th{th}% 5090 1.1 mrg % 5091 1.1.1.5 mrg \let\do\indexnofontsdef 5092 1.1.1.5 mrg % 5093 1.1.1.5 mrg \do\LaTeX{LaTeX}% 5094 1.1.1.5 mrg \do\TeX{TeX}% 5095 1.1.1.5 mrg % 5096 1.1.1.5 mrg % Assorted special characters. 5097 1.1.1.5 mrg \do\atchar{@}% 5098 1.1.1.5 mrg \do\arrow{->}% 5099 1.1.1.5 mrg \do\bullet{bullet}% 5100 1.1.1.5 mrg \do\comma{,}% 5101 1.1.1.5 mrg \do\copyright{copyright}% 5102 1.1.1.5 mrg \do\dots{...}% 5103 1.1.1.5 mrg \do\enddots{...}% 5104 1.1.1.5 mrg \do\equiv{==}% 5105 1.1.1.5 mrg \do\error{error}% 5106 1.1.1.5 mrg \do\euro{euro}% 5107 1.1.1.5 mrg \do\expansion{==>}% 5108 1.1.1.5 mrg \do\geq{>=}% 5109 1.1.1.5 mrg \do\guillemetleft{<<}% 5110 1.1.1.5 mrg \do\guillemetright{>>}% 5111 1.1.1.5 mrg \do\guilsinglleft{<}% 5112 1.1.1.5 mrg \do\guilsinglright{>}% 5113 1.1.1.5 mrg \do\leq{<=}% 5114 1.1.1.5 mrg \do\lbracechar{\{}% 5115 1.1.1.5 mrg \do\minus{-}% 5116 1.1.1.5 mrg \do\point{.}% 5117 1.1.1.5 mrg \do\pounds{pounds}% 5118 1.1.1.5 mrg \do\print{-|}% 5119 1.1.1.5 mrg \do\quotedblbase{"}% 5120 1.1.1.5 mrg \do\quotedblleft{"}% 5121 1.1.1.5 mrg \do\quotedblright{"}% 5122 1.1.1.5 mrg \do\quoteleft{`}% 5123 1.1.1.5 mrg \do\quoteright{'}% 5124 1.1.1.5 mrg \do\quotesinglbase{,}% 5125 1.1.1.5 mrg \do\rbracechar{\}}% 5126 1.1.1.5 mrg \do\registeredsymbol{R}% 5127 1.1 mrg \do\result{=>}% 5128 1.1 mrg \do\textdegree{o}% 5129 1.1 mrg % 5130 1.1 mrg % We need to get rid of all macros, leaving only the arguments (if present). 5131 1.1 mrg % Of course this is not nearly correct, but it is the best we can do for now. 5132 1.1 mrg % makeinfo does not expand macros in the argument to @deffn, which ends up 5133 1.1 mrg % writing an index entry, and texindex isn't prepared for an index sort entry 5134 1.1 mrg % that starts with \. 5135 1.1 mrg % 5136 1.1 mrg % Since macro invocations are followed by braces, we can just redefine them 5137 1.1 mrg % to take a single TeX argument. The case of a macro invocation that 5138 1.1 mrg % goes to end-of-line is not handled. 5139 1.1.1.3 mrg % 5140 1.1 mrg \macrolist 5141 1.1.1.3 mrg \let\value\indexnofontsvalue 5142 1.1.1.5 mrg } 5143 1.1.1.5 mrg 5144 1.1.1.5 mrg % Give the control sequence a definition that removes the {} that follows 5145 1.1 mrg % its use, e.g. @AA{} -> AA 5146 1.1.1.5 mrg \def\indexnofontsdef#1#2{\def#1##1{#2}}% 5147 1.1 mrg 5148 1.1 mrg 5150 1.1.1.4 mrg 5151 1.1 mrg 5152 1.1 mrg % #1 is the index name, #2 is the entry text. 5153 1.1 mrg \def\doind#1#2{% 5154 1.1.1.4 mrg \iflinks 5155 1.1 mrg {% 5156 1.1 mrg % 5157 1.1.1.4 mrg \requireopenindexfile{#1}% 5158 1.1.1.4 mrg \edef\writeto{\csname#1indfile\endcsname}% 5159 1.1 mrg % 5160 1.1 mrg \def\indextext{#2}% 5161 1.1 mrg \safewhatsit\doindwrite 5162 1.1 mrg }% 5163 1.1.1.5 mrg \fi 5164 1.1.1.5 mrg } 5165 1.1.1.5 mrg 5166 1.1.1.5 mrg % Same as \doind, but for code indices 5167 1.1.1.5 mrg \def\docind#1#2{% 5168 1.1.1.5 mrg \iflinks 5169 1.1.1.5 mrg {% 5170 1.1.1.5 mrg % 5171 1.1.1.5 mrg \requireopenindexfile{#1}% 5172 1.1.1.5 mrg \edef\writeto{\csname#1indfile\endcsname}% 5173 1.1.1.5 mrg % 5174 1.1.1.5 mrg \def\indextext{#2}% 5175 1.1.1.5 mrg \safewhatsit\docindwrite 5176 1.1.1.5 mrg }% 5177 1.1.1.3 mrg \fi 5178 1.1.1.3 mrg } 5179 1.1.1.3 mrg 5180 1.1.1.3 mrg % Check if an index file has been opened, and if not, open it. 5181 1.1.1.3 mrg \def\requireopenindexfile#1{% 5182 1.1.1.3 mrg \ifnum\csname #1indfile\endcsname=0 5183 1.1.1.3 mrg \expandafter\newwrite \csname#1indfile\endcsname 5184 1.1.1.3 mrg \edef\suffix{#1}% 5185 1.1.1.3 mrg % A .fls suffix would conflict with the file extension for the output 5186 1.1.1.3 mrg % of -recorder, so use .f1s instead. 5187 1.1.1.5 mrg \ifx\suffix\indexisfl\def\suffix{f1}\fi 5188 1.1.1.3 mrg % Open the file 5189 1.1.1.3 mrg \immediate\openout\csname#1indfile\endcsname \jobname.\suffix 5190 1.1.1.3 mrg % Using \immediate above here prevents an object entering into the current 5191 1.1.1.3 mrg % box, which could confound checks such as those in \safewhatsit for 5192 1.1.1.3 mrg % preceding skips. 5193 1.1.1.3 mrg \typeout{Writing index file \jobname.\suffix}% 5194 1.1.1.4 mrg \fi} 5195 1.1.1.3 mrg \def\indexisfl{fl} 5196 1.1.1.3 mrg 5197 1.1.1.3 mrg % Definition for writing index entry sort key. 5198 1.1.1.3 mrg { 5199 1.1.1.3 mrg \catcode`\-=13 5200 1.1.1.3 mrg \gdef\indexwritesortas{% 5201 1.1.1.3 mrg \begingroup 5202 1.1.1.3 mrg \indexnonalnumreappear 5203 1.1.1.3 mrg \indexwritesortasxxx} 5204 1.1.1.3 mrg \gdef\indexwritesortasxxx#1{% 5205 1.1.1.4 mrg \xdef\indexsortkey{#1}\endgroup} 5206 1.1.1.4 mrg } 5207 1.1.1.4 mrg 5208 1.1.1.4 mrg \def\indexwriteseealso#1{ 5209 1.1.1.4 mrg \gdef\pagenumbertext{\string\seealso{#1}}% 5210 1.1.1.4 mrg } 5211 1.1.1.4 mrg \def\indexwriteseeentry#1{ 5212 1.1.1.4 mrg \gdef\pagenumbertext{\string\seeentry{#1}}% 5213 1.1.1.4 mrg } 5214 1.1.1.4 mrg 5215 1.1.1.4 mrg % The default definitions 5216 1.1.1.4 mrg \def\sortas#1{}% 5217 1.1.1.3 mrg \def\seealso#1{\i{\putwordSeeAlso}\ #1}% for sorted index file only 5218 1.1.1.4 mrg \def\putwordSeeAlso{See also} 5219 1.1.1.4 mrg \def\seeentry#1{\i{\putwordSee}\ #1}% for sorted index file only 5220 1.1.1.4 mrg 5221 1.1.1.4 mrg 5222 1.1.1.4 mrg % Given index entry text like "aaa @subentry bbb @sortas{ZZZ}": 5223 1.1 mrg % * Set \bracedtext to "{aaa}{bbb}" 5224 1.1.1.4 mrg % * Set \fullindexsortkey to "aaa @subentry ZZZ" 5225 1.1.1.4 mrg % * If @seealso occurs, set \pagenumbertext 5226 1.1.1.4 mrg % 5227 1.1.1.4 mrg \def\splitindexentry#1{% 5228 1.1.1.4 mrg \gdef\fullindexsortkey{}% 5229 1.1.1.4 mrg \xdef\bracedtext{}% 5230 1.1.1.4 mrg \def\sep{}% 5231 1.1.1.4 mrg \def\seealso##1{}% 5232 1.1.1.4 mrg \def\seeentry##1{}% 5233 1.1.1.4 mrg \expandafter\doindexsegment#1\subentry\finish\subentry 5234 1.1.1.4 mrg } 5235 1.1.1.4 mrg 5236 1.1.1.4 mrg % append the results from the next segment 5237 1.1.1.4 mrg \def\doindexsegment#1\subentry{% 5238 1.1.1.4 mrg \def\segment{#1}% 5239 1.1.1.5 mrg \ifx\segment\isfinish 5240 1.1.1.4 mrg \else 5241 1.1.1.4 mrg % 5242 1.1.1.4 mrg % Fully expand the segment, throwing away any @sortas directives, and 5243 1.1.1.5 mrg % trim spaces. 5244 1.1.1.5 mrg \edef\trimmed{\segment}% 5245 1.1.1.5 mrg \edef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}% 5246 1.1.1.4 mrg \ifincodeindex 5247 1.1.1.4 mrg \edef\trimmed{\noexpand\code{\trimmed}}% 5248 1.1.1.4 mrg \fi 5249 1.1.1.4 mrg % 5250 1.1.1.4 mrg \xdef\bracedtext{\bracedtext{\trimmed}}% 5251 1.1.1.4 mrg % 5252 1.1.1.4 mrg % Get the string to sort by. Process the segment with all 5253 1.1.1.4 mrg % font commands turned off. 5254 1.1.1.4 mrg \bgroup 5255 1.1.1.4 mrg \let\sortas\indexwritesortas 5256 1.1.1.4 mrg \let\seealso\indexwriteseealso 5257 1.1.1.4 mrg \let\seeentry\indexwriteseeentry 5258 1.1.1.4 mrg \indexnofonts 5259 1.1.1.4 mrg % The braces around the commands are recognized by texindex. 5260 1.1.1.4 mrg \def\lbracechar{{\string\indexlbrace}}% 5261 1.1.1.4 mrg \def\rbracechar{{\string\indexrbrace}}% 5262 1.1.1.4 mrg \let\{=\lbracechar 5263 1.1.1.4 mrg \let\}=\rbracechar 5264 1.1.1.4 mrg \def\@{{\string\indexatchar}}% 5265 1.1.1.4 mrg \def\atchar##1{\@}% 5266 1.1.1.4 mrg \def\backslashchar{{\string\indexbackslash}}% 5267 1.1.1.4 mrg \uccode`\~=`\\ \uppercase{\let~\backslashchar}% 5268 1.1.1.4 mrg % 5269 1.1.1.4 mrg \let\indexsortkey\empty 5270 1.1.1.4 mrg \global\let\pagenumbertext\empty 5271 1.1.1.4 mrg % Execute the segment and throw away the typeset output. This executes 5272 1.1.1.4 mrg % any @sortas or @seealso commands in this segment. 5273 1.1.1.4 mrg \setbox\dummybox = \hbox{\segment}% 5274 1.1.1.4 mrg \ifx\indexsortkey\empty{% 5275 1.1.1.4 mrg \indexnonalnumdisappear 5276 1.1.1.5 mrg \xdef\trimmed{\segment}% 5277 1.1.1.5 mrg \xdef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}% 5278 1.1.1.5 mrg \xdef\indexsortkey{\trimmed}% 5279 1.1.1.5 mrg \ifx\indexsortkey\empty 5280 1.1.1.4 mrg \message{Empty index sort key near line \the\inputlineno}% 5281 1.1.1.4 mrg \xdef\indexsortkey{ }% 5282 1.1.1.4 mrg \fi 5283 1.1.1.4 mrg }\fi 5284 1.1.1.4 mrg % 5285 1.1.1.4 mrg % Append to \fullindexsortkey. 5286 1.1.1.4 mrg \edef\tmp{\gdef\noexpand\fullindexsortkey{% 5287 1.1.1.4 mrg \fullindexsortkey\sep\indexsortkey}}% 5288 1.1.1.4 mrg \tmp 5289 1.1.1.4 mrg \egroup 5290 1.1.1.4 mrg \def\sep{\subentry}% 5291 1.1.1.4 mrg % 5292 1.1.1.4 mrg \expandafter\doindexsegment 5293 1.1.1.4 mrg \fi 5294 1.1.1.4 mrg } 5295 1.1.1.4 mrg \def\isfinish{\finish}% 5296 1.1.1.4 mrg \newbox\dummybox % used above 5297 1.1.1.4 mrg 5298 1.1.1.4 mrg \let\subentry\relax 5299 1.1.1.4 mrg 5300 1.1.1.4 mrg % Use \ instead of @ in index files. To support old texi2dvi and texindex. 5301 1.1.1.4 mrg % This works without changing the escape character used in the toc or aux 5302 1.1.1.4 mrg % files because the index entries are fully expanded here, and \string uses 5303 1.1.1.5 mrg % the current value of \escapechar. 5304 1.1.1.5 mrg \def\escapeisbackslash{\escapechar=`\\} 5305 1.1.1.5 mrg 5306 1.1.1.5 mrg % Use \ in index files by default. texi2dvi didn't support @ as the escape 5307 1.1.1.5 mrg % character (as it checked for "\entry" in the files, and not "@entry"). When 5308 1.1.1.5 mrg % the new version of texi2dvi has had a chance to become more prevalent, then 5309 1.1.1.4 mrg % the escape character can change back to @ again. This should be an easy 5310 1.1.1.4 mrg % change to make now because both @ and \ are only used as escape characters in 5311 1.1.1.4 mrg % index files, never standing for themselves. 5312 1.1.1.4 mrg % 5313 1.1.1.4 mrg \set txiindexescapeisbackslash 5314 1.1.1.5 mrg 5315 1.1.1.5 mrg % Write the entry in \indextext to the index file. 5316 1.1.1.5 mrg % 5317 1.1.1.5 mrg 5318 1.1.1.5 mrg \newif\ifincodeindex 5319 1.1.1.5 mrg \def\doindwrite{\incodeindexfalse\doindwritex} 5320 1.1.1.4 mrg \def\docindwrite{\incodeindextrue\doindwritex} 5321 1.1.1.4 mrg 5322 1.1.1.4 mrg \def\doindwritex{% 5323 1.1.1.4 mrg \maybemarginindex 5324 1.1.1.5 mrg % 5325 1.1 mrg \atdummies 5326 1.1.1.4 mrg % 5327 1.1.1.4 mrg \ifflagclear{txiindexescapeisbackslash}{}{\escapeisbackslash}% 5328 1.1.1.4 mrg % 5329 1.1.1.4 mrg % For texindex which always views { and } as separators. 5330 1.1.1.4 mrg \def\{{\lbracechar{}}% 5331 1.1.1.5 mrg \def\}{\rbracechar{}}% 5332 1.1.1.4 mrg \uccode`\~=`\\ \uppercase{\def~{\backslashchar{}}}% 5333 1.1.1.4 mrg % 5334 1.1 mrg % Split the entry into primary entry and any subentries, and get the index 5335 1.1 mrg % sort key. 5336 1.1 mrg \splitindexentry\indextext 5337 1.1 mrg % 5338 1.1 mrg % Set up the complete index entry, with both the sort key and 5339 1.1 mrg % the original text, including any font commands. We write 5340 1.1.1.4 mrg % three arguments to \entry to the .?? file (four in the 5341 1.1 mrg % subentry case), texindex reduces to two when writing the .??s 5342 1.1 mrg % sorted result. 5343 1.1.1.4 mrg % 5344 1.1.1.4 mrg \edef\temp{% 5345 1.1.1.4 mrg \write\writeto{% 5346 1.1 mrg \string\entry{\fullindexsortkey}% 5347 1.1 mrg {\ifx\pagenumbertext\empty\noexpand\folio\else\pagenumbertext\fi}% 5348 1.1 mrg \bracedtext}% 5349 1.1.1.4 mrg }% 5350 1.1.1.4 mrg \temp 5351 1.1.1.4 mrg } 5352 1.1.1.4 mrg 5353 1.1.1.4 mrg % Put the index entry in the margin if desired (undocumented). 5354 1.1.1.4 mrg \def\maybemarginindex{% 5355 1.1.1.4 mrg \ifx\SETmarginindex\relax\else 5356 1.1.1.4 mrg \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \relax\indextext}}% 5357 1.1.1.4 mrg \fi 5358 1.1 mrg } 5359 1.1 mrg \let\SETmarginindex=\relax 5360 1.1 mrg 5361 1.1 mrg 5362 1.1 mrg % Take care of unwanted page breaks/skips around a whatsit: 5363 1.1 mrg % 5364 1.1 mrg % If a skip is the last thing on the list now, preserve it 5365 1.1 mrg % by backing up by \lastskip, doing the \write, then inserting 5366 1.1 mrg % the skip again. Otherwise, the whatsit generated by the 5367 1.1 mrg % \write or \pdfdest will make \lastskip zero. The result is that 5368 1.1 mrg % sequences like this: 5369 1.1 mrg % @end defun 5370 1.1 mrg % @tindex whatever 5371 1.1 mrg % @defun ... 5372 1.1 mrg % will have extra space inserted, because the \medbreak in the 5373 1.1 mrg % start of the @defun won't see the skip inserted by the @end of 5374 1.1 mrg % the previous defun. 5375 1.1 mrg % 5376 1.1 mrg % But don't do any of this if we're not in vertical mode. We 5377 1.1 mrg % don't want to do a \vskip and prematurely end a paragraph. 5378 1.1 mrg % 5379 1.1 mrg % Avoid page breaks due to these extra skips, too. 5380 1.1 mrg % 5381 1.1 mrg % But wait, there is a catch there: 5382 1.1 mrg % We'll have to check whether \lastskip is zero skip. \ifdim is not 5383 1.1 mrg % sufficient for this purpose, as it ignores stretch and shrink parts 5384 1.1 mrg % of the skip. The only way seems to be to check the textual 5385 1.1 mrg % representation of the skip. 5386 1.1 mrg % 5387 1.1 mrg % The following is almost like \def\zeroskipmacro{0.0pt} except that 5388 1.1 mrg % the ``p'' and ``t'' characters have catcode \other, not 11 (letter). 5389 1.1 mrg % 5390 1.1 mrg \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname} 5391 1.1 mrg % 5392 1.1 mrg \newskip\whatsitskip 5393 1.1 mrg \newcount\whatsitpenalty 5394 1.1 mrg % 5395 1.1 mrg % ..., ready, GO: 5396 1.1 mrg % 5397 1.1 mrg \def\safewhatsit#1{\ifhmode 5398 1.1 mrg #1% 5399 1.1 mrg \else 5400 1.1 mrg % \lastskip and \lastpenalty cannot both be nonzero simultaneously. 5401 1.1 mrg \whatsitskip = \lastskip 5402 1.1 mrg \edef\lastskipmacro{\the\lastskip}% 5403 1.1 mrg \whatsitpenalty = \lastpenalty 5404 1.1 mrg % 5405 1.1 mrg % If \lastskip is nonzero, that means the last item was a 5406 1.1 mrg % skip. And since a skip is discardable, that means this 5407 1.1 mrg % -\whatsitskip glue we're inserting is preceded by a 5408 1.1 mrg % non-discardable item, therefore it is not a potential 5409 1.1 mrg % breakpoint, therefore no \nobreak needed. 5410 1.1 mrg \ifx\lastskipmacro\zeroskipmacro 5411 1.1 mrg \else 5412 1.1 mrg \vskip-\whatsitskip 5413 1.1 mrg \fi 5414 1.1 mrg % 5415 1.1 mrg #1% 5416 1.1 mrg % 5417 1.1 mrg \ifx\lastskipmacro\zeroskipmacro 5418 1.1 mrg % If \lastskip was zero, perhaps the last item was a penalty, and 5419 1.1 mrg % perhaps it was >=10000, e.g., a \nobreak. In that case, we want 5420 1.1 mrg % to re-insert the same penalty (values >10000 are used for various 5421 1.1 mrg % signals); since we just inserted a non-discardable item, any 5422 1.1 mrg % following glue (such as a \parskip) would be a breakpoint. For example: 5423 1.1 mrg % @deffn deffn-whatever 5424 1.1 mrg % @vindex index-whatever 5425 1.1 mrg % Description. 5426 1.1 mrg % would allow a break between the index-whatever whatsit 5427 1.1 mrg % and the "Description." paragraph. 5428 1.1 mrg \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi 5429 1.1 mrg \else 5430 1.1 mrg % On the other hand, if we had a nonzero \lastskip, 5431 1.1 mrg % this make-up glue would be preceded by a non-discardable item 5432 1.1 mrg % (the whatsit from the \write), so we must insert a \nobreak. 5433 1.1 mrg \nobreak\vskip\whatsitskip 5434 1.1 mrg \fi 5435 1.1 mrg \fi} 5436 1.1 mrg 5437 1.1 mrg % The index entry written in the file actually looks like 5438 1.1 mrg % \entry {sortstring}{page}{topic} 5439 1.1 mrg % or 5440 1.1 mrg % \entry {sortstring}{page}{topic}{subtopic} 5441 1.1 mrg % The texindex program reads in these files and writes files 5442 1.1 mrg % containing these kinds of lines: 5443 1.1 mrg % \initial {c} 5444 1.1 mrg % before the first topic whose initial is c 5445 1.1.1.4 mrg % \entry {topic}{pagelist} 5446 1.1 mrg % for a topic that is used without subtopics 5447 1.1 mrg % \primary {topic} 5448 1.1 mrg % \entry {topic}{} 5449 1.1.1.4 mrg % for the beginning of a topic that is used with subtopics 5450 1.1.1.4 mrg % \secondary {subtopic}{pagelist} 5451 1.1.1.4 mrg % for each subtopic. 5452 1.1.1.4 mrg % \secondary {subtopic}{} 5453 1.1 mrg % for a subtopic with sub-subtopics 5454 1.1 mrg % \tertiary {subtopic}{subsubtopic}{pagelist} 5455 1.1 mrg % for each sub-subtopic. 5456 1.1 mrg 5457 1.1 mrg % Define the user-accessible indexing commands 5458 1.1 mrg % @findex, @vindex, @kindex, @cindex. 5459 1.1 mrg 5460 1.1 mrg \def\findex {\fnindex} 5461 1.1 mrg \def\kindex {\kyindex} 5462 1.1 mrg \def\cindex {\cpindex} 5463 1.1 mrg \def\vindex {\vrindex} 5464 1.1 mrg \def\tindex {\tpindex} 5465 1.1 mrg \def\pindex {\pgindex} 5466 1.1 mrg 5467 1.1 mrg % Define the macros used in formatting output of the sorted index material. 5468 1.1 mrg 5469 1.1 mrg % @printindex causes a particular index (the ??s file) to get printed. 5470 1.1 mrg % It does not print any chapter heading (usually an @unnumbered). 5471 1.1 mrg % 5472 1.1 mrg \parseargdef\printindex{\begingroup 5473 1.1 mrg \dobreak \chapheadingskip{10000}% 5474 1.1 mrg % 5475 1.1 mrg \smallfonts \rm 5476 1.1 mrg \tolerance = 9500 5477 1.1.1.3 mrg \plainfrenchspacing 5478 1.1.1.3 mrg \everypar = {}% don't want the \kern\-parindent from indentation suppression. 5479 1.1.1.4 mrg % 5480 1.1.1.4 mrg % See comment in \requireopenindexfile. 5481 1.1.1.3 mrg \def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi 5482 1.1 mrg % 5483 1.1 mrg % See if the index file exists and is nonempty. 5484 1.1 mrg \openin 1 \jobname.\indexname s 5485 1.1 mrg \ifeof 1 5486 1.1 mrg % \enddoublecolumns gets confused if there is no text in the index, 5487 1.1 mrg % and it loses the chapter title and the aux file entries for the 5488 1.1.1.3 mrg % index. The easiest way to prevent this problem is to make sure 5489 1.1 mrg % there is some text. 5490 1.1 mrg \putwordIndexNonexistent 5491 1.1 mrg \typeout{No file \jobname.\indexname s.}% 5492 1.1 mrg \else 5493 1.1.1.3 mrg % If the index file exists but is empty, then \openin leaves \ifeof 5494 1.1 mrg % false. We have to make TeX try to read something from the file, so 5495 1.1 mrg % it can discover if there is anything in it. 5496 1.1 mrg \read 1 to \thisline 5497 1.1.1.4 mrg \ifeof 1 5498 1.1 mrg \putwordIndexIsEmpty 5499 1.1 mrg \else 5500 1.1 mrg \expandafter\printindexzz\thisline\relax\relax\finish% 5501 1.1 mrg \fi 5502 1.1.1.3 mrg \fi 5503 1.1.1.4 mrg \closein 1 5504 1.1.1.4 mrg \endgroup} 5505 1.1.1.4 mrg 5506 1.1.1.4 mrg % If the index file starts with a backslash, forgo reading the index 5507 1.1.1.4 mrg % file altogether. If somebody upgrades texinfo.tex they may still have 5508 1.1.1.5 mrg % old index files using \ as the escape character. Reading this would 5509 1.1.1.4 mrg % at best lead to typesetting garbage, at worst a TeX syntax error. 5510 1.1.1.5 mrg \def\printindexzz#1#2\finish{% 5511 1.1.1.4 mrg \ifflagclear{txiindexescapeisbackslash}{% 5512 1.1.1.5 mrg \uccode`\~=`\\ \uppercase{\if\noexpand~}\noexpand#1 5513 1.1.1.4 mrg \ifflagclear{txiskipindexfileswithbackslash}{% 5514 1.1.1.4 mrg \errmessage{% 5515 1.1.1.5 mrg ERROR: A sorted index file in an obsolete format was skipped. 5516 1.1.1.4 mrg To fix this problem, please upgrade your version of 'texi2dvi' 5517 1.1.1.4 mrg or 'texi2pdf' to that at <https://ftp.gnu.org/gnu/texinfo>. 5518 1.1.1.4 mrg If you are using an old version of 'texindex' (part of the Texinfo 5519 1.1.1.5 mrg distribution), you may also need to upgrade to a newer version (at least 6.0). 5520 1.1.1.4 mrg You may be able to typeset the index if you run 5521 1.1.1.5 mrg 'texindex \jobname.\indexname' yourself. 5522 1.1.1.4 mrg You could also try setting the 'txiindexescapeisbackslash' flag by 5523 1.1.1.5 mrg running a command like 5524 1.1.1.4 mrg 'texi2dvi -t "@set txiindexescapeisbackslash" \jobname.texi'. If you do 5525 1.1.1.4 mrg this, Texinfo will try to use index files in the old format. 5526 1.1.1.5 mrg If you continue to have problems, deleting the index files and starting again 5527 1.1.1.4 mrg might help (with 'rm \jobname.?? \jobname.??s')% 5528 1.1.1.5 mrg }% 5529 1.1.1.4 mrg }{% 5530 1.1.1.4 mrg (Skipped sorted index file in obsolete format) 5531 1.1.1.4 mrg }% 5532 1.1.1.4 mrg \else 5533 1.1.1.4 mrg \begindoublecolumns 5534 1.1.1.5 mrg \input \jobname.\indexname s 5535 1.1.1.4 mrg \enddoublecolumns 5536 1.1.1.4 mrg \fi 5537 1.1.1.5 mrg }{% 5538 1.1.1.5 mrg \begindoublecolumns 5539 1.1.1.5 mrg \catcode`\\=0\relax 5540 1.1.1.5 mrg % 5541 1.1.1.5 mrg % Make @ an escape character to give macros a chance to work. This 5542 1.1.1.4 mrg % should work because we (hopefully) don't otherwise use @ in index files. 5543 1.1.1.4 mrg %\catcode`\@=12\relax 5544 1.1.1.5 mrg \catcode`\@=0\relax 5545 1.1.1.3 mrg \input \jobname.\indexname s 5546 1.1 mrg \enddoublecolumns 5547 1.1 mrg }% 5548 1.1 mrg } 5549 1.1 mrg 5550 1.1.1.3 mrg % These macros are used by the sorted index file itself. 5551 1.1.1.3 mrg % Change them to control the appearance of the index. 5552 1.1.1.3 mrg 5553 1.1.1.3 mrg {\catcode`\/=13 \catcode`\-=13 \catcode`\^=13 \catcode`\~=13 \catcode`\_=13 5554 1.1.1.4 mrg \catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13 5555 1.1.1.4 mrg \catcode`\$=3 5556 1.1.1.4 mrg \gdef\initialglyphs{% 5557 1.1.1.4 mrg % special control sequences used in the index sort key 5558 1.1.1.4 mrg \let\indexlbrace\{% 5559 1.1.1.4 mrg \let\indexrbrace\}% 5560 1.1.1.3 mrg \let\indexatchar\@% 5561 1.1.1.3 mrg \def\indexbackslash{\math{\backslash}}% 5562 1.1.1.3 mrg % 5563 1.1.1.4 mrg % Some changes for non-alphabetic characters. Using the glyphs from the 5564 1.1.1.3 mrg % math fonts looks more consistent than the typewriter font used elsewhere 5565 1.1.1.4 mrg % for these characters. 5566 1.1.1.4 mrg \uccode`\~=`\\ \uppercase{\def~{\math{\backslash}}} 5567 1.1.1.3 mrg % 5568 1.1.1.3 mrg % In case @\ is used for backslash 5569 1.1.1.3 mrg \uppercase{\let\\=~} 5570 1.1.1.3 mrg % Can't get bold backslash so don't use bold forward slash 5571 1.1.1.3 mrg \catcode`\/=13 5572 1.1.1.3 mrg \def/{{\secrmnotbold \normalslash}}% 5573 1.1.1.3 mrg \def-{{\normaldash\normaldash}}% en dash `--' 5574 1.1.1.3 mrg \def^{{\chapbf \normalcaret}}% 5575 1.1.1.3 mrg \def~{{\chapbf \normaltilde}}% 5576 1.1.1.3 mrg \def\_{% 5577 1.1.1.3 mrg \leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }% 5578 1.1.1.3 mrg \def|{$\vert$}% 5579 1.1.1.3 mrg \def<{$\less$}% 5580 1.1.1.3 mrg \def>{$\gtr$}% 5581 1.1.1.3 mrg \def+{$\normalplus$}% 5582 1.1.1.3 mrg }} 5583 1.1.1.3 mrg 5584 1.1.1.3 mrg \def\initial{% 5585 1.1.1.3 mrg \bgroup 5586 1.1.1.3 mrg \initialglyphs 5587 1.1.1.3 mrg \initialx 5588 1.1 mrg } 5589 1.1 mrg 5590 1.1 mrg \def\initialx#1{% 5591 1.1 mrg % Remove any glue we may have, we'll be inserting our own. 5592 1.1.1.3 mrg \removelastskip 5593 1.1.1.3 mrg % 5594 1.1 mrg % We like breaks before the index initials, so insert a bonus. 5595 1.1.1.3 mrg % The glue before the bonus allows a little bit of space at the 5596 1.1.1.5 mrg % bottom of a column to reduce an increase in inter-line spacing. 5597 1.1.1.3 mrg \nobreak 5598 1.1 mrg \vskip 0pt plus 5\baselineskip 5599 1.1 mrg \penalty -300 5600 1.1 mrg \vskip 0pt plus -5\baselineskip 5601 1.1 mrg % 5602 1.1 mrg % Typeset the initial. Making this add up to a whole number of 5603 1.1 mrg % baselineskips increases the chance of the dots lining up from column 5604 1.1 mrg % to column. It still won't often be perfect, because of the stretch 5605 1.1.1.3 mrg % we need before each entry, but it's better. 5606 1.1.1.3 mrg % 5607 1.1.1.3 mrg % No shrink because it confuses \balancecolumns. 5608 1.1.1.3 mrg \vskip 1.67\baselineskip plus 1\baselineskip 5609 1.1.1.3 mrg \leftline{\secfonts \kern-0.05em \secbf #1}% 5610 1.1 mrg % \secfonts is inside the argument of \leftline so that the change of 5611 1.1 mrg % \baselineskip will not affect any glue inserted before the vbox that 5612 1.1 mrg % \leftline creates. 5613 1.1.1.3 mrg % Do our best not to break after the initial. 5614 1.1.1.3 mrg \nobreak 5615 1.1.1.3 mrg \vskip .33\baselineskip plus .1\baselineskip 5616 1.1.1.3 mrg \egroup % \initialglyphs 5617 1.1.1.3 mrg } 5618 1.1 mrg 5619 1.1.1.5 mrg \newdimen\entryrightmargin 5620 1.1.1.5 mrg \entryrightmargin=0pt 5621 1.1.1.5 mrg 5622 1.1.1.5 mrg % for PDF output, whether to make the text of the entry a link to the page 5623 1.1.1.5 mrg % number. set for @contents and @shortcontents where there is only one 5624 1.1 mrg % page number. 5625 1.1 mrg \newif\iflinkentrytext 5626 1.1 mrg 5627 1.1 mrg % \entry typesets a paragraph consisting of the text (#1), dot leaders, and 5628 1.1 mrg % then page number (#2) flushed to the right margin. It is used for index 5629 1.1 mrg % and table of contents entries. The paragraph is indented by \leftskip. 5630 1.1 mrg % 5631 1.1 mrg \def\entry{% 5632 1.1 mrg \begingroup 5633 1.1 mrg % 5634 1.1 mrg % Start a new paragraph if necessary, so our assignments below can't 5635 1.1 mrg % affect previous text. 5636 1.1 mrg \par 5637 1.1 mrg % 5638 1.1 mrg % No extra space above this paragraph. 5639 1.1 mrg \parskip = 0in 5640 1.1 mrg % 5641 1.1 mrg % When reading the text of entry, convert explicit line breaks 5642 1.1.1.3 mrg % from @* into spaces. The user might give these in long section 5643 1.1 mrg % titles, for instance. 5644 1.1 mrg \def\*{\unskip\space\ignorespaces}% 5645 1.1 mrg \def\entrybreak{\hfil\break}% An undocumented command 5646 1.1 mrg % 5647 1.1 mrg % Swallow the left brace of the text (first parameter): 5648 1.1 mrg \afterassignment\doentry 5649 1.1 mrg \let\temp = 5650 1.1.1.5 mrg } 5651 1.1.1.3 mrg \def\entrybreak{\unskip\space\ignorespaces}% 5652 1.1 mrg \def\doentry{% 5653 1.1 mrg % Save the text of the entry in \boxA 5654 1.1 mrg \global\setbox\boxA=\hbox\bgroup 5655 1.1 mrg \bgroup % Instead of the swallowed brace. 5656 1.1.1.3 mrg \noindent 5657 1.1.1.3 mrg \aftergroup\finishentry 5658 1.1 mrg % And now comes the text of the entry. 5659 1.1.1.3 mrg % Not absorbing as a macro argument reduces the chance of problems 5660 1.1.1.5 mrg % with catcodes occurring. 5661 1.1.1.3 mrg } 5662 1.1.1.5 mrg {\catcode`\@=11 5663 1.1.1.3 mrg % #1 is the page number 5664 1.1.1.5 mrg \gdef\finishentry#1{% 5665 1.1.1.4 mrg \egroup % end \boxA 5666 1.1.1.5 mrg \dimen@ = \wd\boxA % Length of text of entry 5667 1.1.1.5 mrg % add any leaders and page number to \boxA. 5668 1.1.1.5 mrg \global\setbox\boxA=\hbox\bgroup 5669 1.1.1.5 mrg \ifpdforxetex 5670 1.1.1.5 mrg \iflinkentrytext 5671 1.1.1.5 mrg \pdflinkpage{#1}{\unhbox\boxA}% 5672 1.1.1.5 mrg \else 5673 1.1.1.5 mrg \unhbox\boxA 5674 1.1.1.5 mrg \fi 5675 1.1 mrg \else 5676 1.1.1.4 mrg \unhbox\boxA 5677 1.1.1.4 mrg \fi 5678 1.1.1.4 mrg % 5679 1.1.1.4 mrg % Get the width of the page numbers, and only use 5680 1.1.1.4 mrg % leaders if they are present. 5681 1.1 mrg \global\setbox\boxB = \hbox{#1}% 5682 1.1.1.4 mrg \ifdim\wd\boxB = 0pt 5683 1.1.1.4 mrg \null\nobreak\hfill\ % 5684 1.1.1.4 mrg \else 5685 1.1.1.4 mrg % 5686 1.1.1.3 mrg \null\nobreak\indexdotfill % Have leaders before the page number. 5687 1.1.1.3 mrg % 5688 1.1.1.4 mrg \ifpdforxetex 5689 1.1.1.4 mrg \pdfgettoks#1.% 5690 1.1.1.3 mrg \hskip\skip\thinshrinkable\the\toksA 5691 1.1 mrg \else 5692 1.1.1.3 mrg \hskip\skip\thinshrinkable #1% 5693 1.1.1.5 mrg \fi 5694 1.1.1.5 mrg \fi 5695 1.1.1.3 mrg \egroup % end \boxA 5696 1.1.1.4 mrg % 5697 1.1.1.4 mrg % now output 5698 1.1.1.4 mrg \ifdim\wd\boxB = 0pt 5699 1.1.1.3 mrg \noindent\unhbox\boxA\par 5700 1.1.1.3 mrg \nobreak 5701 1.1.1.3 mrg \else\bgroup 5702 1.1.1.3 mrg % We want the text of the entries to be aligned to the left, and the 5703 1.1.1.3 mrg % page numbers to be aligned to the right. 5704 1.1.1.3 mrg % 5705 1.1.1.3 mrg \parindent = 0pt 5706 1.1.1.3 mrg \advance\leftskip by 0pt plus 1fil 5707 1.1.1.3 mrg \advance\leftskip by 0pt plus -1fill 5708 1.1.1.3 mrg \rightskip = 0pt plus -1fil 5709 1.1.1.3 mrg \advance\rightskip by 0pt plus 1fill 5710 1.1.1.3 mrg % Cause last line, which could consist of page numbers on their own 5711 1.1.1.3 mrg % if the list of page numbers is long, to be aligned to the right. 5712 1.1.1.3 mrg \parfillskip=0pt plus -1fill 5713 1.1.1.3 mrg % 5714 1.1.1.3 mrg \advance\rightskip by \entryrightmargin 5715 1.1.1.3 mrg % Determine how far we can stretch into the margin. 5716 1.1.1.3 mrg % This allows, e.g., "Appendix H GNU Free Documentation License" to 5717 1.1.1.3 mrg % fit on one line in @letterpaper format. 5718 1.1.1.3 mrg \ifdim\entryrightmargin>2.1em 5719 1.1.1.3 mrg \dimen@i=2.1em 5720 1.1.1.3 mrg \else 5721 1.1.1.3 mrg \dimen@i=0em 5722 1.1.1.3 mrg \fi 5723 1.1.1.3 mrg \advance \parfillskip by 0pt minus 1\dimen@i 5724 1.1.1.3 mrg % 5725 1.1.1.3 mrg \dimen@ii = \hsize 5726 1.1.1.3 mrg \advance\dimen@ii by -1\leftskip 5727 1.1.1.3 mrg \advance\dimen@ii by -1\entryrightmargin 5728 1.1.1.5 mrg \advance\dimen@ii by 1\dimen@i 5729 1.1.1.3 mrg \ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line 5730 1.1.1.3 mrg \ifdim\dimen@ > 0.8\dimen@ii % due to long index text 5731 1.1.1.3 mrg % Try to split the text roughly evenly. \dimen@ will be the length of 5732 1.1.1.3 mrg % the first line. 5733 1.1.1.3 mrg \dimen@ = 0.7\dimen@ 5734 1.1.1.3 mrg \dimen@ii = \hsize 5735 1.1.1.3 mrg \ifnum\dimen@>\dimen@ii 5736 1.1.1.3 mrg % If the entry is too long (for example, if it needs more than 5737 1.1.1.3 mrg % two lines), use all the space in the first line. 5738 1.1.1.3 mrg \dimen@ = \dimen@ii 5739 1.1.1.3 mrg \fi 5740 1.1.1.3 mrg \advance\leftskip by 0pt plus 1fill % ragged right 5741 1.1.1.3 mrg \advance \dimen@ by 1\rightskip 5742 1.1.1.3 mrg \parshape = 2 0pt \dimen@ 0em \dimen@ii 5743 1.1.1.3 mrg % Ideally we'd add a finite glue at the end of the first line only, 5744 1.1.1.3 mrg % instead of using \parshape with explicit line lengths, but TeX 5745 1.1.1.3 mrg % doesn't seem to provide a way to do such a thing. 5746 1.1.1.3 mrg % 5747 1.1.1.3 mrg % Indent all lines but the first one. 5748 1.1.1.3 mrg \advance\leftskip by 1em 5749 1.1.1.3 mrg \advance\parindent by -1em 5750 1.1.1.3 mrg \fi\fi 5751 1.1.1.3 mrg \indent % start paragraph 5752 1.1.1.3 mrg \unhbox\boxA 5753 1.1.1.3 mrg % 5754 1.1.1.3 mrg % Do not prefer a separate line ending with a hyphen to fewer lines. 5755 1.1.1.3 mrg \finalhyphendemerits = 0 5756 1.1.1.3 mrg % 5757 1.1.1.3 mrg % Word spacing - no stretch 5758 1.1.1.3 mrg \spaceskip=\fontdimen2\font minus \fontdimen4\font 5759 1.1.1.3 mrg % 5760 1.1.1.3 mrg \linepenalty=1000 % Discourage line breaks. 5761 1.1.1.3 mrg \hyphenpenalty=5000 % Discourage hyphenation. 5762 1.1.1.3 mrg % 5763 1.1 mrg \par % format the paragraph 5764 1.1.1.3 mrg \egroup % The \vbox 5765 1.1.1.3 mrg \fi 5766 1.1.1.3 mrg \endgroup 5767 1.1.1.3 mrg }} 5768 1.1.1.3 mrg 5769 1.1 mrg \newskip\thinshrinkable 5770 1.1.1.3 mrg \skip\thinshrinkable=.15em minus .15em 5771 1.1.1.3 mrg 5772 1.1 mrg % Like plain.tex's \dotfill, except uses up at least 1 em. 5773 1.1.1.3 mrg % The filll stretch here overpowers both the fil and fill stretch to push 5774 1.1.1.3 mrg % the page number to the right. 5775 1.1 mrg \def\indexdotfill{\cleaders 5776 1.1 mrg \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1filll} 5777 1.1 mrg 5778 1.1.1.4 mrg 5779 1.1.1.4 mrg \def\primary #1{\line{#1\hfil}} 5780 1.1.1.4 mrg 5781 1.1.1.4 mrg \def\secondary{\indententry{0.5cm}} 5782 1.1.1.4 mrg \def\tertiary{\indententry{1cm}} 5783 1.1.1.4 mrg 5784 1.1.1.4 mrg \def\indententry#1#2#3{% 5785 1.1.1.4 mrg \bgroup 5786 1.1.1.4 mrg \leftskip=#1 5787 1.1 mrg \entry{#2}{#3}% 5788 1.1 mrg \egroup 5789 1.1 mrg } 5790 1.1 mrg 5791 1.1.1.3 mrg % Define two-column mode, which we use to typeset indexes. 5792 1.1 mrg % Adapted from the TeXbook, page 416, which is to say, 5793 1.1 mrg % the manmac.tex format used to print the TeXbook itself. 5794 1.1 mrg \catcode`\@=11 % private names 5795 1.1 mrg 5796 1.1 mrg \newbox\partialpage 5797 1.1.1.3 mrg \newdimen\doublecolumnhsize 5798 1.1.1.3 mrg 5799 1.1.1.3 mrg \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns 5800 1.1 mrg % If not much space left on page, start a new page. 5801 1.1 mrg \ifdim\pagetotal>0.8\vsize\vfill\eject\fi 5802 1.1.1.4 mrg % 5803 1.1 mrg % Grab any single-column material above us. 5804 1.1 mrg \output = {% 5805 1.1 mrg \savetopmark 5806 1.1 mrg % 5807 1.1 mrg \global\setbox\partialpage = \vbox{% 5808 1.1 mrg % Unvbox the main output page. 5809 1.1 mrg \unvbox\PAGE 5810 1.1 mrg \kern-\topskip \kern\baselineskip 5811 1.1 mrg }% 5812 1.1 mrg }% 5813 1.1 mrg \eject % run that output routine to set \partialpage 5814 1.1 mrg % 5815 1.1 mrg % Use the double-column output routine for subsequent pages. 5816 1.1 mrg \output = {\doublecolumnout}% 5817 1.1 mrg % 5818 1.1 mrg % Change the page size parameters. We could do this once outside this 5819 1.1 mrg % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 5820 1.1 mrg % format, but then we repeat the same computation. Repeating a couple 5821 1.1 mrg % of assignments once per index is clearly meaningless for the 5822 1.1 mrg % execution time, so we may as well do it in one place. 5823 1.1 mrg % 5824 1.1 mrg % First we halve the line length, less a little for the gutter between 5825 1.1 mrg % the columns. We compute the gutter based on the line length, so it 5826 1.1 mrg % changes automatically with the paper format. The magic constant 5827 1.1 mrg % below is chosen so that the gutter has the same value (well, +-<1pt) 5828 1.1 mrg % as it did when we hard-coded it. 5829 1.1 mrg % 5830 1.1 mrg % We put the result in a separate register, \doublecolumhsize, so we 5831 1.1 mrg % can restore it in \pagesofar, after \hsize itself has (potentially) 5832 1.1 mrg % been clobbered. 5833 1.1 mrg % 5834 1.1 mrg \doublecolumnhsize = \hsize 5835 1.1 mrg \advance\doublecolumnhsize by -.04154\hsize 5836 1.1.1.4 mrg \divide\doublecolumnhsize by 2 5837 1.1.1.4 mrg \hsize = \doublecolumnhsize 5838 1.1.1.4 mrg % 5839 1.1.1.3 mrg % Get the available space for the double columns -- the normal 5840 1.1 mrg % (undoubled) page height minus any material left over from the 5841 1.1.1.3 mrg % previous page. 5842 1.1.1.3 mrg \advance\vsize by -\ht\partialpage 5843 1.1.1.3 mrg \vsize = 2\vsize 5844 1.1 mrg % 5845 1.1 mrg % For the benefit of balancing columns 5846 1.1 mrg \advance\baselineskip by 0pt plus 0.5pt 5847 1.1.1.3 mrg } 5848 1.1 mrg 5849 1.1 mrg % The double-column output routine for all double-column pages except 5850 1.1.1.3 mrg % the last, which is done by \balancecolumns. 5851 1.1.1.4 mrg % 5852 1.1 mrg \def\doublecolumnout{% 5853 1.1 mrg % 5854 1.1 mrg \savetopmark 5855 1.1 mrg \splittopskip=\topskip \splitmaxdepth=\maxdepth 5856 1.1 mrg \dimen@ = \vsize 5857 1.1.1.3 mrg \divide\dimen@ by 2 5858 1.1.1.3 mrg % 5859 1.1.1.4 mrg % box0 will be the left-hand column, box2 the right. 5860 1.1.1.3 mrg \setbox0=\vsplit\PAGE to\dimen@ \setbox2=\vsplit\PAGE to\dimen@ 5861 1.1 mrg \global\advance\vsize by 2\ht\partialpage 5862 1.1 mrg \onepageout\pagesofar % empty except for the first time we are called 5863 1.1 mrg \unvbox\PAGE 5864 1.1 mrg \penalty\outputpenalty 5865 1.1 mrg } 5866 1.1 mrg % 5867 1.1 mrg % Re-output the contents of the output page -- any previous material, 5868 1.1 mrg % followed by the two boxes we just split, in box0 and box2. 5869 1.1 mrg \def\pagesofar{% 5870 1.1 mrg \unvbox\partialpage 5871 1.1.1.3 mrg % 5872 1.1 mrg \hsize = \doublecolumnhsize 5873 1.1.1.3 mrg \wd0=\hsize \wd2=\hsize 5874 1.1.1.3 mrg \hbox to\txipagewidth{\box0\hfil\box2}% 5875 1.1.1.4 mrg } 5876 1.1 mrg 5877 1.1 mrg 5878 1.1 mrg % Finished with double columns. 5879 1.1 mrg \def\enddoublecolumns{% 5880 1.1 mrg % The following penalty ensures that the page builder is exercised 5881 1.1 mrg % _before_ we change the output routine. This is necessary in the 5882 1.1 mrg % following situation: 5883 1.1 mrg % 5884 1.1 mrg % The last section of the index consists only of a single entry. 5885 1.1 mrg % Before this section, \pagetotal is less than \pagegoal, so no 5886 1.1 mrg % break occurs before the last section starts. However, the last 5887 1.1 mrg % section, consisting of \initial and the single \entry, does not 5888 1.1 mrg % fit on the page and has to be broken off. Without the following 5889 1.1 mrg % penalty the page builder will not be exercised until \eject 5890 1.1 mrg % below, and by that time we'll already have changed the output 5891 1.1 mrg % routine to the \balancecolumns version, so the next-to-last 5892 1.1 mrg % double-column page will be processed with \balancecolumns, which 5893 1.1 mrg % is wrong: The two columns will go to the main vertical list, with 5894 1.1 mrg % the broken-off section in the recent contributions. As soon as 5895 1.1 mrg % the output routine finishes, TeX starts reconsidering the page 5896 1.1 mrg % break. The two columns and the broken-off section both fit on the 5897 1.1 mrg % page, because the two columns now take up only half of the page 5898 1.1.1.3 mrg % goal. When TeX sees \eject from below which follows the final 5899 1.1 mrg % section, it invokes the new output routine that we've set after 5900 1.1 mrg % \balancecolumns below; \onepageout will try to fit the two columns 5901 1.1 mrg % and the final section into the vbox of \txipageheight (see 5902 1.1 mrg % \pagebody), causing an overfull box. 5903 1.1 mrg % 5904 1.1 mrg % Note that glue won't work here, because glue does not exercise the 5905 1.1 mrg % page builder, unlike penalties (see The TeXbook, pp. 280-281). 5906 1.1.1.3 mrg \penalty0 5907 1.1.1.4 mrg % 5908 1.1 mrg \output = {% 5909 1.1.1.3 mrg % Split the last of the double-column material. 5910 1.1.1.3 mrg \savetopmark 5911 1.1.1.3 mrg \balancecolumns 5912 1.1.1.3 mrg }% 5913 1.1 mrg \eject % call the \output just set 5914 1.1.1.3 mrg \ifdim\pagetotal=0pt 5915 1.1.1.4 mrg % Having called \balancecolumns once, we do not 5916 1.1.1.3 mrg % want to call it again. Therefore, reset \output to its normal 5917 1.1.1.3 mrg % definition right away. 5918 1.1.1.3 mrg \global\output=\expandafter{\the\defaultoutput} 5919 1.1.1.3 mrg % 5920 1.1.1.3 mrg \endgroup % started in \begindoublecolumns 5921 1.1.1.3 mrg % Leave the double-column material on the current page, no automatic 5922 1.1.1.3 mrg % page break. 5923 1.1.1.3 mrg \box\balancedcolumns 5924 1.1.1.3 mrg % 5925 1.1.1.3 mrg % \pagegoal was set to the doubled \vsize above, since we restarted 5926 1.1.1.3 mrg % the current page. We're now back to normal single-column 5927 1.1.1.3 mrg % typesetting, so reset \pagegoal to the normal \vsize. 5928 1.1.1.3 mrg \global\vsize = \txipageheight % 5929 1.1.1.3 mrg \pagegoal = \txipageheight % 5930 1.1.1.3 mrg \else 5931 1.1.1.3 mrg % We had some left-over material. This might happen when \doublecolumnout 5932 1.1 mrg % is called in \balancecolumns. Try again. 5933 1.1.1.3 mrg \expandafter\enddoublecolumns 5934 1.1.1.3 mrg \fi 5935 1.1 mrg } 5936 1.1.1.5 mrg \newbox\balancedcolumns 5937 1.1.1.3 mrg \setbox\balancedcolumns=\vbox{shouldnt see this}% 5938 1.1 mrg % 5939 1.1.1.3 mrg % Only called for the last of the double column material. \doublecolumnout 5940 1.1 mrg % does the others. 5941 1.1.1.4 mrg \def\balancecolumns{% 5942 1.1.1.3 mrg \setbox0 = \vbox{\unvbox\PAGE}% like \box255 but more efficient, see p.120. 5943 1.1.1.3 mrg \dimen@ = \ht0 5944 1.1.1.3 mrg \ifdim\dimen@<7\baselineskip 5945 1.1.1.3 mrg % Don't split a short final column in two. 5946 1.1.1.4 mrg \setbox2=\vbox{}% 5947 1.1.1.4 mrg \global\setbox\balancedcolumns=\vbox{\pagesofar}% 5948 1.1.1.4 mrg \else 5949 1.1.1.3 mrg % double the leading vertical space 5950 1.1.1.3 mrg \advance\dimen@ by \topskip 5951 1.1.1.3 mrg \advance\dimen@ by-\baselineskip 5952 1.1.1.3 mrg \divide\dimen@ by 2 % target to split to 5953 1.1.1.3 mrg \dimen@ii = \dimen@ 5954 1.1.1.3 mrg \splittopskip = \topskip 5955 1.1.1.3 mrg % Loop until left column is at least as high as the right column. 5956 1.1.1.3 mrg {% 5957 1.1.1.3 mrg \vbadness = 10000 5958 1.1.1.3 mrg \loop 5959 1.1.1.3 mrg \global\setbox3 = \copy0 5960 1.1.1.3 mrg \global\setbox1 = \vsplit3 to \dimen@ 5961 1.1.1.3 mrg \ifdim\ht1<\ht3 5962 1.1.1.3 mrg \global\advance\dimen@ by 1pt 5963 1.1.1.3 mrg \repeat 5964 1.1.1.5 mrg }% 5965 1.1.1.3 mrg % Now the left column is in box 1, and the right column in box 3. 5966 1.1.1.3 mrg % 5967 1.1.1.3 mrg % Check whether the left column has come out higher than the page itself. 5968 1.1.1.3 mrg % (Note that we have doubled \vsize for the double columns, so 5969 1.1.1.3 mrg % the actual height of the page is 0.5\vsize). 5970 1.1.1.3 mrg \ifdim2\ht1>\vsize 5971 1.1.1.3 mrg % It appears that we have been called upon to balance too much material. 5972 1.1.1.3 mrg % Output some of it with \doublecolumnout, leaving the rest on the page. 5973 1.1.1.3 mrg \setbox\PAGE=\box0 5974 1.1.1.3 mrg \doublecolumnout 5975 1.1.1.3 mrg \else 5976 1.1.1.3 mrg % Compare the heights of the two columns. 5977 1.1.1.3 mrg \ifdim4\ht1>5\ht3 5978 1.1.1.3 mrg % Column heights are too different, so don't make their bottoms 5979 1.1.1.3 mrg % flush with each other. 5980 1.1.1.3 mrg \setbox2=\vbox to \ht1 {\unvbox3\vfill}% 5981 1.1.1.3 mrg \setbox0=\vbox to \ht1 {\unvbox1\vfill}% 5982 1.1.1.3 mrg \else 5983 1.1.1.3 mrg % Make column bottoms flush with each other. 5984 1.1.1.3 mrg \setbox2=\vbox to\ht1{\unvbox3\unskip}% 5985 1.1.1.3 mrg \setbox0=\vbox to\ht1{\unvbox1\unskip}% 5986 1.1.1.3 mrg \fi 5987 1.1 mrg \global\setbox\balancedcolumns=\vbox{\pagesofar}% 5988 1.1 mrg \fi 5989 1.1 mrg \fi 5990 1.1 mrg % 5991 1.1 mrg } 5992 1.1 mrg \catcode`\@ = \other 5993 1.1 mrg 5994 1.1 mrg 5995 1.1 mrg \message{sectioning,} 5996 1.1.1.5 mrg % Chapters, sections, etc. 5997 1.1 mrg 5998 1.1 mrg % Let's start with @part. 5999 1.1 mrg \parseargdef\part{\partzzz{#1}} 6000 1.1 mrg \def\partzzz#1{% 6001 1.1 mrg \chapoddpage 6002 1.1.1.3 mrg \null 6003 1.1 mrg \vskip.3\vsize % move it down on the page a bit 6004 1.1 mrg \begingroup 6005 1.1 mrg \noindent \titlefonts\rm #1\par % the text 6006 1.1.1.3 mrg \let\lastnode=\empty % no node to associate with 6007 1.1.1.3 mrg \writetocentry{part}{#1}{}% but put it in the toc 6008 1.1.1.3 mrg \headingsoff % no headline or footline on the part page 6009 1.1.1.3 mrg % This outputs a mark at the end of the page that clears \thischapter 6010 1.1 mrg % and \thissection, as is done in \startcontents. 6011 1.1 mrg \let\pchapsepmacro\relax 6012 1.1 mrg \chapmacro{}{Yomitfromtoc}{}% 6013 1.1 mrg \chapoddpage 6014 1.1 mrg \endgroup 6015 1.1 mrg } 6016 1.1 mrg 6017 1.1 mrg % \unnumberedno is an oxymoron. But we count the unnumbered 6018 1.1 mrg % sections so that we can refer to them unambiguously in the pdf 6019 1.1 mrg % outlines by their "section number". We avoid collisions with chapter 6020 1.1 mrg % numbers by starting them at 10000. (If a document ever has 10000 6021 1.1 mrg % chapters, we're in trouble anyway, I'm sure.) 6022 1.1 mrg \newcount\unnumberedno \unnumberedno = 10000 6023 1.1 mrg \newcount\chapno 6024 1.1 mrg \newcount\secno \secno=0 6025 1.1 mrg \newcount\subsecno \subsecno=0 6026 1.1 mrg \newcount\subsubsecno \subsubsecno=0 6027 1.1 mrg 6028 1.1 mrg % This counter is funny since it counts through charcodes of letters A, B, ... 6029 1.1 mrg \newcount\appendixno \appendixno = `\@ 6030 1.1 mrg % 6031 1.1 mrg % \def\appendixletter{\char\the\appendixno} 6032 1.1 mrg % We do the following ugly conditional instead of the above simple 6033 1.1 mrg % construct for the sake of pdftex, which needs the actual 6034 1.1 mrg % letter in the expansion, not just typeset. 6035 1.1 mrg % 6036 1.1 mrg \def\appendixletter{% 6037 1.1 mrg \ifnum\appendixno=`A A% 6038 1.1 mrg \else\ifnum\appendixno=`B B% 6039 1.1 mrg \else\ifnum\appendixno=`C C% 6040 1.1 mrg \else\ifnum\appendixno=`D D% 6041 1.1 mrg \else\ifnum\appendixno=`E E% 6042 1.1 mrg \else\ifnum\appendixno=`F F% 6043 1.1 mrg \else\ifnum\appendixno=`G G% 6044 1.1 mrg \else\ifnum\appendixno=`H H% 6045 1.1 mrg \else\ifnum\appendixno=`I I% 6046 1.1 mrg \else\ifnum\appendixno=`J J% 6047 1.1 mrg \else\ifnum\appendixno=`K K% 6048 1.1 mrg \else\ifnum\appendixno=`L L% 6049 1.1 mrg \else\ifnum\appendixno=`M M% 6050 1.1 mrg \else\ifnum\appendixno=`N N% 6051 1.1 mrg \else\ifnum\appendixno=`O O% 6052 1.1 mrg \else\ifnum\appendixno=`P P% 6053 1.1 mrg \else\ifnum\appendixno=`Q Q% 6054 1.1 mrg \else\ifnum\appendixno=`R R% 6055 1.1 mrg \else\ifnum\appendixno=`S S% 6056 1.1 mrg \else\ifnum\appendixno=`T T% 6057 1.1 mrg \else\ifnum\appendixno=`U U% 6058 1.1 mrg \else\ifnum\appendixno=`V V% 6059 1.1 mrg \else\ifnum\appendixno=`W W% 6060 1.1 mrg \else\ifnum\appendixno=`X X% 6061 1.1 mrg \else\ifnum\appendixno=`Y Y% 6062 1.1 mrg \else\ifnum\appendixno=`Z Z% 6063 1.1 mrg % The \the is necessary, despite appearances, because \appendixletter is 6064 1.1 mrg % expanded while writing the .toc file. \char\appendixno is not 6065 1.1 mrg % expandable, thus it is written literally, thus all appendixes come out 6066 1.1 mrg % with the same letter (or @) in the toc without it. 6067 1.1 mrg \else\char\the\appendixno 6068 1.1 mrg \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi 6069 1.1 mrg \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} 6070 1.1 mrg 6071 1.1 mrg % Each @chapter defines these (using marks) as the number+name, number 6072 1.1 mrg % and name of the chapter. Page headings and footings can use 6073 1.1 mrg % these. @section does likewise. 6074 1.1 mrg \def\thischapter{} 6075 1.1 mrg \def\thischapternum{} 6076 1.1 mrg \def\thischaptername{} 6077 1.1 mrg \def\thissection{} 6078 1.1 mrg \def\thissectionnum{} 6079 1.1 mrg \def\thissectionname{} 6080 1.1 mrg 6081 1.1 mrg \newcount\absseclevel % used to calculate proper heading level 6082 1.1 mrg \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count 6083 1.1 mrg 6084 1.1 mrg % @raisesections: treat @section as chapter, @subsection as section, etc. 6085 1.1 mrg \def\raisesections{\global\advance\secbase by -1} 6086 1.1 mrg 6087 1.1 mrg % @lowersections: treat @chapter as section, @section as subsection, etc. 6088 1.1 mrg \def\lowersections{\global\advance\secbase by 1} 6089 1.1 mrg 6090 1.1 mrg % we only have subsub. 6091 1.1 mrg \chardef\maxseclevel = 3 6092 1.1 mrg % 6093 1.1 mrg % A numbered section within an unnumbered changes to unnumbered too. 6094 1.1 mrg % To achieve this, remember the "biggest" unnum. sec. we are currently in: 6095 1.1 mrg \chardef\unnlevel = \maxseclevel 6096 1.1 mrg % 6097 1.1 mrg % Trace whether the current chapter is an appendix or not: 6098 1.1 mrg % \chapheadtype is "N" or "A", unnumbered chapters are ignored. 6099 1.1 mrg \def\chapheadtype{N} 6100 1.1 mrg 6101 1.1 mrg % Choose a heading macro 6102 1.1 mrg % #1 is heading type 6103 1.1 mrg % #2 is heading level 6104 1.1 mrg % #3 is text for heading 6105 1.1 mrg \def\genhead#1#2#3{% 6106 1.1 mrg % Compute the abs. sec. level: 6107 1.1 mrg \absseclevel=#2 6108 1.1 mrg \advance\absseclevel by \secbase 6109 1.1 mrg % Make sure \absseclevel doesn't fall outside the range: 6110 1.1 mrg \ifnum \absseclevel < 0 6111 1.1 mrg \absseclevel = 0 6112 1.1 mrg \else 6113 1.1 mrg \ifnum \absseclevel > 3 6114 1.1 mrg \absseclevel = 3 6115 1.1 mrg \fi 6116 1.1 mrg \fi 6117 1.1 mrg % The heading type: 6118 1.1 mrg \def\headtype{#1}% 6119 1.1 mrg \if \headtype U% 6120 1.1 mrg \ifnum \absseclevel < \unnlevel 6121 1.1 mrg \chardef\unnlevel = \absseclevel 6122 1.1 mrg \fi 6123 1.1 mrg \else 6124 1.1 mrg % Check for appendix sections: 6125 1.1 mrg \ifnum \absseclevel = 0 6126 1.1 mrg \edef\chapheadtype{\headtype}% 6127 1.1 mrg \else 6128 1.1 mrg \if \headtype A\if \chapheadtype N% 6129 1.1 mrg \errmessage{@appendix... within a non-appendix chapter}% 6130 1.1 mrg \fi\fi 6131 1.1 mrg \fi 6132 1.1 mrg % Check for numbered within unnumbered: 6133 1.1 mrg \ifnum \absseclevel > \unnlevel 6134 1.1 mrg \def\headtype{U}% 6135 1.1 mrg \else 6136 1.1 mrg \chardef\unnlevel = 3 6137 1.1 mrg \fi 6138 1.1 mrg \fi 6139 1.1 mrg % Now print the heading: 6140 1.1 mrg \if \headtype U% 6141 1.1 mrg \ifcase\absseclevel 6142 1.1 mrg \unnumberedzzz{#3}% 6143 1.1 mrg \or \unnumberedseczzz{#3}% 6144 1.1 mrg \or \unnumberedsubseczzz{#3}% 6145 1.1 mrg \or \unnumberedsubsubseczzz{#3}% 6146 1.1 mrg \fi 6147 1.1 mrg \else 6148 1.1 mrg \if \headtype A% 6149 1.1 mrg \ifcase\absseclevel 6150 1.1 mrg \appendixzzz{#3}% 6151 1.1 mrg \or \appendixsectionzzz{#3}% 6152 1.1 mrg \or \appendixsubseczzz{#3}% 6153 1.1 mrg \or \appendixsubsubseczzz{#3}% 6154 1.1 mrg \fi 6155 1.1 mrg \else 6156 1.1 mrg \ifcase\absseclevel 6157 1.1 mrg \chapterzzz{#3}% 6158 1.1 mrg \or \seczzz{#3}% 6159 1.1 mrg \or \numberedsubseczzz{#3}% 6160 1.1 mrg \or \numberedsubsubseczzz{#3}% 6161 1.1 mrg \fi 6162 1.1 mrg \fi 6163 1.1 mrg \fi 6164 1.1 mrg \suppressfirstparagraphindent 6165 1.1 mrg } 6166 1.1 mrg 6167 1.1 mrg % an interface: 6168 1.1 mrg \def\numhead{\genhead N} 6169 1.1 mrg \def\apphead{\genhead A} 6170 1.1 mrg \def\unnmhead{\genhead U} 6171 1.1 mrg 6172 1.1 mrg % @chapter, @appendix, @unnumbered. Increment top-level counter, reset 6173 1.1 mrg % all lower-level sectioning counters to zero. 6174 1.1 mrg % 6175 1.1 mrg % Also set \chaplevelprefix, which we prepend to @float sequence numbers 6176 1.1 mrg % (e.g., figures), q.v. By default (before any chapter), that is empty. 6177 1.1 mrg \let\chaplevelprefix = \empty 6178 1.1 mrg % 6179 1.1 mrg \outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz 6180 1.1 mrg \def\chapterzzz#1{% 6181 1.1 mrg % section resetting is \global in case the chapter is in a group, such 6182 1.1 mrg % as an @include file. 6183 1.1 mrg \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 6184 1.1 mrg \global\advance\chapno by 1 6185 1.1 mrg % 6186 1.1 mrg % Used for \float. 6187 1.1 mrg \gdef\chaplevelprefix{\the\chapno.}% 6188 1.1 mrg \resetallfloatnos 6189 1.1 mrg % 6190 1.1 mrg % \putwordChapter can contain complex things in translations. 6191 1.1 mrg \toks0=\expandafter{\putwordChapter}% 6192 1.1 mrg \message{\the\toks0 \space \the\chapno}% 6193 1.1 mrg % 6194 1.1 mrg % Write the actual heading. 6195 1.1 mrg \chapmacro{#1}{Ynumbered}{\the\chapno}% 6196 1.1 mrg % 6197 1.1 mrg % So @section and the like are numbered underneath this chapter. 6198 1.1 mrg \global\let\section = \numberedsec 6199 1.1 mrg \global\let\subsection = \numberedsubsec 6200 1.1 mrg \global\let\subsubsection = \numberedsubsubsec 6201 1.1 mrg } 6202 1.1 mrg 6203 1.1 mrg \outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz 6204 1.1 mrg % 6205 1.1 mrg \def\appendixzzz#1{% 6206 1.1 mrg \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 6207 1.1 mrg \global\advance\appendixno by 1 6208 1.1 mrg \gdef\chaplevelprefix{\appendixletter.}% 6209 1.1 mrg \resetallfloatnos 6210 1.1 mrg % 6211 1.1 mrg % \putwordAppendix can contain complex things in translations. 6212 1.1 mrg \toks0=\expandafter{\putwordAppendix}% 6213 1.1 mrg \message{\the\toks0 \space \appendixletter}% 6214 1.1 mrg % 6215 1.1 mrg \chapmacro{#1}{Yappendix}{\appendixletter}% 6216 1.1 mrg % 6217 1.1 mrg \global\let\section = \appendixsec 6218 1.1 mrg \global\let\subsection = \appendixsubsec 6219 1.1 mrg \global\let\subsubsection = \appendixsubsubsec 6220 1.1 mrg } 6221 1.1 mrg 6222 1.1 mrg % normally unnmhead0 calls unnumberedzzz: 6223 1.1 mrg \outer\parseargdef\unnumbered{\unnmhead0{#1}} 6224 1.1 mrg \def\unnumberedzzz#1{% 6225 1.1 mrg \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 6226 1.1 mrg \global\advance\unnumberedno by 1 6227 1.1 mrg % 6228 1.1 mrg % Since an unnumbered has no number, no prefix for figures. 6229 1.1 mrg \global\let\chaplevelprefix = \empty 6230 1.1 mrg \resetallfloatnos 6231 1.1 mrg % 6232 1.1 mrg % This used to be simply \message{#1}, but TeX fully expands the 6233 1.1 mrg % argument to \message. Therefore, if #1 contained @-commands, TeX 6234 1.1 mrg % expanded them. For example, in `@unnumbered The @cite{Book}', TeX 6235 1.1 mrg % expanded @cite (which turns out to cause errors because \cite is meant 6236 1.1 mrg % to be executed, not expanded). 6237 1.1 mrg % 6238 1.1 mrg % Anyway, we don't want the fully-expanded definition of @cite to appear 6239 1.1 mrg % as a result of the \message, we just want `@cite' itself. We use 6240 1.1 mrg % \the<toks register> to achieve this: TeX expands \the<toks> only once, 6241 1.1 mrg % simply yielding the contents of <toks register>. (We also do this for 6242 1.1 mrg % the toc entries.) 6243 1.1 mrg \toks0 = {#1}% 6244 1.1 mrg \message{(\the\toks0)}% 6245 1.1 mrg % 6246 1.1 mrg \chapmacro{#1}{Ynothing}{\the\unnumberedno}% 6247 1.1 mrg % 6248 1.1 mrg \global\let\section = \unnumberedsec 6249 1.1 mrg \global\let\subsection = \unnumberedsubsec 6250 1.1 mrg \global\let\subsubsection = \unnumberedsubsubsec 6251 1.1 mrg } 6252 1.1 mrg 6253 1.1 mrg % @centerchap is like @unnumbered, but the heading is centered. 6254 1.1 mrg \outer\parseargdef\centerchap{% 6255 1.1 mrg \let\centerparametersmaybe = \centerparameters 6256 1.1 mrg \unnmhead0{#1}% 6257 1.1 mrg \let\centerparametersmaybe = \relax 6258 1.1 mrg } 6259 1.1 mrg 6260 1.1 mrg % @top is like @unnumbered. 6261 1.1.1.5 mrg \let\top\unnumbered 6262 1.1 mrg 6263 1.1 mrg % Sections. 6264 1.1 mrg % 6265 1.1 mrg \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz 6266 1.1 mrg \def\seczzz#1{% 6267 1.1 mrg \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 6268 1.1 mrg \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% 6269 1.1 mrg } 6270 1.1 mrg 6271 1.1 mrg % normally calls appendixsectionzzz: 6272 1.1 mrg \outer\parseargdef\appendixsection{\apphead1{#1}} 6273 1.1 mrg \def\appendixsectionzzz#1{% 6274 1.1 mrg \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 6275 1.1 mrg \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% 6276 1.1 mrg } 6277 1.1 mrg \let\appendixsec\appendixsection 6278 1.1 mrg 6279 1.1 mrg % normally calls unnumberedseczzz: 6280 1.1 mrg \outer\parseargdef\unnumberedsec{\unnmhead1{#1}} 6281 1.1 mrg \def\unnumberedseczzz#1{% 6282 1.1 mrg \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 6283 1.1 mrg \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% 6284 1.1.1.5 mrg } 6285 1.1 mrg 6286 1.1 mrg % Subsections. 6287 1.1 mrg % 6288 1.1 mrg % normally calls numberedsubseczzz: 6289 1.1 mrg \outer\parseargdef\numberedsubsec{\numhead2{#1}} 6290 1.1 mrg \def\numberedsubseczzz#1{% 6291 1.1 mrg \global\subsubsecno=0 \global\advance\subsecno by 1 6292 1.1 mrg \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}% 6293 1.1 mrg } 6294 1.1 mrg 6295 1.1 mrg % normally calls appendixsubseczzz: 6296 1.1 mrg \outer\parseargdef\appendixsubsec{\apphead2{#1}} 6297 1.1 mrg \def\appendixsubseczzz#1{% 6298 1.1 mrg \global\subsubsecno=0 \global\advance\subsecno by 1 6299 1.1 mrg \sectionheading{#1}{subsec}{Yappendix}% 6300 1.1 mrg {\appendixletter.\the\secno.\the\subsecno}% 6301 1.1 mrg } 6302 1.1 mrg 6303 1.1 mrg % normally calls unnumberedsubseczzz: 6304 1.1 mrg \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} 6305 1.1 mrg \def\unnumberedsubseczzz#1{% 6306 1.1 mrg \global\subsubsecno=0 \global\advance\subsecno by 1 6307 1.1 mrg \sectionheading{#1}{subsec}{Ynothing}% 6308 1.1 mrg {\the\unnumberedno.\the\secno.\the\subsecno}% 6309 1.1.1.5 mrg } 6310 1.1 mrg 6311 1.1 mrg % Subsubsections. 6312 1.1 mrg % 6313 1.1 mrg % normally numberedsubsubseczzz: 6314 1.1 mrg \outer\parseargdef\numberedsubsubsec{\numhead3{#1}} 6315 1.1 mrg \def\numberedsubsubseczzz#1{% 6316 1.1 mrg \global\advance\subsubsecno by 1 6317 1.1 mrg \sectionheading{#1}{subsubsec}{Ynumbered}% 6318 1.1 mrg {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% 6319 1.1 mrg } 6320 1.1 mrg 6321 1.1 mrg % normally appendixsubsubseczzz: 6322 1.1 mrg \outer\parseargdef\appendixsubsubsec{\apphead3{#1}} 6323 1.1 mrg \def\appendixsubsubseczzz#1{% 6324 1.1 mrg \global\advance\subsubsecno by 1 6325 1.1 mrg \sectionheading{#1}{subsubsec}{Yappendix}% 6326 1.1 mrg {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}% 6327 1.1 mrg } 6328 1.1 mrg 6329 1.1 mrg % normally unnumberedsubsubseczzz: 6330 1.1 mrg \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} 6331 1.1 mrg \def\unnumberedsubsubseczzz#1{% 6332 1.1 mrg \global\advance\subsubsecno by 1 6333 1.1 mrg \sectionheading{#1}{subsubsec}{Ynothing}% 6334 1.1 mrg {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}% 6335 1.1 mrg } 6336 1.1 mrg 6337 1.1 mrg % These macros control what the section commands do, according 6338 1.1 mrg % to what kind of chapter we are in (ordinary, appendix, or unnumbered). 6339 1.1 mrg % Define them by default for a numbered chapter. 6340 1.1 mrg \let\section = \numberedsec 6341 1.1 mrg \let\subsection = \numberedsubsec 6342 1.1 mrg \let\subsubsection = \numberedsubsubsec 6343 1.1 mrg 6344 1.1 mrg % Define @majorheading, @heading and @subheading 6345 1.1 mrg 6346 1.1 mrg \def\majorheading{% 6347 1.1 mrg {\advance\chapheadingskip by 10pt \chapbreak }% 6348 1.1 mrg \parsearg\chapheadingzzz 6349 1.1 mrg } 6350 1.1.1.2 mrg 6351 1.1.1.2 mrg \def\chapheading{\chapbreak \parsearg\chapheadingzzz} 6352 1.1 mrg \def\chapheadingzzz#1{% 6353 1.1 mrg \vbox{\chapfonts \raggedtitlesettings #1\par}% 6354 1.1 mrg \nobreak\bigskip \nobreak 6355 1.1 mrg \suppressfirstparagraphindent 6356 1.1 mrg } 6357 1.1 mrg 6358 1.1 mrg % @heading, @subheading, @subsubheading. 6359 1.1 mrg \parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{} 6360 1.1 mrg \suppressfirstparagraphindent} 6361 1.1 mrg \parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{} 6362 1.1 mrg \suppressfirstparagraphindent} 6363 1.1 mrg \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{} 6364 1.1 mrg \suppressfirstparagraphindent} 6365 1.1 mrg 6366 1.1 mrg % These macros generate a chapter, section, etc. heading only 6367 1.1 mrg % (including whitespace, linebreaking, etc. around it), 6368 1.1 mrg % given all the information in convenient, parsed form. 6369 1.1 mrg 6370 1.1 mrg % Args are the skip and penalty (usually negative) 6371 1.1 mrg \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} 6372 1.1 mrg 6373 1.1 mrg % Parameter controlling skip before chapter headings (if needed) 6374 1.1 mrg \newskip\chapheadingskip 6375 1.1.1.3 mrg 6376 1.1.1.3 mrg % Define plain chapter starts, and page on/off switching for it. 6377 1.1 mrg \def\chapbreak{\dobreak \chapheadingskip {-4000}} 6378 1.1.1.3 mrg 6379 1.1.1.3 mrg % Start a new page 6380 1.1 mrg \def\chappager{\par\vfill\supereject} 6381 1.1 mrg 6382 1.1 mrg % \chapoddpage - start on an odd page for a new chapter 6383 1.1 mrg % Because \domark is called before \chapoddpage, the filler page will 6384 1.1 mrg % get the headings for the next chapter, which is wrong. But we don't 6385 1.1 mrg % care -- we just disable all headings on the filler page. 6386 1.1 mrg \def\chapoddpage{% 6387 1.1 mrg \chappager 6388 1.1 mrg \ifodd\pageno \else 6389 1.1 mrg \begingroup 6390 1.1 mrg \headingsoff 6391 1.1 mrg \null 6392 1.1 mrg \chappager 6393 1.1 mrg \endgroup 6394 1.1.1.5 mrg \fi 6395 1.1 mrg } 6396 1.1 mrg 6397 1.1 mrg \parseargdef\setchapternewpage{\csname CHAPPAG#1\endcsname\HEADINGSon} 6398 1.1 mrg 6399 1.1.1.5 mrg \def\CHAPPAGoff{% 6400 1.1 mrg \global\let\contentsalignmacro = \chappager 6401 1.1 mrg \global\let\pchapsepmacro=\chapbreak 6402 1.1 mrg \global\def\HEADINGSon{\HEADINGSsinglechapoff}} 6403 1.1 mrg 6404 1.1 mrg \def\CHAPPAGon{% 6405 1.1 mrg \global\let\contentsalignmacro = \chappager 6406 1.1 mrg \global\let\pchapsepmacro=\chappager 6407 1.1 mrg \global\def\HEADINGSon{\HEADINGSsingle}} 6408 1.1 mrg 6409 1.1 mrg \def\CHAPPAGodd{% 6410 1.1 mrg \global\let\contentsalignmacro = \chapoddpage 6411 1.1.1.5 mrg \global\let\pchapsepmacro=\chapoddpage 6412 1.1 mrg \global\def\HEADINGSon{\HEADINGSdouble}} 6413 1.1.1.3 mrg 6414 1.1 mrg \setchapternewpage on 6415 1.1 mrg 6416 1.1 mrg % \chapmacro - Chapter opening. 6417 1.1.1.3 mrg % 6418 1.1 mrg % #1 is the text, #2 is the section type (Ynumbered, Ynothing, 6419 1.1 mrg % Yappendix, Yomitfromtoc), #3 the chapter number. 6420 1.1 mrg % Not used for @heading series. 6421 1.1 mrg % 6422 1.1.1.3 mrg % To test against our argument. 6423 1.1 mrg \def\Ynothingkeyword{Ynothing} 6424 1.1.1.5 mrg \def\Yappendixkeyword{Yappendix} 6425 1.1.1.5 mrg \def\Yomitfromtockeyword{Yomitfromtoc} 6426 1.1.1.5 mrg % 6427 1.1.1.5 mrg % 6428 1.1.1.5 mrg % Definitions for @thischapter. These can be overridden in translation 6429 1.1.1.5 mrg % files. 6430 1.1.1.5 mrg \def\thischapterAppendix{% 6431 1.1.1.5 mrg \putwordAppendix{} \thischapternum: \thischaptername} 6432 1.1.1.5 mrg 6433 1.1.1.5 mrg \def\thischapterChapter{% 6434 1.1 mrg \putwordChapter{} \thischapternum: \thischaptername} 6435 1.1.1.3 mrg % 6436 1.1.1.3 mrg % 6437 1.1.1.3 mrg \def\chapmacro#1#2#3{% 6438 1.1 mrg \expandafter\ifx\thisenv\titlepage\else 6439 1.1.1.4 mrg \checkenv{}% chapters, etc., should not start inside an environment. 6440 1.1.1.4 mrg \fi 6441 1.1.1.4 mrg % Insert the first mark before the heading break (see notes for \domark). 6442 1.1 mrg \let\prevchapterdefs=\currentchapterdefs 6443 1.1 mrg \let\prevsectiondefs=\currentsectiondefs 6444 1.1 mrg \gdef\currentsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}% 6445 1.1 mrg \gdef\thissection{}}% 6446 1.1.1.4 mrg % 6447 1.1 mrg \def\temptype{#2}% 6448 1.1 mrg \ifx\temptype\Ynothingkeyword 6449 1.1.1.4 mrg \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% 6450 1.1 mrg \gdef\thischapter{\thischaptername}}% 6451 1.1 mrg \else\ifx\temptype\Yomitfromtockeyword 6452 1.1 mrg \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% 6453 1.1.1.4 mrg \gdef\thischapter{}}% 6454 1.1 mrg \else\ifx\temptype\Yappendixkeyword 6455 1.1 mrg \toks0={#1}% 6456 1.1.1.5 mrg \xdef\currentchapterdefs{% 6457 1.1 mrg \gdef\noexpand\thischaptername{\the\toks0}% 6458 1.1 mrg \gdef\noexpand\thischapternum{\appendixletter}% 6459 1.1 mrg \let\noexpand\thischapter\noexpand\thischapterAppendix 6460 1.1.1.4 mrg }% 6461 1.1 mrg \else 6462 1.1 mrg \toks0={#1}% 6463 1.1.1.5 mrg \xdef\currentchapterdefs{% 6464 1.1 mrg \gdef\noexpand\thischaptername{\the\toks0}% 6465 1.1 mrg \gdef\noexpand\thischapternum{\the\chapno}% 6466 1.1 mrg \let\noexpand\thischapter\noexpand\thischapterChapter 6467 1.1 mrg }% 6468 1.1 mrg \fi\fi\fi 6469 1.1 mrg % 6470 1.1 mrg % Output the mark. Pass it through \safewhatsit, to take care of 6471 1.1 mrg % the preceding space. 6472 1.1 mrg \safewhatsit\domark 6473 1.1 mrg % 6474 1.1 mrg % Insert the chapter heading break. 6475 1.1 mrg \pchapsepmacro 6476 1.1.1.4 mrg % 6477 1.1.1.4 mrg % Now the second mark, after the heading break. No break points 6478 1.1 mrg % between here and the heading. 6479 1.1 mrg \let\prevchapterdefs=\currentchapterdefs 6480 1.1 mrg \let\prevsectiondefs=\currentsectiondefs 6481 1.1.1.3 mrg \domark 6482 1.1.1.3 mrg % 6483 1.1 mrg {% 6484 1.1.1.4 mrg \chapfonts \rm 6485 1.1 mrg \let\footnote=\errfootnoteheading % give better error message 6486 1.1 mrg % 6487 1.1.1.4 mrg % Have to define \currentsection before calling \donoderef, because the 6488 1.1 mrg % xref code eventually uses it. On the other hand, it has to be called 6489 1.1 mrg % after \pchapsepmacro, or the headline will change too soon. 6490 1.1 mrg \gdef\currentsection{#1}% 6491 1.1 mrg % 6492 1.1 mrg % Only insert the separating space if we have a chapter/appendix 6493 1.1 mrg % number, and don't print the unnumbered ``number''. 6494 1.1 mrg \ifx\temptype\Ynothingkeyword 6495 1.1 mrg \setbox0 = \hbox{}% 6496 1.1 mrg \def\toctype{unnchap}% 6497 1.1 mrg \else\ifx\temptype\Yomitfromtockeyword 6498 1.1 mrg \setbox0 = \hbox{}% contents like unnumbered, but no toc entry 6499 1.1 mrg \def\toctype{omit}% 6500 1.1 mrg \else\ifx\temptype\Yappendixkeyword 6501 1.1 mrg \setbox0 = \hbox{\putwordAppendix{} #3\enspace}% 6502 1.1 mrg \def\toctype{app}% 6503 1.1 mrg \else 6504 1.1 mrg \setbox0 = \hbox{#3\enspace}% 6505 1.1 mrg \def\toctype{numchap}% 6506 1.1 mrg \fi\fi\fi 6507 1.1 mrg % 6508 1.1 mrg % Write the toc entry for this chapter. Must come before the 6509 1.1 mrg % \donoderef, because we include the current node name in the toc 6510 1.1 mrg % entry, and \donoderef resets it to empty. 6511 1.1 mrg \writetocentry{\toctype}{#1}{#3}% 6512 1.1 mrg % 6513 1.1 mrg % For pdftex, we have to write out the node definition (aka, make 6514 1.1 mrg % the pdfdest) after any page break, but before the actual text has 6515 1.1 mrg % been typeset. If the destination for the pdf outline is after the 6516 1.1 mrg % text, then jumping from the outline may wind up with the text not 6517 1.1 mrg % being visible, for instance under high magnification. 6518 1.1 mrg \donoderef{#2}% 6519 1.1.1.2 mrg % 6520 1.1 mrg % Typeset the actual heading. 6521 1.1 mrg \nobreak % Avoid page breaks at the interline glue. 6522 1.1 mrg \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe 6523 1.1 mrg \unhbox0 #1\par}% 6524 1.1 mrg }% 6525 1.1 mrg \nobreak\bigskip % no page break after a chapter title 6526 1.1 mrg \nobreak 6527 1.1 mrg } 6528 1.1 mrg 6529 1.1 mrg % @centerchap -- centered and unnumbered. 6530 1.1 mrg \let\centerparametersmaybe = \relax 6531 1.1 mrg \def\centerparameters{% 6532 1.1 mrg \advance\rightskip by 3\rightskip 6533 1.1 mrg \leftskip = \rightskip 6534 1.1 mrg \parfillskip = 0pt 6535 1.1 mrg } 6536 1.1 mrg 6537 1.1 mrg 6538 1.1 mrg % Section titles. These macros combine the section number parts and 6539 1.1 mrg % call the generic \sectionheading to do the printing. 6540 1.1 mrg % 6541 1.1 mrg \newskip\secheadingskip 6542 1.1 mrg \def\secheadingbreak{\dobreak \secheadingskip{-1000}} 6543 1.1 mrg 6544 1.1 mrg % Subsection titles. 6545 1.1 mrg \newskip\subsecheadingskip 6546 1.1 mrg \def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}} 6547 1.1 mrg 6548 1.1 mrg % Subsubsection titles. 6549 1.1.1.5 mrg \def\subsubsecheadingskip{\subsecheadingskip} 6550 1.1.1.5 mrg \def\subsubsecheadingbreak{\subsecheadingbreak} 6551 1.1.1.5 mrg 6552 1.1.1.5 mrg % Definition for @thissection. This can be overridden in translation 6553 1.1.1.5 mrg % files. 6554 1.1.1.5 mrg \def\thissectionDef{% 6555 1.1 mrg \putwordSection{} \thissectionnum: \thissectionname} 6556 1.1 mrg % 6557 1.1 mrg 6558 1.1.1.3 mrg 6559 1.1.1.3 mrg % Print any size, any type, section title. 6560 1.1.1.3 mrg % 6561 1.1.1.3 mrg % #1 is the text of the title, 6562 1.1 mrg % #2 is the section level (sec/subsec/subsubsec), 6563 1.1 mrg % #3 is the section type (Ynumbered, Ynothing, Yappendix, Yomitfromtoc), 6564 1.1 mrg % #4 is the section number. 6565 1.1 mrg % 6566 1.1 mrg \def\seckeyword{sec} 6567 1.1 mrg % 6568 1.1 mrg \def\sectionheading#1#2#3#4{% 6569 1.1 mrg {% 6570 1.1.1.3 mrg \def\sectionlevel{#2}% 6571 1.1.1.3 mrg \def\temptype{#3}% 6572 1.1.1.3 mrg % 6573 1.1.1.3 mrg % It is ok for the @heading series commands to appear inside an 6574 1.1.1.3 mrg % environment (it's been historically allowed, though the logic is 6575 1.1.1.3 mrg % dubious), but not the others. 6576 1.1.1.3 mrg \ifx\temptype\Yomitfromtockeyword\else 6577 1.1.1.3 mrg \checkenv{}% non-@*heading should not be in an environment. 6578 1.1.1.3 mrg \fi 6579 1.1.1.3 mrg \let\footnote=\errfootnoteheading 6580 1.1.1.3 mrg % 6581 1.1 mrg % Switch to the right set of fonts. 6582 1.1.1.4 mrg \csname #2fonts\endcsname \rm 6583 1.1 mrg % 6584 1.1 mrg % Insert first mark before the heading break (see notes for \domark). 6585 1.1.1.4 mrg \let\prevsectiondefs=\currentsectiondefs 6586 1.1 mrg \ifx\temptype\Ynothingkeyword 6587 1.1 mrg \ifx\sectionlevel\seckeyword 6588 1.1 mrg \gdef\currentsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}% 6589 1.1 mrg \gdef\thissection{\thissectionname}}% 6590 1.1 mrg \fi 6591 1.1 mrg \else\ifx\temptype\Yomitfromtockeyword 6592 1.1 mrg % Don't redefine \thissection. 6593 1.1.1.4 mrg \else\ifx\temptype\Yappendixkeyword 6594 1.1 mrg \ifx\sectionlevel\seckeyword 6595 1.1 mrg \toks0={#1}% 6596 1.1.1.5 mrg \xdef\currentsectiondefs{% 6597 1.1 mrg \gdef\noexpand\thissectionname{\the\toks0}% 6598 1.1 mrg \gdef\noexpand\thissectionnum{#4}% 6599 1.1 mrg \let\noexpand\thissection\noexpand\thissectionDef 6600 1.1 mrg }% 6601 1.1 mrg \fi 6602 1.1.1.4 mrg \else 6603 1.1 mrg \ifx\sectionlevel\seckeyword 6604 1.1 mrg \toks0={#1}% 6605 1.1.1.5 mrg \xdef\currentsectiondefs{% 6606 1.1 mrg \gdef\noexpand\thissectionname{\the\toks0}% 6607 1.1 mrg \gdef\noexpand\thissectionnum{#4}% 6608 1.1 mrg \let\noexpand\thissection\noexpand\thissectionDef 6609 1.1 mrg }% 6610 1.1 mrg \fi 6611 1.1 mrg \fi\fi\fi 6612 1.1 mrg % 6613 1.1 mrg % Go into vertical mode. Usually we'll already be there, but we 6614 1.1 mrg % don't want the following whatsit to end up in a preceding paragraph 6615 1.1 mrg % if the document didn't happen to have a blank line. 6616 1.1 mrg \par 6617 1.1 mrg % 6618 1.1 mrg % Output the mark. Pass it through \safewhatsit, to take care of 6619 1.1 mrg % the preceding space. 6620 1.1 mrg \safewhatsit\domark 6621 1.1 mrg % 6622 1.1 mrg % Insert space above the heading. 6623 1.1 mrg \csname #2headingbreak\endcsname 6624 1.1.1.4 mrg % 6625 1.1 mrg % Now the second mark, after the heading break. No break points 6626 1.1 mrg % between here and the heading. 6627 1.1 mrg \global\let\prevsectiondefs=\currentsectiondefs 6628 1.1 mrg \domark 6629 1.1 mrg % 6630 1.1 mrg % Only insert the space after the number if we have a section number. 6631 1.1.1.4 mrg \ifx\temptype\Ynothingkeyword 6632 1.1 mrg \setbox0 = \hbox{}% 6633 1.1 mrg \def\toctype{unn}% 6634 1.1.1.4 mrg \gdef\currentsection{#1}% 6635 1.1 mrg \else\ifx\temptype\Yomitfromtockeyword 6636 1.1 mrg % for @headings -- no section number, don't include in toc, 6637 1.1 mrg % and don't redefine \currentsection. 6638 1.1 mrg \setbox0 = \hbox{}% 6639 1.1 mrg \def\toctype{omit}% 6640 1.1 mrg \let\sectionlevel=\empty 6641 1.1.1.4 mrg \else\ifx\temptype\Yappendixkeyword 6642 1.1 mrg \setbox0 = \hbox{#4\enspace}% 6643 1.1 mrg \def\toctype{app}% 6644 1.1 mrg \gdef\currentsection{#1}% 6645 1.1.1.4 mrg \else 6646 1.1 mrg \setbox0 = \hbox{#4\enspace}% 6647 1.1 mrg \def\toctype{num}% 6648 1.1 mrg \gdef\currentsection{#1}% 6649 1.1 mrg \fi\fi\fi 6650 1.1 mrg % 6651 1.1 mrg % Write the toc entry (before \donoderef). See comments in \chapmacro. 6652 1.1 mrg \writetocentry{\toctype\sectionlevel}{#1}{#4}% 6653 1.1 mrg % 6654 1.1 mrg % Write the node reference (= pdf destination for pdftex). 6655 1.1 mrg % Again, see comments in \chapmacro. 6656 1.1 mrg \donoderef{#3}% 6657 1.1 mrg % 6658 1.1 mrg % Interline glue will be inserted when the vbox is completed. 6659 1.1 mrg % That glue will be a valid breakpoint for the page, since it'll be 6660 1.1 mrg % preceded by a whatsit (usually from the \donoderef, or from the 6661 1.1 mrg % \writetocentry if there was no node). We don't want to allow that 6662 1.1 mrg % break, since then the whatsits could end up on page n while the 6663 1.1 mrg % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000. 6664 1.1 mrg \nobreak 6665 1.1 mrg % 6666 1.1 mrg % Output the actual section heading. 6667 1.1 mrg \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright 6668 1.1 mrg \hangindent=\wd0 % zero if no section number 6669 1.1 mrg \unhbox0 #1}% 6670 1.1 mrg }% 6671 1.1 mrg % Add extra space after the heading -- half of whatever came above it. 6672 1.1 mrg % Don't allow stretch, though. 6673 1.1 mrg \kern .5 \csname #2headingskip\endcsname 6674 1.1 mrg % 6675 1.1 mrg % Do not let the kern be a potential breakpoint, as it would be if it 6676 1.1 mrg % was followed by glue. 6677 1.1 mrg \nobreak 6678 1.1 mrg % 6679 1.1 mrg % We'll almost certainly start a paragraph next, so don't let that 6680 1.1 mrg % glue accumulate. (Not a breakpoint because it's preceded by a 6681 1.1 mrg % discardable item.) However, when a paragraph is not started next 6682 1.1 mrg % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out 6683 1.1 mrg % or the negative glue will cause weirdly wrong output, typically 6684 1.1 mrg % obscuring the section heading with something else. 6685 1.1 mrg \vskip-\parskip 6686 1.1 mrg % 6687 1.1 mrg % This is so the last item on the main vertical list is a known 6688 1.1 mrg % \penalty > 10000, so \startdefun, etc., can recognize the situation 6689 1.1 mrg % and do the needful. 6690 1.1 mrg \penalty 10001 6691 1.1 mrg } 6692 1.1 mrg 6693 1.1 mrg 6694 1.1 mrg \message{toc,} 6695 1.1 mrg % Table of contents. 6696 1.1 mrg \newwrite\tocfile 6697 1.1 mrg 6698 1.1 mrg % Write an entry to the toc file, opening it if necessary. 6699 1.1 mrg % Called from @chapter, etc. 6700 1.1 mrg % 6701 1.1 mrg % Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno} 6702 1.1 mrg % We append the current node name (if any) and page number as additional 6703 1.1 mrg % arguments for the \{chap,sec,...}entry macros which will eventually 6704 1.1 mrg % read this. The node name is used in the pdf outlines as the 6705 1.1 mrg % destination to jump to. 6706 1.1 mrg % 6707 1.1 mrg % We open the .toc file for writing here instead of at @setfilename (or 6708 1.1 mrg % any other fixed time) so that @contents can be anywhere in the document. 6709 1.1 mrg % But if #1 is `omit', then we don't do anything. This is used for the 6710 1.1 mrg % table of contents chapter openings themselves. 6711 1.1 mrg % 6712 1.1 mrg \newif\iftocfileopened 6713 1.1 mrg \def\omitkeyword{omit}% 6714 1.1 mrg % 6715 1.1 mrg \def\writetocentry#1#2#3{% 6716 1.1 mrg \edef\writetoctype{#1}% 6717 1.1 mrg \ifx\writetoctype\omitkeyword \else 6718 1.1 mrg \iftocfileopened\else 6719 1.1 mrg \immediate\openout\tocfile = \jobname.toc 6720 1.1 mrg \global\tocfileopenedtrue 6721 1.1 mrg \fi 6722 1.1 mrg % 6723 1.1 mrg \iflinks 6724 1.1 mrg {\atdummies 6725 1.1 mrg \edef\temp{% 6726 1.1 mrg \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}% 6727 1.1 mrg \temp 6728 1.1 mrg }% 6729 1.1 mrg \fi 6730 1.1 mrg \fi 6731 1.1 mrg % 6732 1.1 mrg % Tell \shipout to create a pdf destination on each page, if we're 6733 1.1 mrg % writing pdf. These are used in the table of contents. We can't 6734 1.1 mrg % just write one on every page because the title pages are numbered 6735 1.1.1.4 mrg % 1 and 2 (the page numbers aren't printed), and so are the first 6736 1.1.1.3 mrg % two pages of the document. Thus, we'd have two destinations named 6737 1.1.1.3 mrg % `1', and two named `2'. 6738 1.1 mrg \ifpdforxetex 6739 1.1 mrg \global\pdfmakepagedesttrue 6740 1.1 mrg \fi 6741 1.1 mrg } 6742 1.1 mrg 6743 1.1 mrg 6744 1.1 mrg % These characters do not print properly in the Computer Modern roman 6745 1.1 mrg % fonts, so we must take special care. This is more or less redundant 6746 1.1 mrg % with the Texinfo input format setup at the end of this file. 6747 1.1 mrg % 6748 1.1 mrg \def\activecatcodes{% 6749 1.1 mrg \catcode`\"=\active 6750 1.1 mrg \catcode`\$=\active 6751 1.1 mrg \catcode`\<=\active 6752 1.1 mrg \catcode`\>=\active 6753 1.1 mrg \catcode`\\=\active 6754 1.1 mrg \catcode`\^=\active 6755 1.1 mrg \catcode`\_=\active 6756 1.1 mrg \catcode`\|=\active 6757 1.1 mrg \catcode`\~=\active 6758 1.1 mrg } 6759 1.1 mrg 6760 1.1 mrg 6761 1.1 mrg % Read the toc file, which is essentially Texinfo input. 6762 1.1 mrg \def\readtocfile{% 6763 1.1 mrg \setupdatafile 6764 1.1 mrg \activecatcodes 6765 1.1 mrg \input \tocreadfilename 6766 1.1 mrg } 6767 1.1 mrg 6768 1.1 mrg \newskip\contentsrightmargin \contentsrightmargin=1in 6769 1.1 mrg \newcount\savepageno 6770 1.1 mrg \newcount\lastnegativepageno \lastnegativepageno = -1 6771 1.1 mrg 6772 1.1 mrg % Prepare to read what we've written to \tocfile. 6773 1.1.1.5 mrg % 6774 1.1 mrg \def\startcontents#1{% 6775 1.1 mrg % If @setchapternewpage on, and @headings double, the contents should 6776 1.1 mrg % start on an odd page, unlike chapters. 6777 1.1 mrg \contentsalignmacro 6778 1.1 mrg \immediate\closeout\tocfile 6779 1.1 mrg % 6780 1.1 mrg % Don't need to put `Contents' or `Short Contents' in the headline. 6781 1.1 mrg % It is abundantly clear what they are. 6782 1.1 mrg \chapmacro{#1}{Yomitfromtoc}{}% 6783 1.1 mrg % 6784 1.1.1.3 mrg \savepageno = \pageno 6785 1.1 mrg \begingroup % Set up to handle contents files properly. 6786 1.1 mrg \raggedbottom % Worry more about breakpoints than the bottom. 6787 1.1 mrg \entryrightmargin=\contentsrightmargin % Don't use the full line length. 6788 1.1.1.5 mrg % 6789 1.1.1.5 mrg % Roman numerals for page numbers. 6790 1.1.1.5 mrg \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi 6791 1.1.1.5 mrg \def\thistitle{}% no title in double-sided headings 6792 1.1 mrg % Record where the Roman numerals started. 6793 1.1 mrg \ifnum\romancount=0 \global\romancount=\pagecount \fi 6794 1.1.1.5 mrg \linkentrytexttrue 6795 1.1.1.5 mrg } 6796 1.1.1.5 mrg 6797 1.1.1.5 mrg % \raggedbottom in plain.tex hardcodes \topskip so override it 6798 1.1.1.5 mrg \catcode`\@=11 6799 1.1 mrg \def\raggedbottom{\advance\topskip by 0pt plus60pt \r@ggedbottomtrue} 6800 1.1 mrg \catcode`\@=\other 6801 1.1 mrg 6802 1.1 mrg % redefined for the two-volume lispref. We always output on 6803 1.1 mrg % \jobname.toc even if this is redefined. 6804 1.1 mrg % 6805 1.1 mrg \def\tocreadfilename{\jobname.toc} 6806 1.1 mrg 6807 1.1 mrg % Normal (long) toc. 6808 1.1 mrg % 6809 1.1 mrg \def\contents{% 6810 1.1 mrg \startcontents{\putwordTOC}% 6811 1.1 mrg \openin 1 \tocreadfilename\space 6812 1.1 mrg \ifeof 1 \else 6813 1.1 mrg \readtocfile 6814 1.1 mrg \fi 6815 1.1 mrg \vfill \eject 6816 1.1 mrg \contentsalignmacro % in case @setchapternewpage odd is in effect 6817 1.1 mrg \ifeof 1 \else 6818 1.1 mrg \pdfmakeoutlines 6819 1.1.1.5 mrg \fi 6820 1.1 mrg \closein 1 6821 1.1 mrg \endgroup 6822 1.1 mrg \contentsendroman 6823 1.1 mrg } 6824 1.1 mrg 6825 1.1 mrg % And just the chapters. 6826 1.1 mrg \def\summarycontents{% 6827 1.1 mrg \startcontents{\putwordShortTOC}% 6828 1.1 mrg % 6829 1.1 mrg \let\partentry = \shortpartentry 6830 1.1 mrg \let\numchapentry = \shortchapentry 6831 1.1 mrg \let\appentry = \shortchapentry 6832 1.1 mrg \let\unnchapentry = \shortunnchapentry 6833 1.1 mrg % We want a true roman here for the page numbers. 6834 1.1 mrg \secfonts 6835 1.1 mrg \let\rm=\shortcontrm \let\bf=\shortcontbf 6836 1.1 mrg \let\sl=\shortcontsl \let\tt=\shortconttt 6837 1.1 mrg \rm 6838 1.1 mrg \hyphenpenalty = 10000 6839 1.1 mrg \advance\baselineskip by 1pt % Open it up a little. 6840 1.1 mrg \def\numsecentry##1##2##3##4{} 6841 1.1 mrg \let\appsecentry = \numsecentry 6842 1.1 mrg \let\unnsecentry = \numsecentry 6843 1.1 mrg \let\numsubsecentry = \numsecentry 6844 1.1 mrg \let\appsubsecentry = \numsecentry 6845 1.1 mrg \let\unnsubsecentry = \numsecentry 6846 1.1 mrg \let\numsubsubsecentry = \numsecentry 6847 1.1 mrg \let\appsubsubsecentry = \numsecentry 6848 1.1 mrg \let\unnsubsubsecentry = \numsecentry 6849 1.1 mrg \openin 1 \tocreadfilename\space 6850 1.1 mrg \ifeof 1 \else 6851 1.1 mrg \readtocfile 6852 1.1 mrg \fi 6853 1.1 mrg \closein 1 6854 1.1.1.5 mrg \vfill \eject 6855 1.1.1.5 mrg \contentsalignmacro % in case @setchapternewpage odd is in effect 6856 1.1.1.5 mrg \endgroup 6857 1.1.1.5 mrg \contentsendroman 6858 1.1.1.5 mrg } 6859 1.1.1.5 mrg \let\shortcontents = \summarycontents 6860 1.1 mrg 6861 1.1 mrg % Get ready to use Arabic numerals again 6862 1.1.1.5 mrg \def\contentsendroman{% 6863 1.1.1.5 mrg \lastnegativepageno = \pageno 6864 1.1.1.5 mrg \global\pageno = \savepageno 6865 1.1.1.5 mrg % 6866 1.1.1.5 mrg % If \romancount > \arabiccount, the contents are at the end of the 6867 1.1 mrg % document. Otherwise, advance where the Arabic numerals start for 6868 1.1 mrg % the page numbers. 6869 1.1 mrg \ifnum\romancount>\arabiccount\else\global\arabiccount=\pagecount\fi 6870 1.1 mrg } 6871 1.1 mrg 6872 1.1 mrg % Typeset the label for a chapter or appendix for the short contents. 6873 1.1 mrg % The arg is, e.g., `A' for an appendix, or `3' for a chapter. 6874 1.1 mrg % 6875 1.1 mrg \def\shortchaplabel#1{% 6876 1.1 mrg % This space should be enough, since a single number is .5em, and the 6877 1.1 mrg % widest letter (M) is 1em, at least in the Computer Modern fonts. 6878 1.1 mrg % But use \hss just in case. 6879 1.1 mrg % (This space doesn't include the extra space that gets added after 6880 1.1 mrg % the label; that gets put in by \shortchapentry above.) 6881 1.1 mrg % 6882 1.1 mrg % We'd like to right-justify chapter numbers, but that looks strange 6883 1.1 mrg % with appendix letters. And right-justifying numbers and 6884 1.1 mrg % left-justifying letters looks strange when there is less than 10 6885 1.1 mrg % chapters. Have to read the whole toc once to know how many chapters 6886 1.1 mrg % there are before deciding ... 6887 1.1 mrg \hbox to 1em{#1\hss}% 6888 1.1 mrg } 6889 1.1 mrg 6890 1.1 mrg % These macros generate individual entries in the table of contents. 6891 1.1 mrg % The first argument is the chapter or section name. 6892 1.1 mrg % The last argument is the page number. 6893 1.1 mrg % The arguments in between are the chapter number, section number, ... 6894 1.1 mrg 6895 1.1 mrg % Parts, in the main contents. Replace the part number, which doesn't 6896 1.1.1.3 mrg % exist, with an empty box. Let's hope all the numbers have the same width. 6897 1.1.1.3 mrg % Also ignore the page number, which is conventionally not printed. 6898 1.1.1.3 mrg \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}} 6899 1.1.1.3 mrg \def\partentry#1#2#3#4{% 6900 1.1.1.3 mrg % Add stretch and a bonus for breaking the page before the part heading. 6901 1.1.1.3 mrg % This reduces the chance of the page being broken immediately after the 6902 1.1.1.3 mrg % part heading, before a following chapter heading. 6903 1.1.1.3 mrg \vskip 0pt plus 5\baselineskip 6904 1.1.1.3 mrg \penalty-300 6905 1.1 mrg \vskip 0pt plus -5\baselineskip 6906 1.1 mrg \dochapentry{\numeralbox\labelspace#1}{}% 6907 1.1 mrg } 6908 1.1 mrg % 6909 1.1 mrg % Parts, in the short toc. 6910 1.1 mrg \def\shortpartentry#1#2#3#4{% 6911 1.1 mrg \penalty-300 6912 1.1 mrg \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip 6913 1.1 mrg \shortchapentry{{\bf #1}}{\numeralbox}{}{}% 6914 1.1 mrg } 6915 1.1.1.3 mrg 6916 1.1 mrg % Chapters, in the main contents. 6917 1.1 mrg \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} 6918 1.1 mrg 6919 1.1.1.5 mrg % Chapters, in the short toc. 6920 1.1 mrg % See comments in \dochapentry re vbox and related settings. 6921 1.1 mrg \def\shortchapentry#1#2#3#4{% 6922 1.1 mrg \tocentry{\shortchaplabel{#2}\labelspace #1}{#4}% 6923 1.1 mrg } 6924 1.1 mrg 6925 1.1 mrg % Appendices, in the main contents. 6926 1.1 mrg % Need the word Appendix, and a fixed-size box. 6927 1.1 mrg % 6928 1.1 mrg \def\appendixbox#1{% 6929 1.1 mrg % We use M since it's probably the widest letter. 6930 1.1.1.3 mrg \setbox0 = \hbox{\putwordAppendix{} M}% 6931 1.1 mrg \hbox to \wd0{\putwordAppendix{} #1\hss}} 6932 1.1 mrg % 6933 1.1 mrg \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\hskip.7em#1}{#4}} 6934 1.1.1.5 mrg 6935 1.1 mrg % Unnumbered chapters. 6936 1.1 mrg \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} 6937 1.1 mrg \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{#4}} 6938 1.1 mrg 6939 1.1 mrg % Sections. 6940 1.1 mrg \def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} 6941 1.1 mrg \let\appsecentry=\numsecentry 6942 1.1 mrg \def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}} 6943 1.1 mrg 6944 1.1 mrg % Subsections. 6945 1.1 mrg \def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}} 6946 1.1 mrg \let\appsubsecentry=\numsubsecentry 6947 1.1 mrg \def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} 6948 1.1 mrg 6949 1.1 mrg % And subsubsections. 6950 1.1 mrg \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}} 6951 1.1 mrg \let\appsubsubsecentry=\numsubsubsecentry 6952 1.1 mrg \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}} 6953 1.1 mrg 6954 1.1 mrg % This parameter controls the indentation of the various levels. 6955 1.1 mrg % Same as \defaultparindent. 6956 1.1 mrg \newdimen\tocindent \tocindent = 15pt 6957 1.1 mrg 6958 1.1 mrg % Now for the actual typesetting. In all these, #1 is the text and #2 is the 6959 1.1 mrg % page number. 6960 1.1 mrg % 6961 1.1 mrg % If the toc has to be broken over pages, we want it to be at chapters 6962 1.1 mrg % if at all possible; hence the \penalty. 6963 1.1.1.3 mrg \def\dochapentry#1#2{% 6964 1.1.1.3 mrg \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip 6965 1.1 mrg \begingroup 6966 1.1.1.5 mrg % Move the page numbers slightly to the right 6967 1.1 mrg \advance\entryrightmargin by -0.05em 6968 1.1 mrg \chapentryfonts 6969 1.1 mrg \tocentry{#1}{#2}% 6970 1.1 mrg \endgroup 6971 1.1 mrg \nobreak\vskip .25\baselineskip plus.1\baselineskip 6972 1.1 mrg } 6973 1.1.1.5 mrg 6974 1.1 mrg \def\dosecentry#1#2{\begingroup 6975 1.1 mrg \secentryfonts \leftskip=\tocindent 6976 1.1 mrg \tocentry{#1}{#2}% 6977 1.1 mrg \endgroup} 6978 1.1.1.5 mrg 6979 1.1 mrg \def\dosubsecentry#1#2{\begingroup 6980 1.1 mrg \subsecentryfonts \leftskip=2\tocindent 6981 1.1 mrg \tocentry{#1}{#2}% 6982 1.1 mrg \endgroup} 6983 1.1.1.5 mrg 6984 1.1 mrg \def\dosubsubsecentry#1#2{\begingroup 6985 1.1 mrg \subsubsecentryfonts \leftskip=3\tocindent 6986 1.1 mrg \tocentry{#1}{#2}% 6987 1.1 mrg \endgroup} 6988 1.1 mrg 6989 1.1 mrg % We use the same \entry macro as for the index entries. 6990 1.1 mrg \let\tocentry = \entry 6991 1.1 mrg 6992 1.1 mrg % Space between chapter (or whatever) number and the title. 6993 1.1 mrg \def\labelspace{\hskip1em \relax} 6994 1.1 mrg 6995 1.1 mrg \def\chapentryfonts{\secfonts \rm} 6996 1.1 mrg \def\secentryfonts{\textfonts} 6997 1.1 mrg \def\subsecentryfonts{\textfonts} 6998 1.1 mrg \def\subsubsecentryfonts{\textfonts} 6999 1.1 mrg 7000 1.1 mrg 7001 1.1 mrg \message{environments,} 7002 1.1 mrg % @foo ... @end foo. 7003 1.1 mrg 7004 1.1 mrg % @tex ... @end tex escapes into raw TeX temporarily. 7005 1.1 mrg % One exception: @ is still an escape character, so that @end tex works. 7006 1.1.1.5 mrg % But \@ or @@ will get a plain @ character. 7007 1.1 mrg 7008 1.1 mrg \envdef\tex{% 7009 1.1 mrg \setregularquotes 7010 1.1 mrg \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 7011 1.1 mrg \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 7012 1.1 mrg \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie 7013 1.1 mrg \catcode `\%=14 7014 1.1 mrg \catcode `\+=\other 7015 1.1 mrg \catcode `\"=\other 7016 1.1.1.3 mrg \catcode `\|=\other 7017 1.1.1.3 mrg \catcode `\<=\other 7018 1.1 mrg \catcode `\>=\other 7019 1.1 mrg \catcode `\`=\other 7020 1.1 mrg \catcode `\'=\other 7021 1.1 mrg % 7022 1.1 mrg % ' is active in math mode (mathcode"8000). So reset it, and all our 7023 1.1.1.3 mrg % other math active characters (just in case), to plain's definitions. 7024 1.1 mrg \mathactive 7025 1.1 mrg % 7026 1.1 mrg % Inverse of the list at the beginning of the file. 7027 1.1 mrg \let\b=\ptexb 7028 1.1 mrg \let\bullet=\ptexbullet 7029 1.1 mrg \let\c=\ptexc 7030 1.1 mrg \let\,=\ptexcomma 7031 1.1 mrg \let\.=\ptexdot 7032 1.1 mrg \let\dots=\ptexdots 7033 1.1 mrg \let\equiv=\ptexequiv 7034 1.1 mrg \let\!=\ptexexclam 7035 1.1 mrg \let\i=\ptexi 7036 1.1 mrg \let\indent=\ptexindent 7037 1.1 mrg \let\noindent=\ptexnoindent 7038 1.1 mrg \let\{=\ptexlbrace 7039 1.1.1.3 mrg \let\+=\tabalign 7040 1.1 mrg \let\}=\ptexrbrace 7041 1.1.1.3 mrg \let\/=\ptexslash 7042 1.1 mrg \let\sp=\ptexsp 7043 1.1.1.3 mrg \let\*=\ptexstar 7044 1.1 mrg %\let\sup=\ptexsup % do not redefine, we want @sup to work in math mode 7045 1.1 mrg \let\t=\ptext 7046 1.1 mrg \expandafter \let\csname top\endcsname=\ptextop % we've made it outer 7047 1.1 mrg \let\frenchspacing=\plainfrenchspacing 7048 1.1 mrg % 7049 1.1 mrg \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% 7050 1.1 mrg \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% 7051 1.1 mrg \def\@{@}% 7052 1.1 mrg } 7053 1.1 mrg % There is no need to define \Etex. 7054 1.1 mrg 7055 1.1 mrg % Define @lisp ... @end lisp. 7056 1.1 mrg % @lisp environment forms a group so it can rebind things, 7057 1.1 mrg % including the definition of @end lisp (which normally is erroneous). 7058 1.1 mrg 7059 1.1 mrg % Amount to narrow the margins by for @lisp. 7060 1.1 mrg \newskip\lispnarrowing \lispnarrowing=0.4in 7061 1.1 mrg 7062 1.1 mrg % This is the definition that ^^M gets inside @lisp, @example, and other 7063 1.1 mrg % such environments. \null is better than a space, since it doesn't 7064 1.1 mrg % have any width. 7065 1.1 mrg \def\lisppar{\null\endgraf} 7066 1.1 mrg 7067 1.1 mrg % This space is always present above and below environments. 7068 1.1 mrg \newskip\envskipamount \envskipamount = 0pt 7069 1.1 mrg 7070 1.1 mrg % Make spacing and below environment symmetrical. We use \parskip here 7071 1.1 mrg % to help in doing that, since in @example-like environments \parskip 7072 1.1 mrg % is reset to zero; thus the \afterenvbreak inserts no space -- but the 7073 1.1 mrg % start of the next paragraph will insert \parskip. 7074 1.1 mrg % 7075 1.1 mrg \def\aboveenvbreak{{% 7076 1.1 mrg % =10000 instead of <10000 because of a special case in \itemzzz and 7077 1.1 mrg % \sectionheading, q.v. 7078 1.1 mrg \ifnum \lastpenalty=10000 \else 7079 1.1 mrg \advance\envskipamount by \parskip 7080 1.1.1.3 mrg \endgraf 7081 1.1.1.3 mrg \ifdim\lastskip<\envskipamount 7082 1.1.1.3 mrg \removelastskip 7083 1.1.1.3 mrg \ifnum\lastpenalty<10000 7084 1.1.1.3 mrg % Penalize breaking before the environment, because preceding text 7085 1.1.1.3 mrg % often leads into it. 7086 1.1.1.3 mrg \penalty100 7087 1.1.1.3 mrg \fi 7088 1.1.1.3 mrg \vskip\envskipamount 7089 1.1.1.3 mrg \fi 7090 1.1.1.3 mrg \fi 7091 1.1.1.3 mrg }} 7092 1.1.1.3 mrg 7093 1.1.1.3 mrg \def\afterenvbreak{{% 7094 1.1.1.3 mrg % =10000 instead of <10000 because of a special case in \itemzzz and 7095 1.1.1.3 mrg % \sectionheading, q.v. 7096 1.1.1.3 mrg \ifnum \lastpenalty=10000 \else 7097 1.1.1.3 mrg \advance\envskipamount by \parskip 7098 1.1 mrg \endgraf 7099 1.1 mrg \ifdim\lastskip<\envskipamount 7100 1.1 mrg \removelastskip 7101 1.1 mrg % it's not a good place to break if the last penalty was \nobreak 7102 1.1 mrg % or better ... 7103 1.1 mrg \ifnum\lastpenalty<10000 \penalty-50 \fi 7104 1.1 mrg \vskip\envskipamount 7105 1.1 mrg \fi 7106 1.1 mrg \fi 7107 1.1 mrg }} 7108 1.1 mrg 7109 1.1 mrg % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will 7110 1.1 mrg % also clear it, so that its embedded environments do the narrowing again. 7111 1.1 mrg \let\nonarrowing=\relax 7112 1.1.1.4 mrg 7113 1.1 mrg % @cartouche ... @end cartouche: draw rectangle w/rounded corners around 7114 1.1 mrg % environment contents. 7115 1.1 mrg 7116 1.1 mrg % 7117 1.1 mrg \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth 7118 1.1 mrg \def\ctr{{\hskip 6pt\circle\char'010}} 7119 1.1 mrg \def\cbl{{\circle\char'012\hskip -6pt}} 7120 1.1 mrg \def\cbr{{\hskip 6pt\circle\char'011}} 7121 1.1 mrg \def\carttop{\hbox to \cartouter{\hskip\lskip 7122 1.1 mrg \ctl\leaders\hrule height\circthick\hfil\ctr 7123 1.1 mrg \hskip\rskip}} 7124 1.1 mrg \def\cartbot{\hbox to \cartouter{\hskip\lskip 7125 1.1 mrg \cbl\leaders\hrule height\circthick\hfil\cbr 7126 1.1 mrg \hskip\rskip}} 7127 1.1.1.4 mrg % 7128 1.1.1.4 mrg \newskip\lskip\newskip\rskip 7129 1.1.1.4 mrg 7130 1.1.1.4 mrg % only require the font if @cartouche is actually used 7131 1.1.1.4 mrg \def\cartouchefontdefs{% 7132 1.1.1.4 mrg \font\circle=lcircle10\relax 7133 1.1.1.4 mrg \circthick=\fontdimen8\circle 7134 1.1.1.4 mrg } 7135 1.1.1.4 mrg \newdimen\circthick 7136 1.1.1.4 mrg \newdimen\cartouter\newdimen\cartinner 7137 1.1 mrg \newskip\normbskip\newskip\normpskip\newskip\normlskip 7138 1.1.1.4 mrg 7139 1.1 mrg 7140 1.1 mrg \envdef\cartouche{% 7141 1.1 mrg \cartouchefontdefs 7142 1.1 mrg \ifhmode\par\fi % can't be in the midst of a paragraph. 7143 1.1.1.5 mrg \startsavinginserts 7144 1.1.1.5 mrg \lskip=\leftskip \rskip=\rightskip 7145 1.1.1.5 mrg \leftskip=0pt\rightskip=0pt % we want these *outside*. 7146 1.1 mrg % 7147 1.1 mrg % Set paragraph width for text inside cartouche. There are 7148 1.1.1.5 mrg % left and right margins of 3pt each plus two vrules 0.4pt each. 7149 1.1.1.5 mrg \cartinner=\hsize \advance\cartinner by-\lskip 7150 1.1.1.5 mrg \advance\cartinner by-\rskip 7151 1.1.1.5 mrg \advance\cartinner by -6.8pt 7152 1.1.1.5 mrg % 7153 1.1 mrg % For drawing top and bottom of cartouche. Each corner char 7154 1.1.1.5 mrg % adds 6pt and we take off the width of a rule to line up with the 7155 1.1.1.5 mrg % right boundary perfectly. 7156 1.1 mrg \cartouter=\hsize 7157 1.1 mrg \advance\cartouter by 11.6pt 7158 1.1 mrg % 7159 1.1 mrg \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip 7160 1.1 mrg % 7161 1.1 mrg % If this cartouche directly follows a sectioning command, we need the 7162 1.1 mrg % \parskip glue (backspaced over by default) or the cartouche can 7163 1.1.1.5 mrg % collide with the section heading. 7164 1.1 mrg \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi 7165 1.1 mrg % 7166 1.1 mrg \setbox\groupbox=\vtop\bgroup 7167 1.1 mrg \baselineskip=0pt\parskip=0pt\lineskip=0pt 7168 1.1 mrg \carttop 7169 1.1 mrg \hbox\bgroup 7170 1.1 mrg \hskip\lskip 7171 1.1 mrg \vrule\kern3pt 7172 1.1 mrg \vbox\bgroup 7173 1.1 mrg \kern3pt 7174 1.1 mrg \hsize=\cartinner 7175 1.1 mrg \baselineskip=\normbskip 7176 1.1 mrg \lineskip=\normlskip 7177 1.1 mrg \parskip=\normpskip 7178 1.1 mrg \vskip -\parskip 7179 1.1 mrg \comment % For explanation, see the end of def\group. 7180 1.1 mrg } 7181 1.1 mrg \def\Ecartouche{% 7182 1.1 mrg \ifhmode\par\fi 7183 1.1 mrg \kern3pt 7184 1.1 mrg \egroup 7185 1.1 mrg \kern3pt\vrule 7186 1.1 mrg \hskip\rskip 7187 1.1.1.3 mrg \egroup 7188 1.1 mrg \cartbot 7189 1.1 mrg \egroup 7190 1.1 mrg \addgroupbox 7191 1.1 mrg \checkinserts 7192 1.1 mrg } 7193 1.1 mrg 7194 1.1 mrg 7195 1.1 mrg % This macro is called at the beginning of all the @example variants, 7196 1.1 mrg % inside a group. 7197 1.1.1.3 mrg \newdimen\nonfillparindent 7198 1.1 mrg \def\nonfillstart{% 7199 1.1 mrg \aboveenvbreak 7200 1.1 mrg \ifdim\hfuzz < 12pt \hfuzz = 12pt \fi % Don't be fussy 7201 1.1 mrg \sepspaces % Make spaces be word-separators rather than space tokens. 7202 1.1 mrg \let\par = \lisppar % don't ignore blank lines 7203 1.1 mrg \obeylines % each line of input is a line of output 7204 1.1 mrg \parskip = 0pt 7205 1.1 mrg % Turn off paragraph indentation but redefine \indent to emulate 7206 1.1 mrg % the normal \indent. 7207 1.1 mrg \nonfillparindent=\parindent 7208 1.1 mrg \parindent = 0pt 7209 1.1 mrg \let\indent\nonfillindent 7210 1.1 mrg % 7211 1.1 mrg \emergencystretch = 0pt % don't try to avoid overfull boxes 7212 1.1 mrg \ifx\nonarrowing\relax 7213 1.1 mrg \advance \leftskip by \lispnarrowing 7214 1.1 mrg \exdentamount=\lispnarrowing 7215 1.1 mrg \else 7216 1.1 mrg \let\nonarrowing = \relax 7217 1.1 mrg \fi 7218 1.1 mrg \let\exdent=\nofillexdent 7219 1.1 mrg } 7220 1.1 mrg 7221 1.1 mrg \begingroup 7222 1.1 mrg \obeyspaces 7223 1.1 mrg % We want to swallow spaces (but not other tokens) after the fake 7224 1.1 mrg % @indent in our nonfill-environments, where spaces are normally 7225 1.1 mrg % active and set to @tie, resulting in them not being ignored after 7226 1.1 mrg % @indent. 7227 1.1 mrg \gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}% 7228 1.1 mrg \gdef\nonfillindentcheck{% 7229 1.1 mrg \ifx\temp % 7230 1.1 mrg \expandafter\nonfillindentgobble% 7231 1.1 mrg \else% 7232 1.1 mrg \leavevmode\nonfillindentbox% 7233 1.1 mrg \fi% 7234 1.1 mrg }% 7235 1.1 mrg \endgroup 7236 1.1 mrg \def\nonfillindentgobble#1{\nonfillindent} 7237 1.1 mrg \def\nonfillindentbox{\hbox to \nonfillparindent{\hss}} 7238 1.1 mrg 7239 1.1.1.5 mrg % If you want all examples etc. small: @set dispenvsize small. 7240 1.1 mrg % If you want even small examples the full size: @set dispenvsize nosmall. 7241 1.1 mrg % This affects the following displayed environments: 7242 1.1 mrg % @example, @display, @format, @lisp, @verbatim 7243 1.1 mrg % 7244 1.1 mrg \def\smallword{small} 7245 1.1 mrg \def\nosmallword{nosmall} 7246 1.1 mrg \let\SETdispenvsize\relax 7247 1.1 mrg \def\setnormaldispenv{% 7248 1.1 mrg \ifx\SETdispenvsize\smallword 7249 1.1 mrg % end paragraph for sake of leading, in case document has no blank 7250 1.1 mrg % line. This is redundant with what happens in \aboveenvbreak, but 7251 1.1 mrg % we need to do it before changing the fonts, and it's inconvenient 7252 1.1 mrg % to change the fonts afterward. 7253 1.1 mrg \ifnum \lastpenalty=10000 \else \endgraf \fi 7254 1.1 mrg \smallexamplefonts \rm 7255 1.1 mrg \fi 7256 1.1 mrg } 7257 1.1 mrg \def\setsmalldispenv{% 7258 1.1 mrg \ifx\SETdispenvsize\nosmallword 7259 1.1 mrg \else 7260 1.1 mrg \ifnum \lastpenalty=10000 \else \endgraf \fi 7261 1.1 mrg \smallexamplefonts \rm 7262 1.1 mrg \fi 7263 1.1 mrg } 7264 1.1 mrg 7265 1.1 mrg % We often define two environments, @foo and @smallfoo. 7266 1.1 mrg % Let's do it in one command. #1 is the env name, #2 the definition. 7267 1.1 mrg \def\makedispenvdef#1#2{% 7268 1.1 mrg \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}% 7269 1.1 mrg \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}% 7270 1.1 mrg \expandafter\let\csname E#1\endcsname \afterenvbreak 7271 1.1 mrg \expandafter\let\csname Esmall#1\endcsname \afterenvbreak 7272 1.1 mrg } 7273 1.1 mrg 7274 1.1 mrg % Define two environment synonyms (#1 and #2) for an environment. 7275 1.1 mrg \def\maketwodispenvdef#1#2#3{% 7276 1.1 mrg \makedispenvdef{#1}{#3}% 7277 1.1 mrg \makedispenvdef{#2}{#3}% 7278 1.1 mrg } 7279 1.1 mrg % 7280 1.1 mrg % @lisp: indented, narrowed, typewriter font; 7281 1.1 mrg % @example: same as @lisp. 7282 1.1 mrg % 7283 1.1 mrg % @smallexample and @smalllisp: use smaller fonts. 7284 1.1 mrg % Originally contributed by Pavel@xerox. 7285 1.1.1.5 mrg % 7286 1.1 mrg \maketwodispenvdef{lisp}{example}{% 7287 1.1.1.5 mrg \nonfillstart 7288 1.1 mrg \tt\setcodequotes 7289 1.1 mrg \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. 7290 1.1 mrg \parsearg\gobble 7291 1.1 mrg } 7292 1.1 mrg % @display/@smalldisplay: same as @lisp except keep current font. 7293 1.1 mrg % 7294 1.1 mrg \makedispenvdef{display}{% 7295 1.1 mrg \nonfillstart 7296 1.1 mrg \gobble 7297 1.1 mrg } 7298 1.1 mrg 7299 1.1 mrg % @format/@smallformat: same as @display except don't narrow margins. 7300 1.1 mrg % 7301 1.1 mrg \makedispenvdef{format}{% 7302 1.1 mrg \let\nonarrowing = t% 7303 1.1 mrg \nonfillstart 7304 1.1 mrg \gobble 7305 1.1 mrg } 7306 1.1 mrg 7307 1.1 mrg % @flushleft: same as @format, but doesn't obey \SETdispenvsize. 7308 1.1 mrg \envdef\flushleft{% 7309 1.1 mrg \let\nonarrowing = t% 7310 1.1 mrg \nonfillstart 7311 1.1 mrg \gobble 7312 1.1 mrg } 7313 1.1 mrg \let\Eflushleft = \afterenvbreak 7314 1.1 mrg 7315 1.1 mrg % @flushright. 7316 1.1 mrg % 7317 1.1 mrg \envdef\flushright{% 7318 1.1 mrg \let\nonarrowing = t% 7319 1.1 mrg \nonfillstart 7320 1.1 mrg \advance\leftskip by 0pt plus 1fill\relax 7321 1.1 mrg \gobble 7322 1.1 mrg } 7323 1.1 mrg \let\Eflushright = \afterenvbreak 7324 1.1.1.4 mrg 7325 1.1 mrg 7326 1.1.1.3 mrg % @raggedright does more-or-less normal line breaking but no right 7327 1.1 mrg % justification. From plain.tex. 7328 1.1 mrg \envdef\raggedright{% 7329 1.1 mrg \rightskip0pt plus2.4em \spaceskip.3333em \xspaceskip.5em\relax 7330 1.1 mrg } 7331 1.1 mrg \let\Eraggedright\par 7332 1.1 mrg 7333 1.1 mrg 7334 1.1 mrg % @quotation does normal linebreaking (hence we can't use \nonfillstart) 7335 1.1 mrg % and narrows the margins. We keep \parskip nonzero in general, since 7336 1.1 mrg % we're doing normal filling. So, when using \aboveenvbreak and 7337 1.1 mrg % \afterenvbreak, temporarily make \parskip 0. 7338 1.1 mrg % 7339 1.1.1.2 mrg \makedispenvdef{quotation}{\quotationstart} 7340 1.1 mrg % 7341 1.1 mrg \def\quotationstart{% 7342 1.1 mrg \indentedblockstart % same as \indentedblock, but increase right margin too. 7343 1.1 mrg \ifx\nonarrowing\relax 7344 1.1 mrg \advance\rightskip by \lispnarrowing 7345 1.1 mrg \fi 7346 1.1 mrg \parsearg\quotationlabel 7347 1.1 mrg } 7348 1.1 mrg 7349 1.1 mrg % We have retained a nonzero parskip for the environment, since we're 7350 1.1 mrg % doing normal filling. 7351 1.1 mrg % 7352 1.1 mrg \def\Equotation{% 7353 1.1 mrg \par 7354 1.1 mrg \ifx\quotationauthor\thisisundefined\else 7355 1.1 mrg % indent a bit. 7356 1.1 mrg \leftline{\kern 2\leftskip \sl ---\quotationauthor}% 7357 1.1 mrg \fi 7358 1.1 mrg {\parskip=0pt \afterenvbreak}% 7359 1.1 mrg } 7360 1.1 mrg \def\Esmallquotation{\Equotation} 7361 1.1 mrg 7362 1.1 mrg % If we're given an argument, typeset it in bold with a colon after. 7363 1.1 mrg \def\quotationlabel#1{% 7364 1.1 mrg \def\temp{#1}% 7365 1.1 mrg \ifx\temp\empty \else 7366 1.1 mrg {\bf #1: }% 7367 1.1.1.2 mrg \fi 7368 1.1.1.2 mrg } 7369 1.1.1.5 mrg 7370 1.1.1.2 mrg % @indentedblock is like @quotation, but indents only on the left and 7371 1.1.1.2 mrg % has no optional argument. 7372 1.1.1.2 mrg % 7373 1.1.1.2 mrg \makedispenvdef{indentedblock}{\indentedblockstart} 7374 1.1.1.2 mrg % 7375 1.1.1.2 mrg \def\indentedblockstart{% 7376 1.1.1.2 mrg {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip 7377 1.1.1.2 mrg \parindent=0pt 7378 1.1.1.2 mrg % 7379 1.1.1.2 mrg % @cartouche defines \nonarrowing to inhibit narrowing at next level down. 7380 1.1.1.2 mrg \ifx\nonarrowing\relax 7381 1.1.1.2 mrg \advance\leftskip by \lispnarrowing 7382 1.1.1.2 mrg \exdentamount = \lispnarrowing 7383 1.1.1.2 mrg \else 7384 1.1.1.2 mrg \let\nonarrowing = \relax 7385 1.1.1.2 mrg \fi 7386 1.1.1.2 mrg } 7387 1.1.1.2 mrg 7388 1.1.1.2 mrg % Keep a nonzero parskip for the environment, since we're doing normal filling. 7389 1.1.1.2 mrg % 7390 1.1.1.2 mrg \def\Eindentedblock{% 7391 1.1.1.2 mrg \par 7392 1.1.1.2 mrg {\parskip=0pt \afterenvbreak}% 7393 1.1 mrg } 7394 1.1 mrg \def\Esmallindentedblock{\Eindentedblock} 7395 1.1 mrg 7396 1.1 mrg 7397 1.1 mrg % LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>} 7398 1.1 mrg % If we want to allow any <char> as delimiter, 7399 1.1 mrg % we need the curly braces so that makeinfo sees the @verb command, eg: 7400 1.1 mrg % `@verbx...x' would look like the '@verbx' command. --janneke (a] gnu.org 7401 1.1 mrg % 7402 1.1 mrg % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. 7403 1.1 mrg % 7404 1.1 mrg % [Knuth] p.344; only we need to do the other characters Texinfo sets 7405 1.1 mrg % active too. Otherwise, they get lost as the first character on a 7406 1.1 mrg % verbatim line. 7407 1.1 mrg \def\dospecials{% 7408 1.1 mrg \do\ \do\\\do\{\do\}\do\$\do\&% 7409 1.1 mrg \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~% 7410 1.1 mrg \do\<\do\>\do\|\do\@\do+\do\"% 7411 1.1 mrg % Don't do the quotes -- if we do, @set txicodequoteundirected and 7412 1.1 mrg % @set txicodequotebacktick will not have effect on @verb and 7413 1.1 mrg % @verbatim, and ?` and !` ligatures won't get disabled. 7414 1.1 mrg %\do\`\do\'% 7415 1.1 mrg } 7416 1.1 mrg % 7417 1.1 mrg % [Knuth] p. 380 7418 1.1 mrg \def\uncatcodespecials{% 7419 1.1 mrg \def\do##1{\catcode`##1=\other}\dospecials} 7420 1.1 mrg % 7421 1.1 mrg % Setup for the @verb command. 7422 1.1 mrg % 7423 1.1 mrg % Eight spaces for a tab 7424 1.1 mrg \begingroup 7425 1.1 mrg \catcode`\^^I=\active 7426 1.1 mrg \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }} 7427 1.1.1.5 mrg \endgroup 7428 1.1 mrg % 7429 1.1.1.5 mrg \def\setupverb{% 7430 1.1 mrg \tt 7431 1.1.1.5 mrg \def\par{\leavevmode\endgraf}% 7432 1.1 mrg \setcodequotes 7433 1.1 mrg \tabeightspaces 7434 1.1 mrg \nohyphenation 7435 1.1 mrg % Respect line breaks, 7436 1.1 mrg % print special symbols as themselves, and 7437 1.1 mrg % make each space count 7438 1.1 mrg % must do in this order: 7439 1.1 mrg \obeylines \uncatcodespecials \sepspaces 7440 1.1 mrg } 7441 1.1 mrg 7442 1.1 mrg % Setup for the @verbatim environment 7443 1.1 mrg % 7444 1.1 mrg % Real tab expansion. 7445 1.1.1.5 mrg \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount 7446 1.1 mrg % 7447 1.1.1.5 mrg % We typeset each line of the verbatim in an \hbox, so we can handle 7448 1.1 mrg % tabs. 7449 1.1 mrg \newbox\verbbox 7450 1.1 mrg \def\starttabbox{\setbox\verbbox=\hbox\bgroup} 7451 1.1 mrg % 7452 1.1 mrg \begingroup 7453 1.1 mrg \catcode`\^^I=\active 7454 1.1 mrg \gdef\tabexpand{% 7455 1.1 mrg \catcode`\^^I=\active 7456 1.1 mrg \def^^I{\leavevmode\egroup 7457 1.1 mrg \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab 7458 1.1.1.5 mrg \divide\dimen\verbbox by\tabw 7459 1.1.1.5 mrg \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw 7460 1.1 mrg \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw 7461 1.1 mrg \wd\verbbox=\dimen\verbbox 7462 1.1 mrg \leavevmode\box\verbbox \starttabbox 7463 1.1 mrg }% 7464 1.1 mrg } 7465 1.1 mrg \endgroup 7466 1.1 mrg 7467 1.1 mrg % start the verbatim environment. 7468 1.1 mrg \def\setupverbatim{% 7469 1.1.1.5 mrg \let\nonarrowing = t% 7470 1.1 mrg \nonfillstart 7471 1.1.1.5 mrg \tt % easiest (and conventionally used) font for verbatim 7472 1.1 mrg \def\par{\egroup\leavevmode\box\verbbox\endgraf\starttabbox}% 7473 1.1 mrg \tabexpand 7474 1.1 mrg \setcodequotes 7475 1.1 mrg % Respect line breaks, 7476 1.1 mrg % print special symbols as themselves, and 7477 1.1 mrg % make each space count. 7478 1.1 mrg % Must do in this order: 7479 1.1 mrg \obeylines \uncatcodespecials \sepspaces 7480 1.1 mrg } 7481 1.1 mrg 7482 1.1 mrg % Do the @verb magic: verbatim text is quoted by unique 7483 1.1 mrg % delimiter characters. Before first delimiter expect a 7484 1.1 mrg % right brace, after last delimiter expect closing brace: 7485 1.1 mrg % 7486 1.1 mrg % \def\doverb'{'<char>#1<char>'}'{#1} 7487 1.1 mrg % 7488 1.1 mrg % [Knuth] p. 382; only eat outer {} 7489 1.1 mrg \begingroup 7490 1.1 mrg \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other 7491 1.1 mrg \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] 7492 1.1 mrg \endgroup 7493 1.1 mrg % 7494 1.1 mrg \def\verb{\begingroup\setupverb\doverb} 7495 1.1 mrg % 7496 1.1 mrg % 7497 1.1 mrg % Do the @verbatim magic: define the macro \doverbatim so that 7498 1.1 mrg % the (first) argument ends when '@end verbatim' is reached, ie: 7499 1.1 mrg % 7500 1.1 mrg % \def\doverbatim#1@end verbatim{#1} 7501 1.1 mrg % 7502 1.1 mrg % For Texinfo it's a lot easier than for LaTeX, 7503 1.1 mrg % because texinfo's \verbatim doesn't stop at '\end{verbatim}': 7504 1.1 mrg % we need not redefine '\', '{' and '}'. 7505 1.1 mrg % 7506 1.1 mrg % Inspired by LaTeX's verbatim command set [latex.ltx] 7507 1.1 mrg % 7508 1.1 mrg \begingroup 7509 1.1 mrg \catcode`\ =\active 7510 1.1 mrg \obeylines % 7511 1.1.1.5 mrg % ignore everything up to the first ^^M, that's the newline at the end 7512 1.1.1.5 mrg % of the @verbatim input line itself. Otherwise we get an extra blank 7513 1.1 mrg % line in the output. 7514 1.1 mrg \xdef\doverbatim#1^^M#2@end verbatim{% 7515 1.1.1.5 mrg \starttabbox#2\egroup\noexpand\end\gobble verbatim}% 7516 1.1.1.5 mrg % We really want {...\end verbatim} in the body of the macro, but 7517 1.1 mrg % without the active space; thus we have to use \xdef and \gobble. 7518 1.1 mrg % The \egroup ends the \verbbox started at the end of the last line in 7519 1.1 mrg % the block. 7520 1.1.1.5 mrg \endgroup 7521 1.1 mrg % 7522 1.1 mrg \envdef\verbatim{% 7523 1.1 mrg \setnormaldispenv\setupverbatim\doverbatim 7524 1.1 mrg } 7525 1.1 mrg \let\Everbatim = \afterenvbreak 7526 1.1 mrg 7527 1.1 mrg 7528 1.1 mrg % @verbatiminclude FILE - insert text of file in verbatim environment. 7529 1.1 mrg % 7530 1.1 mrg \def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude} 7531 1.1 mrg % 7532 1.1 mrg \def\doverbatiminclude#1{% 7533 1.1.1.4 mrg {% 7534 1.1.1.4 mrg \makevalueexpandable 7535 1.1.1.4 mrg \setupverbatim 7536 1.1.1.4 mrg {% 7537 1.1.1.4 mrg \indexnofonts % Allow `@@' and other weird things in file names. 7538 1.1.1.5 mrg \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}% 7539 1.1 mrg \edef\tmp{\noexpand\input #1 } 7540 1.1 mrg \expandafter 7541 1.1 mrg }\expandafter\starttabbox\tmp\egroup 7542 1.1 mrg \afterenvbreak 7543 1.1 mrg }% 7544 1.1 mrg } 7545 1.1 mrg 7546 1.1 mrg % @copying ... @end copying. 7547 1.1 mrg % Save the text away for @insertcopying later. 7548 1.1 mrg % 7549 1.1 mrg % We save the uninterpreted tokens, rather than creating a box. 7550 1.1 mrg % Saving the text in a box would be much easier, but then all the 7551 1.1.1.3 mrg % typesetting commands (@smallbook, font changes, etc.) have to be done 7552 1.1 mrg % beforehand -- and a) we want @copying to be done first in the source 7553 1.1.1.5 mrg % file; b) letting users define the frontmatter in as flexible order as 7554 1.1.1.5 mrg % possible is desirable. 7555 1.1.1.5 mrg % 7556 1.1.1.5 mrg \def\copying{\checkenv{}\begingroup\macrobodyctxt\docopying} 7557 1.1.1.5 mrg {\catcode`\ =\other 7558 1.1 mrg \gdef\docopying#1@end copying{\endgroup\def\copyingtext{#1}} 7559 1.1 mrg } 7560 1.1 mrg 7561 1.1 mrg \def\insertcopying{% 7562 1.1 mrg \begingroup 7563 1.1 mrg \parindent = 0pt % paragraph indentation looks wrong on title page 7564 1.1 mrg \scanexp\copyingtext 7565 1.1 mrg \endgroup 7566 1.1 mrg } 7567 1.1 mrg 7568 1.1 mrg 7569 1.1 mrg \message{defuns,} 7570 1.1 mrg % @defun etc. 7571 1.1 mrg 7572 1.1 mrg \newskip\defbodyindent \defbodyindent=.4in 7573 1.1 mrg \newskip\defargsindent \defargsindent=50pt 7574 1.1 mrg \newskip\deflastargmargin \deflastargmargin=18pt 7575 1.1 mrg \newcount\defunpenalty 7576 1.1 mrg 7577 1.1 mrg % Start the processing of @deffn: 7578 1.1 mrg \def\startdefun{% 7579 1.1 mrg \ifnum\lastpenalty<10000 7580 1.1 mrg \medbreak 7581 1.1 mrg \defunpenalty=10003 % Will keep this @deffn together with the 7582 1.1 mrg % following @def command, see below. 7583 1.1 mrg \else 7584 1.1 mrg % If there are two @def commands in a row, we'll have a \nobreak, 7585 1.1 mrg % which is there to keep the function description together with its 7586 1.1 mrg % header. But if there's nothing but headers, we need to allow a 7587 1.1 mrg % break somewhere. Check specifically for penalty 10002, inserted 7588 1.1 mrg % by \printdefunline, instead of 10000, since the sectioning 7589 1.1 mrg % commands also insert a nobreak penalty, and we don't want to allow 7590 1.1 mrg % a break between a section heading and a defun. 7591 1.1 mrg % 7592 1.1 mrg % As a further refinement, we avoid "club" headers by signalling 7593 1.1 mrg % with penalty of 10003 after the very first @deffn in the 7594 1.1 mrg % sequence (see above), and penalty of 10002 after any following 7595 1.1 mrg % @def command. 7596 1.1 mrg \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi 7597 1.1 mrg % 7598 1.1 mrg % Similarly, after a section heading, do not allow a break. 7599 1.1 mrg % But do insert the glue. 7600 1.1 mrg \medskip % preceded by discardable penalty, so not a breakpoint 7601 1.1 mrg \fi 7602 1.1 mrg % 7603 1.1 mrg \parindent=0in 7604 1.1 mrg \advance\leftskip by \defbodyindent 7605 1.1 mrg \exdentamount=\defbodyindent 7606 1.1 mrg } 7607 1.1 mrg 7608 1.1 mrg \def\dodefunx#1{% 7609 1.1 mrg % First, check whether we are in the right environment: 7610 1.1 mrg \checkenv#1% 7611 1.1 mrg % 7612 1.1 mrg % As above, allow line break if we have multiple x headers in a row. 7613 1.1 mrg % It's not a great place, though. 7614 1.1 mrg \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi 7615 1.1 mrg % 7616 1.1 mrg % And now, it's time to reuse the body of the original defun: 7617 1.1 mrg \expandafter\gobbledefun#1% 7618 1.1 mrg } 7619 1.1 mrg \def\gobbledefun#1\startdefun{} 7620 1.1 mrg 7621 1.1 mrg % \printdefunline \deffnheader{text} 7622 1.1.1.5 mrg % 7623 1.1 mrg \def\printdefunline#1#2{% 7624 1.1 mrg \begingroup 7625 1.1 mrg \plainfrenchspacing 7626 1.1 mrg % call \deffnheader: 7627 1.1 mrg #1#2 \endheader 7628 1.1 mrg % common ending: 7629 1.1 mrg \interlinepenalty = 10000 7630 1.1 mrg \advance\rightskip by 0pt plus 1fil\relax 7631 1.1 mrg \endgraf 7632 1.1 mrg \nobreak\vskip -\parskip 7633 1.1 mrg \penalty\defunpenalty % signal to \startdefun and \dodefunx 7634 1.1 mrg % Some of the @defun-type tags do not enable magic parentheses, 7635 1.1 mrg % rendering the following check redundant. But we don't optimize. 7636 1.1 mrg \checkparencounts 7637 1.1 mrg \endgroup 7638 1.1 mrg } 7639 1.1.1.5 mrg 7640 1.1 mrg \def\Edefun{\endgraf\medbreak} 7641 1.1.1.5 mrg 7642 1.1 mrg % \makedefun{deffoo}{ (definition of \deffooheader) } 7643 1.1 mrg % 7644 1.1 mrg % Define \deffoo, \deffoox \Edeffoo and \deffooheader. 7645 1.1 mrg \def\makedefun#1{% 7646 1.1 mrg \expandafter\let\csname E#1\endcsname = \Edefun 7647 1.1 mrg \edef\temp{\noexpand\domakedefun 7648 1.1 mrg \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}% 7649 1.1 mrg \temp 7650 1.1 mrg } 7651 1.1 mrg \def\domakedefun#1#2#3{% 7652 1.1 mrg \envdef#1{% 7653 1.1 mrg \startdefun 7654 1.1 mrg \doingtypefnfalse % distinguish typed functions from all else 7655 1.1 mrg \parseargusing\activeparens{\printdefunline#3}% 7656 1.1 mrg }% 7657 1.1 mrg \def#2{\dodefunx#1}% 7658 1.1 mrg \def#3% 7659 1.1 mrg } 7660 1.1 mrg 7661 1.1 mrg \newif\ifdoingtypefn % doing typed function? 7662 1.1 mrg \newif\ifrettypeownline % typeset return type on its own line? 7663 1.1 mrg 7664 1.1.1.5 mrg % @deftypefnnewline on|off says whether the return type of typed functions 7665 1.1 mrg % are printed on their own line. This affects @deftypefn, @deftypefun, 7666 1.1 mrg % @deftypeop, and @deftypemethod. 7667 1.1 mrg % 7668 1.1 mrg \parseargdef\deftypefnnewline{% 7669 1.1 mrg \def\temp{#1}% 7670 1.1 mrg \ifx\temp\onword 7671 1.1 mrg \expandafter\let\csname SETtxideftypefnnl\endcsname 7672 1.1 mrg = \empty 7673 1.1 mrg \else\ifx\temp\offword 7674 1.1 mrg \expandafter\let\csname SETtxideftypefnnl\endcsname 7675 1.1 mrg = \relax 7676 1.1 mrg \else 7677 1.1 mrg \errhelp = \EMsimple 7678 1.1 mrg \errmessage{Unknown @txideftypefnnl value `\temp', 7679 1.1 mrg must be on|off}% 7680 1.1 mrg \fi\fi 7681 1.1 mrg } 7682 1.1 mrg 7683 1.1.1.5 mrg % Untyped functions: 7684 1.1.1.5 mrg 7685 1.1.1.5 mrg % @deffn category name args 7686 1.1.1.5 mrg \makedefun{deffn}#1 #2 #3\endheader{% 7687 1.1 mrg \doind{fn}{\code{#2}}% 7688 1.1.1.5 mrg \defname{#1}{}{#2}\magicamp\defunargs{#3\unskip}% 7689 1.1.1.5 mrg } 7690 1.1.1.5 mrg 7691 1.1.1.5 mrg % @defop category class name args 7692 1.1.1.5 mrg \makedefun{defop}#1 {\defopheaderx{#1\ \putwordon}} 7693 1.1 mrg \def\defopheaderx#1#2 #3 #4\endheader{% 7694 1.1 mrg \doind{fn}{\code{#3}\space\putwordon\ \code{#2}}% 7695 1.1 mrg \defname{#1\ \code{#2}}{}{#3}\magicamp\defunargs{#4\unskip}% 7696 1.1 mrg } 7697 1.1 mrg 7698 1.1.1.5 mrg % Typed functions: 7699 1.1.1.5 mrg 7700 1.1.1.5 mrg % @deftypefn category type name args 7701 1.1.1.5 mrg \makedefun{deftypefn}#1 #2 #3 #4\endheader{% 7702 1.1.1.5 mrg \doind{fn}{\code{#3}}% 7703 1.1 mrg \doingtypefntrue 7704 1.1 mrg \defname{#1}{#2}{#3}\defunargs{#4\unskip}% 7705 1.1.1.5 mrg } 7706 1.1.1.5 mrg 7707 1.1.1.5 mrg % @deftypeop category class type name args 7708 1.1 mrg \makedefun{deftypeop}#1 {\deftypeopheaderx{#1\ \putwordon}} 7709 1.1.1.5 mrg \def\deftypeopheaderx#1#2 #3 #4 #5\endheader{% 7710 1.1 mrg \doind{fn}{\code{#4}\space\putwordon\ \code{#1\ \code{#2}}}% 7711 1.1 mrg \doingtypefntrue 7712 1.1 mrg \defname{#1\ \code{#2}}{#3}{#4}\defunargs{#5\unskip}% 7713 1.1 mrg } 7714 1.1 mrg 7715 1.1.1.5 mrg % Typed variables: 7716 1.1.1.5 mrg 7717 1.1.1.5 mrg % @deftypevr category type var args 7718 1.1.1.5 mrg \makedefun{deftypevr}#1 #2 #3 #4\endheader{% 7719 1.1 mrg \doind{vr}{\code{#3}}% 7720 1.1 mrg \defname{#1}{#2}{#3}\defunargs{#4\unskip}% 7721 1.1.1.5 mrg } 7722 1.1.1.5 mrg 7723 1.1.1.5 mrg % @deftypecv category class type var args 7724 1.1.1.5 mrg \makedefun{deftypecv}#1 {\deftypecvheaderx{#1\ \putwordof}} 7725 1.1 mrg \def\deftypecvheaderx#1#2 #3 #4 #5\endheader{% 7726 1.1 mrg \doind{vr}{\code{#4}\space\putwordof\ \code{#2}}% 7727 1.1 mrg \defname{#1\ \code{#2}}{#3}{#4}\defunargs{#5\unskip}% 7728 1.1 mrg } 7729 1.1 mrg 7730 1.1 mrg % Untyped variables: 7731 1.1 mrg 7732 1.1 mrg % @defvr category var args 7733 1.1.1.5 mrg \makedefun{defvr}#1 {\deftypevrheader{#1} {} } 7734 1.1.1.5 mrg 7735 1.1 mrg % @defcv category class var args 7736 1.1 mrg \makedefun{defcv}#1 {\defcvheaderx{#1\ \putwordof}} 7737 1.1 mrg \def\defcvheaderx#1#2 {\deftypecvheaderx{#1}#2 {} } 7738 1.1 mrg 7739 1.1 mrg % Types: 7740 1.1 mrg 7741 1.1 mrg % @deftp category name args 7742 1.1 mrg \makedefun{deftp}#1 #2 #3\endheader{% 7743 1.1 mrg \doind{tp}{\code{#2}}% 7744 1.1 mrg \defname{#1}{}{#2}\defunargs{#3\unskip}% 7745 1.1 mrg } 7746 1.1 mrg 7747 1.1 mrg % Remaining @defun-like shortcuts: 7748 1.1 mrg \makedefun{defun}{\deffnheader{\putwordDeffunc} } 7749 1.1 mrg \makedefun{defmac}{\deffnheader{\putwordDefmac} } 7750 1.1 mrg \makedefun{defspec}{\deffnheader{\putwordDefspec} } 7751 1.1 mrg \makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} } 7752 1.1.1.5 mrg \makedefun{defvar}{\defvrheader{\putwordDefvar} } 7753 1.1.1.5 mrg \makedefun{defopt}{\defvrheader{\putwordDefopt} } 7754 1.1.1.5 mrg \makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} } 7755 1.1.1.5 mrg \makedefun{defmethod}{\defopheaderx\putwordMethodon} 7756 1.1 mrg \makedefun{deftypemethod}{\deftypeopheaderx\putwordMethodon} 7757 1.1 mrg \makedefun{defivar}{\defcvheaderx\putwordInstanceVariableof} 7758 1.1 mrg \makedefun{deftypeivar}{\deftypecvheaderx\putwordInstanceVariableof} 7759 1.1 mrg 7760 1.1 mrg % \defname, which formats the name of the @def (not the args). 7761 1.1 mrg % #1 is the category, such as "Function". 7762 1.1 mrg % #2 is the return type, if any. 7763 1.1 mrg % #3 is the function name. 7764 1.1 mrg % 7765 1.1 mrg % We are followed by (but not passed) the arguments, if any. 7766 1.1 mrg % 7767 1.1 mrg \def\defname#1#2#3{% 7768 1.1 mrg \par 7769 1.1 mrg % Get the values of \leftskip and \rightskip as they were outside the @def... 7770 1.1 mrg \advance\leftskip by -\defbodyindent 7771 1.1 mrg % 7772 1.1 mrg % Determine if we are typesetting the return type of a typed function 7773 1.1 mrg % on a line by itself. 7774 1.1.1.5 mrg \rettypeownlinefalse 7775 1.1 mrg \ifdoingtypefn % doing a typed function specifically? 7776 1.1 mrg % then check user option for putting return type on its own line: 7777 1.1 mrg \ifflagclear{txideftypefnnl}{}{\rettypeownlinetrue}% 7778 1.1 mrg \fi 7779 1.1 mrg % 7780 1.1 mrg % How we'll format the category name. Putting it in brackets helps 7781 1.1 mrg % distinguish it from the body text that may end up on the next line 7782 1.1 mrg % just below it. 7783 1.1 mrg \def\temp{#1}% 7784 1.1 mrg \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} 7785 1.1 mrg % 7786 1.1 mrg % Figure out line sizes for the paragraph shape. We'll always have at 7787 1.1 mrg % least two. 7788 1.1 mrg \tempnum = 2 7789 1.1 mrg % 7790 1.1 mrg % The first line needs space for \box0; but if \rightskip is nonzero, 7791 1.1 mrg % we need only space for the part of \box0 which exceeds it: 7792 1.1 mrg \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip 7793 1.1 mrg % 7794 1.1 mrg % If doing a return type on its own line, we'll have another line. 7795 1.1 mrg \ifrettypeownline 7796 1.1 mrg \advance\tempnum by 1 7797 1.1 mrg \def\maybeshapeline{0in \hsize}% 7798 1.1 mrg \else 7799 1.1 mrg \def\maybeshapeline{}% 7800 1.1 mrg \fi 7801 1.1 mrg % 7802 1.1 mrg % The continuations: 7803 1.1 mrg \dimen2=\hsize \advance\dimen2 by -\defargsindent 7804 1.1 mrg % 7805 1.1 mrg % The final paragraph shape: 7806 1.1 mrg \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2 7807 1.1 mrg % 7808 1.1 mrg % Put the category name at the right margin. 7809 1.1 mrg \noindent 7810 1.1 mrg \hbox to 0pt{% 7811 1.1 mrg \hfil\box0 \kern-\hsize 7812 1.1 mrg % \hsize has to be shortened this way: 7813 1.1 mrg \kern\leftskip 7814 1.1 mrg % Intentionally do not respect \rightskip, since we need the space. 7815 1.1 mrg }% 7816 1.1 mrg % 7817 1.1 mrg % Allow all lines to be underfull without complaint: 7818 1.1 mrg \tolerance=10000 \hbadness=10000 7819 1.1 mrg \exdentamount=\defbodyindent 7820 1.1 mrg {% 7821 1.1 mrg % defun fonts. We use typewriter by default (used to be bold) because: 7822 1.1 mrg % . we're printing identifiers, they should be in tt in principle. 7823 1.1 mrg % . in languages with many accents, such as Czech or French, it's 7824 1.1 mrg % common to leave accents off identifiers. The result looks ok in 7825 1.1 mrg % tt, but exceedingly strange in rm. 7826 1.1 mrg % . we don't want -- and --- to be treated as ligatures. 7827 1.1 mrg % . this still does not fix the ?` and !` ligatures, but so far no 7828 1.1 mrg % one has made identifiers using them :). 7829 1.1 mrg \df \tt 7830 1.1 mrg \def\temp{#2}% text of the return type 7831 1.1 mrg \ifx\temp\empty\else 7832 1.1.1.5 mrg \tclose{\temp}% typeset the return type 7833 1.1 mrg \ifrettypeownline 7834 1.1 mrg % put return type on its own line; prohibit line break following: 7835 1.1 mrg \hfil\vadjust{\nobreak}\break 7836 1.1 mrg \else 7837 1.1 mrg \space % type on same line, so just followed by a space 7838 1.1 mrg \fi 7839 1.1.1.5 mrg \fi % no return type 7840 1.1.1.5 mrg #3% output function name 7841 1.1.1.5 mrg }% 7842 1.1 mrg \ifflagclear{txidefnamenospace}{% 7843 1.1 mrg {\rm\enskip}% hskip 0.5 em of \rmfont 7844 1.1 mrg }{}% 7845 1.1 mrg % 7846 1.1 mrg \boldbrax 7847 1.1.1.5 mrg % arguments will be output next, if any. 7848 1.1 mrg } 7849 1.1.1.5 mrg 7850 1.1.1.5 mrg % Print arguments. Use slanted for @def*, typewriter for @deftype*. 7851 1.1.1.5 mrg \def\defunargs#1{% 7852 1.1 mrg \df \ifdoingtypefn \tt \else \sl \fi 7853 1.1 mrg \ifflagclear{txicodevaristt}{}% 7854 1.1 mrg {\def\var##1{{\setregularquotes \ttsl ##1}}}% 7855 1.1 mrg #1% 7856 1.1 mrg } 7857 1.1 mrg 7858 1.1 mrg % We want ()&[] to print specially on the defun line. 7859 1.1 mrg % 7860 1.1 mrg \def\activeparens{% 7861 1.1 mrg \catcode`\(=\active \catcode`\)=\active 7862 1.1 mrg \catcode`\[=\active \catcode`\]=\active 7863 1.1 mrg \catcode`\&=\active 7864 1.1 mrg } 7865 1.1 mrg 7866 1.1 mrg % Make control sequences which act like normal parenthesis chars. 7867 1.1 mrg \let\lparen = ( \let\rparen = ) 7868 1.1 mrg 7869 1.1 mrg % Be sure that we always have a definition for `(', etc. For example, 7870 1.1 mrg % if the fn name has parens in it, \boldbrax will not be in effect yet, 7871 1.1.1.5 mrg % so TeX would otherwise complain about undefined control sequence. 7872 1.1.1.5 mrg { 7873 1.1.1.5 mrg \activeparens 7874 1.1.1.5 mrg \gdef\defcharsdefault{% 7875 1.1.1.5 mrg \let(=\lparen \let)=\rparen 7876 1.1.1.5 mrg \let[=\lbrack \let]=\rbrack 7877 1.1 mrg \let& = \&% 7878 1.1 mrg } 7879 1.1 mrg \globaldefs=1 \defcharsdefault 7880 1.1 mrg 7881 1.1.1.4 mrg \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} 7882 1.1 mrg \gdef\magicamp{\let&=\amprm} 7883 1.1 mrg } 7884 1.1 mrg \let\ampchar\& 7885 1.1 mrg 7886 1.1 mrg \newcount\parencount 7887 1.1 mrg 7888 1.1 mrg % If we encounter &foo, then turn on ()-hacking afterwards 7889 1.1 mrg \newif\ifampseen 7890 1.1 mrg \def\amprm#1 {\ampseentrue{\bf\ }} 7891 1.1 mrg 7892 1.1 mrg \def\parenfont{% 7893 1.1 mrg \ifampseen 7894 1.1 mrg % At the first level, print parens in roman, 7895 1.1 mrg % otherwise use the default font. 7896 1.1 mrg \ifnum \parencount=1 \rm \fi 7897 1.1 mrg \else 7898 1.1 mrg % The \sf parens (in \boldbrax) actually are a little bolder than 7899 1.1 mrg % the contained text. This is especially needed for [ and ] . 7900 1.1 mrg \sf 7901 1.1 mrg \fi 7902 1.1 mrg } 7903 1.1 mrg \def\infirstlevel#1{% 7904 1.1 mrg \ifampseen 7905 1.1 mrg \ifnum\parencount=1 7906 1.1 mrg #1% 7907 1.1 mrg \fi 7908 1.1 mrg \fi 7909 1.1 mrg } 7910 1.1 mrg \def\bfafterword#1 {#1 \bf} 7911 1.1 mrg 7912 1.1 mrg \def\opnr{% 7913 1.1 mrg \global\advance\parencount by 1 7914 1.1 mrg {\parenfont(}% 7915 1.1 mrg \infirstlevel \bfafterword 7916 1.1 mrg } 7917 1.1 mrg \def\clnr{% 7918 1.1 mrg {\parenfont)}% 7919 1.1 mrg \infirstlevel \sl 7920 1.1 mrg \global\advance\parencount by -1 7921 1.1 mrg } 7922 1.1 mrg 7923 1.1 mrg \newcount\brackcount 7924 1.1 mrg \def\lbrb{% 7925 1.1 mrg \global\advance\brackcount by 1 7926 1.1 mrg {\bf[}% 7927 1.1 mrg } 7928 1.1 mrg \def\rbrb{% 7929 1.1 mrg {\bf]}% 7930 1.1 mrg \global\advance\brackcount by -1 7931 1.1 mrg } 7932 1.1 mrg 7933 1.1 mrg \def\checkparencounts{% 7934 1.1 mrg \ifnum\parencount=0 \else \badparencount \fi 7935 1.1 mrg \ifnum\brackcount=0 \else \badbrackcount \fi 7936 1.1 mrg } 7937 1.1 mrg % these should not use \errmessage; the glibc manual, at least, actually 7938 1.1 mrg % has such constructs (when documenting function pointers). 7939 1.1 mrg \def\badparencount{% 7940 1.1 mrg \message{Warning: unbalanced parentheses in @def...}% 7941 1.1 mrg \global\parencount=0 7942 1.1 mrg } 7943 1.1 mrg \def\badbrackcount{% 7944 1.1 mrg \message{Warning: unbalanced square brackets in @def...}% 7945 1.1 mrg \global\brackcount=0 7946 1.1 mrg } 7947 1.1 mrg 7948 1.1 mrg 7949 1.1 mrg \message{macros,} 7950 1.1 mrg % @macro. 7951 1.1 mrg 7952 1.1 mrg % To do this right we need a feature of e-TeX, \scantokens, 7953 1.1 mrg % which we arrange to emulate with a temporary file in ordinary TeX. 7954 1.1 mrg \ifx\eTeXversion\thisisundefined 7955 1.1 mrg \newwrite\macscribble 7956 1.1 mrg \def\scantokens#1{% 7957 1.1 mrg \toks0={#1}% 7958 1.1 mrg \immediate\openout\macscribble=\jobname.tmp 7959 1.1 mrg \immediate\write\macscribble{\the\toks0}% 7960 1.1 mrg \immediate\closeout\macscribble 7961 1.1 mrg \input \jobname.tmp 7962 1.1.1.5 mrg } 7963 1.1.1.5 mrg \fi 7964 1.1.1.3 mrg 7965 1.1.1.3 mrg \let\E=\expandafter 7966 1.1.1.3 mrg 7967 1.1 mrg % Used at the time of macro expansion. 7968 1.1.1.5 mrg % Argument is macro body with arguments substituted 7969 1.1.1.5 mrg \def\scanmacro#1{% 7970 1.1.1.5 mrg \newlinechar`\^^M 7971 1.1.1.5 mrg % expand the expansion of \eatleadingcr twice to maybe remove a leading 7972 1.1.1.5 mrg % newline (and \else and \fi tokens), then call \eatspaces on the result. 7973 1.1.1.5 mrg \def\xeatspaces##1{% 7974 1.1.1.3 mrg \E\E\E\E\E\E\E\eatspaces\E\E\E\E\E\E\E{\eatleadingcr##1% 7975 1.1.1.3 mrg }}% 7976 1.1.1.4 mrg \def\xempty##1{}% 7977 1.1 mrg % 7978 1.1.1.4 mrg % Process the macro body under the current catcode regime. 7979 1.1.1.5 mrg \scantokens{#1@comment}% 7980 1.1.1.4 mrg % 7981 1.1.1.3 mrg % The \comment is to remove the \newlinechar added by \scantokens, and 7982 1.1 mrg % can be noticed by \parsearg. Note \c isn't used because this means cedilla 7983 1.1.1.3 mrg % in math mode. 7984 1.1 mrg } 7985 1.1.1.3 mrg 7986 1.1 mrg % Used for copying and captions 7987 1.1 mrg \def\scanexp#1{% 7988 1.1 mrg \expandafter\scanmacro\expandafter{#1}% 7989 1.1 mrg } 7990 1.1 mrg 7991 1.1 mrg \newcount\paramno % Count of parameters 7992 1.1 mrg \newtoks\macname % Macro name 7993 1.1.1.3 mrg \newif\ifrecursive % Is it recursive? 7994 1.1 mrg 7995 1.1 mrg % List of all defined macros in the form 7996 1.1 mrg % \commondummyword\macro1\commondummyword\macro2... 7997 1.1 mrg % Currently is also contains all @aliases; the list can be split 7998 1.1 mrg % if there is a need. 7999 1.1 mrg \def\macrolist{} 8000 1.1 mrg 8001 1.1.1.3 mrg % Add the macro to \macrolist 8002 1.1 mrg \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname} 8003 1.1 mrg \def\addtomacrolistxxx#1{% 8004 1.1 mrg \toks0 = \expandafter{\macrolist\commondummyword#1}% 8005 1.1 mrg \xdef\macrolist{\the\toks0}% 8006 1.1 mrg } 8007 1.1 mrg 8008 1.1 mrg % Utility routines. 8009 1.1 mrg % This does \let #1 = #2, with \csnames; that is, 8010 1.1 mrg % \let \csname#1\endcsname = \csname#2\endcsname 8011 1.1 mrg % (except of course we have to play expansion games). 8012 1.1 mrg % 8013 1.1 mrg \def\cslet#1#2{% 8014 1.1 mrg \expandafter\let 8015 1.1 mrg \csname#1\expandafter\endcsname 8016 1.1 mrg \csname#2\endcsname 8017 1.1 mrg } 8018 1.1 mrg 8019 1.1 mrg % Trim leading and trailing spaces off a string. 8020 1.1 mrg % Concepts from aro-bend problem 15 (see CTAN). 8021 1.1 mrg {\catcode`\@=11 8022 1.1 mrg \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} 8023 1.1 mrg \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} 8024 1.1 mrg \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} 8025 1.1 mrg \def\unbrace#1{#1} 8026 1.1.1.5 mrg \unbrace{\gdef\trim@@@ #1 } #2@{#1} 8027 1.1.1.5 mrg } 8028 1.1.1.5 mrg 8029 1.1.1.5 mrg {\catcode`\^^M=\other% 8030 1.1.1.5 mrg \gdef\eatleadingcr#1{\if\noexpand#1\noexpand^^M\else\E#1\fi}}% 8031 1.1 mrg % Warning: this won't work for a delimited argument 8032 1.1 mrg % or for an empty argument 8033 1.1 mrg 8034 1.1 mrg % Trim a single trailing ^^M off a string. 8035 1.1 mrg {\catcode`\^^M=\other \catcode`\Q=3% 8036 1.1 mrg \gdef\eatcr #1{\eatcra #1Q^^MQ}% 8037 1.1 mrg \gdef\eatcra#1^^MQ{\eatcrb#1Q}% 8038 1.1 mrg \gdef\eatcrb#1Q#2Q{#1}% 8039 1.1 mrg } 8040 1.1 mrg 8041 1.1 mrg % Macro bodies are absorbed as an argument in a context where 8042 1.1 mrg % all characters are catcode 10, 11 or 12, except \ which is active 8043 1.1 mrg % (as in normal texinfo). It is necessary to change the definition of \ 8044 1.1 mrg % to recognize macro arguments; this is the job of \mbodybackslash. 8045 1.1 mrg % 8046 1.1 mrg % Non-ASCII encodings make 8-bit characters active, so un-activate 8047 1.1 mrg % them to avoid their expansion. Must do this non-globally, to 8048 1.1 mrg % confine the change to the current group. 8049 1.1 mrg % 8050 1.1 mrg % It's necessary to have hard CRs when the macro is executed. This is 8051 1.1 mrg % done by making ^^M (\endlinechar) catcode 12 when reading the macro 8052 1.1 mrg % body, and then making it the \newlinechar in \scanmacro. 8053 1.1 mrg % 8054 1.1 mrg \def\scanctxt{% used as subroutine 8055 1.1 mrg \catcode`\"=\other 8056 1.1 mrg \catcode`\+=\other 8057 1.1 mrg \catcode`\<=\other 8058 1.1 mrg \catcode`\>=\other 8059 1.1 mrg \catcode`\^=\other 8060 1.1.1.3 mrg \catcode`\_=\other 8061 1.1 mrg \catcode`\|=\other 8062 1.1.1.5 mrg \catcode`\~=\other 8063 1.1.1.5 mrg \catcode`\@=\other 8064 1.1 mrg \catcode`\^^M=\other 8065 1.1 mrg \catcode`\\=\active 8066 1.1.1.5 mrg \passthroughcharstrue 8067 1.1 mrg } 8068 1.1.1.3 mrg 8069 1.1 mrg \def\macrobodyctxt{% used for @macro definitions and @copying 8070 1.1 mrg \scanctxt 8071 1.1 mrg \catcode`\ =\other 8072 1.1 mrg \catcode`\{=\other 8073 1.1.1.3 mrg \catcode`\}=\other 8074 1.1.1.3 mrg } 8075 1.1.1.3 mrg 8076 1.1.1.3 mrg % Used when scanning braced macro arguments. Note, however, that catcode 8077 1.1 mrg % changes here are ineffectual if the macro invocation was nested inside 8078 1.1.1.3 mrg % an argument to another Texinfo command. 8079 1.1 mrg \def\macroargctxt{% 8080 1.1 mrg \scanctxt 8081 1.1.1.3 mrg \catcode`\ =\active 8082 1.1.1.3 mrg } 8083 1.1.1.3 mrg 8084 1.1.1.3 mrg \def\macrolineargctxt{% used for whole-line arguments without braces 8085 1.1.1.3 mrg \scanctxt 8086 1.1 mrg \catcode`\{=\other 8087 1.1 mrg \catcode`\}=\other 8088 1.1 mrg } 8089 1.1 mrg 8090 1.1 mrg % \mbodybackslash is the definition of \ in @macro bodies. 8091 1.1 mrg % It maps \foo\ => \csname macarg.foo\endcsname => #N 8092 1.1 mrg % where N is the macro parameter number. 8093 1.1 mrg % We define \csname macarg.\endcsname to be \realbackslash, so 8094 1.1 mrg % \\ in macro replacement text gets you a backslash. 8095 1.1 mrg % 8096 1.1 mrg {\catcode`@=0 @catcode`@\=@active 8097 1.1 mrg @gdef@usembodybackslash{@let\=@mbodybackslash} 8098 1.1 mrg @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} 8099 1.1 mrg } 8100 1.1 mrg \expandafter\def\csname macarg.\endcsname{\realbackslash} 8101 1.1 mrg 8102 1.1 mrg \def\margbackslash#1{\char`\#1 } 8103 1.1 mrg 8104 1.1 mrg \def\macro{\recursivefalse\parsearg\macroxxx} 8105 1.1 mrg \def\rmacro{\recursivetrue\parsearg\macroxxx} 8106 1.1 mrg 8107 1.1 mrg \def\macroxxx#1{% 8108 1.1 mrg \getargs{#1}% now \macname is the macname and \argl the arglist 8109 1.1 mrg \ifx\argl\empty % no arguments 8110 1.1 mrg \paramno=0\relax 8111 1.1 mrg \else 8112 1.1 mrg \expandafter\parsemargdef \argl;% 8113 1.1 mrg \if\paramno>256\relax 8114 1.1 mrg \ifx\eTeXversion\thisisundefined 8115 1.1 mrg \errhelp = \EMsimple 8116 1.1 mrg \errmessage{You need eTeX to compile a file with macros with more than 256 arguments} 8117 1.1 mrg \fi 8118 1.1 mrg \fi 8119 1.1 mrg \fi 8120 1.1 mrg \if1\csname ismacro.\the\macname\endcsname 8121 1.1 mrg \message{Warning: redefining \the\macname}% 8122 1.1 mrg \else 8123 1.1 mrg \expandafter\ifx\csname \the\macname\endcsname \relax 8124 1.1 mrg \else \errmessage{Macro name \the\macname\space already defined}\fi 8125 1.1 mrg \global\cslet{macsave.\the\macname}{\the\macname}% 8126 1.1.1.5 mrg \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% 8127 1.1 mrg \addtomacrolist{\the\macname}% 8128 1.1 mrg \fi 8129 1.1 mrg \begingroup \macrobodyctxt \usembodybackslash 8130 1.1 mrg \ifrecursive \expandafter\parsermacbody 8131 1.1 mrg \else \expandafter\parsemacbody 8132 1.1 mrg \fi} 8133 1.1 mrg 8134 1.1 mrg \parseargdef\unmacro{% 8135 1.1 mrg \if1\csname ismacro.#1\endcsname 8136 1.1 mrg \global\cslet{#1}{macsave.#1}% 8137 1.1 mrg \global\expandafter\let \csname ismacro.#1\endcsname=0% 8138 1.1.1.3 mrg % Remove the macro name from \macrolist: 8139 1.1 mrg \begingroup 8140 1.1 mrg \expandafter\let\csname#1\endcsname \relax 8141 1.1 mrg \let\commondummyword\unmacrodo 8142 1.1 mrg \xdef\macrolist{\macrolist}% 8143 1.1 mrg \endgroup 8144 1.1 mrg \else 8145 1.1 mrg \errmessage{Macro #1 not defined}% 8146 1.1 mrg \fi 8147 1.1 mrg } 8148 1.1 mrg 8149 1.1 mrg % Called by \do from \dounmacro on each macro. The idea is to omit any 8150 1.1 mrg % macro definitions that have been changed to \relax. 8151 1.1 mrg % 8152 1.1 mrg \def\unmacrodo#1{% 8153 1.1.1.3 mrg \ifx #1\relax 8154 1.1 mrg % remove this 8155 1.1 mrg \else 8156 1.1 mrg \noexpand\commondummyword \noexpand#1% 8157 1.1.1.3 mrg \fi 8158 1.1.1.3 mrg } 8159 1.1 mrg 8160 1.1 mrg % \getargs -- Parse the arguments to a @macro line. Set \macname to 8161 1.1 mrg % the name of the macro, and \argl to the braced argument list. 8162 1.1 mrg \def\getargs#1{\getargsxxx#1{}} 8163 1.1.1.3 mrg \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} 8164 1.1.1.3 mrg \def\getmacname#1 #2\relax{\macname={#1}} 8165 1.1.1.3 mrg \def\getmacargs#1{\def\argl{#1}} 8166 1.1 mrg % This made use of the feature that if the last token of a 8167 1.1.1.3 mrg % <parameter list> is #, then the preceding argument is delimited by 8168 1.1.1.3 mrg % an opening brace, and that opening brace is not consumed. 8169 1.1.1.3 mrg 8170 1.1.1.3 mrg % Parse the optional {params} list to @macro or @rmacro. 8171 1.1.1.3 mrg % Set \paramno to the number of arguments, 8172 1.1.1.3 mrg % and \paramlist to a parameter text for the macro (e.g. #1,#2,#3 for a 8173 1.1 mrg % three-param macro.) Define \macarg.BLAH for each BLAH in the params 8174 1.1.1.5 mrg % list to some hook where the argument is to be expanded. If there are 8175 1.1 mrg % less than 10 arguments that hook is to be replaced by ##N where N 8176 1.1 mrg % is the position in that list, that is to say the macro arguments are to be 8177 1.1 mrg % defined `a la TeX in the macro body. 8178 1.1.1.3 mrg % 8179 1.1.1.3 mrg % That gets used by \mbodybackslash (above). 8180 1.1 mrg % 8181 1.1 mrg % If there are 10 or more arguments, a different technique is used: see 8182 1.1 mrg % \parsemmanyargdef. 8183 1.1 mrg % 8184 1.1.1.3 mrg \def\parsemargdef#1;{% 8185 1.1 mrg \paramno=0\def\paramlist{}% 8186 1.1.1.5 mrg \let\hash\relax 8187 1.1 mrg % \hash is redefined to `#' later to get it into definitions 8188 1.1 mrg \let\xeatspaces\relax 8189 1.1 mrg \let\xempty\relax 8190 1.1 mrg \parsemargdefxxx#1,;,% 8191 1.1 mrg \ifnum\paramno<10\relax\else 8192 1.1 mrg \paramno0\relax 8193 1.1 mrg \parsemmanyargdef@@#1,;,% 10 or more arguments 8194 1.1 mrg \fi 8195 1.1 mrg } 8196 1.1 mrg \def\parsemargdefxxx#1,{% 8197 1.1 mrg \if#1;\let\next=\relax 8198 1.1.1.5 mrg \else \let\next=\parsemargdefxxx 8199 1.1 mrg \advance\paramno by 1 8200 1.1 mrg \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname 8201 1.1.1.5 mrg {\xeatspaces{\hash\the\paramno\noexpand\xempty{}}}% 8202 1.1.1.5 mrg \edef\paramlist{\paramlist\hash\the\paramno,}% 8203 1.1 mrg \fi\next} 8204 1.1.1.3 mrg % the \xempty{} is to give \eatleadingcr an argument in the case of an 8205 1.1.1.3 mrg % empty macro argument. 8206 1.1.1.3 mrg 8207 1.1.1.3 mrg % \parsemacbody, \parsermacbody 8208 1.1.1.5 mrg % 8209 1.1.1.5 mrg % Read recursive and nonrecursive macro bodies. (They're different since 8210 1.1.1.3 mrg % rec and nonrec macros end differently.) 8211 1.1.1.3 mrg % 8212 1.1.1.3 mrg % We are in \macrobodyctxt, and the \xdef causes backslashshes in the macro 8213 1.1.1.3 mrg % body to be transformed. 8214 1.1.1.3 mrg % Set \macrobody to the body of the macro, and call \defmacro. 8215 1.1.1.3 mrg % 8216 1.1.1.3 mrg {\catcode`\ =\other\long\gdef\parsemacbody#1@end macro{% 8217 1.1.1.3 mrg \xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}% 8218 1.1.1.3 mrg {\catcode`\ =\other\long\gdef\parsermacbody#1@end rmacro{% 8219 1.1.1.3 mrg \xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}% 8220 1.1.1.3 mrg 8221 1.1.1.3 mrg % Make @ a letter, so that we can make private-to-Texinfo macro names. 8222 1.1.1.3 mrg \edef\texiatcatcode{\the\catcode`\@} 8223 1.1.1.3 mrg \catcode `@=11\relax 8224 1.1.1.3 mrg 8225 1.1.1.3 mrg %%%%%%%%%%%%%% Code for > 10 arguments only %%%%%%%%%%%%%%%%%% 8226 1.1.1.3 mrg 8227 1.1.1.3 mrg % If there are 10 or more arguments, a different technique is used, where the 8228 1.1.1.3 mrg % hook remains in the body, and when macro is to be expanded the body is 8229 1.1.1.3 mrg % processed again to replace the arguments. 8230 1.1.1.3 mrg % 8231 1.1.1.3 mrg % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the 8232 1.1.1.3 mrg % argument N value and then \edef the body (nothing else will expand because of 8233 1.1.1.3 mrg % the catcode regime under which the body was input). 8234 1.1.1.3 mrg % 8235 1.1.1.3 mrg % If you compile with TeX (not eTeX), and you have macros with 10 or more 8236 1.1.1.3 mrg % arguments, no macro can have more than 256 arguments (else error). 8237 1.1.1.3 mrg % 8238 1.1.1.3 mrg % In case that there are 10 or more arguments we parse again the arguments 8239 1.1.1.3 mrg % list to set new definitions for the \macarg.BLAH macros corresponding to 8240 1.1.1.3 mrg % each BLAH argument. It was anyhow needed to parse already once this list 8241 1.1 mrg % in order to count the arguments, and as macros with at most 9 arguments 8242 1.1 mrg % are by far more frequent than macro with 10 or more arguments, defining 8243 1.1.1.5 mrg % twice the \macarg.BLAH macros does not cost too much processing power. 8244 1.1 mrg \def\parsemmanyargdef@@#1,{% 8245 1.1 mrg \if#1;\let\next=\relax 8246 1.1 mrg \else 8247 1.1 mrg \let\next=\parsemmanyargdef@@ 8248 1.1 mrg \edef\tempb{\eatspaces{#1}}% 8249 1.1 mrg \expandafter\def\expandafter\tempa 8250 1.1 mrg \expandafter{\csname macarg.\tempb\endcsname}% 8251 1.1 mrg % Note that we need some extra \noexpand\noexpand, this is because we 8252 1.1 mrg % don't want \the to be expanded in the \parsermacbody as it uses an 8253 1.1 mrg % \xdef . 8254 1.1 mrg \expandafter\edef\tempa 8255 1.1 mrg {\noexpand\noexpand\noexpand\the\toks\the\paramno}% 8256 1.1 mrg \advance\paramno by 1\relax 8257 1.1 mrg \fi\next} 8258 1.1 mrg 8259 1.1 mrg 8260 1.1 mrg \let\endargs@\relax 8261 1.1 mrg \let\nil@\relax 8262 1.1 mrg \def\nilm@{\nil@}% 8263 1.1.1.3 mrg \long\def\nillm@{\nil@}% 8264 1.1 mrg 8265 1.1 mrg % This macro is expanded during the Texinfo macro expansion, not during its 8266 1.1 mrg % definition. It gets all the arguments' values and assigns them to macros 8267 1.1 mrg % macarg.ARGNAME 8268 1.1 mrg % 8269 1.1 mrg % #1 is the macro name 8270 1.1 mrg % #2 is the list of argument names 8271 1.1 mrg % #3 is the list of argument values 8272 1.1 mrg \def\getargvals@#1#2#3{% 8273 1.1 mrg \def\macargdeflist@{}% 8274 1.1 mrg \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion. 8275 1.1 mrg \def\paramlist{#2,\nil@}% 8276 1.1 mrg \def\macroname{#1}% 8277 1.1 mrg \begingroup 8278 1.1 mrg \macroargctxt 8279 1.1 mrg \def\argvaluelist{#3,\nil@}% 8280 1.1 mrg \def\@tempa{#3}% 8281 1.1 mrg \ifx\@tempa\empty 8282 1.1 mrg \setemptyargvalues@ 8283 1.1 mrg \else 8284 1.1 mrg \getargvals@@ 8285 1.1 mrg \fi 8286 1.1 mrg } 8287 1.1 mrg \def\getargvals@@{% 8288 1.1 mrg \ifx\paramlist\nilm@ 8289 1.1 mrg % Some sanity check needed here that \argvaluelist is also empty. 8290 1.1 mrg \ifx\argvaluelist\nillm@ 8291 1.1 mrg \else 8292 1.1 mrg \errhelp = \EMsimple 8293 1.1 mrg \errmessage{Too many arguments in macro `\macroname'!}% 8294 1.1 mrg \fi 8295 1.1 mrg \let\next\macargexpandinbody@ 8296 1.1 mrg \else 8297 1.1 mrg \ifx\argvaluelist\nillm@ 8298 1.1 mrg % No more arguments values passed to macro. Set remaining named-arg 8299 1.1 mrg % macros to empty. 8300 1.1 mrg \let\next\setemptyargvalues@ 8301 1.1 mrg \else 8302 1.1 mrg % pop current arg name into \@tempb 8303 1.1 mrg \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}% 8304 1.1 mrg \expandafter\@tempa\expandafter{\paramlist}% 8305 1.1 mrg % pop current argument value into \@tempc 8306 1.1 mrg \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}% 8307 1.1 mrg \expandafter\@tempa\expandafter{\argvaluelist}% 8308 1.1 mrg % Here \@tempb is the current arg name and \@tempc is the current arg value. 8309 1.1 mrg % First place the new argument macro definition into \@tempd 8310 1.1 mrg \expandafter\macname\expandafter{\@tempc}% 8311 1.1 mrg \expandafter\let\csname macarg.\@tempb\endcsname\relax 8312 1.1 mrg \expandafter\def\expandafter\@tempe\expandafter{% 8313 1.1 mrg \csname macarg.\@tempb\endcsname}% 8314 1.1 mrg \edef\@tempd{\long\def\@tempe{\the\macname}}% 8315 1.1 mrg \push@\@tempd\macargdeflist@ 8316 1.1 mrg \let\next\getargvals@@ 8317 1.1 mrg \fi 8318 1.1 mrg \fi 8319 1.1 mrg \next 8320 1.1 mrg } 8321 1.1 mrg 8322 1.1 mrg \def\push@#1#2{% 8323 1.1 mrg \expandafter\expandafter\expandafter\def 8324 1.1 mrg \expandafter\expandafter\expandafter#2% 8325 1.1 mrg \expandafter\expandafter\expandafter{% 8326 1.1 mrg \expandafter#1#2}% 8327 1.1.1.3 mrg } 8328 1.1.1.5 mrg 8329 1.1 mrg % Replace arguments by their values in the macro body, and place the result 8330 1.1 mrg % in macro \@tempa. 8331 1.1 mrg % 8332 1.1 mrg \def\macvalstoargs@{% 8333 1.1 mrg % To do this we use the property that token registers that are \the'ed 8334 1.1 mrg % within an \edef expand only once. So we are going to place all argument 8335 1.1 mrg % values into respective token registers. 8336 1.1 mrg % 8337 1.1 mrg % First we save the token context, and initialize argument numbering. 8338 1.1 mrg \begingroup 8339 1.1 mrg \paramno0\relax 8340 1.1 mrg % Then, for each argument number #N, we place the corresponding argument 8341 1.1 mrg % value into a new token list register \toks#N 8342 1.1 mrg \expandafter\putargsintokens@\saveparamlist@,;,% 8343 1.1 mrg % Then, we expand the body so that argument are replaced by their 8344 1.1 mrg % values. The trick for values not to be expanded themselves is that they 8345 1.1 mrg % are within tokens and that tokens expand only once in an \edef . 8346 1.1 mrg \edef\@tempc{\csname mac.\macroname .body\endcsname}% 8347 1.1 mrg % Now we restore the token stack pointer to free the token list registers 8348 1.1 mrg % which we have used, but we make sure that expanded body is saved after 8349 1.1 mrg % group. 8350 1.1 mrg \expandafter 8351 1.1 mrg \endgroup 8352 1.1.1.5 mrg \expandafter\def\expandafter\@tempa\expandafter{\@tempc}% 8353 1.1.1.5 mrg } 8354 1.1.1.5 mrg 8355 1.1 mrg % Define the named-macro outside of this group and then close this group. 8356 1.1 mrg % 8357 1.1 mrg \def\macargexpandinbody@{% 8358 1.1 mrg \expandafter 8359 1.1 mrg \endgroup 8360 1.1 mrg \macargdeflist@ 8361 1.1 mrg % First the replace in body the macro arguments by their values, the result 8362 1.1 mrg % is in \@tempa . 8363 1.1 mrg \macvalstoargs@ 8364 1.1 mrg % Then we point at the \norecurse or \gobble (for recursive) macro value 8365 1.1 mrg % with \@tempb . 8366 1.1 mrg \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname 8367 1.1 mrg % Depending on whether it is recursive or not, we need some tailing 8368 1.1 mrg % \egroup . 8369 1.1 mrg \ifx\@tempb\gobble 8370 1.1 mrg \let\@tempc\relax 8371 1.1 mrg \else 8372 1.1 mrg \let\@tempc\egroup 8373 1.1 mrg \fi 8374 1.1 mrg % And now we do the real job: 8375 1.1 mrg \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}% 8376 1.1 mrg \@tempd 8377 1.1 mrg } 8378 1.1 mrg 8379 1.1 mrg \def\putargsintokens@#1,{% 8380 1.1 mrg \if#1;\let\next\relax 8381 1.1 mrg \else 8382 1.1 mrg \let\next\putargsintokens@ 8383 1.1 mrg % First we allocate the new token list register, and give it a temporary 8384 1.1 mrg % alias \@tempb . 8385 1.1 mrg \toksdef\@tempb\the\paramno 8386 1.1 mrg % Then we place the argument value into that token list register. 8387 1.1 mrg \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname 8388 1.1 mrg \expandafter\@tempb\expandafter{\@tempa}% 8389 1.1 mrg \advance\paramno by 1\relax 8390 1.1 mrg \fi 8391 1.1.1.3 mrg \next 8392 1.1.1.5 mrg } 8393 1.1 mrg 8394 1.1 mrg % Trailing missing arguments are set to empty. 8395 1.1 mrg % 8396 1.1 mrg \def\setemptyargvalues@{% 8397 1.1 mrg \ifx\paramlist\nilm@ 8398 1.1 mrg \let\next\macargexpandinbody@ 8399 1.1 mrg \else 8400 1.1 mrg \expandafter\setemptyargvaluesparser@\paramlist\endargs@ 8401 1.1 mrg \let\next\setemptyargvalues@ 8402 1.1 mrg \fi 8403 1.1 mrg \next 8404 1.1 mrg } 8405 1.1 mrg 8406 1.1 mrg \def\setemptyargvaluesparser@#1,#2\endargs@{% 8407 1.1 mrg \expandafter\def\expandafter\@tempa\expandafter{% 8408 1.1 mrg \expandafter\def\csname macarg.#1\endcsname{}}% 8409 1.1 mrg \push@\@tempa\macargdeflist@ 8410 1.1 mrg \def\paramlist{#2}% 8411 1.1 mrg } 8412 1.1 mrg 8413 1.1 mrg % #1 is the element target macro 8414 1.1 mrg % #2 is the list macro 8415 1.1 mrg % #3,#4\endargs@ is the list value 8416 1.1 mrg \def\pop@#1#2#3,#4\endargs@{% 8417 1.1 mrg \def#1{#3}% 8418 1.1 mrg \def#2{#4}% 8419 1.1 mrg } 8420 1.1 mrg \long\def\longpop@#1#2#3,#4\endargs@{% 8421 1.1 mrg \long\def#1{#3}% 8422 1.1.1.3 mrg \long\def#2{#4}% 8423 1.1.1.3 mrg } 8424 1.1.1.3 mrg 8425 1.1.1.3 mrg 8426 1.1.1.3 mrg %%%%%%%%%%%%%% End of code for > 10 arguments %%%%%%%%%%%%%%%%%% 8427 1.1.1.3 mrg 8428 1.1.1.3 mrg 8429 1.1.1.3 mrg % This defines a Texinfo @macro or @rmacro, called by \parsemacbody. 8430 1.1.1.3 mrg % \macrobody has the body of the macro in it, with placeholders for 8431 1.1.1.3 mrg % its parameters, looking like "\xeatspaces{\hash 1}". 8432 1.1 mrg % \paramno is the number of parameters 8433 1.1.1.3 mrg % \paramlist is a TeX parameter text, e.g. "#1,#2,#3," 8434 1.1 mrg % There are four cases: macros of zero, one, up to nine, and many arguments. 8435 1.1 mrg % \xdef is used so that macro definitions will survive the file 8436 1.1 mrg % they're defined in: @include reads the file inside a group. 8437 1.1.1.3 mrg % 8438 1.1.1.3 mrg \def\defmacro{% 8439 1.1.1.3 mrg \let\hash=##% convert placeholders to macro parameter chars 8440 1.1.1.3 mrg \ifnum\paramno=1 8441 1.1.1.3 mrg \def\xeatspaces##1{##1}% 8442 1.1.1.3 mrg % This removes the pair of braces around the argument. We don't 8443 1.1.1.3 mrg % use \eatspaces, because this can cause ends of lines to be lost 8444 1.1.1.3 mrg % when the argument to \eatspaces is read, leading to line-based 8445 1.1.1.3 mrg % commands like "@itemize" not being read correctly. 8446 1.1.1.3 mrg \else 8447 1.1.1.3 mrg \let\xeatspaces\relax % suppress expansion 8448 1.1.1.3 mrg \fi 8449 1.1.1.5 mrg \ifcase\paramno 8450 1.1.1.3 mrg % 0 8451 1.1.1.3 mrg \expandafter\xdef\csname\the\macname\endcsname{% 8452 1.1.1.3 mrg \begingroup 8453 1.1.1.3 mrg \noexpand\spaceisspace 8454 1.1.1.3 mrg \noexpand\endlineisspace 8455 1.1.1.5 mrg \noexpand\expandafter % skip any whitespace after the macro name. 8456 1.1.1.3 mrg \expandafter\noexpand\csname\the\macname @@@\endcsname}% 8457 1.1.1.3 mrg \expandafter\xdef\csname\the\macname @@@\endcsname{% 8458 1.1.1.3 mrg \endgroup 8459 1.1.1.5 mrg \noexpand\scanmacro{\macrobody}}% 8460 1.1.1.3 mrg \or % 1 8461 1.1.1.3 mrg \expandafter\xdef\csname\the\macname\endcsname{% 8462 1.1.1.3 mrg \begingroup 8463 1.1.1.5 mrg \noexpand\braceorline 8464 1.1.1.3 mrg \expandafter\noexpand\csname\the\macname @@@\endcsname}% 8465 1.1.1.3 mrg \expandafter\xdef\csname\the\macname @@@\endcsname##1{% 8466 1.1.1.3 mrg \endgroup 8467 1.1.1.3 mrg \noexpand\scanmacro{\macrobody}% 8468 1.1.1.3 mrg }% 8469 1.1.1.5 mrg \else % at most 9 8470 1.1.1.3 mrg \ifnum\paramno<10\relax 8471 1.1.1.3 mrg % @MACNAME sets the context for reading the macro argument 8472 1.1.1.3 mrg % @MACNAME@@ gets the argument, processes backslashes and appends a 8473 1.1 mrg % comma. 8474 1.1.1.5 mrg % @MACNAME@@@ removes braces surrounding the argument list. 8475 1.1.1.3 mrg % @MACNAME@@@@ scans the macro body with arguments substituted. 8476 1.1.1.3 mrg \expandafter\xdef\csname\the\macname\endcsname{% 8477 1.1.1.3 mrg \begingroup 8478 1.1.1.3 mrg \noexpand\expandafter % This \expandafter skip any spaces after the 8479 1.1.1.3 mrg \noexpand\macroargctxt % macro before we change the catcode of space. 8480 1.1.1.3 mrg \noexpand\expandafter 8481 1.1.1.3 mrg \expandafter\noexpand\csname\the\macname @@\endcsname}% 8482 1.1.1.3 mrg \expandafter\xdef\csname\the\macname @@\endcsname##1{% 8483 1.1.1.3 mrg \noexpand\passargtomacro 8484 1.1.1.3 mrg \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}% 8485 1.1.1.3 mrg \expandafter\xdef\csname\the\macname @@@\endcsname##1{% 8486 1.1.1.3 mrg \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}% 8487 1.1.1.3 mrg \expandafter\expandafter 8488 1.1.1.5 mrg \expandafter\xdef 8489 1.1.1.3 mrg \expandafter\expandafter 8490 1.1 mrg \csname\the\macname @@@@\endcsname\paramlist{% 8491 1.1.1.3 mrg \endgroup\noexpand\scanmacro{\macrobody}}% 8492 1.1.1.3 mrg \else % 10 or more: 8493 1.1.1.3 mrg \expandafter\xdef\csname\the\macname\endcsname{% 8494 1.1.1.3 mrg \noexpand\getargvals@{\the\macname}{\argl}% 8495 1.1 mrg }% 8496 1.1 mrg \global\expandafter\let\csname mac.\the\macname .body\endcsname\macrobody 8497 1.1 mrg \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble 8498 1.1.1.3 mrg \fi 8499 1.1 mrg \fi} 8500 1.1 mrg 8501 1.1 mrg \catcode `\@\texiatcatcode\relax % end private-to-Texinfo catcodes 8502 1.1.1.3 mrg 8503 1.1.1.3 mrg \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} 8504 1.1.1.3 mrg 8505 1.1.1.3 mrg 8506 1.1.1.3 mrg %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8507 1.1.1.3 mrg % 8508 1.1.1.3 mrg {\catcode`\@=0 \catcode`\\=13 % We need to manipulate \ so use @ as escape 8509 1.1.1.3 mrg @catcode`@_=11 % private names 8510 1.1.1.3 mrg @catcode`@!=11 % used as argument separator 8511 1.1.1.3 mrg 8512 1.1.1.3 mrg % \passargtomacro#1#2 - 8513 1.1.1.5 mrg % Call #1 with a list of tokens #2, with any doubled backslashes in #2 8514 1.1.1.5 mrg % compressed to one. 8515 1.1.1.5 mrg % 8516 1.1.1.3 mrg % This implementation works by expansion, and not execution (so we cannot use 8517 1.1.1.5 mrg % \def or similar). This reduces the risk of this failing in contexts where 8518 1.1.1.3 mrg % complete expansion is done with no execution (for example, in writing out to 8519 1.1.1.3 mrg % an auxiliary file for an index entry). 8520 1.1.1.3 mrg % 8521 1.1.1.3 mrg % State is kept in the input stream: the argument passed to 8522 1.1.1.3 mrg % @look_ahead, @gobble_and_check_finish and @add_segment is 8523 1.1.1.3 mrg % 8524 1.1.1.3 mrg % THE_MACRO ARG_RESULT ! {PENDING_BS} NEXT_TOKEN (... rest of input) 8525 1.1.1.3 mrg % 8526 1.1.1.3 mrg % where: 8527 1.1.1.3 mrg % THE_MACRO - name of the macro we want to call 8528 1.1.1.3 mrg % ARG_RESULT - argument list we build to pass to that macro 8529 1.1.1.3 mrg % PENDING_BS - either a backslash or nothing 8530 1.1.1.3 mrg % NEXT_TOKEN - used to look ahead in the input stream to see what's coming next 8531 1.1.1.3 mrg 8532 1.1.1.3 mrg @gdef@passargtomacro#1#2{% 8533 1.1.1.3 mrg @add_segment #1!{}@relax#2\@_finish\% 8534 1.1.1.3 mrg } 8535 1.1.1.3 mrg @gdef@_finish{@_finishx} @global@let@_finishx@relax 8536 1.1.1.3 mrg 8537 1.1.1.3 mrg % #1 - THE_MACRO ARG_RESULT 8538 1.1.1.3 mrg % #2 - PENDING_BS 8539 1.1.1.5 mrg % #3 - NEXT_TOKEN 8540 1.1.1.3 mrg % #4 used to look ahead 8541 1.1.1.3 mrg % 8542 1.1.1.3 mrg % If the next token is not a backslash, process the rest of the argument; 8543 1.1.1.5 mrg % otherwise, remove the next token. 8544 1.1.1.3 mrg @gdef@look_ahead#1!#2#3#4{% 8545 1.1.1.3 mrg @ifx#4\% 8546 1.1.1.3 mrg @expandafter@gobble_and_check_finish 8547 1.1.1.3 mrg @else 8548 1.1.1.3 mrg @expandafter@add_segment 8549 1.1.1.3 mrg @fi#1!{#2}#4#4% 8550 1.1.1.3 mrg } 8551 1.1.1.3 mrg 8552 1.1.1.3 mrg % #1 - THE_MACRO ARG_RESULT 8553 1.1.1.3 mrg % #2 - PENDING_BS 8554 1.1.1.3 mrg % #3 - NEXT_TOKEN 8555 1.1.1.3 mrg % #4 should be a backslash, which is gobbled. 8556 1.1.1.3 mrg % #5 looks ahead 8557 1.1.1.3 mrg % 8558 1.1.1.3 mrg % Double backslash found. Add a single backslash, and look ahead. 8559 1.1.1.3 mrg @gdef@gobble_and_check_finish#1!#2#3#4#5{% 8560 1.1.1.3 mrg @add_segment#1\!{}#5#5% 8561 1.1.1.3 mrg } 8562 1.1.1.3 mrg 8563 1.1.1.3 mrg @gdef@is_fi{@fi} 8564 1.1.1.3 mrg 8565 1.1.1.3 mrg % #1 - THE_MACRO ARG_RESULT 8566 1.1.1.3 mrg % #2 - PENDING_BS 8567 1.1.1.5 mrg % #3 - NEXT_TOKEN 8568 1.1.1.5 mrg % #4 is input stream until next backslash 8569 1.1.1.5 mrg % 8570 1.1.1.3 mrg % Input stream is either at the start of the argument, or just after a 8571 1.1.1.3 mrg % backslash sequence, either a lone backslash, or a doubled backslash. 8572 1.1.1.3 mrg % NEXT_TOKEN contains the first token in the input stream: if it is \finish, 8573 1.1.1.3 mrg % finish; otherwise, append to ARG_RESULT the segment of the argument up until 8574 1.1.1.3 mrg % the next backslash. PENDING_BACKSLASH contains a backslash to represent 8575 1.1.1.3 mrg % a backslash just before the start of the input stream that has not been 8576 1.1.1.3 mrg % added to ARG_RESULT. 8577 1.1.1.3 mrg @gdef@add_segment#1!#2#3#4\{% 8578 1.1.1.3 mrg @ifx#3@_finish 8579 1.1.1.3 mrg @call_the_macro#1!% 8580 1.1.1.3 mrg @else 8581 1.1.1.5 mrg % append the pending backslash to the result, followed by the next segment 8582 1.1.1.3 mrg @expandafter@is_fi@look_ahead#1#2#4!{\}@fi 8583 1.1.1.3 mrg % this @fi is discarded by @look_ahead. 8584 1.1.1.3 mrg % we can't get rid of it with \expandafter because we don't know how 8585 1.1.1.3 mrg % long #4 is. 8586 1.1.1.3 mrg } 8587 1.1.1.5 mrg 8588 1.1.1.3 mrg % #1 - THE_MACRO 8589 1.1.1.3 mrg % #2 - ARG_RESULT 8590 1.1.1.3 mrg % #3 discards the res of the conditional in @add_segment, and @is_fi ends the 8591 1.1.1.3 mrg % conditional. 8592 1.1.1.3 mrg @gdef@call_the_macro#1#2!#3@fi{@is_fi #1{#2}} 8593 1.1.1.3 mrg 8594 1.1.1.3 mrg } 8595 1.1.1.3 mrg %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8596 1.1.1.3 mrg 8597 1.1.1.3 mrg % \braceorline MAC is used for a one-argument macro MAC. It checks 8598 1.1.1.3 mrg % whether the next non-whitespace character is a {. It sets the context 8599 1.1.1.5 mrg % for reading the argument (slightly different in the two cases). Then, 8600 1.1 mrg % to read the argument, in the whole-line case, it then calls the regular 8601 1.1 mrg % \parsearg MAC; in the lbrace case, it calls \passargtomacro MAC. 8602 1.1.1.3 mrg % 8603 1.1.1.3 mrg \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} 8604 1.1.1.3 mrg \def\braceorlinexxx{% 8605 1.1.1.3 mrg \ifx\nchar\bgroup 8606 1.1.1.3 mrg \macroargctxt 8607 1.1 mrg \expandafter\passargtomacro 8608 1.1 mrg \else 8609 1.1 mrg \macrolineargctxt\expandafter\parsearg 8610 1.1 mrg \fi \macnamexxx} 8611 1.1 mrg 8612 1.1 mrg 8613 1.1 mrg % @alias. 8614 1.1 mrg % We need some trickery to remove the optional spaces around the equal 8615 1.1 mrg % sign. Make them active and then expand them all to nothing. 8616 1.1 mrg % 8617 1.1 mrg \def\alias{\parseargusing\obeyspaces\aliasxxx} 8618 1.1 mrg \def\aliasxxx #1{\aliasyyy#1\relax} 8619 1.1 mrg \def\aliasyyy #1=#2\relax{% 8620 1.1 mrg {% 8621 1.1 mrg \expandafter\let\obeyedspace=\empty 8622 1.1 mrg \addtomacrolist{#1}% 8623 1.1 mrg \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}% 8624 1.1 mrg }% 8625 1.1 mrg \next 8626 1.1 mrg } 8627 1.1 mrg 8628 1.1 mrg 8629 1.1 mrg \message{cross references,} 8630 1.1 mrg 8631 1.1 mrg \newwrite\auxfile 8632 1.1 mrg \newif\ifhavexrefs % True if xref values are known. 8633 1.1 mrg \newif\ifwarnedxrefs % True if we warned once that they aren't known. 8634 1.1 mrg 8635 1.1 mrg % @inforef is relatively simple. 8636 1.1 mrg \def\inforef #1{\inforefzzz #1,,,,**} 8637 1.1 mrg \def\inforefzzz #1,#2,#3,#4**{% 8638 1.1 mrg \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, 8639 1.1 mrg node \samp{\ignorespaces#1{}}} 8640 1.1 mrg 8641 1.1 mrg % @node's only job in TeX is to define \lastnode, which is used in 8642 1.1 mrg % cross-references. The @node line might or might not have commas, and 8643 1.1 mrg % might or might not have spaces before the first comma, like: 8644 1.1 mrg % @node foo , bar , ... 8645 1.1 mrg % We don't want such trailing spaces in the node name. 8646 1.1 mrg % 8647 1.1 mrg \parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse} 8648 1.1 mrg % 8649 1.1.1.4 mrg % also remove a trailing comma, in case of something like this: 8650 1.1.1.4 mrg % @node Help-Cross, , , Cross-refs 8651 1.1.1.4 mrg \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} 8652 1.1.1.4 mrg \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}\omittopnode} 8653 1.1.1.5 mrg 8654 1.1.1.4 mrg % Used so that the @top node doesn't have to be wrapped in an @ifnottex 8655 1.1.1.4 mrg % conditional. 8656 1.1.1.4 mrg % \doignore goes to more effort to skip nested conditionals but we don't need 8657 1.1.1.4 mrg % that here. 8658 1.1.1.4 mrg \def\omittopnode{% 8659 1.1.1.4 mrg \ifx\lastnode\wordTop 8660 1.1.1.4 mrg \expandafter\ignorenode\fi 8661 1.1.1.5 mrg } 8662 1.1.1.5 mrg \def\wordTop{Top} 8663 1.1.1.5 mrg 8664 1.1.1.5 mrg % Until the next @node, @part or @bye command, divert output to a box that 8665 1.1.1.5 mrg % is not output. 8666 1.1.1.4 mrg \def\ignorenode{\setbox\dummybox\vbox\bgroup 8667 1.1.1.4 mrg \def\part{\egroup\part}% 8668 1.1.1.4 mrg \def\node{\egroup\node}% 8669 1.1.1.4 mrg \ignorenodebye 8670 1.1.1.4 mrg } 8671 1.1.1.4 mrg 8672 1.1.1.4 mrg {\let\bye\relax 8673 1.1 mrg \gdef\ignorenodebye{\let\bye\ignorenodebyedef} 8674 1.1 mrg \gdef\ignorenodebyedef{\egroup(`Top' node ignored)\bye}} 8675 1.1 mrg % The redefinition of \bye here is because it is declared \outer 8676 1.1 mrg 8677 1.1 mrg \let\lastnode=\empty 8678 1.1 mrg 8679 1.1 mrg % Write a cross-reference definition for the current node. #1 is the 8680 1.1 mrg % type (Ynumbered, Yappendix, Ynothing). 8681 1.1 mrg % 8682 1.1 mrg \def\donoderef#1{% 8683 1.1 mrg \ifx\lastnode\empty\else 8684 1.1 mrg \setref{\lastnode}{#1}% 8685 1.1 mrg \global\let\lastnode=\empty 8686 1.1 mrg \fi 8687 1.1 mrg } 8688 1.1 mrg 8689 1.1 mrg % @anchor{NAME} -- define xref target at arbitrary point. 8690 1.1 mrg % 8691 1.1 mrg \newcount\savesfregister 8692 1.1 mrg % 8693 1.1 mrg \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} 8694 1.1 mrg \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} 8695 1.1 mrg \def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} 8696 1.1.1.4 mrg 8697 1.1 mrg % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an 8698 1.1 mrg % anchor), which consists of three parts: 8699 1.1 mrg % 1) NAME-title - the current sectioning name taken from \currentsection, 8700 1.1 mrg % or the anchor name. 8701 1.1 mrg % 2) NAME-snt - section number and type, passed as the SNT arg, or 8702 1.1 mrg % empty for anchors. 8703 1.1 mrg % 3) NAME-pg - the page number. 8704 1.1 mrg % 8705 1.1 mrg % This is called from \donoderef, \anchor, and \dofloat. In the case of 8706 1.1 mrg % floats, there is an additional part, which is not written here: 8707 1.1 mrg % 4) NAME-lof - the text as it should appear in a @listoffloats. 8708 1.1 mrg % 8709 1.1 mrg \def\setref#1#2{% 8710 1.1.1.3 mrg \pdfmkdest{#1}% 8711 1.1 mrg \iflinks 8712 1.1.1.3 mrg {% 8713 1.1.1.3 mrg \requireauxfile 8714 1.1 mrg \atdummies % preserve commands, but don't expand them 8715 1.1 mrg % match definition in \xrdef, \refx, \xrefX. 8716 1.1 mrg \def\value##1{##1}% 8717 1.1 mrg \edef\writexrdef##1##2{% 8718 1.1.1.4 mrg \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef 8719 1.1 mrg ##1}{##2}}% these are parameters of \writexrdef 8720 1.1 mrg }% 8721 1.1 mrg \toks0 = \expandafter{\currentsection}% 8722 1.1 mrg \immediate \writexrdef{title}{\the\toks0 }% 8723 1.1 mrg \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. 8724 1.1 mrg \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout 8725 1.1 mrg }% 8726 1.1 mrg \fi 8727 1.1 mrg } 8728 1.1 mrg 8729 1.1 mrg % @xrefautosectiontitle on|off says whether @section(ing) names are used 8730 1.1.1.5 mrg % automatically in xrefs, if the third arg is not explicitly specified. 8731 1.1 mrg % This was provided as a "secret" @set xref-automatic-section-title 8732 1.1 mrg % variable, now it's official. 8733 1.1 mrg % 8734 1.1 mrg \parseargdef\xrefautomaticsectiontitle{% 8735 1.1 mrg \def\temp{#1}% 8736 1.1 mrg \ifx\temp\onword 8737 1.1 mrg \expandafter\let\csname SETxref-automatic-section-title\endcsname 8738 1.1 mrg = \empty 8739 1.1 mrg \else\ifx\temp\offword 8740 1.1 mrg \expandafter\let\csname SETxref-automatic-section-title\endcsname 8741 1.1 mrg = \relax 8742 1.1 mrg \else 8743 1.1 mrg \errhelp = \EMsimple 8744 1.1 mrg \errmessage{Unknown @xrefautomaticsectiontitle value `\temp', 8745 1.1 mrg must be on|off}% 8746 1.1.1.5 mrg \fi\fi 8747 1.1 mrg } 8748 1.1 mrg 8749 1.1 mrg % 8751 1.1 mrg % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is 8752 1.1.1.3 mrg % the node name, #2 the name of the Info cross-reference, #3 the printed 8753 1.1.1.3 mrg % node name, #4 the name of the Info file, #5 the name of the printed 8754 1.1.1.3 mrg % manual. All but the node name can be omitted. 8755 1.1.1.3 mrg % 8756 1.1.1.3 mrg \def\pxref{\putwordsee{} \xrefXX} 8757 1.1.1.3 mrg \def\xref{\putwordSee{} \xrefXX} 8758 1.1 mrg \def\ref{\xrefXX} 8759 1.1.1.2 mrg 8760 1.1 mrg \def\xrefXX#1{\def\xrefXXarg{#1}\futurelet\tokenafterxref\xrefXXX} 8761 1.1.1.2 mrg \def\xrefXXX{\expandafter\xrefX\expandafter[\xrefXXarg,,,,,,,]} 8762 1.1 mrg % 8763 1.1 mrg \newbox\toprefbox 8764 1.1 mrg \newbox\printedrefnamebox 8765 1.1 mrg \newbox\infofilenamebox 8766 1.1 mrg \newbox\printedmanualbox 8767 1.1.1.2 mrg % 8768 1.1 mrg \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup 8769 1.1 mrg \unsepspaces 8770 1.1 mrg % 8771 1.1.1.2 mrg % Get args without leading/trailing spaces. 8772 1.1.1.2 mrg \def\printedrefname{\ignorespaces #3}% 8773 1.1.1.2 mrg \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}% 8774 1.1 mrg % 8775 1.1 mrg \def\infofilename{\ignorespaces #4}% 8776 1.1 mrg \setbox\infofilenamebox = \hbox{\infofilename\unskip}% 8777 1.1 mrg % 8778 1.1 mrg \def\printedmanual{\ignorespaces #5}% 8779 1.1 mrg \setbox\printedmanualbox = \hbox{\printedmanual\unskip}% 8780 1.1 mrg % 8781 1.1 mrg % If the printed reference name (arg #3) was not explicitly given in 8782 1.1 mrg % the @xref, figure out what we want to use. 8783 1.1 mrg \ifdim \wd\printedrefnamebox = 0pt 8784 1.1 mrg % No printed node name was explicitly given. 8785 1.1 mrg \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax 8786 1.1 mrg % Not auto section-title: use node name inside the square brackets. 8787 1.1 mrg \def\printedrefname{\ignorespaces #1}% 8788 1.1 mrg \else 8789 1.1 mrg % Auto section-title: use chapter/section title inside 8790 1.1 mrg % the square brackets if we have it. 8791 1.1 mrg \ifdim \wd\printedmanualbox > 0pt 8792 1.1 mrg % It is in another manual, so we don't have it; use node name. 8793 1.1.1.5 mrg \def\printedrefname{\ignorespaces #1}% 8794 1.1 mrg \else 8795 1.1 mrg \ifhavexrefs 8796 1.1 mrg % We (should) know the real title if we have the xref values. 8797 1.1 mrg \def\printedrefname{\refx{#1-title}}% 8798 1.1 mrg \else 8799 1.1 mrg % Otherwise just copy the Info node name. 8800 1.1 mrg \def\printedrefname{\ignorespaces #1}% 8801 1.1 mrg \fi% 8802 1.1 mrg \fi 8803 1.1 mrg \fi 8804 1.1.1.3 mrg \fi 8805 1.1 mrg % 8806 1.1 mrg % Make link in pdf output. 8807 1.1.1.3 mrg \ifpdf 8808 1.1 mrg % For pdfTeX and LuaTeX 8809 1.1.1.2 mrg {\indexnofonts 8810 1.1.1.2 mrg \makevalueexpandable 8811 1.1 mrg \turnoffactive 8812 1.1 mrg % This expands tokens, so do it after making catcode changes, so _ 8813 1.1.1.2 mrg % etc. don't get their TeX definitions. This ignores all spaces in 8814 1.1.1.2 mrg % #4, including (wrongly) those in the middle of the filename. 8815 1.1.1.3 mrg \getfilename{#4}% 8816 1.1.1.3 mrg % 8817 1.1.1.3 mrg % This (wrongly) does not take account of leading or trailing 8818 1.1.1.3 mrg % spaces in #1, which should be ignored. 8819 1.1.1.2 mrg \setpdfdestname{#1}% 8820 1.1 mrg % 8821 1.1 mrg \ifx\pdfdestname\empty 8822 1.1 mrg \def\pdfdestname{Top}% no empty targets 8823 1.1 mrg \fi 8824 1.1.1.3 mrg % 8825 1.1 mrg \leavevmode 8826 1.1.1.3 mrg \startlink attr{/Border [0 0 0]}% 8827 1.1 mrg \ifnum\filenamelength>0 8828 1.1 mrg goto file{\the\filename.pdf} name{\pdfdestname}% 8829 1.1 mrg \else 8830 1.1.1.3 mrg goto name{\pdfmkpgn{\pdfdestname}}% 8831 1.1.1.3 mrg \fi 8832 1.1.1.3 mrg }% 8833 1.1.1.3 mrg \setcolor{\linkcolor}% 8834 1.1.1.3 mrg \else 8835 1.1.1.3 mrg \ifx\XeTeXrevision\thisisundefined 8836 1.1.1.3 mrg \else 8837 1.1.1.3 mrg % For XeTeX 8838 1.1.1.3 mrg {\indexnofonts 8839 1.1.1.3 mrg \makevalueexpandable 8840 1.1.1.3 mrg \turnoffactive 8841 1.1.1.3 mrg % This expands tokens, so do it after making catcode changes, so _ 8842 1.1.1.3 mrg % etc. don't get their TeX definitions. This ignores all spaces in 8843 1.1.1.3 mrg % #4, including (wrongly) those in the middle of the filename. 8844 1.1.1.3 mrg \getfilename{#4}% 8845 1.1.1.3 mrg % 8846 1.1.1.3 mrg % This (wrongly) does not take account of leading or trailing 8847 1.1.1.3 mrg % spaces in #1, which should be ignored. 8848 1.1.1.3 mrg \setpdfdestname{#1}% 8849 1.1.1.3 mrg % 8850 1.1.1.3 mrg \ifx\pdfdestname\empty 8851 1.1.1.3 mrg \def\pdfdestname{Top}% no empty targets 8852 1.1.1.3 mrg \fi 8853 1.1.1.3 mrg % 8854 1.1.1.3 mrg \leavevmode 8855 1.1.1.3 mrg \ifnum\filenamelength>0 8856 1.1.1.3 mrg % With default settings, 8857 1.1.1.3 mrg % XeTeX (xdvipdfmx) replaces link destination names with integers. 8858 1.1.1.3 mrg % In this case, the replaced destination names of 8859 1.1.1.3 mrg % remote PDFs are no longer known. In order to avoid a replacement, 8860 1.1.1.3 mrg % you can use xdvipdfmx's command line option `-C 0x0010'. 8861 1.1.1.3 mrg % If you use XeTeX 0.99996+ (TeX Live 2016+), 8862 1.1.1.3 mrg % this command line option is no longer necessary 8863 1.1.1.3 mrg % because we can use the `dvipdfmx:config' special. 8864 1.1.1.3 mrg \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A 8865 1.1.1.3 mrg << /S /GoToR /F (\the\filename.pdf) /D (\pdfdestname) >> >>}% 8866 1.1.1.3 mrg \else 8867 1.1.1.3 mrg \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A 8868 1.1.1.3 mrg << /S /GoTo /D (\pdfdestname) >> >>}% 8869 1.1 mrg \fi 8870 1.1 mrg }% 8871 1.1 mrg \setcolor{\linkcolor}% 8872 1.1 mrg \fi 8873 1.1 mrg \fi 8874 1.1 mrg {% 8875 1.1.1.3 mrg % Have to otherify everything special to allow the \csname to 8876 1.1 mrg % include an _ in the xref name, etc. 8877 1.1 mrg \indexnofonts 8878 1.1 mrg \turnoffactive 8879 1.1.1.3 mrg \def\value##1{##1}% 8880 1.1.1.3 mrg \expandafter\global\expandafter\let\expandafter\Xthisreftitle 8881 1.1.1.3 mrg \csname XR#1-title\endcsname 8882 1.1.1.3 mrg }% 8883 1.1 mrg % 8884 1.1 mrg % Float references are printed completely differently: "Figure 1.2" 8885 1.1 mrg % instead of "[somenode], p.3". \iffloat distinguishes them by 8886 1.1 mrg % \Xthisreftitle being set to a magic string. 8887 1.1.1.5 mrg \iffloat\Xthisreftitle 8888 1.1 mrg % If the user specified the print name (third arg) to the ref, 8889 1.1 mrg % print it instead of our usual "Figure 1.2". 8890 1.1 mrg \ifdim\wd\printedrefnamebox = 0pt 8891 1.1 mrg \refx{#1-snt}% 8892 1.1.1.2 mrg \else 8893 1.1 mrg \printedrefname 8894 1.1 mrg \fi 8895 1.1 mrg % 8896 1.1 mrg % If the user also gave the printed manual name (fifth arg), append 8897 1.1 mrg % "in MANUALNAME". 8898 1.1 mrg \ifdim \wd\printedmanualbox > 0pt 8899 1.1.1.5 mrg \space \putwordin{} \cite{\printedmanual}% 8900 1.1 mrg \fi 8901 1.1 mrg \else 8902 1.1 mrg % node/anchor (non-float) references. 8903 1.1 mrg % 8904 1.1 mrg % If we use \unhbox to print the node names, TeX does not insert 8905 1.1 mrg % empty discretionaries after hyphens, which means that it will not 8906 1.1.1.5 mrg % find a line break at a hyphen in a node names. Since some manuals 8907 1.1 mrg % are best written with fairly long node names, containing hyphens, 8908 1.1.1.2 mrg % this is a loss. Therefore, we give the text of the node name 8909 1.1.1.5 mrg % again, so it is as if TeX is seeing it for the first time. 8910 1.1.1.2 mrg % 8911 1.1.1.2 mrg \ifdim \wd\printedmanualbox > 0pt 8912 1.1.1.2 mrg % Cross-manual reference with a printed manual name. 8913 1.1.1.2 mrg % 8914 1.1.1.2 mrg \crossmanualxref{\cite{\printedmanual\unskip}}% 8915 1.1.1.2 mrg % 8916 1.1.1.5 mrg \else\ifdim \wd\infofilenamebox > 0pt 8917 1.1.1.2 mrg % Cross-manual reference with only an info filename (arg 4), no 8918 1.1.1.2 mrg % printed manual name (arg 5). This is essentially the same as 8919 1.1 mrg % the case above; we output the filename, since we have nothing else. 8920 1.1.1.2 mrg % 8921 1.1 mrg \crossmanualxref{\code{\infofilename\unskip}}% 8922 1.1.1.5 mrg % 8923 1.1.1.5 mrg \else 8924 1.1.1.5 mrg % Reference within this manual. 8925 1.1.1.4 mrg % 8926 1.1.1.4 mrg % Only output a following space if the -snt ref is nonempty, as the ref 8927 1.1 mrg % will be empty for @unnumbered and @anchor. 8928 1.1 mrg \setbox2 = \hbox{\ignorespaces \refx{#1-snt}}% 8929 1.1 mrg \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi 8930 1.1.1.5 mrg % 8931 1.1.1.5 mrg % output the `[mynode]' via the macro below so it can be overridden. 8932 1.1.1.5 mrg \xrefprintnodename\printedrefname 8933 1.1.1.5 mrg % 8934 1.1.1.5 mrg \ifflagclear{txiomitxrefpg}{% 8935 1.1.1.5 mrg % We always want a comma 8936 1.1.1.5 mrg ,% 8937 1.1.1.5 mrg % output the `page 3'. 8938 1.1.1.5 mrg \turnoffactive \putpageref{#1}% 8939 1.1.1.5 mrg % Add a , if xref followed by a space 8940 1.1.1.5 mrg \if\space\noexpand\tokenafterxref ,% 8941 1.1.1.5 mrg \else\ifx\ \tokenafterxref ,% @TAB 8942 1.1.1.5 mrg \else\ifx\*\tokenafterxref ,% @* 8943 1.1.1.5 mrg \else\ifx\ \tokenafterxref ,% @SPACE 8944 1.1.1.5 mrg \else\ifx\ 8945 1.1.1.2 mrg \tokenafterxref ,% @NL 8946 1.1 mrg \else\ifx\tie\tokenafterxref ,% @tie 8947 1.1 mrg \fi\fi\fi\fi\fi\fi 8948 1.1 mrg }{}% 8949 1.1 mrg \fi\fi 8950 1.1.1.5 mrg \fi 8951 1.1.1.5 mrg \endlink 8952 1.1.1.5 mrg \endgroup} 8953 1.1.1.5 mrg 8954 1.1.1.2 mrg % can be overridden in translation files 8955 1.1.1.5 mrg \def\putpageref#1{% 8956 1.1.1.2 mrg \space\putwordpage\tie\refx{#1-pg}} 8957 1.1.1.2 mrg 8958 1.1.1.2 mrg % Output a cross-manual xref to #1. Used just above (twice). 8959 1.1.1.5 mrg % 8960 1.1.1.2 mrg % Only include the text "Section ``foo'' in" if the foo is neither 8961 1.1.1.2 mrg % missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply 8962 1.1.1.2 mrg % "see The Foo Manual", the idea being to refer to the whole manual. 8963 1.1.1.2 mrg % 8964 1.1.1.2 mrg % But, this being TeX, we can't easily compare our node name against the 8965 1.1.1.5 mrg % string "Top" while ignoring the possible spaces before and after in 8966 1.1.1.2 mrg % the input. By adding the arbitrary 7sp below, we make it much less 8967 1.1.1.2 mrg % likely that a real node name would have the same width as "Top" (e.g., 8968 1.1.1.5 mrg % in a monospaced font). Hopefully it will never happen in practice. 8969 1.1.1.2 mrg % 8970 1.1.1.2 mrg % For the same basic reason, we retypeset the "Top" at every 8971 1.1.1.2 mrg % reference, since the current font is indeterminate. 8972 1.1.1.2 mrg % 8973 1.1.1.2 mrg \def\crossmanualxref#1{% 8974 1.1.1.2 mrg \setbox\toprefbox = \hbox{Top\kern7sp}% 8975 1.1.1.2 mrg \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}% 8976 1.1.1.2 mrg \ifdim \wd2 > 7sp % nonempty? 8977 1.1.1.2 mrg \ifdim \wd2 = \wd\toprefbox \else % same as Top? 8978 1.1.1.2 mrg \putwordSection{} ``\printedrefname'' \putwordin{}\space 8979 1.1.1.2 mrg \fi 8980 1.1 mrg \fi 8981 1.1 mrg #1% 8982 1.1 mrg } 8983 1.1 mrg 8984 1.1 mrg % This macro is called from \xrefX for the `[nodename]' part of xref 8985 1.1 mrg % output. It's a separate macro only so it can be changed more easily, 8986 1.1 mrg % since square brackets don't work well in some documents. Particularly 8987 1.1 mrg % one that Bob is working on :). 8988 1.1 mrg % 8989 1.1 mrg \def\xrefprintnodename#1{[#1]} 8990 1.1 mrg 8991 1.1 mrg % Things referred to by \setref. 8992 1.1 mrg % 8993 1.1 mrg \def\Ynothing{} 8994 1.1 mrg \def\Yomitfromtoc{} 8995 1.1 mrg \def\Ynumbered{% 8996 1.1 mrg \ifnum\secno=0 8997 1.1 mrg \putwordChapter@tie \the\chapno 8998 1.1 mrg \else \ifnum\subsecno=0 8999 1.1 mrg \putwordSection@tie \the\chapno.\the\secno 9000 1.1 mrg \else \ifnum\subsubsecno=0 9001 1.1 mrg \putwordSection@tie \the\chapno.\the\secno.\the\subsecno 9002 1.1 mrg \else 9003 1.1 mrg \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno 9004 1.1 mrg \fi\fi\fi 9005 1.1 mrg } 9006 1.1 mrg \def\Yappendix{% 9007 1.1 mrg \ifnum\secno=0 9008 1.1 mrg \putwordAppendix@tie @char\the\appendixno{}% 9009 1.1 mrg \else \ifnum\subsecno=0 9010 1.1 mrg \putwordSection@tie @char\the\appendixno.\the\secno 9011 1.1 mrg \else \ifnum\subsubsecno=0 9012 1.1 mrg \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno 9013 1.1 mrg \else 9014 1.1 mrg \putwordSection@tie 9015 1.1.1.5 mrg @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno 9016 1.1.1.5 mrg \fi\fi\fi 9017 1.1.1.3 mrg } 9018 1.1 mrg 9019 1.1 mrg % \refx{NAME} - reference a cross-reference string named NAME. 9020 1.1.1.4 mrg \def\refx#1{% 9021 1.1.1.3 mrg \requireauxfile 9022 1.1 mrg {% 9023 1.1 mrg \indexnofonts 9024 1.1 mrg \turnoffactive 9025 1.1 mrg \def\value##1{##1}% 9026 1.1 mrg \expandafter\global\expandafter\let\expandafter\thisrefX 9027 1.1 mrg \csname XR#1\endcsname 9028 1.1 mrg }% 9029 1.1 mrg \ifx\thisrefX\relax 9030 1.1 mrg % If not defined, say something at least. 9031 1.1 mrg \angleleft un\-de\-fined\angleright 9032 1.1 mrg \iflinks 9033 1.1 mrg \ifhavexrefs 9034 1.1 mrg {\toks0 = {#1}% avoid expansion of possibly-complex value 9035 1.1 mrg \message{\linenumber Undefined cross reference `\the\toks0'.}}% 9036 1.1 mrg \else 9037 1.1 mrg \ifwarnedxrefs\else 9038 1.1 mrg \global\warnedxrefstrue 9039 1.1 mrg \message{Cross reference values unknown; you must run TeX again.}% 9040 1.1 mrg \fi 9041 1.1 mrg \fi 9042 1.1 mrg \fi 9043 1.1 mrg \else 9044 1.1 mrg % It's defined, so just use it. 9045 1.1.1.5 mrg \thisrefX 9046 1.1.1.5 mrg \fi 9047 1.1.1.5 mrg } 9048 1.1.1.3 mrg 9049 1.1 mrg % This is the macro invoked by entries in the aux file. Define a control 9050 1.1 mrg % sequence for a cross-reference target (we prepend XR to the control sequence 9051 1.1.1.3 mrg % name to avoid collisions). The value is the page number. If this is a float 9052 1.1.1.3 mrg % type, we have more work to do. 9053 1.1.1.3 mrg % 9054 1.1 mrg \def\xrdef#1#2{% 9055 1.1 mrg {% Expand the node or anchor name to remove control sequences. 9056 1.1.1.3 mrg % \turnoffactive stops 8-bit characters being changed to commands 9057 1.1 mrg % like @'e. \refx does the same to retrieve the value in the definition. 9058 1.1 mrg \indexnofonts 9059 1.1 mrg \turnoffactive 9060 1.1.1.3 mrg \def\value##1{##1}% 9061 1.1.1.3 mrg \xdef\safexrefname{#1}% 9062 1.1.1.3 mrg }% 9063 1.1.1.5 mrg % 9064 1.1.1.5 mrg \bgroup 9065 1.1.1.3 mrg \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% 9066 1.1.1.5 mrg \egroup 9067 1.1 mrg % We put the \gdef inside a group to avoid the definitions building up on 9068 1.1 mrg % TeX's save stack, which can cause it to run out of space for aux files with 9069 1.1 mrg % thousands of lines. \gdef doesn't use the save stack, but \csname does 9070 1.1 mrg % when it defines an unknown control sequence as \relax. 9071 1.1 mrg % 9072 1.1 mrg % Was that xref control sequence that we just defined for a float? 9073 1.1 mrg \expandafter\iffloat\csname XR\safexrefname\endcsname 9074 1.1 mrg % it was a float, and we have the (safe) float type in \iffloattype. 9075 1.1 mrg \expandafter\let\expandafter\floatlist 9076 1.1 mrg \csname floatlist\iffloattype\endcsname 9077 1.1 mrg % 9078 1.1 mrg % Is this the first time we've seen this float type? 9079 1.1 mrg \expandafter\ifx\floatlist\relax 9080 1.1 mrg \toks0 = {\do}% yes, so just \do 9081 1.1 mrg \else 9082 1.1 mrg % had it before, so preserve previous elements in list. 9083 1.1 mrg \toks0 = \expandafter{\floatlist\do}% 9084 1.1 mrg \fi 9085 1.1 mrg % 9086 1.1 mrg % Remember this xref in the control sequence \floatlistFLOATTYPE, 9087 1.1 mrg % for later use in \listoffloats. 9088 1.1 mrg \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0 9089 1.1.1.3 mrg {\safexrefname}}% 9090 1.1.1.3 mrg \fi 9091 1.1.1.3 mrg } 9092 1.1.1.3 mrg 9093 1.1.1.3 mrg % If working on a large document in chapters, it is convenient to 9094 1.1.1.3 mrg % be able to disable indexing, cross-referencing, and contents, for test runs. 9095 1.1.1.3 mrg % This is done with @novalidate at the beginning of the file. 9096 1.1.1.3 mrg % 9097 1.1.1.3 mrg \newif\iflinks \linkstrue % by default we want the aux files. 9098 1.1.1.3 mrg \let\novalidate = \linksfalse 9099 1.1.1.3 mrg 9100 1.1.1.3 mrg % Used when writing to the aux file, or when using data from it. 9101 1.1.1.3 mrg \def\requireauxfile{% 9102 1.1.1.3 mrg \iflinks 9103 1.1.1.3 mrg \tryauxfile 9104 1.1.1.3 mrg % Open the new aux file. TeX will close it automatically at exit. 9105 1.1.1.3 mrg \immediate\openout\auxfile=\jobname.aux 9106 1.1 mrg \fi 9107 1.1 mrg \global\let\requireauxfile=\relax % Only do this once. 9108 1.1 mrg } 9109 1.1 mrg 9110 1.1 mrg % Read the last existing aux file, if any. No error if none exists. 9111 1.1 mrg % 9112 1.1 mrg \def\tryauxfile{% 9113 1.1 mrg \openin 1 \jobname.aux 9114 1.1 mrg \ifeof 1 \else 9115 1.1 mrg \readdatafile{aux}% 9116 1.1 mrg \global\havexrefstrue 9117 1.1 mrg \fi 9118 1.1 mrg \closein 1 9119 1.1 mrg } 9120 1.1 mrg 9121 1.1 mrg \def\setupdatafile{% 9122 1.1 mrg \catcode`\^^@=\other 9123 1.1 mrg \catcode`\^^A=\other 9124 1.1 mrg \catcode`\^^B=\other 9125 1.1 mrg \catcode`\^^C=\other 9126 1.1 mrg \catcode`\^^D=\other 9127 1.1 mrg \catcode`\^^E=\other 9128 1.1 mrg \catcode`\^^F=\other 9129 1.1 mrg \catcode`\^^G=\other 9130 1.1 mrg \catcode`\^^H=\other 9131 1.1 mrg \catcode`\^^K=\other 9132 1.1 mrg \catcode`\^^L=\other 9133 1.1 mrg \catcode`\^^N=\other 9134 1.1 mrg \catcode`\^^P=\other 9135 1.1 mrg \catcode`\^^Q=\other 9136 1.1 mrg \catcode`\^^R=\other 9137 1.1 mrg \catcode`\^^S=\other 9138 1.1 mrg \catcode`\^^T=\other 9139 1.1 mrg \catcode`\^^U=\other 9140 1.1 mrg \catcode`\^^V=\other 9141 1.1 mrg \catcode`\^^W=\other 9142 1.1 mrg \catcode`\^^X=\other 9143 1.1 mrg \catcode`\^^Z=\other 9144 1.1 mrg \catcode`\^^[=\other 9145 1.1 mrg \catcode`\^^\=\other 9146 1.1 mrg \catcode`\^^]=\other 9147 1.1 mrg \catcode`\^^^=\other 9148 1.1 mrg \catcode`\^^_=\other 9149 1.1 mrg \catcode`\^=\other 9150 1.1 mrg % 9151 1.1 mrg % Special characters. Should be turned off anyway, but... 9152 1.1.1.5 mrg \catcode`\~=\other 9153 1.1.1.5 mrg \catcode`\[=\other 9154 1.1.1.5 mrg \catcode`\]=\other 9155 1.1.1.5 mrg \catcode`\"=\other 9156 1.1 mrg \catcode`\_=\active 9157 1.1 mrg \catcode`\|=\active 9158 1.1 mrg \catcode`\<=\active 9159 1.1 mrg \catcode`\>=\active 9160 1.1 mrg \catcode`\$=\other 9161 1.1 mrg \catcode`\#=\other 9162 1.1.1.4 mrg \catcode`\&=\other 9163 1.1 mrg \catcode`\%=\other 9164 1.1 mrg \catcode`+=\other % avoid \+ for paranoia even though we've turned it off 9165 1.1 mrg % 9166 1.1 mrg \catcode`\\=\active 9167 1.1 mrg % 9168 1.1 mrg % @ is our escape character in .aux files, and we need braces. 9169 1.1 mrg \catcode`\{=1 9170 1.1 mrg \catcode`\}=2 9171 1.1 mrg \catcode`\@=0 9172 1.1 mrg } 9173 1.1 mrg 9174 1.1 mrg \def\readdatafile#1{% 9175 1.1 mrg \begingroup 9176 1.1 mrg \setupdatafile 9177 1.1 mrg \input\jobname.#1 9178 1.1 mrg \endgroup} 9179 1.1 mrg 9180 1.1 mrg 9181 1.1 mrg \message{insertions,} 9182 1.1 mrg % including footnotes. 9183 1.1 mrg 9184 1.1 mrg \newcount \footnoteno 9185 1.1 mrg 9186 1.1 mrg % The trailing space in the following definition for supereject is 9187 1.1 mrg % vital for proper filling; pages come out unaligned when you do a 9188 1.1 mrg % pagealignmacro call if that space before the closing brace is 9189 1.1 mrg % removed. (Generally, numeric constants should always be followed by a 9190 1.1 mrg % space to prevent strange expansion errors.) 9191 1.1 mrg \def\supereject{\par\penalty -20000\footnoteno =0 } 9192 1.1 mrg 9193 1.1 mrg % @footnotestyle is meaningful for Info output only. 9194 1.1 mrg \let\footnotestyle=\comment 9195 1.1 mrg 9196 1.1 mrg {\catcode `\@=11 9197 1.1 mrg % 9198 1.1 mrg % Auto-number footnotes. Otherwise like plain. 9199 1.1 mrg \gdef\footnote{% 9200 1.1 mrg \global\advance\footnoteno by \@ne 9201 1.1 mrg \edef\thisfootno{$^{\the\footnoteno}$}% 9202 1.1 mrg % 9203 1.1 mrg % In case the footnote comes at the end of a sentence, preserve the 9204 1.1 mrg % extra spacing after we do the footnote number. 9205 1.1 mrg \let\@sf\empty 9206 1.1 mrg \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi 9207 1.1 mrg % 9208 1.1 mrg % Remove inadvertent blank space before typesetting the footnote number. 9209 1.1 mrg \unskip 9210 1.1 mrg \thisfootno\@sf 9211 1.1 mrg \dofootnote 9212 1.1 mrg }% 9213 1.1 mrg 9214 1.1 mrg % Don't bother with the trickery in plain.tex to not require the 9215 1.1 mrg % footnote text as a parameter. Our footnotes don't need to be so general. 9216 1.1 mrg % 9217 1.1 mrg % Oh yes, they do; otherwise, @ifset (and anything else that uses 9218 1.1 mrg % \parseargline) fails inside footnotes because the tokens are fixed when 9219 1.1.1.3 mrg % the footnote is read. --karl, 16nov96. 9220 1.1.1.3 mrg % 9221 1.1.1.3 mrg \gdef\dofootnote{% 9222 1.1.1.3 mrg \insert\footins\bgroup 9223 1.1.1.3 mrg % 9224 1.1 mrg % Nested footnotes are not supported in TeX, that would take a lot 9225 1.1 mrg % more work. (\startsavinginserts does not suffice.) 9226 1.1 mrg \let\footnote=\errfootnotenest 9227 1.1.1.3 mrg % 9228 1.1 mrg % We want to typeset this text as a normal paragraph, even if the 9229 1.1 mrg % footnote reference occurs in (for example) a display environment. 9230 1.1 mrg % So reset some parameters. 9231 1.1 mrg \hsize=\txipagewidth 9232 1.1 mrg \interlinepenalty\interfootnotelinepenalty 9233 1.1 mrg \splittopskip\ht\strutbox % top baseline for broken footnotes 9234 1.1 mrg \splitmaxdepth\dp\strutbox 9235 1.1 mrg \floatingpenalty\@MM 9236 1.1 mrg \leftskip\z@skip 9237 1.1 mrg \rightskip\z@skip 9238 1.1 mrg \spaceskip\z@skip 9239 1.1 mrg \xspaceskip\z@skip 9240 1.1 mrg \parindent\defaultparindent 9241 1.1 mrg % 9242 1.1 mrg \smallfonts \rm 9243 1.1 mrg % 9244 1.1 mrg % Because we use hanging indentation in footnotes, a @noindent appears 9245 1.1 mrg % to exdent this text, so make it be a no-op. makeinfo does not use 9246 1.1 mrg % hanging indentation so @noindent can still be needed within footnote 9247 1.1 mrg % text after an @example or the like (not that this is good style). 9248 1.1 mrg \let\noindent = \relax 9249 1.1 mrg % 9250 1.1 mrg % Hang the footnote text off the number. Use \everypar in case the 9251 1.1 mrg % footnote extends for more than one paragraph. 9252 1.1 mrg \everypar = {\hang}% 9253 1.1 mrg \textindent{\thisfootno}% 9254 1.1 mrg % 9255 1.1 mrg % Don't crash into the line above the footnote text. Since this 9256 1.1 mrg % expands into a box, it must come within the paragraph, lest it 9257 1.1 mrg % provide a place where TeX can split the footnote. 9258 1.1 mrg \footstrut 9259 1.1 mrg % 9260 1.1 mrg % Invoke rest of plain TeX footnote routine. 9261 1.1.1.3 mrg \futurelet\next\fo@t 9262 1.1.1.3 mrg } 9263 1.1.1.3 mrg }%end \catcode `\@=11 9264 1.1.1.3 mrg 9265 1.1.1.3 mrg \def\errfootnotenest{% 9266 1.1.1.3 mrg \errhelp=\EMsimple 9267 1.1.1.3 mrg \errmessage{Nested footnotes not supported in texinfo.tex, 9268 1.1.1.3 mrg even though they work in makeinfo; sorry} 9269 1.1.1.3 mrg } 9270 1.1.1.3 mrg 9271 1.1.1.3 mrg \def\errfootnoteheading{% 9272 1.1 mrg \errhelp=\EMsimple 9273 1.1 mrg \errmessage{Footnotes in chapters, sections, etc., are not supported} 9274 1.1 mrg } 9275 1.1 mrg 9276 1.1 mrg % In case a @footnote appears in a vbox, save the footnote text and create 9277 1.1 mrg % the real \insert just after the vbox finished. Otherwise, the insertion 9278 1.1.1.3 mrg % would be lost. 9279 1.1 mrg % Similarly, if a @footnote appears inside an alignment, save the footnote 9280 1.1 mrg % text to a box and make the \insert when a row of the table is finished. 9281 1.1 mrg % And the same can be done for other insert classes. --kasal, 16nov03. 9282 1.1 mrg % 9283 1.1 mrg % Replace the \insert primitive by a cheating macro. 9284 1.1 mrg % Deeper inside, just make sure that the saved insertions are not spilled 9285 1.1 mrg % out prematurely. 9286 1.1 mrg % 9287 1.1 mrg \def\startsavinginserts{% 9288 1.1 mrg \ifx \insert\ptexinsert 9289 1.1 mrg \let\insert\saveinsert 9290 1.1 mrg \else 9291 1.1 mrg \let\checkinserts\relax 9292 1.1 mrg \fi 9293 1.1 mrg } 9294 1.1 mrg 9295 1.1 mrg % This \insert replacement works for both \insert\footins{foo} and 9296 1.1 mrg % \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}. 9297 1.1 mrg % 9298 1.1 mrg \def\saveinsert#1{% 9299 1.1 mrg \edef\next{\noexpand\savetobox \makeSAVEname#1}% 9300 1.1 mrg \afterassignment\next 9301 1.1 mrg % swallow the left brace 9302 1.1 mrg \let\temp = 9303 1.1 mrg } 9304 1.1 mrg \def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}} 9305 1.1 mrg \def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1} 9306 1.1 mrg 9307 1.1 mrg \def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi} 9308 1.1 mrg 9309 1.1 mrg \def\placesaveins#1{% 9310 1.1 mrg \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname 9311 1.1 mrg {\box#1}% 9312 1.1 mrg } 9313 1.1 mrg 9314 1.1 mrg % eat @SAVE -- beware, all of them have catcode \other: 9315 1.1 mrg { 9316 1.1 mrg \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-) 9317 1.1 mrg \gdef\gobblesave @SAVE{} 9318 1.1 mrg } 9319 1.1 mrg 9320 1.1 mrg % initialization: 9321 1.1 mrg \def\newsaveins #1{% 9322 1.1 mrg \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}% 9323 1.1 mrg \next 9324 1.1 mrg } 9325 1.1 mrg \def\newsaveinsX #1{% 9326 1.1 mrg \csname newbox\endcsname #1% 9327 1.1 mrg \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts 9328 1.1 mrg \checksaveins #1}% 9329 1.1 mrg } 9330 1.1 mrg 9331 1.1 mrg % initialize: 9332 1.1 mrg \let\checkinserts\empty 9333 1.1 mrg \newsaveins\footins 9334 1.1 mrg \newsaveins\margin 9335 1.1 mrg 9336 1.1 mrg 9337 1.1 mrg % @image. We use the macros from epsf.tex to support this. 9338 1.1 mrg % If epsf.tex is not installed and @image is used, we complain. 9339 1.1 mrg % 9340 1.1 mrg % Check for and read epsf.tex up front. If we read it only at @image 9341 1.1 mrg % time, we might be inside a group, and then its definitions would get 9342 1.1 mrg % undone and the next image would fail. 9343 1.1 mrg \openin 1 = epsf.tex 9344 1.1 mrg \ifeof 1 \else 9345 1.1 mrg % Do not bother showing banner with epsf.tex v2.7k (available in 9346 1.1 mrg % doc/epsf.tex and on ctan). 9347 1.1 mrg \def\epsfannounce{\toks0 = }% 9348 1.1 mrg \input epsf.tex 9349 1.1 mrg \fi 9350 1.1 mrg \closein 1 9351 1.1 mrg % 9352 1.1.1.3 mrg % We will only complain once about lack of epsf.tex. 9353 1.1 mrg \newif\ifwarnednoepsf 9354 1.1 mrg \newhelp\noepsfhelp{epsf.tex must be installed for images to 9355 1.1 mrg work. It is also included in the Texinfo distribution, or you can get 9356 1.1 mrg it from https://ctan.org/texarchive/macros/texinfo/texinfo/doc/epsf.tex.} 9357 1.1 mrg % 9358 1.1 mrg \def\image#1{% 9359 1.1 mrg \ifx\epsfbox\thisisundefined 9360 1.1 mrg \ifwarnednoepsf \else 9361 1.1 mrg \errhelp = \noepsfhelp 9362 1.1 mrg \errmessage{epsf.tex not found, images will be ignored}% 9363 1.1 mrg \global\warnednoepsftrue 9364 1.1 mrg \fi 9365 1.1.1.5 mrg \else 9366 1.1.1.5 mrg \imagexxx #1,,,,,\finish 9367 1.1.1.5 mrg \fi 9368 1.1.1.5 mrg } 9369 1.1.1.5 mrg 9370 1.1.1.5 mrg % Approximate height of a line in the standard text font. 9371 1.1 mrg \newdimen\capheight 9372 1.1 mrg \setbox0=\vbox{\tenrm H} 9373 1.1 mrg \capheight=\ht0 9374 1.1 mrg 9375 1.1 mrg % 9376 1.1 mrg % Arguments to @image: 9377 1.1 mrg % #1 is (mandatory) image filename; we tack on .eps extension. 9378 1.1 mrg % #2 is (optional) width, #3 is (optional) height. 9379 1.1 mrg % #4 is (ignored optional) html alt text. 9380 1.1 mrg % #5 is (ignored optional) extension. 9381 1.1 mrg % #6 is just the usual extra ignored arg for parsing stuff. 9382 1.1.1.5 mrg \newif\ifimagevmode 9383 1.1 mrg \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup 9384 1.1 mrg \catcode`\^^M = 5 % in case we're inside an example 9385 1.1.1.5 mrg \normalturnoffactive % allow _ et al. in names 9386 1.1 mrg \makevalueexpandable 9387 1.1 mrg \ifvmode 9388 1.1 mrg \imagevmodetrue 9389 1.1.1.5 mrg \medskip 9390 1.1.1.5 mrg % Usually we'll have text after the image which will insert 9391 1.1.1.5 mrg % \parskip glue, so insert it here too to equalize the space 9392 1.1.1.5 mrg % above and below. 9393 1.1.1.5 mrg \vskip\parskip 9394 1.1 mrg % 9395 1.1 mrg % Place image in a \vtop for a top page margin that is (close to) correct, 9396 1.1.1.5 mrg % as \topskip glue is relative to the first baseline. 9397 1.1.1.5 mrg \vtop\bgroup \kern -\capheight \vskip-\parskip 9398 1.1.1.5 mrg \fi 9399 1.1.1.5 mrg % 9400 1.1.1.5 mrg \ifx\centersub\centerV 9401 1.1.1.5 mrg % For @center @image, enter vertical mode and add vertical space 9402 1.1.1.5 mrg % Enter an extra \parskip because @center doesn't add space itself. 9403 1.1.1.5 mrg \vbox\bgroup\vskip\parskip\medskip\vskip\parskip 9404 1.1.1.5 mrg \else 9405 1.1.1.5 mrg % Enter horizontal mode so that indentation from an enclosing 9406 1.1.1.5 mrg % environment such as @quotation is respected. 9407 1.1 mrg % However, if we're at the top level, we don't want the 9408 1.1 mrg % normal paragraph indentation. 9409 1.1 mrg \imageindent 9410 1.1.1.3 mrg \fi 9411 1.1 mrg % 9412 1.1 mrg % Output the image. 9413 1.1.1.3 mrg \ifpdf 9414 1.1.1.3 mrg % For pdfTeX and LuaTeX <= 0.80 9415 1.1.1.3 mrg \dopdfimage{#1}{#2}{#3}% 9416 1.1.1.3 mrg \else 9417 1.1.1.3 mrg \ifx\XeTeXrevision\thisisundefined 9418 1.1.1.3 mrg % For epsf.tex 9419 1.1.1.3 mrg % \epsfbox itself resets \epsf?size at each figure. 9420 1.1.1.3 mrg \setbox0 = \hbox{\ignorespaces #2}% 9421 1.1.1.3 mrg \ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi 9422 1.1.1.3 mrg \setbox0 = \hbox{\ignorespaces #3}% 9423 1.1.1.3 mrg \ifdim\wd0 > 0pt \epsfysize=#3\relax \fi 9424 1.1.1.3 mrg \epsfbox{#1.eps}% 9425 1.1 mrg \else 9426 1.1 mrg % For XeTeX 9427 1.1 mrg \doxeteximage{#1}{#2}{#3}% 9428 1.1.1.5 mrg \fi 9429 1.1 mrg \fi 9430 1.1.1.4 mrg % 9431 1.1.1.5 mrg \ifimagevmode 9432 1.1.1.5 mrg \egroup 9433 1.1.1.5 mrg \medskip % space after a standalone image 9434 1.1.1.5 mrg \fi 9435 1.1 mrg \ifx\centersub\centerV % @center @image 9436 1.1 mrg \medskip 9437 1.1 mrg \egroup % close \vbox 9438 1.1 mrg \fi 9439 1.1 mrg \endgroup} 9440 1.1 mrg 9441 1.1 mrg 9442 1.1 mrg % @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables, 9443 1.1 mrg % etc. We don't actually implement floating yet, we always include the 9444 1.1 mrg % float "here". But it seemed the best name for the future. 9445 1.1 mrg % 9446 1.1 mrg \envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish} 9447 1.1 mrg 9448 1.1 mrg % There may be a space before second and/or third parameter; delete it. 9449 1.1 mrg \def\eatcommaspace#1, {#1,} 9450 1.1 mrg 9451 1.1 mrg % #1 is the optional FLOATTYPE, the text label for this float, typically 9452 1.1 mrg % "Figure", "Table", "Example", etc. Can't contain commas. If omitted, 9453 1.1 mrg % this float will not be numbered and cannot be referred to. 9454 1.1 mrg % 9455 1.1 mrg % #2 is the optional xref label. Also must be present for the float to 9456 1.1 mrg % be referable. 9457 1.1 mrg % 9458 1.1 mrg % #3 is the optional positioning argument; for now, it is ignored. It 9459 1.1 mrg % will somehow specify the positions allowed to float to (here, top, bottom). 9460 1.1 mrg % 9461 1.1 mrg % We keep a separate counter for each FLOATTYPE, which we reset at each 9462 1.1 mrg % chapter-level command. 9463 1.1 mrg \let\resetallfloatnos=\empty 9464 1.1 mrg % 9465 1.1 mrg \def\dofloat#1,#2,#3,#4\finish{% 9466 1.1 mrg \let\thiscaption=\empty 9467 1.1 mrg \let\thisshortcaption=\empty 9468 1.1 mrg % 9469 1.1 mrg % don't lose footnotes inside @float. 9470 1.1 mrg % 9471 1.1 mrg % BEWARE: when the floats start float, we have to issue warning whenever an 9472 1.1 mrg % insert appears inside a float which could possibly float. --kasal, 26may04 9473 1.1 mrg % 9474 1.1 mrg \startsavinginserts 9475 1.1 mrg % 9476 1.1 mrg % We can't be used inside a paragraph. 9477 1.1 mrg \par 9478 1.1 mrg % 9479 1.1 mrg \vtop\bgroup 9480 1.1 mrg \def\floattype{#1}% 9481 1.1 mrg \def\floatlabel{#2}% 9482 1.1 mrg \def\floatloc{#3}% we do nothing with this yet. 9483 1.1 mrg % 9484 1.1 mrg \ifx\floattype\empty 9485 1.1 mrg \let\safefloattype=\empty 9486 1.1 mrg \else 9487 1.1 mrg {% 9488 1.1 mrg % the floattype might have accents or other special characters, 9489 1.1 mrg % but we need to use it in a control sequence name. 9490 1.1 mrg \indexnofonts 9491 1.1 mrg \turnoffactive 9492 1.1 mrg \xdef\safefloattype{\floattype}% 9493 1.1 mrg }% 9494 1.1 mrg \fi 9495 1.1 mrg % 9496 1.1 mrg % If label is given but no type, we handle that as the empty type. 9497 1.1 mrg \ifx\floatlabel\empty \else 9498 1.1 mrg % We want each FLOATTYPE to be numbered separately (Figure 1, 9499 1.1 mrg % Table 1, Figure 2, ...). (And if no label, no number.) 9500 1.1 mrg % 9501 1.1.1.4 mrg \expandafter\getfloatno\csname\safefloattype floatno\endcsname 9502 1.1 mrg \global\advance\floatno by 1 9503 1.1 mrg % 9504 1.1 mrg {% 9505 1.1 mrg % This magic value for \currentsection is output by \setref as the 9506 1.1 mrg % XREFLABEL-title value. \xrefX uses it to distinguish float 9507 1.1.1.4 mrg % labels (which have a completely different output format) from 9508 1.1 mrg % node and anchor labels. And \xrdef uses it to construct the 9509 1.1 mrg % lists of floats. 9510 1.1 mrg % 9511 1.1 mrg \edef\currentsection{\floatmagic=\safefloattype}% 9512 1.1 mrg \setref{\floatlabel}{Yfloat}% 9513 1.1 mrg }% 9514 1.1 mrg \fi 9515 1.1 mrg % 9516 1.1 mrg % start with \parskip glue, I guess. 9517 1.1 mrg \vskip\parskip 9518 1.1 mrg % 9519 1.1 mrg % Don't suppress indentation if a float happens to start a section. 9520 1.1 mrg \restorefirstparagraphindent 9521 1.1 mrg } 9522 1.1 mrg 9523 1.1 mrg % we have these possibilities: 9524 1.1 mrg % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap 9525 1.1 mrg % @float Foo,lbl & no caption: Foo 1.1 9526 1.1 mrg % @float Foo & @caption{Cap}: Foo: Cap 9527 1.1 mrg % @float Foo & no caption: Foo 9528 1.1 mrg % @float ,lbl & Caption{Cap}: 1.1: Cap 9529 1.1 mrg % @float ,lbl & no caption: 1.1 9530 1.1 mrg % @float & @caption{Cap}: Cap 9531 1.1 mrg % @float & no caption: 9532 1.1 mrg % 9533 1.1 mrg \def\Efloat{% 9534 1.1 mrg \let\floatident = \empty 9535 1.1 mrg % 9536 1.1 mrg % In all cases, if we have a float type, it comes first. 9537 1.1 mrg \ifx\floattype\empty \else \def\floatident{\floattype}\fi 9538 1.1 mrg % 9539 1.1 mrg % If we have an xref label, the number comes next. 9540 1.1 mrg \ifx\floatlabel\empty \else 9541 1.1 mrg \ifx\floattype\empty \else % if also had float type, need tie first. 9542 1.1 mrg \appendtomacro\floatident{\tie}% 9543 1.1 mrg \fi 9544 1.1 mrg % the number. 9545 1.1 mrg \appendtomacro\floatident{\chaplevelprefix\the\floatno}% 9546 1.1 mrg \fi 9547 1.1 mrg % 9548 1.1 mrg % Start the printed caption with what we've constructed in 9549 1.1 mrg % \floatident, but keep it separate; we need \floatident again. 9550 1.1.1.3 mrg \let\captionline = \floatident 9551 1.1 mrg % 9552 1.1 mrg \ifx\thiscaption\empty \else 9553 1.1 mrg \ifx\floatident\empty \else 9554 1.1 mrg \appendtomacro\captionline{: }% had ident, so need a colon between 9555 1.1 mrg \fi 9556 1.1 mrg % 9557 1.1 mrg % caption text. 9558 1.1 mrg \appendtomacro\captionline{\scanexp\thiscaption}% 9559 1.1 mrg \fi 9560 1.1 mrg % 9561 1.1 mrg % If we have anything to print, print it, with space before. 9562 1.1 mrg % Eventually this needs to become an \insert. 9563 1.1 mrg \ifx\captionline\empty \else 9564 1.1 mrg \vskip.5\parskip 9565 1.1 mrg \captionline 9566 1.1 mrg % 9567 1.1 mrg % Space below caption. 9568 1.1 mrg \vskip\parskip 9569 1.1 mrg \fi 9570 1.1 mrg % 9571 1.1 mrg % If have an xref label, write the list of floats info. Do this 9572 1.1 mrg % after the caption, to avoid chance of it being a breakpoint. 9573 1.1 mrg \ifx\floatlabel\empty \else 9574 1.1.1.3 mrg % Write the text that goes in the lof to the aux file as 9575 1.1 mrg % \floatlabel-lof. Besides \floatident, we include the short 9576 1.1 mrg % caption if specified, else the full caption if specified, else nothing. 9577 1.1.1.3 mrg {% 9578 1.1.1.3 mrg \requireauxfile 9579 1.1.1.3 mrg \atdummies 9580 1.1.1.3 mrg % 9581 1.1.1.3 mrg \ifx\thisshortcaption\empty 9582 1.1 mrg \def\gtemp{\thiscaption}% 9583 1.1.1.3 mrg \else 9584 1.1 mrg \def\gtemp{\thisshortcaption}% 9585 1.1 mrg \fi 9586 1.1 mrg \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident 9587 1.1 mrg \ifx\gtemp\empty \else : \gtemp \fi}}% 9588 1.1 mrg }% 9589 1.1 mrg \fi 9590 1.1 mrg \egroup % end of \vtop 9591 1.1 mrg % 9592 1.1 mrg \checkinserts 9593 1.1 mrg } 9594 1.1 mrg 9595 1.1 mrg % Append the tokens #2 to the definition of macro #1, not expanding either. 9596 1.1 mrg % 9597 1.1 mrg \def\appendtomacro#1#2{% 9598 1.1 mrg \expandafter\def\expandafter#1\expandafter{#1#2}% 9599 1.1 mrg } 9600 1.1 mrg 9601 1.1.1.5 mrg % @caption, @shortcaption 9602 1.1 mrg % 9603 1.1 mrg \def\caption{\docaption\thiscaption} 9604 1.1 mrg \def\shortcaption{\docaption\thisshortcaption} 9605 1.1 mrg \def\docaption{\checkenv\float \bgroup\scanctxt\defcaption} 9606 1.1 mrg \def\defcaption#1#2{\egroup \def#1{#2}} 9607 1.1 mrg 9608 1.1 mrg % The parameter is the control sequence identifying the counter we are 9609 1.1 mrg % going to use. Create it if it doesn't exist and assign it to \floatno. 9610 1.1 mrg \def\getfloatno#1{% 9611 1.1 mrg \ifx#1\relax 9612 1.1 mrg % Haven't seen this figure type before. 9613 1.1 mrg \csname newcount\endcsname #1% 9614 1.1 mrg % 9615 1.1 mrg % Remember to reset this floatno at the next chap. 9616 1.1 mrg \expandafter\gdef\expandafter\resetallfloatnos 9617 1.1 mrg \expandafter{\resetallfloatnos #1=0 }% 9618 1.1 mrg \fi 9619 1.1 mrg \let\floatno#1% 9620 1.1 mrg } 9621 1.1 mrg 9622 1.1 mrg % \setref calls this to get the XREFLABEL-snt value. We want an @xref 9623 1.1 mrg % to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we 9624 1.1 mrg % first read the @float command. 9625 1.1 mrg % 9626 1.1 mrg \def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}% 9627 1.1 mrg 9628 1.1 mrg % Magic string used for the XREFLABEL-title value, so \xrefX can 9629 1.1 mrg % distinguish floats from other xref types. 9630 1.1.1.4 mrg \def\floatmagic{!!float!!} 9631 1.1 mrg 9632 1.1 mrg % #1 is the control sequence we are passed; we expand into a conditional 9633 1.1 mrg % which is true if #1 represents a float ref. That is, the magic 9634 1.1 mrg % \currentsection value which we \setref above. 9635 1.1 mrg % 9636 1.1 mrg \def\iffloat#1{\expandafter\doiffloat#1==\finish} 9637 1.1 mrg % 9638 1.1 mrg % #1 is (maybe) the \floatmagic string. If so, #2 will be the 9639 1.1 mrg % (safe) float type for this float. We set \iffloattype to #2. 9640 1.1 mrg % 9641 1.1 mrg \def\doiffloat#1=#2=#3\finish{% 9642 1.1 mrg \def\temp{#1}% 9643 1.1 mrg \def\iffloattype{#2}% 9644 1.1 mrg \ifx\temp\floatmagic 9645 1.1 mrg } 9646 1.1 mrg 9647 1.1 mrg % @listoffloats FLOATTYPE - print a list of floats like a table of contents. 9648 1.1 mrg % 9649 1.1 mrg \parseargdef\listoffloats{% 9650 1.1 mrg \def\floattype{#1}% floattype 9651 1.1 mrg {% 9652 1.1 mrg % the floattype might have accents or other special characters, 9653 1.1 mrg % but we need to use it in a control sequence name. 9654 1.1 mrg \indexnofonts 9655 1.1 mrg \turnoffactive 9656 1.1 mrg \xdef\safefloattype{\floattype}% 9657 1.1 mrg }% 9658 1.1 mrg % 9659 1.1 mrg % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE. 9660 1.1 mrg \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax 9661 1.1 mrg \ifhavexrefs 9662 1.1 mrg % if the user said @listoffloats foo but never @float foo. 9663 1.1 mrg \message{\linenumber No `\safefloattype' floats to list.}% 9664 1.1 mrg \fi 9665 1.1 mrg \else 9666 1.1 mrg \begingroup 9667 1.1 mrg \leftskip=\tocindent % indent these entries like a toc 9668 1.1 mrg \let\do=\listoffloatsdo 9669 1.1 mrg \csname floatlist\safefloattype\endcsname 9670 1.1 mrg \endgroup 9671 1.1 mrg \fi 9672 1.1 mrg } 9673 1.1 mrg 9674 1.1 mrg % This is called on each entry in a list of floats. We're passed the 9675 1.1 mrg % xref label, in the form LABEL-title, which is how we save it in the 9676 1.1 mrg % aux file. We strip off the -title and look up \XRLABEL-lof, which 9677 1.1 mrg % has the text we're supposed to typeset here. 9678 1.1 mrg % 9679 1.1 mrg % Figures without xref labels will not be included in the list (since 9680 1.1 mrg % they won't appear in the aux file). 9681 1.1 mrg % 9682 1.1 mrg \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish} 9683 1.1 mrg \def\listoffloatsdoentry#1-title\finish{{% 9684 1.1 mrg % Can't fully expand XR#1-lof because it can contain anything. Just 9685 1.1 mrg % pass the control sequence. On the other hand, XR#1-pg is just the 9686 1.1 mrg % page number, and we want to fully expand that so we can get a link 9687 1.1 mrg % in pdf output. 9688 1.1 mrg \toksA = \expandafter{\csname XR#1-lof\endcsname}% 9689 1.1 mrg % 9690 1.1 mrg % use the same \entry macro we use to generate the TOC and index. 9691 1.1 mrg \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}% 9692 1.1 mrg \writeentry 9693 1.1 mrg }} 9694 1.1 mrg 9695 1.1 mrg 9696 1.1 mrg \message{localization,} 9697 1.1 mrg 9698 1.1 mrg % For single-language documents, @documentlanguage is usually given very 9699 1.1 mrg % early, just after @documentencoding. Single argument is the language 9700 1.1 mrg % (de) or locale (de_DE) abbreviation. 9701 1.1.1.3 mrg % 9702 1.1 mrg { 9703 1.1 mrg \catcode`\_ = \active 9704 1.1.1.3 mrg \globaldefs=1 9705 1.1 mrg \parseargdef\documentlanguage{% 9706 1.1 mrg \tex % read txi-??.tex file in plain TeX. 9707 1.1.1.3 mrg % Read the file by the name they passed if it exists. 9708 1.1 mrg \let_ = \normalunderscore % normal _ character for filename test 9709 1.1 mrg \openin 1 txi-#1.tex 9710 1.1 mrg \ifeof 1 9711 1.1 mrg \documentlanguagetrywithoutunderscore #1_\finish 9712 1.1 mrg \else 9713 1.1 mrg \globaldefs = 1 % everything in the txi-LL files needs to persist 9714 1.1.1.3 mrg \input txi-#1.tex 9715 1.1 mrg \fi 9716 1.1 mrg \closein 1 9717 1.1 mrg \endgroup % end raw TeX 9718 1.1 mrg } 9719 1.1 mrg % 9720 1.1 mrg % If they passed de_DE, and txi-de_DE.tex doesn't exist, 9721 1.1 mrg % try txi-de.tex. 9722 1.1 mrg % 9723 1.1 mrg \gdef\documentlanguagetrywithoutunderscore#1_#2\finish{% 9724 1.1 mrg \openin 1 txi-#1.tex 9725 1.1 mrg \ifeof 1 9726 1.1 mrg \errhelp = \nolanghelp 9727 1.1 mrg \errmessage{Cannot read language file txi-#1.tex}% 9728 1.1 mrg \else 9729 1.1 mrg \globaldefs = 1 % everything in the txi-LL files needs to persist 9730 1.1 mrg \input txi-#1.tex 9731 1.1 mrg \fi 9732 1.1 mrg \closein 1 9733 1.1 mrg } 9734 1.1 mrg }% end of special _ catcode 9735 1.1 mrg % 9736 1.1 mrg \newhelp\nolanghelp{The given language definition file cannot be found or 9737 1.1 mrg is empty. Maybe you need to install it? Putting it in the current 9738 1.1 mrg directory should work if nowhere else does.} 9739 1.1 mrg 9740 1.1 mrg % This macro is called from txi-??.tex files; the first argument is the 9741 1.1 mrg % \language name to set (without the "\lang@" prefix), the second and 9742 1.1 mrg % third args are \{left,right}hyphenmin. 9743 1.1 mrg % 9744 1.1 mrg % The language names to pass are determined when the format is built. 9745 1.1 mrg % See the etex.log file created at that time, e.g., 9746 1.1 mrg % /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log. 9747 1.1 mrg % 9748 1.1 mrg % With TeX Live 2008, etex now includes hyphenation patterns for all 9749 1.1 mrg % available languages. This means we can support hyphenation in 9750 1.1 mrg % Texinfo, at least to some extent. (This still doesn't solve the 9751 1.1 mrg % accented characters problem.) 9752 1.1 mrg % 9753 1.1 mrg \catcode`@=11 9754 1.1 mrg \def\txisetlanguage#1#2#3{% 9755 1.1 mrg % do not set the language if the name is undefined in the current TeX. 9756 1.1 mrg \expandafter\ifx\csname lang@#1\endcsname \relax 9757 1.1 mrg \message{no patterns for #1}% 9758 1.1 mrg \else 9759 1.1 mrg \global\language = \csname lang@#1\endcsname 9760 1.1 mrg \fi 9761 1.1 mrg % but there is no harm in adjusting the hyphenmin values regardless. 9762 1.1.1.3 mrg \global\lefthyphenmin = #2\relax 9763 1.1.1.3 mrg \global\righthyphenmin = #3\relax 9764 1.1.1.3 mrg } 9765 1.1.1.3 mrg 9766 1.1.1.3 mrg % XeTeX and LuaTeX can handle Unicode natively. 9767 1.1.1.3 mrg % Their default I/O uses UTF-8 sequences instead of a byte-wise operation. 9768 1.1.1.3 mrg % Other TeX engines' I/O (pdfTeX, etc.) is byte-wise. 9769 1.1.1.3 mrg % 9770 1.1.1.3 mrg \newif\iftxinativeunicodecapable 9771 1.1.1.3 mrg \newif\iftxiusebytewiseio 9772 1.1.1.3 mrg 9773 1.1.1.3 mrg \ifx\XeTeXrevision\thisisundefined 9774 1.1.1.3 mrg \ifx\luatexversion\thisisundefined 9775 1.1.1.3 mrg \txinativeunicodecapablefalse 9776 1.1.1.3 mrg \txiusebytewiseiotrue 9777 1.1.1.3 mrg \else 9778 1.1.1.3 mrg \txinativeunicodecapabletrue 9779 1.1.1.3 mrg \txiusebytewiseiofalse 9780 1.1.1.3 mrg \fi 9781 1.1.1.3 mrg \else 9782 1.1.1.3 mrg \txinativeunicodecapabletrue 9783 1.1.1.3 mrg \txiusebytewiseiofalse 9784 1.1.1.3 mrg \fi 9785 1.1.1.3 mrg 9786 1.1.1.3 mrg % Set I/O by bytes instead of UTF-8 sequence for XeTeX and LuaTex 9787 1.1.1.3 mrg % for non-UTF-8 (byte-wise) encodings. 9788 1.1.1.3 mrg % 9789 1.1.1.3 mrg \def\setbytewiseio{% 9790 1.1.1.3 mrg \ifx\XeTeXrevision\thisisundefined 9791 1.1.1.3 mrg \else 9792 1.1.1.3 mrg \XeTeXdefaultencoding "bytes" % For subsequent files to be read 9793 1.1.1.3 mrg \XeTeXinputencoding "bytes" % For document root file 9794 1.1.1.3 mrg % Unfortunately, there seems to be no corresponding XeTeX command for 9795 1.1.1.3 mrg % output encoding. This is a problem for auxiliary index and TOC files. 9796 1.1.1.3 mrg % The only solution would be perhaps to write out @U{...} sequences in 9797 1.1.1.3 mrg % place of non-ASCII characters. 9798 1.1.1.3 mrg \fi 9799 1.1.1.3 mrg 9800 1.1.1.3 mrg \ifx\luatexversion\thisisundefined 9801 1.1.1.3 mrg \else 9802 1.1.1.3 mrg \directlua{ 9803 1.1.1.3 mrg local utf8_char, byte, gsub = unicode.utf8.char, string.byte, string.gsub 9804 1.1.1.3 mrg local function convert_char (char) 9805 1.1.1.3 mrg return utf8_char(byte(char)) 9806 1.1.1.3 mrg end 9807 1.1.1.3 mrg 9808 1.1.1.3 mrg local function convert_line (line) 9809 1.1.1.3 mrg return gsub(line, ".", convert_char) 9810 1.1.1.3 mrg end 9811 1.1.1.3 mrg 9812 1.1.1.3 mrg callback.register("process_input_buffer", convert_line) 9813 1.1.1.3 mrg 9814 1.1.1.3 mrg local function convert_line_out (line) 9815 1.1.1.3 mrg local line_out = "" 9816 1.1.1.3 mrg for c in string.utfvalues(line) do 9817 1.1.1.3 mrg line_out = line_out .. string.char(c) 9818 1.1.1.3 mrg end 9819 1.1.1.3 mrg return line_out 9820 1.1.1.3 mrg end 9821 1.1.1.3 mrg 9822 1.1.1.3 mrg callback.register("process_output_buffer", convert_line_out) 9823 1.1.1.3 mrg } 9824 1.1.1.3 mrg \fi 9825 1.1.1.3 mrg 9826 1.1 mrg \txiusebytewiseiotrue 9827 1.1 mrg } 9828 1.1 mrg 9829 1.1 mrg 9830 1.1 mrg % Helpers for encodings. 9831 1.1 mrg % Set the catcode of characters 128 through 255 to the specified number. 9832 1.1 mrg % 9833 1.1 mrg \def\setnonasciicharscatcode#1{% 9834 1.1 mrg \count255=128 9835 1.1 mrg \loop\ifnum\count255<256 9836 1.1 mrg \global\catcode\count255=#1\relax 9837 1.1 mrg \advance\count255 by 1 9838 1.1 mrg \repeat 9839 1.1 mrg } 9840 1.1 mrg 9841 1.1 mrg \def\setnonasciicharscatcodenonglobal#1{% 9842 1.1 mrg \count255=128 9843 1.1 mrg \loop\ifnum\count255<256 9844 1.1 mrg \catcode\count255=#1\relax 9845 1.1 mrg \advance\count255 by 1 9846 1.1 mrg \repeat 9847 1.1 mrg } 9848 1.1.1.3 mrg 9849 1.1.1.3 mrg % @documentencoding sets the definition of non-ASCII characters 9850 1.1.1.3 mrg % according to the specified encoding. 9851 1.1 mrg % 9852 1.1 mrg \def\documentencoding{\parseargusing\filenamecatcodes\documentencodingzzz} 9853 1.1 mrg \def\documentencodingzzz#1{% 9854 1.1 mrg % 9855 1.1 mrg % Encoding being declared for the document. 9856 1.1 mrg \def\declaredencoding{\csname #1.enc\endcsname}% 9857 1.1 mrg % 9858 1.1 mrg % Supported encodings: names converted to tokens in order to be able 9859 1.1 mrg % to compare them with \ifx. 9860 1.1 mrg \def\ascii{\csname US-ASCII.enc\endcsname}% 9861 1.1 mrg \def\latnine{\csname ISO-8859-15.enc\endcsname}% 9862 1.1 mrg \def\latone{\csname ISO-8859-1.enc\endcsname}% 9863 1.1 mrg \def\lattwo{\csname ISO-8859-2.enc\endcsname}% 9864 1.1 mrg \def\utfeight{\csname UTF-8.enc\endcsname}% 9865 1.1 mrg % 9866 1.1.1.3 mrg \ifx \declaredencoding \ascii 9867 1.1.1.3 mrg \asciichardefs 9868 1.1.1.3 mrg % 9869 1.1 mrg \else \ifx \declaredencoding \lattwo 9870 1.1 mrg \iftxinativeunicodecapable 9871 1.1 mrg \setbytewiseio 9872 1.1 mrg \fi 9873 1.1.1.3 mrg \setnonasciicharscatcode\active 9874 1.1.1.3 mrg \lattwochardefs 9875 1.1.1.3 mrg % 9876 1.1 mrg \else \ifx \declaredencoding \latone 9877 1.1 mrg \iftxinativeunicodecapable 9878 1.1 mrg \setbytewiseio 9879 1.1 mrg \fi 9880 1.1.1.3 mrg \setnonasciicharscatcode\active 9881 1.1.1.3 mrg \latonechardefs 9882 1.1.1.3 mrg % 9883 1.1 mrg \else \ifx \declaredencoding \latnine 9884 1.1 mrg \iftxinativeunicodecapable 9885 1.1 mrg \setbytewiseio 9886 1.1 mrg \fi 9887 1.1.1.3 mrg \setnonasciicharscatcode\active 9888 1.1.1.3 mrg \latninechardefs 9889 1.1.1.3 mrg % 9890 1.1.1.3 mrg \else \ifx \declaredencoding \utfeight 9891 1.1.1.3 mrg \iftxinativeunicodecapable 9892 1.1.1.3 mrg % For native Unicode handling (XeTeX and LuaTeX) 9893 1.1.1.3 mrg \nativeunicodechardefs 9894 1.1.1.3 mrg \else 9895 1.1.1.3 mrg % For treating UTF-8 as byte sequences (TeX, eTeX and pdfTeX) 9896 1.1.1.3 mrg \setnonasciicharscatcode\active 9897 1.1.1.3 mrg % since we already invoked \utfeightchardefs at the top level 9898 1.1 mrg % (below), do not re-invoke it, otherwise our check for duplicated 9899 1.1 mrg % definitions gets triggered. Making non-ascii chars active is 9900 1.1.1.3 mrg % sufficient. 9901 1.1 mrg \fi 9902 1.1 mrg % 9903 1.1 mrg \else 9904 1.1 mrg \message{Ignoring unknown document encoding: #1.}% 9905 1.1 mrg % 9906 1.1 mrg \fi % utfeight 9907 1.1.1.3 mrg \fi % latnine 9908 1.1.1.3 mrg \fi % latone 9909 1.1.1.3 mrg \fi % lattwo 9910 1.1.1.3 mrg \fi % ascii 9911 1.1.1.3 mrg % 9912 1.1.1.3 mrg \ifx\XeTeXrevision\thisisundefined 9913 1.1.1.3 mrg \else 9914 1.1.1.3 mrg \ifx \declaredencoding \utfeight 9915 1.1.1.3 mrg \else 9916 1.1.1.3 mrg \ifx \declaredencoding \ascii 9917 1.1.1.3 mrg \else 9918 1.1.1.3 mrg \message{Warning: XeTeX with non-UTF-8 encodings cannot handle % 9919 1.1 mrg non-ASCII characters in auxiliary files.}% 9920 1.1 mrg \fi 9921 1.1.1.3 mrg \fi 9922 1.1 mrg \fi 9923 1.1 mrg } 9924 1.1 mrg 9925 1.1.1.3 mrg % emacs-page 9926 1.1 mrg % A message to be logged when using a character that isn't available 9927 1.1 mrg % the default font encoding (OT1). 9928 1.1 mrg % 9929 1.1 mrg \def\missingcharmsg#1{\message{Character missing, sorry: #1.}} 9930 1.1 mrg 9931 1.1 mrg % Take account of \c (plain) vs. \, (Texinfo) difference. 9932 1.1 mrg \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi} 9933 1.1 mrg 9934 1.1 mrg % First, make active non-ASCII characters in order for them to be 9935 1.1.1.3 mrg % correctly categorized when TeX reads the replacement text of 9936 1.1.1.3 mrg % macros containing the character definitions. 9937 1.1.1.3 mrg \setnonasciicharscatcode\active 9938 1.1.1.3 mrg % 9939 1.1.1.3 mrg 9940 1.1.1.3 mrg \def\gdefchar#1#2{% 9941 1.1.1.3 mrg \gdef#1{% 9942 1.1.1.3 mrg \ifpassthroughchars 9943 1.1.1.3 mrg \string#1% 9944 1.1.1.3 mrg \else 9945 1.1 mrg #2% 9946 1.1 mrg \fi 9947 1.1.1.3 mrg }} 9948 1.1.1.3 mrg 9949 1.1.1.3 mrg % Latin1 (ISO-8859-1) character definitions. 9950 1.1.1.3 mrg \def\latonechardefs{% 9951 1.1.1.3 mrg \gdefchar^^a0{\tie} 9952 1.1.1.3 mrg \gdefchar^^a1{\exclamdown} 9953 1.1.1.3 mrg \gdefchar^^a2{{\tcfont \char162}} % cent 9954 1.1.1.3 mrg \gdefchar^^a3{\pounds{}} 9955 1.1.1.3 mrg \gdefchar^^a4{{\tcfont \char164}} % currency 9956 1.1.1.3 mrg \gdefchar^^a5{{\tcfont \char165}} % yen 9957 1.1.1.3 mrg \gdefchar^^a6{{\tcfont \char166}} % broken bar 9958 1.1.1.3 mrg \gdefchar^^a7{\S} 9959 1.1.1.3 mrg \gdefchar^^a8{\"{}} 9960 1.1.1.3 mrg \gdefchar^^a9{\copyright{}} 9961 1.1.1.3 mrg \gdefchar^^aa{\ordf} 9962 1.1.1.3 mrg \gdefchar^^ab{\guillemetleft{}} 9963 1.1.1.3 mrg \gdefchar^^ac{\ensuremath\lnot} 9964 1.1.1.3 mrg \gdefchar^^ad{\-} 9965 1.1.1.3 mrg \gdefchar^^ae{\registeredsymbol{}} 9966 1.1.1.3 mrg \gdefchar^^af{\={}} 9967 1.1.1.3 mrg % 9968 1.1.1.3 mrg \gdefchar^^b0{\textdegree} 9969 1.1.1.3 mrg \gdefchar^^b1{$\pm$} 9970 1.1.1.3 mrg \gdefchar^^b2{$^2$} 9971 1.1.1.3 mrg \gdefchar^^b3{$^3$} 9972 1.1.1.3 mrg \gdefchar^^b4{\'{}} 9973 1.1.1.3 mrg \gdefchar^^b5{$\mu$} 9974 1.1.1.3 mrg \gdefchar^^b6{\P} 9975 1.1.1.3 mrg \gdefchar^^b7{\ensuremath\cdot} 9976 1.1.1.3 mrg \gdefchar^^b8{\cedilla\ } 9977 1.1.1.3 mrg \gdefchar^^b9{$^1$} 9978 1.1.1.3 mrg \gdefchar^^ba{\ordm} 9979 1.1.1.3 mrg \gdefchar^^bb{\guillemetright{}} 9980 1.1.1.3 mrg \gdefchar^^bc{$1\over4$} 9981 1.1.1.3 mrg \gdefchar^^bd{$1\over2$} 9982 1.1.1.3 mrg \gdefchar^^be{$3\over4$} 9983 1.1.1.3 mrg \gdefchar^^bf{\questiondown} 9984 1.1.1.3 mrg % 9985 1.1.1.3 mrg \gdefchar^^c0{\`A} 9986 1.1.1.3 mrg \gdefchar^^c1{\'A} 9987 1.1.1.3 mrg \gdefchar^^c2{\^A} 9988 1.1.1.3 mrg \gdefchar^^c3{\~A} 9989 1.1.1.3 mrg \gdefchar^^c4{\"A} 9990 1.1.1.3 mrg \gdefchar^^c5{\ringaccent A} 9991 1.1.1.3 mrg \gdefchar^^c6{\AE} 9992 1.1.1.3 mrg \gdefchar^^c7{\cedilla C} 9993 1.1.1.3 mrg \gdefchar^^c8{\`E} 9994 1.1.1.3 mrg \gdefchar^^c9{\'E} 9995 1.1.1.3 mrg \gdefchar^^ca{\^E} 9996 1.1.1.3 mrg \gdefchar^^cb{\"E} 9997 1.1.1.3 mrg \gdefchar^^cc{\`I} 9998 1.1.1.3 mrg \gdefchar^^cd{\'I} 9999 1.1.1.3 mrg \gdefchar^^ce{\^I} 10000 1.1.1.3 mrg \gdefchar^^cf{\"I} 10001 1.1.1.3 mrg % 10002 1.1.1.3 mrg \gdefchar^^d0{\DH} 10003 1.1.1.3 mrg \gdefchar^^d1{\~N} 10004 1.1.1.3 mrg \gdefchar^^d2{\`O} 10005 1.1.1.3 mrg \gdefchar^^d3{\'O} 10006 1.1.1.3 mrg \gdefchar^^d4{\^O} 10007 1.1.1.3 mrg \gdefchar^^d5{\~O} 10008 1.1.1.3 mrg \gdefchar^^d6{\"O} 10009 1.1.1.3 mrg \gdefchar^^d7{$\times$} 10010 1.1.1.3 mrg \gdefchar^^d8{\O} 10011 1.1.1.3 mrg \gdefchar^^d9{\`U} 10012 1.1.1.3 mrg \gdefchar^^da{\'U} 10013 1.1.1.3 mrg \gdefchar^^db{\^U} 10014 1.1.1.3 mrg \gdefchar^^dc{\"U} 10015 1.1.1.3 mrg \gdefchar^^dd{\'Y} 10016 1.1.1.3 mrg \gdefchar^^de{\TH} 10017 1.1.1.3 mrg \gdefchar^^df{\ss} 10018 1.1.1.3 mrg % 10019 1.1.1.3 mrg \gdefchar^^e0{\`a} 10020 1.1.1.3 mrg \gdefchar^^e1{\'a} 10021 1.1.1.3 mrg \gdefchar^^e2{\^a} 10022 1.1.1.3 mrg \gdefchar^^e3{\~a} 10023 1.1.1.3 mrg \gdefchar^^e4{\"a} 10024 1.1.1.3 mrg \gdefchar^^e5{\ringaccent a} 10025 1.1.1.3 mrg \gdefchar^^e6{\ae} 10026 1.1.1.3 mrg \gdefchar^^e7{\cedilla c} 10027 1.1.1.3 mrg \gdefchar^^e8{\`e} 10028 1.1.1.3 mrg \gdefchar^^e9{\'e} 10029 1.1.1.3 mrg \gdefchar^^ea{\^e} 10030 1.1.1.3 mrg \gdefchar^^eb{\"e} 10031 1.1.1.3 mrg \gdefchar^^ec{\`{\dotless i}} 10032 1.1.1.3 mrg \gdefchar^^ed{\'{\dotless i}} 10033 1.1.1.3 mrg \gdefchar^^ee{\^{\dotless i}} 10034 1.1.1.3 mrg \gdefchar^^ef{\"{\dotless i}} 10035 1.1.1.3 mrg % 10036 1.1.1.3 mrg \gdefchar^^f0{\dh} 10037 1.1.1.3 mrg \gdefchar^^f1{\~n} 10038 1.1.1.3 mrg \gdefchar^^f2{\`o} 10039 1.1.1.3 mrg \gdefchar^^f3{\'o} 10040 1.1.1.3 mrg \gdefchar^^f4{\^o} 10041 1.1.1.3 mrg \gdefchar^^f5{\~o} 10042 1.1.1.3 mrg \gdefchar^^f6{\"o} 10043 1.1.1.3 mrg \gdefchar^^f7{$\div$} 10044 1.1.1.3 mrg \gdefchar^^f8{\o} 10045 1.1.1.3 mrg \gdefchar^^f9{\`u} 10046 1.1.1.3 mrg \gdefchar^^fa{\'u} 10047 1.1.1.3 mrg \gdefchar^^fb{\^u} 10048 1.1 mrg \gdefchar^^fc{\"u} 10049 1.1 mrg \gdefchar^^fd{\'y} 10050 1.1 mrg \gdefchar^^fe{\th} 10051 1.1 mrg \gdefchar^^ff{\"y} 10052 1.1 mrg } 10053 1.1 mrg 10054 1.1 mrg % Latin9 (ISO-8859-15) encoding character definitions. 10055 1.1.1.3 mrg \def\latninechardefs{% 10056 1.1.1.3 mrg % Encoding is almost identical to Latin1. 10057 1.1.1.3 mrg \latonechardefs 10058 1.1.1.3 mrg % 10059 1.1.1.3 mrg \gdefchar^^a4{\euro{}} 10060 1.1.1.3 mrg \gdefchar^^a6{\v S} 10061 1.1.1.3 mrg \gdefchar^^a8{\v s} 10062 1.1.1.3 mrg \gdefchar^^b4{\v Z} 10063 1.1 mrg \gdefchar^^b8{\v z} 10064 1.1 mrg \gdefchar^^bc{\OE} 10065 1.1 mrg \gdefchar^^bd{\oe} 10066 1.1 mrg \gdefchar^^be{\"Y} 10067 1.1.1.3 mrg } 10068 1.1.1.3 mrg 10069 1.1.1.3 mrg % Latin2 (ISO-8859-2) character definitions. 10070 1.1.1.3 mrg \def\lattwochardefs{% 10071 1.1.1.3 mrg \gdefchar^^a0{\tie} 10072 1.1.1.3 mrg \gdefchar^^a1{\ogonek{A}} 10073 1.1.1.3 mrg \gdefchar^^a2{\u{}} 10074 1.1.1.3 mrg \gdefchar^^a3{\L} 10075 1.1.1.3 mrg \gdefchar^^a4{\missingcharmsg{CURRENCY SIGN}} 10076 1.1.1.3 mrg \gdefchar^^a5{\v L} 10077 1.1.1.3 mrg \gdefchar^^a6{\'S} 10078 1.1.1.3 mrg \gdefchar^^a7{\S} 10079 1.1.1.3 mrg \gdefchar^^a8{\"{}} 10080 1.1.1.3 mrg \gdefchar^^a9{\v S} 10081 1.1.1.3 mrg \gdefchar^^aa{\cedilla S} 10082 1.1.1.3 mrg \gdefchar^^ab{\v T} 10083 1.1.1.3 mrg \gdefchar^^ac{\'Z} 10084 1.1.1.5 mrg \gdefchar^^ad{\-} 10085 1.1.1.3 mrg \gdefchar^^ae{\v Z} 10086 1.1.1.3 mrg \gdefchar^^af{\dotaccent Z} 10087 1.1.1.3 mrg % 10088 1.1.1.3 mrg \gdefchar^^b0{\textdegree} 10089 1.1.1.3 mrg \gdefchar^^b1{\ogonek{a}} 10090 1.1.1.3 mrg \gdefchar^^b2{\ogonek{ }} 10091 1.1.1.3 mrg \gdefchar^^b3{\l} 10092 1.1.1.3 mrg \gdefchar^^b4{\'{}} 10093 1.1.1.3 mrg \gdefchar^^b5{\v l} 10094 1.1.1.3 mrg \gdefchar^^b6{\'s} 10095 1.1.1.3 mrg \gdefchar^^b7{\v{}} 10096 1.1.1.3 mrg \gdefchar^^b8{\cedilla\ } 10097 1.1.1.3 mrg \gdefchar^^b9{\v s} 10098 1.1.1.3 mrg \gdefchar^^ba{\cedilla s} 10099 1.1.1.3 mrg \gdefchar^^bb{\v t} 10100 1.1.1.3 mrg \gdefchar^^bc{\'z} 10101 1.1.1.3 mrg \gdefchar^^bd{\H{}} 10102 1.1.1.3 mrg \gdefchar^^be{\v z} 10103 1.1.1.3 mrg \gdefchar^^bf{\dotaccent z} 10104 1.1.1.3 mrg % 10105 1.1.1.3 mrg \gdefchar^^c0{\'R} 10106 1.1.1.3 mrg \gdefchar^^c1{\'A} 10107 1.1.1.3 mrg \gdefchar^^c2{\^A} 10108 1.1.1.3 mrg \gdefchar^^c3{\u A} 10109 1.1.1.3 mrg \gdefchar^^c4{\"A} 10110 1.1.1.3 mrg \gdefchar^^c5{\'L} 10111 1.1.1.3 mrg \gdefchar^^c6{\'C} 10112 1.1.1.3 mrg \gdefchar^^c7{\cedilla C} 10113 1.1.1.3 mrg \gdefchar^^c8{\v C} 10114 1.1.1.3 mrg \gdefchar^^c9{\'E} 10115 1.1.1.3 mrg \gdefchar^^ca{\ogonek{E}} 10116 1.1.1.3 mrg \gdefchar^^cb{\"E} 10117 1.1.1.3 mrg \gdefchar^^cc{\v E} 10118 1.1.1.3 mrg \gdefchar^^cd{\'I} 10119 1.1.1.3 mrg \gdefchar^^ce{\^I} 10120 1.1.1.3 mrg \gdefchar^^cf{\v D} 10121 1.1.1.3 mrg % 10122 1.1.1.3 mrg \gdefchar^^d0{\DH} 10123 1.1.1.3 mrg \gdefchar^^d1{\'N} 10124 1.1.1.3 mrg \gdefchar^^d2{\v N} 10125 1.1.1.3 mrg \gdefchar^^d3{\'O} 10126 1.1.1.3 mrg \gdefchar^^d4{\^O} 10127 1.1.1.3 mrg \gdefchar^^d5{\H O} 10128 1.1.1.3 mrg \gdefchar^^d6{\"O} 10129 1.1.1.3 mrg \gdefchar^^d7{$\times$} 10130 1.1.1.3 mrg \gdefchar^^d8{\v R} 10131 1.1.1.3 mrg \gdefchar^^d9{\ringaccent U} 10132 1.1.1.3 mrg \gdefchar^^da{\'U} 10133 1.1.1.3 mrg \gdefchar^^db{\H U} 10134 1.1.1.3 mrg \gdefchar^^dc{\"U} 10135 1.1.1.3 mrg \gdefchar^^dd{\'Y} 10136 1.1.1.3 mrg \gdefchar^^de{\cedilla T} 10137 1.1.1.3 mrg \gdefchar^^df{\ss} 10138 1.1.1.3 mrg % 10139 1.1.1.3 mrg \gdefchar^^e0{\'r} 10140 1.1.1.3 mrg \gdefchar^^e1{\'a} 10141 1.1.1.3 mrg \gdefchar^^e2{\^a} 10142 1.1.1.3 mrg \gdefchar^^e3{\u a} 10143 1.1.1.3 mrg \gdefchar^^e4{\"a} 10144 1.1.1.3 mrg \gdefchar^^e5{\'l} 10145 1.1.1.3 mrg \gdefchar^^e6{\'c} 10146 1.1.1.3 mrg \gdefchar^^e7{\cedilla c} 10147 1.1.1.3 mrg \gdefchar^^e8{\v c} 10148 1.1.1.3 mrg \gdefchar^^e9{\'e} 10149 1.1.1.3 mrg \gdefchar^^ea{\ogonek{e}} 10150 1.1.1.3 mrg \gdefchar^^eb{\"e} 10151 1.1.1.3 mrg \gdefchar^^ec{\v e} 10152 1.1.1.3 mrg \gdefchar^^ed{\'{\dotless{i}}} 10153 1.1.1.3 mrg \gdefchar^^ee{\^{\dotless{i}}} 10154 1.1.1.3 mrg \gdefchar^^ef{\v d} 10155 1.1.1.3 mrg % 10156 1.1.1.3 mrg \gdefchar^^f0{\dh} 10157 1.1.1.3 mrg \gdefchar^^f1{\'n} 10158 1.1.1.3 mrg \gdefchar^^f2{\v n} 10159 1.1.1.3 mrg \gdefchar^^f3{\'o} 10160 1.1.1.3 mrg \gdefchar^^f4{\^o} 10161 1.1.1.3 mrg \gdefchar^^f5{\H o} 10162 1.1.1.3 mrg \gdefchar^^f6{\"o} 10163 1.1.1.3 mrg \gdefchar^^f7{$\div$} 10164 1.1.1.3 mrg \gdefchar^^f8{\v r} 10165 1.1.1.3 mrg \gdefchar^^f9{\ringaccent u} 10166 1.1.1.3 mrg \gdefchar^^fa{\'u} 10167 1.1.1.3 mrg \gdefchar^^fb{\H u} 10168 1.1 mrg \gdefchar^^fc{\"u} 10169 1.1 mrg \gdefchar^^fd{\'y} 10170 1.1 mrg \gdefchar^^fe{\cedilla t} 10171 1.1 mrg \gdefchar^^ff{\dotaccent{}} 10172 1.1 mrg } 10173 1.1 mrg 10174 1.1 mrg % UTF-8 character definitions. 10175 1.1 mrg % 10176 1.1 mrg % This code to support UTF-8 is based on LaTeX's utf8.def, with some 10177 1.1 mrg % changes for Texinfo conventions. It is included here under the GPL by 10178 1.1 mrg % permission from Frank Mittelbach and the LaTeX team. 10179 1.1 mrg % 10180 1.1 mrg \newcount\countUTFx 10181 1.1 mrg \newcount\countUTFy 10182 1.1 mrg \newcount\countUTFz 10183 1.1 mrg 10184 1.1 mrg \gdef\UTFviiiTwoOctets#1#2{\expandafter 10185 1.1 mrg \UTFviiiDefined\csname u8:#1\string #2\endcsname} 10186 1.1 mrg % 10187 1.1 mrg \gdef\UTFviiiThreeOctets#1#2#3{\expandafter 10188 1.1 mrg \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname} 10189 1.1 mrg % 10190 1.1 mrg \gdef\UTFviiiFourOctets#1#2#3#4{\expandafter 10191 1.1 mrg \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname} 10192 1.1 mrg 10193 1.1 mrg \gdef\UTFviiiDefined#1{% 10194 1.1 mrg \ifx #1\relax 10195 1.1 mrg \message{\linenumber Unicode char \string #1 not defined for Texinfo}% 10196 1.1 mrg \else 10197 1.1.1.3 mrg \expandafter #1% 10198 1.1 mrg \fi 10199 1.1 mrg } 10200 1.1.1.3 mrg 10201 1.1 mrg % Give non-ASCII bytes the active definitions for processing UTF-8 sequences 10202 1.1 mrg \begingroup 10203 1.1.1.3 mrg \catcode`\~13 10204 1.1.1.3 mrg \catcode`\$12 10205 1.1 mrg \catcode`\"12 10206 1.1 mrg 10207 1.1 mrg % Loop from \countUTFx to \countUTFy, performing \UTFviiiTmp 10208 1.1.1.3 mrg % substituting ~ and $ with a character token of that value. 10209 1.1 mrg \def\UTFviiiLoop{% 10210 1.1 mrg \global\catcode\countUTFx\active 10211 1.1 mrg \uccode`\~\countUTFx 10212 1.1 mrg \uccode`\$\countUTFx 10213 1.1 mrg \uppercase\expandafter{\UTFviiiTmp}% 10214 1.1 mrg \advance\countUTFx by 1 10215 1.1.1.3 mrg \ifnum\countUTFx < \countUTFy 10216 1.1.1.3 mrg \expandafter\UTFviiiLoop 10217 1.1.1.3 mrg \fi} 10218 1.1.1.3 mrg 10219 1.1.1.3 mrg % For bytes other than the first in a UTF-8 sequence. Not expected to 10220 1.1.1.3 mrg % be expanded except when writing to auxiliary files. 10221 1.1.1.3 mrg \countUTFx = "80 10222 1.1.1.3 mrg \countUTFy = "C2 10223 1.1.1.3 mrg \def\UTFviiiTmp{% 10224 1.1 mrg \gdef~{% 10225 1.1 mrg \ifpassthroughchars $\fi}}% 10226 1.1 mrg \UTFviiiLoop 10227 1.1.1.3 mrg 10228 1.1.1.3 mrg \countUTFx = "C2 10229 1.1.1.3 mrg \countUTFy = "E0 10230 1.1 mrg \def\UTFviiiTmp{% 10231 1.1 mrg \gdef~{% 10232 1.1 mrg \ifpassthroughchars $% 10233 1.1 mrg \else\expandafter\UTFviiiTwoOctets\expandafter$\fi}}% 10234 1.1 mrg \UTFviiiLoop 10235 1.1.1.3 mrg 10236 1.1.1.3 mrg \countUTFx = "E0 10237 1.1.1.3 mrg \countUTFy = "F0 10238 1.1 mrg \def\UTFviiiTmp{% 10239 1.1 mrg \gdef~{% 10240 1.1 mrg \ifpassthroughchars $% 10241 1.1 mrg \else\expandafter\UTFviiiThreeOctets\expandafter$\fi}}% 10242 1.1 mrg \UTFviiiLoop 10243 1.1.1.3 mrg 10244 1.1.1.3 mrg \countUTFx = "F0 10245 1.1.1.3 mrg \countUTFy = "F4 10246 1.1.1.3 mrg \def\UTFviiiTmp{% 10247 1.1 mrg \gdef~{% 10248 1.1 mrg \ifpassthroughchars $% 10249 1.1 mrg \else\expandafter\UTFviiiFourOctets\expandafter$\fi 10250 1.1.1.3 mrg }}% 10251 1.1.1.3 mrg \UTFviiiLoop 10252 1.1.1.3 mrg \endgroup 10253 1.1.1.3 mrg 10254 1.1.1.3 mrg \def\globallet{\global\let} % save some \expandafter's below 10255 1.1.1.3 mrg 10256 1.1.1.3 mrg % @U{xxxx} to produce U+xxxx, if we support it. 10257 1.1.1.3 mrg \def\U#1{% 10258 1.1.1.3 mrg \expandafter\ifx\csname uni:#1\endcsname \relax 10259 1.1.1.3 mrg \iftxinativeunicodecapable 10260 1.1.1.3 mrg % All Unicode characters can be used if native Unicode handling is 10261 1.1.1.3 mrg % active. However, if the font does not have the glyph, 10262 1.1.1.3 mrg % letters are missing. 10263 1.1.1.3 mrg \begingroup 10264 1.1.1.5 mrg \uccode`\.="#1\relax 10265 1.1.1.3 mrg \uppercase{.} 10266 1.1.1.3 mrg \endgroup 10267 1.1.1.3 mrg \else 10268 1.1.1.3 mrg \errhelp = \EMsimple 10269 1.1.1.3 mrg \errmessage{Unicode character U+#1 not supported, sorry}% 10270 1.1.1.3 mrg \fi 10271 1.1.1.3 mrg \else 10272 1.1.1.3 mrg \csname uni:#1\endcsname 10273 1.1.1.3 mrg \fi 10274 1.1.1.3 mrg } 10275 1.1.1.3 mrg 10276 1.1.1.3 mrg % These macros are used here to construct the name of a control 10277 1.1.1.3 mrg % sequence to be defined. 10278 1.1.1.3 mrg \def\UTFviiiTwoOctetsName#1#2{% 10279 1.1.1.3 mrg \csname u8:#1\string #2\endcsname}% 10280 1.1.1.3 mrg \def\UTFviiiThreeOctetsName#1#2#3{% 10281 1.1.1.3 mrg \csname u8:#1\string #2\string #3\endcsname}% 10282 1.1.1.3 mrg \def\UTFviiiFourOctetsName#1#2#3#4{% 10283 1.1.1.3 mrg \csname u8:#1\string #2\string #3\string #4\endcsname}% 10284 1.1.1.3 mrg 10285 1.1 mrg % For UTF-8 byte sequences (TeX, e-TeX and pdfTeX), 10286 1.1 mrg % provide a definition macro to replace a Unicode character; 10287 1.1 mrg % this gets used by the @U command 10288 1.1 mrg % 10289 1.1 mrg \begingroup 10290 1.1 mrg \catcode`\"=12 10291 1.1 mrg \catcode`\<=12 10292 1.1 mrg \catcode`\.=12 10293 1.1.1.3 mrg \catcode`\,=12 10294 1.1 mrg \catcode`\;=12 10295 1.1 mrg \catcode`\!=12 10296 1.1 mrg \catcode`\~=13 10297 1.1.1.5 mrg \gdef\DeclareUnicodeCharacterUTFviii#1#2{% 10298 1.1.1.3 mrg \countUTFz = "#1\relax 10299 1.1.1.3 mrg \begingroup 10300 1.1.1.3 mrg \parseXMLCharref 10301 1.1.1.3 mrg 10302 1.1.1.3 mrg % Give \u8:... its definition. The sequence of seven \expandafter's 10303 1.1.1.3 mrg % expands after the \gdef three times, e.g. 10304 1.1.1.3 mrg % 10305 1.1.1.3 mrg % 1. \UTFviiTwoOctetsName B1 B2 10306 1.1.1.3 mrg % 2. \csname u8:B1 \string B2 \endcsname 10307 1.1.1.3 mrg % 3. \u8: B1 B2 (a single control sequence token) 10308 1.1.1.3 mrg % 10309 1.1.1.5 mrg \expandafter\expandafter 10310 1.1.1.3 mrg \expandafter\expandafter 10311 1.1.1.3 mrg \expandafter\expandafter 10312 1.1.1.3 mrg \expandafter\gdef \UTFviiiTmp{#2}% 10313 1.1.1.3 mrg % 10314 1.1.1.3 mrg \expandafter\ifx\csname uni:#1\endcsname \relax \else 10315 1.1.1.3 mrg \message{Internal error, already defined: #1}% 10316 1.1 mrg \fi 10317 1.1.1.3 mrg % 10318 1.1.1.3 mrg % define an additional control sequence for this code point. 10319 1.1.1.3 mrg \expandafter\globallet\csname uni:#1\endcsname \UTFviiiTmp 10320 1.1 mrg \endgroup} 10321 1.1.1.5 mrg % 10322 1.1 mrg % Given the value in \countUTFz as a Unicode code point, set \UTFviiiTmp 10323 1.1.1.5 mrg % to the corresponding UTF-8 sequence. 10324 1.1 mrg \gdef\parseXMLCharref{% 10325 1.1 mrg \ifnum\countUTFz < "20\relax 10326 1.1.1.3 mrg \errhelp = \EMsimple 10327 1.1 mrg \errmessage{Cannot define Unicode char value < 0020}% 10328 1.1 mrg \else\ifnum\countUTFz < "800\relax 10329 1.1 mrg \parseUTFviiiA,% 10330 1.1.1.3 mrg \parseUTFviiiB C\UTFviiiTwoOctetsName.,% 10331 1.1 mrg \else\ifnum\countUTFz < "10000\relax 10332 1.1 mrg \parseUTFviiiA;% 10333 1.1 mrg \parseUTFviiiA,% 10334 1.1 mrg \parseUTFviiiB E\UTFviiiThreeOctetsName.{,;}% 10335 1.1.1.3 mrg \else 10336 1.1 mrg \parseUTFviiiA;% 10337 1.1 mrg \parseUTFviiiA,% 10338 1.1 mrg \parseUTFviiiA!% 10339 1.1.1.3 mrg \parseUTFviiiB F\UTFviiiFourOctetsName.{!,;}% 10340 1.1.1.3 mrg \fi\fi\fi 10341 1.1.1.3 mrg } 10342 1.1.1.3 mrg 10343 1.1 mrg % Extract a byte from the end of the UTF-8 representation of \countUTFx. 10344 1.1 mrg % It must be a non-initial byte in the sequence. 10345 1.1 mrg % Change \uccode of #1 for it to be used in \parseUTFviiiB as one 10346 1.1.1.3 mrg % of the bytes. 10347 1.1 mrg \gdef\parseUTFviiiA#1{% 10348 1.1.1.5 mrg \countUTFx = \countUTFz 10349 1.1.1.3 mrg \divide\countUTFz by 64 10350 1.1.1.3 mrg \countUTFy = \countUTFz % Save to be the future value of \countUTFz. 10351 1.1 mrg \multiply\countUTFz by 64 10352 1.1.1.3 mrg 10353 1.1.1.3 mrg % \countUTFz is now \countUTFx with the last 5 bits cleared. Subtract 10354 1.1 mrg % in order to get the last five bits. 10355 1.1 mrg \advance\countUTFx by -\countUTFz 10356 1.1 mrg 10357 1.1 mrg % Convert this to the byte in the UTF-8 sequence. 10358 1.1.1.3 mrg \advance\countUTFx by 128 10359 1.1.1.3 mrg \uccode `#1\countUTFx 10360 1.1.1.3 mrg \countUTFz = \countUTFy} 10361 1.1.1.3 mrg 10362 1.1.1.3 mrg % Used to put a UTF-8 byte sequence into \UTFviiiTmp 10363 1.1.1.3 mrg % #1 is the increment for \countUTFz to yield a the first byte of the UTF-8 10364 1.1.1.3 mrg % sequence. 10365 1.1 mrg % #2 is one of the \UTFviii*OctetsName macros. 10366 1.1 mrg % #3 is always a full stop (.) 10367 1.1 mrg % #4 is a template for the other bytes in the sequence. The values for these 10368 1.1 mrg % bytes is substituted in here with \uppercase using the \uccode's. 10369 1.1 mrg \gdef\parseUTFviiiB#1#2#3#4{% 10370 1.1 mrg \advance\countUTFz by "#10\relax 10371 1.1.1.3 mrg \uccode `#3\countUTFz 10372 1.1.1.3 mrg \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} 10373 1.1.1.3 mrg \endgroup 10374 1.1.1.3 mrg 10375 1.1.1.3 mrg % For native Unicode handling (XeTeX and LuaTeX), 10376 1.1.1.3 mrg % provide a definition macro that sets a catcode to `other' non-globally 10377 1.1.1.3 mrg % 10378 1.1.1.3 mrg \def\DeclareUnicodeCharacterNativeOther#1#2{% 10379 1.1.1.3 mrg \catcode"#1=\other 10380 1.1.1.3 mrg } 10381 1.1.1.3 mrg 10382 1.1.1.3 mrg % https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_M 10383 1.1.1.5 mrg % U+0000..U+007F = https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block) 10384 1.1.1.3 mrg % U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block) 10385 1.1.1.3 mrg % U+0100..U+017F = https://en.wikipedia.org/wiki/Latin_Extended-A 10386 1.1.1.3 mrg % U+0180..U+024F = https://en.wikipedia.org/wiki/Latin_Extended-B 10387 1.1.1.3 mrg % 10388 1.1.1.3 mrg % Many of our renditions are less than wonderful, and all the missing 10389 1.1.1.3 mrg % characters are available somewhere. Loading the necessary fonts 10390 1.1.1.3 mrg % awaits user request. We can't truly support Unicode without 10391 1.1.1.3 mrg % reimplementing everything that's been done in LaTeX for many years, 10392 1.1.1.3 mrg % plus probably using luatex or xetex, and who knows what else. 10393 1.1.1.5 mrg % We won't be doing that here in this simple file. But we can try to at 10394 1.1.1.5 mrg % least make most of the characters not bomb out. 10395 1.1.1.5 mrg % 10396 1.1.1.5 mrg \def\unicodechardefs{% 10397 1.1.1.5 mrg \DeclareUnicodeCharacter{0020}{ } % space 10398 1.1.1.5 mrg \DeclareUnicodeCharacter{0021}{\char"21 }% % space to terminate number 10399 1.1.1.5 mrg \DeclareUnicodeCharacter{0022}{\char"22 }% 10400 1.1.1.5 mrg \DeclareUnicodeCharacter{0023}{\char"23 }% 10401 1.1.1.5 mrg \DeclareUnicodeCharacter{0024}{\char"24 }% 10402 1.1.1.5 mrg \DeclareUnicodeCharacter{0025}{\char"25 }% 10403 1.1.1.5 mrg \DeclareUnicodeCharacter{0026}{\char"26 }% 10404 1.1.1.5 mrg \DeclareUnicodeCharacter{0027}{\char"27 }% 10405 1.1.1.5 mrg \DeclareUnicodeCharacter{0028}{\char"28 }% 10406 1.1.1.5 mrg \DeclareUnicodeCharacter{0029}{\char"29 }% 10407 1.1.1.5 mrg \DeclareUnicodeCharacter{002A}{\char"2A }% 10408 1.1.1.5 mrg \DeclareUnicodeCharacter{002B}{\char"2B }% 10409 1.1.1.5 mrg \DeclareUnicodeCharacter{002C}{\char"2C }% 10410 1.1.1.5 mrg \DeclareUnicodeCharacter{002D}{\char"2D }% 10411 1.1.1.5 mrg \DeclareUnicodeCharacter{002E}{\char"2E }% 10412 1.1.1.5 mrg \DeclareUnicodeCharacter{002F}{\char"2F }% 10413 1.1.1.5 mrg \DeclareUnicodeCharacter{0030}{0}% 10414 1.1.1.5 mrg \DeclareUnicodeCharacter{0031}{1}% 10415 1.1.1.5 mrg \DeclareUnicodeCharacter{0032}{2}% 10416 1.1.1.5 mrg \DeclareUnicodeCharacter{0033}{3}% 10417 1.1.1.5 mrg \DeclareUnicodeCharacter{0034}{4}% 10418 1.1.1.5 mrg \DeclareUnicodeCharacter{0035}{5}% 10419 1.1.1.5 mrg \DeclareUnicodeCharacter{0036}{6}% 10420 1.1.1.5 mrg \DeclareUnicodeCharacter{0037}{7}% 10421 1.1.1.5 mrg \DeclareUnicodeCharacter{0038}{8}% 10422 1.1.1.5 mrg \DeclareUnicodeCharacter{0039}{9}% 10423 1.1.1.5 mrg \DeclareUnicodeCharacter{003A}{\char"3A }% 10424 1.1.1.5 mrg \DeclareUnicodeCharacter{003B}{\char"3B }% 10425 1.1.1.5 mrg \DeclareUnicodeCharacter{003C}{\char"3C }% 10426 1.1.1.5 mrg \DeclareUnicodeCharacter{003D}{\char"3D }% 10427 1.1.1.5 mrg \DeclareUnicodeCharacter{003E}{\char"3E }% 10428 1.1.1.5 mrg \DeclareUnicodeCharacter{003F}{\char"3F }% 10429 1.1.1.5 mrg \DeclareUnicodeCharacter{0040}{\char"40 }% 10430 1.1.1.5 mrg \DeclareUnicodeCharacter{0041}{A}% 10431 1.1.1.5 mrg \DeclareUnicodeCharacter{0042}{B}% 10432 1.1.1.5 mrg \DeclareUnicodeCharacter{0043}{C}% 10433 1.1.1.5 mrg \DeclareUnicodeCharacter{0044}{D}% 10434 1.1.1.5 mrg \DeclareUnicodeCharacter{0045}{E}% 10435 1.1.1.5 mrg \DeclareUnicodeCharacter{0046}{F}% 10436 1.1.1.5 mrg \DeclareUnicodeCharacter{0047}{G}% 10437 1.1.1.5 mrg \DeclareUnicodeCharacter{0048}{H}% 10438 1.1.1.5 mrg \DeclareUnicodeCharacter{0049}{I}% 10439 1.1.1.5 mrg \DeclareUnicodeCharacter{004A}{J}% 10440 1.1.1.5 mrg \DeclareUnicodeCharacter{004B}{K}% 10441 1.1.1.5 mrg \DeclareUnicodeCharacter{004C}{L}% 10442 1.1.1.5 mrg \DeclareUnicodeCharacter{004D}{M}% 10443 1.1.1.5 mrg \DeclareUnicodeCharacter{004E}{N}% 10444 1.1.1.5 mrg \DeclareUnicodeCharacter{004F}{O}% 10445 1.1.1.5 mrg \DeclareUnicodeCharacter{0050}{P}% 10446 1.1.1.5 mrg \DeclareUnicodeCharacter{0051}{Q}% 10447 1.1.1.5 mrg \DeclareUnicodeCharacter{0052}{R}% 10448 1.1.1.5 mrg \DeclareUnicodeCharacter{0053}{S}% 10449 1.1.1.5 mrg \DeclareUnicodeCharacter{0054}{T}% 10450 1.1.1.5 mrg \DeclareUnicodeCharacter{0055}{U}% 10451 1.1.1.5 mrg \DeclareUnicodeCharacter{0056}{V}% 10452 1.1.1.5 mrg \DeclareUnicodeCharacter{0057}{W}% 10453 1.1.1.5 mrg \DeclareUnicodeCharacter{0058}{X}% 10454 1.1.1.5 mrg \DeclareUnicodeCharacter{0059}{Y}% 10455 1.1.1.5 mrg \DeclareUnicodeCharacter{005A}{Z}% 10456 1.1.1.5 mrg \DeclareUnicodeCharacter{005B}{\char"5B }% 10457 1.1.1.5 mrg \DeclareUnicodeCharacter{005C}{\char"5C }% 10458 1.1.1.5 mrg \DeclareUnicodeCharacter{005D}{\char"5D }% 10459 1.1.1.5 mrg \DeclareUnicodeCharacter{005E}{\char"5E }% 10460 1.1.1.5 mrg \DeclareUnicodeCharacter{005F}{\char"5F }% 10461 1.1.1.5 mrg \DeclareUnicodeCharacter{0060}{\char"60 }% 10462 1.1.1.5 mrg \DeclareUnicodeCharacter{0061}{a}% 10463 1.1.1.5 mrg \DeclareUnicodeCharacter{0062}{b}% 10464 1.1.1.5 mrg \DeclareUnicodeCharacter{0063}{c}% 10465 1.1.1.5 mrg \DeclareUnicodeCharacter{0064}{d}% 10466 1.1.1.5 mrg \DeclareUnicodeCharacter{0065}{e}% 10467 1.1.1.5 mrg \DeclareUnicodeCharacter{0066}{f}% 10468 1.1.1.5 mrg \DeclareUnicodeCharacter{0067}{g}% 10469 1.1.1.5 mrg \DeclareUnicodeCharacter{0068}{h}% 10470 1.1.1.5 mrg \DeclareUnicodeCharacter{0069}{i}% 10471 1.1.1.5 mrg \DeclareUnicodeCharacter{006A}{j}% 10472 1.1.1.5 mrg \DeclareUnicodeCharacter{006B}{k}% 10473 1.1.1.5 mrg \DeclareUnicodeCharacter{006C}{l}% 10474 1.1.1.5 mrg \DeclareUnicodeCharacter{006D}{m}% 10475 1.1.1.5 mrg \DeclareUnicodeCharacter{006E}{n}% 10476 1.1.1.5 mrg \DeclareUnicodeCharacter{006F}{o}% 10477 1.1.1.5 mrg \DeclareUnicodeCharacter{0070}{p}% 10478 1.1.1.5 mrg \DeclareUnicodeCharacter{0071}{q}% 10479 1.1.1.5 mrg \DeclareUnicodeCharacter{0072}{r}% 10480 1.1.1.5 mrg \DeclareUnicodeCharacter{0073}{s}% 10481 1.1.1.5 mrg \DeclareUnicodeCharacter{0074}{t}% 10482 1.1.1.5 mrg \DeclareUnicodeCharacter{0075}{u}% 10483 1.1.1.5 mrg \DeclareUnicodeCharacter{0076}{v}% 10484 1.1.1.5 mrg \DeclareUnicodeCharacter{0077}{w}% 10485 1.1.1.5 mrg \DeclareUnicodeCharacter{0078}{x}% 10486 1.1.1.5 mrg \DeclareUnicodeCharacter{0079}{y}% 10487 1.1.1.5 mrg \DeclareUnicodeCharacter{007A}{z}% 10488 1.1.1.5 mrg \DeclareUnicodeCharacter{007B}{\char"7B }% 10489 1.1.1.5 mrg \DeclareUnicodeCharacter{007C}{\char"7C }% 10490 1.1.1.3 mrg \DeclareUnicodeCharacter{007D}{\char"7D }% 10491 1.1.1.3 mrg \DeclareUnicodeCharacter{007E}{\char"7E }% 10492 1.1.1.3 mrg % \DeclareUnicodeCharacter{007F}{} % DEL 10493 1.1.1.3 mrg % 10494 1.1.1.3 mrg \DeclareUnicodeCharacter{00A0}{\tie}% 10495 1.1.1.3 mrg \DeclareUnicodeCharacter{00A1}{\exclamdown}% 10496 1.1.1.3 mrg \DeclareUnicodeCharacter{00A2}{{\tcfont \char162}}% 0242=cent 10497 1.1.1.3 mrg \DeclareUnicodeCharacter{00A3}{\pounds{}}% 10498 1.1.1.3 mrg \DeclareUnicodeCharacter{00A4}{{\tcfont \char164}}% 0244=currency 10499 1.1.1.3 mrg \DeclareUnicodeCharacter{00A5}{{\tcfont \char165}}% 0245=yen 10500 1.1.1.3 mrg \DeclareUnicodeCharacter{00A6}{{\tcfont \char166}}% 0246=brokenbar 10501 1.1.1.3 mrg \DeclareUnicodeCharacter{00A7}{\S}% 10502 1.1.1.3 mrg \DeclareUnicodeCharacter{00A8}{\"{ }}% 10503 1.1.1.3 mrg \DeclareUnicodeCharacter{00A9}{\copyright{}}% 10504 1.1.1.3 mrg \DeclareUnicodeCharacter{00AA}{\ordf}% 10505 1.1.1.3 mrg \DeclareUnicodeCharacter{00AB}{\guillemetleft{}}% 10506 1.1.1.3 mrg \DeclareUnicodeCharacter{00AC}{\ensuremath\lnot}% 10507 1.1.1.5 mrg \DeclareUnicodeCharacter{00AD}{\-}% 10508 1.1.1.3 mrg \DeclareUnicodeCharacter{00AE}{\registeredsymbol{}}% 10509 1.1.1.3 mrg \DeclareUnicodeCharacter{00AF}{\={ }}% 10510 1.1.1.3 mrg % 10511 1.1.1.3 mrg \DeclareUnicodeCharacter{00B0}{\textdegree}% 10512 1.1.1.3 mrg \DeclareUnicodeCharacter{00B1}{\ensuremath\pm}% 10513 1.1.1.3 mrg \DeclareUnicodeCharacter{00B2}{$^2$}% 10514 1.1.1.3 mrg \DeclareUnicodeCharacter{00B3}{$^3$}% 10515 1.1.1.3 mrg \DeclareUnicodeCharacter{00B4}{\'{ }}% 10516 1.1.1.3 mrg \DeclareUnicodeCharacter{00B5}{$\mu$}% 10517 1.1.1.3 mrg \DeclareUnicodeCharacter{00B6}{\P}% 10518 1.1.1.3 mrg \DeclareUnicodeCharacter{00B7}{\ensuremath\cdot}% 10519 1.1.1.3 mrg \DeclareUnicodeCharacter{00B8}{\cedilla{ }}% 10520 1.1.1.3 mrg \DeclareUnicodeCharacter{00B9}{$^1$}% 10521 1.1.1.3 mrg \DeclareUnicodeCharacter{00BA}{\ordm}% 10522 1.1.1.3 mrg \DeclareUnicodeCharacter{00BB}{\guillemetright{}}% 10523 1.1.1.3 mrg \DeclareUnicodeCharacter{00BC}{$1\over4$}% 10524 1.1.1.3 mrg \DeclareUnicodeCharacter{00BD}{$1\over2$}% 10525 1.1.1.3 mrg \DeclareUnicodeCharacter{00BE}{$3\over4$}% 10526 1.1.1.3 mrg \DeclareUnicodeCharacter{00BF}{\questiondown}% 10527 1.1.1.3 mrg % 10528 1.1.1.3 mrg \DeclareUnicodeCharacter{00C0}{\`A}% 10529 1.1.1.3 mrg \DeclareUnicodeCharacter{00C1}{\'A}% 10530 1.1.1.3 mrg \DeclareUnicodeCharacter{00C2}{\^A}% 10531 1.1.1.3 mrg \DeclareUnicodeCharacter{00C3}{\~A}% 10532 1.1.1.3 mrg \DeclareUnicodeCharacter{00C4}{\"A}% 10533 1.1.1.3 mrg \DeclareUnicodeCharacter{00C5}{\AA}% 10534 1.1.1.3 mrg \DeclareUnicodeCharacter{00C6}{\AE}% 10535 1.1.1.3 mrg \DeclareUnicodeCharacter{00C7}{\cedilla{C}}% 10536 1.1.1.3 mrg \DeclareUnicodeCharacter{00C8}{\`E}% 10537 1.1.1.3 mrg \DeclareUnicodeCharacter{00C9}{\'E}% 10538 1.1.1.3 mrg \DeclareUnicodeCharacter{00CA}{\^E}% 10539 1.1.1.3 mrg \DeclareUnicodeCharacter{00CB}{\"E}% 10540 1.1.1.3 mrg \DeclareUnicodeCharacter{00CC}{\`I}% 10541 1.1.1.3 mrg \DeclareUnicodeCharacter{00CD}{\'I}% 10542 1.1.1.3 mrg \DeclareUnicodeCharacter{00CE}{\^I}% 10543 1.1.1.3 mrg \DeclareUnicodeCharacter{00CF}{\"I}% 10544 1.1.1.3 mrg % 10545 1.1.1.3 mrg \DeclareUnicodeCharacter{00D0}{\DH}% 10546 1.1.1.3 mrg \DeclareUnicodeCharacter{00D1}{\~N}% 10547 1.1.1.3 mrg \DeclareUnicodeCharacter{00D2}{\`O}% 10548 1.1.1.3 mrg \DeclareUnicodeCharacter{00D3}{\'O}% 10549 1.1.1.3 mrg \DeclareUnicodeCharacter{00D4}{\^O}% 10550 1.1.1.3 mrg \DeclareUnicodeCharacter{00D5}{\~O}% 10551 1.1.1.3 mrg \DeclareUnicodeCharacter{00D6}{\"O}% 10552 1.1.1.3 mrg \DeclareUnicodeCharacter{00D7}{\ensuremath\times}% 10553 1.1.1.3 mrg \DeclareUnicodeCharacter{00D8}{\O}% 10554 1.1.1.3 mrg \DeclareUnicodeCharacter{00D9}{\`U}% 10555 1.1.1.3 mrg \DeclareUnicodeCharacter{00DA}{\'U}% 10556 1.1.1.3 mrg \DeclareUnicodeCharacter{00DB}{\^U}% 10557 1.1.1.3 mrg \DeclareUnicodeCharacter{00DC}{\"U}% 10558 1.1.1.3 mrg \DeclareUnicodeCharacter{00DD}{\'Y}% 10559 1.1.1.3 mrg \DeclareUnicodeCharacter{00DE}{\TH}% 10560 1.1.1.3 mrg \DeclareUnicodeCharacter{00DF}{\ss}% 10561 1.1.1.3 mrg % 10562 1.1.1.3 mrg \DeclareUnicodeCharacter{00E0}{\`a}% 10563 1.1.1.3 mrg \DeclareUnicodeCharacter{00E1}{\'a}% 10564 1.1.1.3 mrg \DeclareUnicodeCharacter{00E2}{\^a}% 10565 1.1.1.3 mrg \DeclareUnicodeCharacter{00E3}{\~a}% 10566 1.1.1.3 mrg \DeclareUnicodeCharacter{00E4}{\"a}% 10567 1.1.1.3 mrg \DeclareUnicodeCharacter{00E5}{\aa}% 10568 1.1.1.3 mrg \DeclareUnicodeCharacter{00E6}{\ae}% 10569 1.1.1.3 mrg \DeclareUnicodeCharacter{00E7}{\cedilla{c}}% 10570 1.1.1.3 mrg \DeclareUnicodeCharacter{00E8}{\`e}% 10571 1.1.1.3 mrg \DeclareUnicodeCharacter{00E9}{\'e}% 10572 1.1.1.3 mrg \DeclareUnicodeCharacter{00EA}{\^e}% 10573 1.1.1.3 mrg \DeclareUnicodeCharacter{00EB}{\"e}% 10574 1.1.1.3 mrg \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}% 10575 1.1.1.3 mrg \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}% 10576 1.1.1.3 mrg \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}% 10577 1.1.1.3 mrg \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}% 10578 1.1.1.3 mrg % 10579 1.1.1.3 mrg \DeclareUnicodeCharacter{00F0}{\dh}% 10580 1.1.1.3 mrg \DeclareUnicodeCharacter{00F1}{\~n}% 10581 1.1.1.3 mrg \DeclareUnicodeCharacter{00F2}{\`o}% 10582 1.1.1.3 mrg \DeclareUnicodeCharacter{00F3}{\'o}% 10583 1.1.1.3 mrg \DeclareUnicodeCharacter{00F4}{\^o}% 10584 1.1.1.3 mrg \DeclareUnicodeCharacter{00F5}{\~o}% 10585 1.1.1.3 mrg \DeclareUnicodeCharacter{00F6}{\"o}% 10586 1.1.1.3 mrg \DeclareUnicodeCharacter{00F7}{\ensuremath\div}% 10587 1.1.1.3 mrg \DeclareUnicodeCharacter{00F8}{\o}% 10588 1.1.1.3 mrg \DeclareUnicodeCharacter{00F9}{\`u}% 10589 1.1.1.3 mrg \DeclareUnicodeCharacter{00FA}{\'u}% 10590 1.1.1.3 mrg \DeclareUnicodeCharacter{00FB}{\^u}% 10591 1.1.1.3 mrg \DeclareUnicodeCharacter{00FC}{\"u}% 10592 1.1.1.3 mrg \DeclareUnicodeCharacter{00FD}{\'y}% 10593 1.1.1.3 mrg \DeclareUnicodeCharacter{00FE}{\th}% 10594 1.1.1.3 mrg \DeclareUnicodeCharacter{00FF}{\"y}% 10595 1.1.1.3 mrg % 10596 1.1.1.3 mrg \DeclareUnicodeCharacter{0100}{\=A}% 10597 1.1.1.3 mrg \DeclareUnicodeCharacter{0101}{\=a}% 10598 1.1.1.3 mrg \DeclareUnicodeCharacter{0102}{\u{A}}% 10599 1.1.1.3 mrg \DeclareUnicodeCharacter{0103}{\u{a}}% 10600 1.1.1.3 mrg \DeclareUnicodeCharacter{0104}{\ogonek{A}}% 10601 1.1.1.3 mrg \DeclareUnicodeCharacter{0105}{\ogonek{a}}% 10602 1.1.1.3 mrg \DeclareUnicodeCharacter{0106}{\'C}% 10603 1.1.1.3 mrg \DeclareUnicodeCharacter{0107}{\'c}% 10604 1.1.1.3 mrg \DeclareUnicodeCharacter{0108}{\^C}% 10605 1.1.1.3 mrg \DeclareUnicodeCharacter{0109}{\^c}% 10606 1.1.1.3 mrg \DeclareUnicodeCharacter{010A}{\dotaccent{C}}% 10607 1.1.1.3 mrg \DeclareUnicodeCharacter{010B}{\dotaccent{c}}% 10608 1.1.1.3 mrg \DeclareUnicodeCharacter{010C}{\v{C}}% 10609 1.1.1.3 mrg \DeclareUnicodeCharacter{010D}{\v{c}}% 10610 1.1.1.3 mrg \DeclareUnicodeCharacter{010E}{\v{D}}% 10611 1.1.1.3 mrg \DeclareUnicodeCharacter{010F}{d'}% 10612 1.1.1.3 mrg % 10613 1.1.1.3 mrg \DeclareUnicodeCharacter{0110}{\DH}% 10614 1.1.1.3 mrg \DeclareUnicodeCharacter{0111}{\dh}% 10615 1.1.1.3 mrg \DeclareUnicodeCharacter{0112}{\=E}% 10616 1.1.1.3 mrg \DeclareUnicodeCharacter{0113}{\=e}% 10617 1.1.1.3 mrg \DeclareUnicodeCharacter{0114}{\u{E}}% 10618 1.1.1.3 mrg \DeclareUnicodeCharacter{0115}{\u{e}}% 10619 1.1.1.3 mrg \DeclareUnicodeCharacter{0116}{\dotaccent{E}}% 10620 1.1.1.3 mrg \DeclareUnicodeCharacter{0117}{\dotaccent{e}}% 10621 1.1.1.3 mrg \DeclareUnicodeCharacter{0118}{\ogonek{E}}% 10622 1.1.1.3 mrg \DeclareUnicodeCharacter{0119}{\ogonek{e}}% 10623 1.1.1.3 mrg \DeclareUnicodeCharacter{011A}{\v{E}}% 10624 1.1.1.3 mrg \DeclareUnicodeCharacter{011B}{\v{e}}% 10625 1.1.1.3 mrg \DeclareUnicodeCharacter{011C}{\^G}% 10626 1.1.1.3 mrg \DeclareUnicodeCharacter{011D}{\^g}% 10627 1.1.1.3 mrg \DeclareUnicodeCharacter{011E}{\u{G}}% 10628 1.1.1.3 mrg \DeclareUnicodeCharacter{011F}{\u{g}}% 10629 1.1.1.3 mrg % 10630 1.1.1.3 mrg \DeclareUnicodeCharacter{0120}{\dotaccent{G}}% 10631 1.1.1.3 mrg \DeclareUnicodeCharacter{0121}{\dotaccent{g}}% 10632 1.1.1.3 mrg \DeclareUnicodeCharacter{0122}{\cedilla{G}}% 10633 1.1.1.3 mrg \DeclareUnicodeCharacter{0123}{\cedilla{g}}% 10634 1.1.1.3 mrg \DeclareUnicodeCharacter{0124}{\^H}% 10635 1.1.1.3 mrg \DeclareUnicodeCharacter{0125}{\^h}% 10636 1.1.1.3 mrg \DeclareUnicodeCharacter{0126}{\missingcharmsg{H WITH STROKE}}% 10637 1.1.1.3 mrg \DeclareUnicodeCharacter{0127}{\missingcharmsg{h WITH STROKE}}% 10638 1.1.1.3 mrg \DeclareUnicodeCharacter{0128}{\~I}% 10639 1.1.1.3 mrg \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}% 10640 1.1.1.3 mrg \DeclareUnicodeCharacter{012A}{\=I}% 10641 1.1.1.3 mrg \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}% 10642 1.1.1.3 mrg \DeclareUnicodeCharacter{012C}{\u{I}}% 10643 1.1.1.3 mrg \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}% 10644 1.1.1.3 mrg \DeclareUnicodeCharacter{012E}{\ogonek{I}}% 10645 1.1.1.3 mrg \DeclareUnicodeCharacter{012F}{\ogonek{i}}% 10646 1.1.1.3 mrg % 10647 1.1.1.3 mrg \DeclareUnicodeCharacter{0130}{\dotaccent{I}}% 10648 1.1.1.3 mrg \DeclareUnicodeCharacter{0131}{\dotless{i}}% 10649 1.1.1.3 mrg \DeclareUnicodeCharacter{0132}{IJ}% 10650 1.1.1.3 mrg \DeclareUnicodeCharacter{0133}{ij}% 10651 1.1.1.3 mrg \DeclareUnicodeCharacter{0134}{\^J}% 10652 1.1.1.3 mrg \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}% 10653 1.1.1.3 mrg \DeclareUnicodeCharacter{0136}{\cedilla{K}}% 10654 1.1.1.3 mrg \DeclareUnicodeCharacter{0137}{\cedilla{k}}% 10655 1.1.1.3 mrg \DeclareUnicodeCharacter{0138}{\ensuremath\kappa}% 10656 1.1.1.3 mrg \DeclareUnicodeCharacter{0139}{\'L}% 10657 1.1.1.3 mrg \DeclareUnicodeCharacter{013A}{\'l}% 10658 1.1.1.3 mrg \DeclareUnicodeCharacter{013B}{\cedilla{L}}% 10659 1.1.1.3 mrg \DeclareUnicodeCharacter{013C}{\cedilla{l}}% 10660 1.1.1.3 mrg \DeclareUnicodeCharacter{013D}{L'}% should kern 10661 1.1.1.3 mrg \DeclareUnicodeCharacter{013E}{l'}% should kern 10662 1.1.1.3 mrg \DeclareUnicodeCharacter{013F}{L\U{00B7}}% 10663 1.1.1.3 mrg % 10664 1.1.1.3 mrg \DeclareUnicodeCharacter{0140}{l\U{00B7}}% 10665 1.1.1.3 mrg \DeclareUnicodeCharacter{0141}{\L}% 10666 1.1.1.3 mrg \DeclareUnicodeCharacter{0142}{\l}% 10667 1.1.1.3 mrg \DeclareUnicodeCharacter{0143}{\'N}% 10668 1.1.1.3 mrg \DeclareUnicodeCharacter{0144}{\'n}% 10669 1.1.1.3 mrg \DeclareUnicodeCharacter{0145}{\cedilla{N}}% 10670 1.1.1.3 mrg \DeclareUnicodeCharacter{0146}{\cedilla{n}}% 10671 1.1.1.3 mrg \DeclareUnicodeCharacter{0147}{\v{N}}% 10672 1.1.1.3 mrg \DeclareUnicodeCharacter{0148}{\v{n}}% 10673 1.1.1.3 mrg \DeclareUnicodeCharacter{0149}{'n}% 10674 1.1.1.3 mrg \DeclareUnicodeCharacter{014A}{\missingcharmsg{ENG}}% 10675 1.1.1.3 mrg \DeclareUnicodeCharacter{014B}{\missingcharmsg{eng}}% 10676 1.1.1.3 mrg \DeclareUnicodeCharacter{014C}{\=O}% 10677 1.1.1.3 mrg \DeclareUnicodeCharacter{014D}{\=o}% 10678 1.1.1.3 mrg \DeclareUnicodeCharacter{014E}{\u{O}}% 10679 1.1.1.3 mrg \DeclareUnicodeCharacter{014F}{\u{o}}% 10680 1.1.1.3 mrg % 10681 1.1.1.3 mrg \DeclareUnicodeCharacter{0150}{\H{O}}% 10682 1.1.1.3 mrg \DeclareUnicodeCharacter{0151}{\H{o}}% 10683 1.1.1.3 mrg \DeclareUnicodeCharacter{0152}{\OE}% 10684 1.1.1.3 mrg \DeclareUnicodeCharacter{0153}{\oe}% 10685 1.1.1.3 mrg \DeclareUnicodeCharacter{0154}{\'R}% 10686 1.1.1.3 mrg \DeclareUnicodeCharacter{0155}{\'r}% 10687 1.1.1.3 mrg \DeclareUnicodeCharacter{0156}{\cedilla{R}}% 10688 1.1.1.3 mrg \DeclareUnicodeCharacter{0157}{\cedilla{r}}% 10689 1.1.1.3 mrg \DeclareUnicodeCharacter{0158}{\v{R}}% 10690 1.1.1.3 mrg \DeclareUnicodeCharacter{0159}{\v{r}}% 10691 1.1.1.3 mrg \DeclareUnicodeCharacter{015A}{\'S}% 10692 1.1.1.3 mrg \DeclareUnicodeCharacter{015B}{\'s}% 10693 1.1.1.3 mrg \DeclareUnicodeCharacter{015C}{\^S}% 10694 1.1.1.3 mrg \DeclareUnicodeCharacter{015D}{\^s}% 10695 1.1.1.3 mrg \DeclareUnicodeCharacter{015E}{\cedilla{S}}% 10696 1.1.1.3 mrg \DeclareUnicodeCharacter{015F}{\cedilla{s}}% 10697 1.1.1.3 mrg % 10698 1.1.1.3 mrg \DeclareUnicodeCharacter{0160}{\v{S}}% 10699 1.1.1.3 mrg \DeclareUnicodeCharacter{0161}{\v{s}}% 10700 1.1.1.3 mrg \DeclareUnicodeCharacter{0162}{\cedilla{T}}% 10701 1.1.1.3 mrg \DeclareUnicodeCharacter{0163}{\cedilla{t}}% 10702 1.1.1.3 mrg \DeclareUnicodeCharacter{0164}{\v{T}}% 10703 1.1.1.3 mrg \DeclareUnicodeCharacter{0165}{\v{t}}% 10704 1.1.1.3 mrg \DeclareUnicodeCharacter{0166}{\missingcharmsg{H WITH STROKE}}% 10705 1.1.1.3 mrg \DeclareUnicodeCharacter{0167}{\missingcharmsg{h WITH STROKE}}% 10706 1.1.1.3 mrg \DeclareUnicodeCharacter{0168}{\~U}% 10707 1.1.1.3 mrg \DeclareUnicodeCharacter{0169}{\~u}% 10708 1.1.1.3 mrg \DeclareUnicodeCharacter{016A}{\=U}% 10709 1.1.1.3 mrg \DeclareUnicodeCharacter{016B}{\=u}% 10710 1.1.1.3 mrg \DeclareUnicodeCharacter{016C}{\u{U}}% 10711 1.1.1.3 mrg \DeclareUnicodeCharacter{016D}{\u{u}}% 10712 1.1.1.3 mrg \DeclareUnicodeCharacter{016E}{\ringaccent{U}}% 10713 1.1.1.3 mrg \DeclareUnicodeCharacter{016F}{\ringaccent{u}}% 10714 1.1.1.3 mrg % 10715 1.1.1.3 mrg \DeclareUnicodeCharacter{0170}{\H{U}}% 10716 1.1.1.3 mrg \DeclareUnicodeCharacter{0171}{\H{u}}% 10717 1.1.1.3 mrg \DeclareUnicodeCharacter{0172}{\ogonek{U}}% 10718 1.1.1.3 mrg \DeclareUnicodeCharacter{0173}{\ogonek{u}}% 10719 1.1.1.3 mrg \DeclareUnicodeCharacter{0174}{\^W}% 10720 1.1.1.3 mrg \DeclareUnicodeCharacter{0175}{\^w}% 10721 1.1.1.3 mrg \DeclareUnicodeCharacter{0176}{\^Y}% 10722 1.1.1.3 mrg \DeclareUnicodeCharacter{0177}{\^y}% 10723 1.1.1.3 mrg \DeclareUnicodeCharacter{0178}{\"Y}% 10724 1.1.1.3 mrg \DeclareUnicodeCharacter{0179}{\'Z}% 10725 1.1.1.3 mrg \DeclareUnicodeCharacter{017A}{\'z}% 10726 1.1.1.3 mrg \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}% 10727 1.1.1.3 mrg \DeclareUnicodeCharacter{017C}{\dotaccent{z}}% 10728 1.1.1.3 mrg \DeclareUnicodeCharacter{017D}{\v{Z}}% 10729 1.1.1.3 mrg \DeclareUnicodeCharacter{017E}{\v{z}}% 10730 1.1.1.3 mrg \DeclareUnicodeCharacter{017F}{\missingcharmsg{LONG S}}% 10731 1.1.1.3 mrg % 10732 1.1.1.3 mrg \DeclareUnicodeCharacter{01C4}{D\v{Z}}% 10733 1.1.1.3 mrg \DeclareUnicodeCharacter{01C5}{D\v{z}}% 10734 1.1.1.3 mrg \DeclareUnicodeCharacter{01C6}{d\v{z}}% 10735 1.1.1.3 mrg \DeclareUnicodeCharacter{01C7}{LJ}% 10736 1.1.1.3 mrg \DeclareUnicodeCharacter{01C8}{Lj}% 10737 1.1.1.3 mrg \DeclareUnicodeCharacter{01C9}{lj}% 10738 1.1.1.3 mrg \DeclareUnicodeCharacter{01CA}{NJ}% 10739 1.1.1.3 mrg \DeclareUnicodeCharacter{01CB}{Nj}% 10740 1.1.1.3 mrg \DeclareUnicodeCharacter{01CC}{nj}% 10741 1.1.1.3 mrg \DeclareUnicodeCharacter{01CD}{\v{A}}% 10742 1.1.1.3 mrg \DeclareUnicodeCharacter{01CE}{\v{a}}% 10743 1.1.1.3 mrg \DeclareUnicodeCharacter{01CF}{\v{I}}% 10744 1.1.1.3 mrg % 10745 1.1.1.3 mrg \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}% 10746 1.1.1.3 mrg \DeclareUnicodeCharacter{01D1}{\v{O}}% 10747 1.1.1.3 mrg \DeclareUnicodeCharacter{01D2}{\v{o}}% 10748 1.1.1.3 mrg \DeclareUnicodeCharacter{01D3}{\v{U}}% 10749 1.1.1.3 mrg \DeclareUnicodeCharacter{01D4}{\v{u}}% 10750 1.1.1.3 mrg % 10751 1.1.1.3 mrg \DeclareUnicodeCharacter{01E2}{\={\AE}}% 10752 1.1.1.3 mrg \DeclareUnicodeCharacter{01E3}{\={\ae}}% 10753 1.1.1.3 mrg \DeclareUnicodeCharacter{01E6}{\v{G}}% 10754 1.1.1.3 mrg \DeclareUnicodeCharacter{01E7}{\v{g}}% 10755 1.1.1.3 mrg \DeclareUnicodeCharacter{01E8}{\v{K}}% 10756 1.1.1.3 mrg \DeclareUnicodeCharacter{01E9}{\v{k}}% 10757 1.1.1.3 mrg % 10758 1.1.1.3 mrg \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}% 10759 1.1.1.3 mrg \DeclareUnicodeCharacter{01F1}{DZ}% 10760 1.1.1.3 mrg \DeclareUnicodeCharacter{01F2}{Dz}% 10761 1.1.1.3 mrg \DeclareUnicodeCharacter{01F3}{dz}% 10762 1.1.1.3 mrg \DeclareUnicodeCharacter{01F4}{\'G}% 10763 1.1.1.3 mrg \DeclareUnicodeCharacter{01F5}{\'g}% 10764 1.1.1.3 mrg \DeclareUnicodeCharacter{01F8}{\`N}% 10765 1.1.1.3 mrg \DeclareUnicodeCharacter{01F9}{\`n}% 10766 1.1.1.3 mrg \DeclareUnicodeCharacter{01FC}{\'{\AE}}% 10767 1.1.1.3 mrg \DeclareUnicodeCharacter{01FD}{\'{\ae}}% 10768 1.1.1.3 mrg \DeclareUnicodeCharacter{01FE}{\'{\O}}% 10769 1.1.1.3 mrg \DeclareUnicodeCharacter{01FF}{\'{\o}}% 10770 1.1.1.3 mrg % 10771 1.1.1.3 mrg \DeclareUnicodeCharacter{021E}{\v{H}}% 10772 1.1.1.3 mrg \DeclareUnicodeCharacter{021F}{\v{h}}% 10773 1.1.1.3 mrg % 10774 1.1.1.3 mrg \DeclareUnicodeCharacter{0226}{\dotaccent{A}}% 10775 1.1.1.3 mrg \DeclareUnicodeCharacter{0227}{\dotaccent{a}}% 10776 1.1.1.3 mrg \DeclareUnicodeCharacter{0228}{\cedilla{E}}% 10777 1.1.1.3 mrg \DeclareUnicodeCharacter{0229}{\cedilla{e}}% 10778 1.1.1.3 mrg \DeclareUnicodeCharacter{022E}{\dotaccent{O}}% 10779 1.1.1.3 mrg \DeclareUnicodeCharacter{022F}{\dotaccent{o}}% 10780 1.1.1.3 mrg % 10781 1.1.1.5 mrg \DeclareUnicodeCharacter{0232}{\=Y}% 10782 1.1.1.5 mrg \DeclareUnicodeCharacter{0233}{\=y}% 10783 1.1.1.3 mrg \DeclareUnicodeCharacter{0237}{\dotless{j}}% 10784 1.1.1.3 mrg % 10785 1.1.1.3 mrg \DeclareUnicodeCharacter{02BC}{'}% 10786 1.1.1.3 mrg % 10787 1.1.1.3 mrg \DeclareUnicodeCharacter{02DB}{\ogonek{ }}% 10788 1.1.1.3 mrg % 10789 1.1.1.3 mrg % Greek letters upper case 10790 1.1.1.3 mrg \DeclareUnicodeCharacter{0391}{{\it A}}% 10791 1.1.1.3 mrg \DeclareUnicodeCharacter{0392}{{\it B}}% 10792 1.1.1.3 mrg \DeclareUnicodeCharacter{0393}{\ensuremath{\mit\Gamma}}% 10793 1.1.1.3 mrg \DeclareUnicodeCharacter{0394}{\ensuremath{\mit\Delta}}% 10794 1.1.1.3 mrg \DeclareUnicodeCharacter{0395}{{\it E}}% 10795 1.1.1.3 mrg \DeclareUnicodeCharacter{0396}{{\it Z}}% 10796 1.1.1.3 mrg \DeclareUnicodeCharacter{0397}{{\it H}}% 10797 1.1.1.3 mrg \DeclareUnicodeCharacter{0398}{\ensuremath{\mit\Theta}}% 10798 1.1.1.3 mrg \DeclareUnicodeCharacter{0399}{{\it I}}% 10799 1.1.1.3 mrg \DeclareUnicodeCharacter{039A}{{\it K}}% 10800 1.1.1.3 mrg \DeclareUnicodeCharacter{039B}{\ensuremath{\mit\Lambda}}% 10801 1.1.1.3 mrg \DeclareUnicodeCharacter{039C}{{\it M}}% 10802 1.1.1.3 mrg \DeclareUnicodeCharacter{039D}{{\it N}}% 10803 1.1.1.3 mrg \DeclareUnicodeCharacter{039E}{\ensuremath{\mit\Xi}}% 10804 1.1.1.3 mrg \DeclareUnicodeCharacter{039F}{{\it O}}% 10805 1.1.1.3 mrg \DeclareUnicodeCharacter{03A0}{\ensuremath{\mit\Pi}}% 10806 1.1.1.3 mrg \DeclareUnicodeCharacter{03A1}{{\it P}}% 10807 1.1.1.3 mrg %\DeclareUnicodeCharacter{03A2}{} % none - corresponds to final sigma 10808 1.1.1.3 mrg \DeclareUnicodeCharacter{03A3}{\ensuremath{\mit\Sigma}}% 10809 1.1.1.3 mrg \DeclareUnicodeCharacter{03A4}{{\it T}}% 10810 1.1.1.3 mrg \DeclareUnicodeCharacter{03A5}{\ensuremath{\mit\Upsilon}}% 10811 1.1.1.3 mrg \DeclareUnicodeCharacter{03A6}{\ensuremath{\mit\Phi}}% 10812 1.1.1.3 mrg \DeclareUnicodeCharacter{03A7}{{\it X}}% 10813 1.1.1.3 mrg \DeclareUnicodeCharacter{03A8}{\ensuremath{\mit\Psi}}% 10814 1.1.1.3 mrg \DeclareUnicodeCharacter{03A9}{\ensuremath{\mit\Omega}}% 10815 1.1.1.3 mrg % 10816 1.1.1.3 mrg % Vowels with accents 10817 1.1.1.3 mrg \DeclareUnicodeCharacter{0390}{\ensuremath{\ddot{\acute\iota}}}% 10818 1.1.1.3 mrg \DeclareUnicodeCharacter{03AC}{\ensuremath{\acute\alpha}}% 10819 1.1.1.3 mrg \DeclareUnicodeCharacter{03AD}{\ensuremath{\acute\epsilon}}% 10820 1.1.1.3 mrg \DeclareUnicodeCharacter{03AE}{\ensuremath{\acute\eta}}% 10821 1.1.1.3 mrg \DeclareUnicodeCharacter{03AF}{\ensuremath{\acute\iota}}% 10822 1.1.1.3 mrg \DeclareUnicodeCharacter{03B0}{\ensuremath{\acute{\ddot\upsilon}}}% 10823 1.1.1.3 mrg % 10824 1.1.1.3 mrg % Standalone accent 10825 1.1.1.3 mrg \DeclareUnicodeCharacter{0384}{\ensuremath{\acute{\ }}}% 10826 1.1.1.3 mrg % 10827 1.1.1.3 mrg % Greek letters lower case 10828 1.1.1.3 mrg \DeclareUnicodeCharacter{03B1}{\ensuremath\alpha}% 10829 1.1.1.3 mrg \DeclareUnicodeCharacter{03B2}{\ensuremath\beta}% 10830 1.1.1.3 mrg \DeclareUnicodeCharacter{03B3}{\ensuremath\gamma}% 10831 1.1.1.3 mrg \DeclareUnicodeCharacter{03B4}{\ensuremath\delta}% 10832 1.1.1.3 mrg \DeclareUnicodeCharacter{03B5}{\ensuremath\epsilon}% 10833 1.1.1.3 mrg \DeclareUnicodeCharacter{03B6}{\ensuremath\zeta}% 10834 1.1.1.3 mrg \DeclareUnicodeCharacter{03B7}{\ensuremath\eta}% 10835 1.1.1.3 mrg \DeclareUnicodeCharacter{03B8}{\ensuremath\theta}% 10836 1.1.1.3 mrg \DeclareUnicodeCharacter{03B9}{\ensuremath\iota}% 10837 1.1.1.3 mrg \DeclareUnicodeCharacter{03BA}{\ensuremath\kappa}% 10838 1.1.1.3 mrg \DeclareUnicodeCharacter{03BB}{\ensuremath\lambda}% 10839 1.1.1.3 mrg \DeclareUnicodeCharacter{03BC}{\ensuremath\mu}% 10840 1.1.1.3 mrg \DeclareUnicodeCharacter{03BD}{\ensuremath\nu}% 10841 1.1.1.3 mrg \DeclareUnicodeCharacter{03BE}{\ensuremath\xi}% 10842 1.1.1.3 mrg \DeclareUnicodeCharacter{03BF}{{\it o}}% omicron 10843 1.1.1.3 mrg \DeclareUnicodeCharacter{03C0}{\ensuremath\pi}% 10844 1.1.1.3 mrg \DeclareUnicodeCharacter{03C1}{\ensuremath\rho}% 10845 1.1.1.3 mrg \DeclareUnicodeCharacter{03C2}{\ensuremath\varsigma}% 10846 1.1.1.3 mrg \DeclareUnicodeCharacter{03C3}{\ensuremath\sigma}% 10847 1.1.1.3 mrg \DeclareUnicodeCharacter{03C4}{\ensuremath\tau}% 10848 1.1.1.3 mrg \DeclareUnicodeCharacter{03C5}{\ensuremath\upsilon}% 10849 1.1.1.3 mrg \DeclareUnicodeCharacter{03C6}{\ensuremath\phi}% 10850 1.1.1.3 mrg \DeclareUnicodeCharacter{03C7}{\ensuremath\chi}% 10851 1.1.1.3 mrg \DeclareUnicodeCharacter{03C8}{\ensuremath\psi}% 10852 1.1.1.3 mrg \DeclareUnicodeCharacter{03C9}{\ensuremath\omega}% 10853 1.1.1.3 mrg % 10854 1.1.1.3 mrg % More Greek vowels with accents 10855 1.1.1.3 mrg \DeclareUnicodeCharacter{03CA}{\ensuremath{\ddot\iota}}% 10856 1.1.1.3 mrg \DeclareUnicodeCharacter{03CB}{\ensuremath{\ddot\upsilon}}% 10857 1.1.1.3 mrg \DeclareUnicodeCharacter{03CC}{\ensuremath{\acute o}}% 10858 1.1.1.3 mrg \DeclareUnicodeCharacter{03CD}{\ensuremath{\acute\upsilon}}% 10859 1.1.1.3 mrg \DeclareUnicodeCharacter{03CE}{\ensuremath{\acute\omega}}% 10860 1.1.1.3 mrg % 10861 1.1.1.3 mrg % Variant Greek letters 10862 1.1.1.3 mrg \DeclareUnicodeCharacter{03D1}{\ensuremath\vartheta}% 10863 1.1.1.3 mrg \DeclareUnicodeCharacter{03D6}{\ensuremath\varpi}% 10864 1.1.1.3 mrg \DeclareUnicodeCharacter{03F1}{\ensuremath\varrho}% 10865 1.1.1.3 mrg % 10866 1.1.1.3 mrg \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}% 10867 1.1.1.3 mrg \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}% 10868 1.1.1.3 mrg \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}% 10869 1.1.1.3 mrg \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}% 10870 1.1.1.3 mrg \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}% 10871 1.1.1.3 mrg \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}% 10872 1.1.1.3 mrg \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}% 10873 1.1.1.3 mrg \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}% 10874 1.1.1.3 mrg \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}% 10875 1.1.1.3 mrg \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}% 10876 1.1.1.3 mrg \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}% 10877 1.1.1.3 mrg \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}% 10878 1.1.1.3 mrg % 10879 1.1.1.3 mrg \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}% 10880 1.1.1.3 mrg \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}% 10881 1.1.1.3 mrg % 10882 1.1.1.3 mrg \DeclareUnicodeCharacter{1E20}{\=G}% 10883 1.1.1.3 mrg \DeclareUnicodeCharacter{1E21}{\=g}% 10884 1.1.1.3 mrg \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}% 10885 1.1.1.3 mrg \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}% 10886 1.1.1.3 mrg \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}% 10887 1.1.1.3 mrg \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}% 10888 1.1.1.3 mrg \DeclareUnicodeCharacter{1E26}{\"H}% 10889 1.1.1.3 mrg \DeclareUnicodeCharacter{1E27}{\"h}% 10890 1.1.1.3 mrg % 10891 1.1.1.3 mrg \DeclareUnicodeCharacter{1E30}{\'K}% 10892 1.1.1.3 mrg \DeclareUnicodeCharacter{1E31}{\'k}% 10893 1.1.1.3 mrg \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}% 10894 1.1.1.3 mrg \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}% 10895 1.1.1.3 mrg \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}% 10896 1.1.1.3 mrg \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}% 10897 1.1.1.3 mrg \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}% 10898 1.1.1.3 mrg \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}% 10899 1.1.1.3 mrg \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}% 10900 1.1.1.3 mrg \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}% 10901 1.1.1.3 mrg \DeclareUnicodeCharacter{1E3E}{\'M}% 10902 1.1.1.3 mrg \DeclareUnicodeCharacter{1E3F}{\'m}% 10903 1.1.1.3 mrg % 10904 1.1.1.3 mrg \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}% 10905 1.1.1.3 mrg \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}% 10906 1.1.1.3 mrg \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}% 10907 1.1.1.3 mrg \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}% 10908 1.1.1.3 mrg \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}% 10909 1.1.1.3 mrg \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}% 10910 1.1.1.3 mrg \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}% 10911 1.1.1.3 mrg \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}% 10912 1.1.1.3 mrg \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}% 10913 1.1.1.3 mrg \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}% 10914 1.1.1.3 mrg % 10915 1.1.1.3 mrg \DeclareUnicodeCharacter{1E54}{\'P}% 10916 1.1.1.3 mrg \DeclareUnicodeCharacter{1E55}{\'p}% 10917 1.1.1.3 mrg \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}% 10918 1.1.1.3 mrg \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}% 10919 1.1.1.3 mrg \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}% 10920 1.1.1.3 mrg \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}% 10921 1.1.1.3 mrg \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}% 10922 1.1.1.3 mrg \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}% 10923 1.1.1.3 mrg \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}% 10924 1.1.1.3 mrg \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}% 10925 1.1.1.3 mrg % 10926 1.1.1.3 mrg \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}% 10927 1.1.1.3 mrg \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}% 10928 1.1.1.3 mrg \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}% 10929 1.1.1.3 mrg \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}% 10930 1.1.1.3 mrg \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}% 10931 1.1.1.3 mrg \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}% 10932 1.1.1.3 mrg \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}% 10933 1.1.1.3 mrg \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}% 10934 1.1.1.3 mrg \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}% 10935 1.1.1.3 mrg \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}% 10936 1.1.1.3 mrg % 10937 1.1.1.3 mrg \DeclareUnicodeCharacter{1E7C}{\~V}% 10938 1.1.1.3 mrg \DeclareUnicodeCharacter{1E7D}{\~v}% 10939 1.1.1.3 mrg \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}% 10940 1.1.1.3 mrg \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}% 10941 1.1.1.3 mrg % 10942 1.1.1.3 mrg \DeclareUnicodeCharacter{1E80}{\`W}% 10943 1.1.1.3 mrg \DeclareUnicodeCharacter{1E81}{\`w}% 10944 1.1.1.3 mrg \DeclareUnicodeCharacter{1E82}{\'W}% 10945 1.1.1.3 mrg \DeclareUnicodeCharacter{1E83}{\'w}% 10946 1.1.1.3 mrg \DeclareUnicodeCharacter{1E84}{\"W}% 10947 1.1.1.3 mrg \DeclareUnicodeCharacter{1E85}{\"w}% 10948 1.1.1.3 mrg \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}% 10949 1.1.1.3 mrg \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}% 10950 1.1.1.3 mrg \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}% 10951 1.1.1.3 mrg \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}% 10952 1.1.1.3 mrg \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}% 10953 1.1.1.3 mrg \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}% 10954 1.1.1.3 mrg \DeclareUnicodeCharacter{1E8C}{\"X}% 10955 1.1.1.3 mrg \DeclareUnicodeCharacter{1E8D}{\"x}% 10956 1.1.1.3 mrg \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}% 10957 1.1.1.3 mrg \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}% 10958 1.1.1.3 mrg % 10959 1.1.1.3 mrg \DeclareUnicodeCharacter{1E90}{\^Z}% 10960 1.1.1.3 mrg \DeclareUnicodeCharacter{1E91}{\^z}% 10961 1.1.1.3 mrg \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}% 10962 1.1.1.3 mrg \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}% 10963 1.1.1.3 mrg \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}% 10964 1.1.1.3 mrg \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}% 10965 1.1.1.3 mrg \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}% 10966 1.1.1.3 mrg \DeclareUnicodeCharacter{1E97}{\"t}% 10967 1.1.1.3 mrg \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}% 10968 1.1.1.3 mrg \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}% 10969 1.1.1.3 mrg % 10970 1.1.1.3 mrg \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}% 10971 1.1.1.3 mrg \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}% 10972 1.1.1.3 mrg % 10973 1.1.1.3 mrg \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}% 10974 1.1.1.3 mrg \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}% 10975 1.1.1.3 mrg \DeclareUnicodeCharacter{1EBC}{\~E}% 10976 1.1.1.3 mrg \DeclareUnicodeCharacter{1EBD}{\~e}% 10977 1.1.1.3 mrg % 10978 1.1.1.3 mrg \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}% 10979 1.1.1.3 mrg \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}% 10980 1.1.1.3 mrg \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}% 10981 1.1.1.3 mrg \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}% 10982 1.1.1.3 mrg % 10983 1.1.1.3 mrg \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}% 10984 1.1.1.3 mrg \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}% 10985 1.1.1.3 mrg % 10986 1.1.1.3 mrg \DeclareUnicodeCharacter{1EF2}{\`Y}% 10987 1.1.1.3 mrg \DeclareUnicodeCharacter{1EF3}{\`y}% 10988 1.1.1.3 mrg \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}% 10989 1.1.1.5 mrg % 10990 1.1.1.5 mrg \DeclareUnicodeCharacter{1EF8}{\~Y}% 10991 1.1.1.5 mrg \DeclareUnicodeCharacter{1EF9}{\~y}% 10992 1.1.1.3 mrg % 10993 1.1.1.3 mrg % Exotic spaces 10994 1.1.1.3 mrg \DeclareUnicodeCharacter{2007}{\hphantom{0}}% 10995 1.1.1.3 mrg % 10996 1.1.1.3 mrg % Punctuation 10997 1.1.1.3 mrg \DeclareUnicodeCharacter{2013}{--}% 10998 1.1.1.3 mrg \DeclareUnicodeCharacter{2014}{---}% 10999 1.1.1.3 mrg \DeclareUnicodeCharacter{2018}{\quoteleft{}}% 11000 1.1.1.3 mrg \DeclareUnicodeCharacter{2019}{\quoteright{}}% 11001 1.1.1.3 mrg \DeclareUnicodeCharacter{201A}{\quotesinglbase{}}% 11002 1.1.1.3 mrg \DeclareUnicodeCharacter{201C}{\quotedblleft{}}% 11003 1.1.1.3 mrg \DeclareUnicodeCharacter{201D}{\quotedblright{}}% 11004 1.1.1.3 mrg \DeclareUnicodeCharacter{201E}{\quotedblbase{}}% 11005 1.1.1.3 mrg \DeclareUnicodeCharacter{2020}{\ensuremath\dagger}% 11006 1.1.1.3 mrg \DeclareUnicodeCharacter{2021}{\ensuremath\ddagger}% 11007 1.1.1.3 mrg \DeclareUnicodeCharacter{2022}{\bullet{}}% 11008 1.1.1.3 mrg \DeclareUnicodeCharacter{202F}{\thinspace}% 11009 1.1.1.3 mrg \DeclareUnicodeCharacter{2026}{\dots{}}% 11010 1.1.1.3 mrg \DeclareUnicodeCharacter{2039}{\guilsinglleft{}}% 11011 1.1.1.5 mrg \DeclareUnicodeCharacter{203A}{\guilsinglright{}}% 11012 1.1.1.3 mrg % 11013 1.1.1.3 mrg \DeclareUnicodeCharacter{20AC}{\euro{}}% 11014 1.1.1.3 mrg % 11015 1.1.1.3 mrg \DeclareUnicodeCharacter{2192}{\arrow}% 11016 1.1.1.3 mrg \DeclareUnicodeCharacter{21D2}{\result{}}% 11017 1.1.1.3 mrg % 11018 1.1.1.3 mrg % Mathematical symbols 11019 1.1.1.3 mrg \DeclareUnicodeCharacter{2200}{\ensuremath\forall}% 11020 1.1.1.3 mrg \DeclareUnicodeCharacter{2203}{\ensuremath\exists}% 11021 1.1.1.3 mrg \DeclareUnicodeCharacter{2208}{\ensuremath\in}% 11022 1.1.1.3 mrg \DeclareUnicodeCharacter{2212}{\minus{}}% 11023 1.1.1.3 mrg \DeclareUnicodeCharacter{2217}{\ast}% 11024 1.1.1.3 mrg \DeclareUnicodeCharacter{221E}{\ensuremath\infty}% 11025 1.1.1.3 mrg \DeclareUnicodeCharacter{2225}{\ensuremath\parallel}% 11026 1.1.1.3 mrg \DeclareUnicodeCharacter{2227}{\ensuremath\wedge}% 11027 1.1.1.3 mrg \DeclareUnicodeCharacter{2229}{\ensuremath\cap}% 11028 1.1.1.3 mrg \DeclareUnicodeCharacter{2261}{\equiv{}}% 11029 1.1.1.3 mrg \DeclareUnicodeCharacter{2264}{\ensuremath\leq}% 11030 1.1.1.3 mrg \DeclareUnicodeCharacter{2265}{\ensuremath\geq}% 11031 1.1.1.3 mrg \DeclareUnicodeCharacter{2282}{\ensuremath\subset}% 11032 1.1.1.3 mrg \DeclareUnicodeCharacter{2287}{\ensuremath\supseteq}% 11033 1.1.1.3 mrg % 11034 1.1.1.3 mrg \DeclareUnicodeCharacter{2016}{\ensuremath\Vert}% 11035 1.1.1.3 mrg \DeclareUnicodeCharacter{2032}{\ensuremath\prime}% 11036 1.1.1.3 mrg \DeclareUnicodeCharacter{210F}{\ensuremath\hbar}% 11037 1.1.1.3 mrg \DeclareUnicodeCharacter{2111}{\ensuremath\Im}% 11038 1.1.1.3 mrg \DeclareUnicodeCharacter{2113}{\ensuremath\ell}% 11039 1.1.1.3 mrg \DeclareUnicodeCharacter{2118}{\ensuremath\wp}% 11040 1.1.1.3 mrg \DeclareUnicodeCharacter{211C}{\ensuremath\Re}% 11041 1.1.1.3 mrg \DeclareUnicodeCharacter{2135}{\ensuremath\aleph}% 11042 1.1.1.3 mrg \DeclareUnicodeCharacter{2190}{\ensuremath\leftarrow}% 11043 1.1.1.3 mrg \DeclareUnicodeCharacter{2191}{\ensuremath\uparrow}% 11044 1.1.1.3 mrg \DeclareUnicodeCharacter{2193}{\ensuremath\downarrow}% 11045 1.1.1.3 mrg \DeclareUnicodeCharacter{2194}{\ensuremath\leftrightarrow}% 11046 1.1.1.3 mrg \DeclareUnicodeCharacter{2195}{\ensuremath\updownarrow}% 11047 1.1.1.3 mrg \DeclareUnicodeCharacter{2196}{\ensuremath\nwarrow}% 11048 1.1.1.3 mrg \DeclareUnicodeCharacter{2197}{\ensuremath\nearrow}% 11049 1.1.1.3 mrg \DeclareUnicodeCharacter{2198}{\ensuremath\searrow}% 11050 1.1.1.3 mrg \DeclareUnicodeCharacter{2199}{\ensuremath\swarrow}% 11051 1.1.1.3 mrg \DeclareUnicodeCharacter{21A6}{\ensuremath\mapsto}% 11052 1.1.1.3 mrg \DeclareUnicodeCharacter{21A9}{\ensuremath\hookleftarrow}% 11053 1.1.1.3 mrg \DeclareUnicodeCharacter{21AA}{\ensuremath\hookrightarrow}% 11054 1.1.1.3 mrg \DeclareUnicodeCharacter{21BC}{\ensuremath\leftharpoonup}% 11055 1.1.1.3 mrg \DeclareUnicodeCharacter{21BD}{\ensuremath\leftharpoondown}% 11056 1.1.1.3 mrg \DeclareUnicodeCharacter{21C0}{\ensuremath\rightharpoonup}% 11057 1.1.1.3 mrg \DeclareUnicodeCharacter{21C1}{\ensuremath\rightharpoondown}% 11058 1.1.1.3 mrg \DeclareUnicodeCharacter{21CC}{\ensuremath\rightleftharpoons}% 11059 1.1.1.3 mrg \DeclareUnicodeCharacter{21D0}{\ensuremath\Leftarrow}% 11060 1.1.1.3 mrg \DeclareUnicodeCharacter{21D1}{\ensuremath\Uparrow}% 11061 1.1.1.3 mrg \DeclareUnicodeCharacter{21D3}{\ensuremath\Downarrow}% 11062 1.1.1.3 mrg \DeclareUnicodeCharacter{21D4}{\ensuremath\Leftrightarrow}% 11063 1.1.1.3 mrg \DeclareUnicodeCharacter{21D5}{\ensuremath\Updownarrow}% 11064 1.1.1.3 mrg \DeclareUnicodeCharacter{2202}{\ensuremath\partial}% 11065 1.1.1.3 mrg \DeclareUnicodeCharacter{2205}{\ensuremath\emptyset}% 11066 1.1.1.3 mrg \DeclareUnicodeCharacter{2207}{\ensuremath\nabla}% 11067 1.1.1.3 mrg \DeclareUnicodeCharacter{2209}{\ensuremath\notin}% 11068 1.1.1.3 mrg \DeclareUnicodeCharacter{220B}{\ensuremath\owns}% 11069 1.1.1.3 mrg \DeclareUnicodeCharacter{220F}{\ensuremath\prod}% 11070 1.1.1.3 mrg \DeclareUnicodeCharacter{2210}{\ensuremath\coprod}% 11071 1.1.1.3 mrg \DeclareUnicodeCharacter{2211}{\ensuremath\sum}% 11072 1.1.1.3 mrg \DeclareUnicodeCharacter{2213}{\ensuremath\mp}% 11073 1.1.1.3 mrg \DeclareUnicodeCharacter{2218}{\ensuremath\circ}% 11074 1.1.1.3 mrg \DeclareUnicodeCharacter{221A}{\ensuremath\surd}% 11075 1.1.1.3 mrg \DeclareUnicodeCharacter{221D}{\ensuremath\propto}% 11076 1.1.1.3 mrg \DeclareUnicodeCharacter{2220}{\ensuremath\angle}% 11077 1.1.1.3 mrg \DeclareUnicodeCharacter{2223}{\ensuremath\mid}% 11078 1.1.1.3 mrg \DeclareUnicodeCharacter{2228}{\ensuremath\vee}% 11079 1.1.1.3 mrg \DeclareUnicodeCharacter{222A}{\ensuremath\cup}% 11080 1.1.1.3 mrg \DeclareUnicodeCharacter{222B}{\ensuremath\smallint}% 11081 1.1.1.3 mrg \DeclareUnicodeCharacter{222E}{\ensuremath\oint}% 11082 1.1.1.3 mrg \DeclareUnicodeCharacter{223C}{\ensuremath\sim}% 11083 1.1.1.3 mrg \DeclareUnicodeCharacter{2240}{\ensuremath\wr}% 11084 1.1.1.3 mrg \DeclareUnicodeCharacter{2243}{\ensuremath\simeq}% 11085 1.1.1.3 mrg \DeclareUnicodeCharacter{2245}{\ensuremath\cong}% 11086 1.1.1.3 mrg \DeclareUnicodeCharacter{2248}{\ensuremath\approx}% 11087 1.1.1.3 mrg \DeclareUnicodeCharacter{224D}{\ensuremath\asymp}% 11088 1.1.1.3 mrg \DeclareUnicodeCharacter{2250}{\ensuremath\doteq}% 11089 1.1.1.3 mrg \DeclareUnicodeCharacter{2260}{\ensuremath\neq}% 11090 1.1.1.3 mrg \DeclareUnicodeCharacter{226A}{\ensuremath\ll}% 11091 1.1.1.3 mrg \DeclareUnicodeCharacter{226B}{\ensuremath\gg}% 11092 1.1.1.3 mrg \DeclareUnicodeCharacter{227A}{\ensuremath\prec}% 11093 1.1.1.3 mrg \DeclareUnicodeCharacter{227B}{\ensuremath\succ}% 11094 1.1.1.3 mrg \DeclareUnicodeCharacter{2283}{\ensuremath\supset}% 11095 1.1.1.3 mrg \DeclareUnicodeCharacter{2286}{\ensuremath\subseteq}% 11096 1.1.1.3 mrg \DeclareUnicodeCharacter{228E}{\ensuremath\uplus}% 11097 1.1.1.3 mrg \DeclareUnicodeCharacter{2291}{\ensuremath\sqsubseteq}% 11098 1.1.1.3 mrg \DeclareUnicodeCharacter{2292}{\ensuremath\sqsupseteq}% 11099 1.1.1.3 mrg \DeclareUnicodeCharacter{2293}{\ensuremath\sqcap}% 11100 1.1.1.3 mrg \DeclareUnicodeCharacter{2294}{\ensuremath\sqcup}% 11101 1.1.1.3 mrg \DeclareUnicodeCharacter{2295}{\ensuremath\oplus}% 11102 1.1.1.3 mrg \DeclareUnicodeCharacter{2296}{\ensuremath\ominus}% 11103 1.1.1.3 mrg \DeclareUnicodeCharacter{2297}{\ensuremath\otimes}% 11104 1.1.1.3 mrg \DeclareUnicodeCharacter{2298}{\ensuremath\oslash}% 11105 1.1.1.3 mrg \DeclareUnicodeCharacter{2299}{\ensuremath\odot}% 11106 1.1.1.3 mrg \DeclareUnicodeCharacter{22A2}{\ensuremath\vdash}% 11107 1.1.1.3 mrg \DeclareUnicodeCharacter{22A3}{\ensuremath\dashv}% 11108 1.1.1.3 mrg \DeclareUnicodeCharacter{22A4}{\ensuremath\ptextop}% 11109 1.1.1.3 mrg \DeclareUnicodeCharacter{22A5}{\ensuremath\bot}% 11110 1.1.1.3 mrg \DeclareUnicodeCharacter{22A8}{\ensuremath\models}% 11111 1.1.1.3 mrg \DeclareUnicodeCharacter{22C0}{\ensuremath\bigwedge}% 11112 1.1.1.3 mrg \DeclareUnicodeCharacter{22C1}{\ensuremath\bigvee}% 11113 1.1.1.3 mrg \DeclareUnicodeCharacter{22C2}{\ensuremath\bigcap}% 11114 1.1.1.3 mrg \DeclareUnicodeCharacter{22C3}{\ensuremath\bigcup}% 11115 1.1.1.3 mrg \DeclareUnicodeCharacter{22C4}{\ensuremath\diamond}% 11116 1.1.1.3 mrg \DeclareUnicodeCharacter{22C5}{\ensuremath\cdot}% 11117 1.1.1.3 mrg \DeclareUnicodeCharacter{22C6}{\ensuremath\star}% 11118 1.1.1.3 mrg \DeclareUnicodeCharacter{22C8}{\ensuremath\bowtie}% 11119 1.1.1.3 mrg \DeclareUnicodeCharacter{2308}{\ensuremath\lceil}% 11120 1.1.1.3 mrg \DeclareUnicodeCharacter{2309}{\ensuremath\rceil}% 11121 1.1.1.3 mrg \DeclareUnicodeCharacter{230A}{\ensuremath\lfloor}% 11122 1.1.1.3 mrg \DeclareUnicodeCharacter{230B}{\ensuremath\rfloor}% 11123 1.1.1.3 mrg \DeclareUnicodeCharacter{2322}{\ensuremath\frown}% 11124 1.1.1.3 mrg \DeclareUnicodeCharacter{2323}{\ensuremath\smile}% 11125 1.1.1.3 mrg % 11126 1.1.1.3 mrg \DeclareUnicodeCharacter{25B3}{\ensuremath\triangle}% 11127 1.1.1.3 mrg \DeclareUnicodeCharacter{25B7}{\ensuremath\triangleright}% 11128 1.1.1.3 mrg \DeclareUnicodeCharacter{25BD}{\ensuremath\bigtriangledown}% 11129 1.1.1.3 mrg \DeclareUnicodeCharacter{25C1}{\ensuremath\triangleleft}% 11130 1.1.1.3 mrg \DeclareUnicodeCharacter{25C7}{\ensuremath\diamond}% 11131 1.1.1.3 mrg \DeclareUnicodeCharacter{2660}{\ensuremath\spadesuit}% 11132 1.1.1.3 mrg \DeclareUnicodeCharacter{2661}{\ensuremath\heartsuit}% 11133 1.1.1.3 mrg \DeclareUnicodeCharacter{2662}{\ensuremath\diamondsuit}% 11134 1.1.1.3 mrg \DeclareUnicodeCharacter{2663}{\ensuremath\clubsuit}% 11135 1.1.1.3 mrg \DeclareUnicodeCharacter{266D}{\ensuremath\flat}% 11136 1.1.1.3 mrg \DeclareUnicodeCharacter{266E}{\ensuremath\natural}% 11137 1.1.1.3 mrg \DeclareUnicodeCharacter{266F}{\ensuremath\sharp}% 11138 1.1.1.3 mrg \DeclareUnicodeCharacter{26AA}{\ensuremath\bigcirc}% 11139 1.1.1.3 mrg \DeclareUnicodeCharacter{27B9}{\ensuremath\rangle}% 11140 1.1.1.3 mrg \DeclareUnicodeCharacter{27C2}{\ensuremath\perp}% 11141 1.1.1.3 mrg \DeclareUnicodeCharacter{27E8}{\ensuremath\langle}% 11142 1.1.1.3 mrg \DeclareUnicodeCharacter{27F5}{\ensuremath\longleftarrow}% 11143 1.1.1.3 mrg \DeclareUnicodeCharacter{27F6}{\ensuremath\longrightarrow}% 11144 1.1.1.3 mrg \DeclareUnicodeCharacter{27F7}{\ensuremath\longleftrightarrow}% 11145 1.1.1.3 mrg \DeclareUnicodeCharacter{27FC}{\ensuremath\longmapsto}% 11146 1.1.1.3 mrg \DeclareUnicodeCharacter{29F5}{\ensuremath\setminus}% 11147 1.1.1.3 mrg \DeclareUnicodeCharacter{2A00}{\ensuremath\bigodot}% 11148 1.1.1.3 mrg \DeclareUnicodeCharacter{2A01}{\ensuremath\bigoplus}% 11149 1.1.1.3 mrg \DeclareUnicodeCharacter{2A02}{\ensuremath\bigotimes}% 11150 1.1.1.3 mrg \DeclareUnicodeCharacter{2A04}{\ensuremath\biguplus}% 11151 1.1.1.3 mrg \DeclareUnicodeCharacter{2A06}{\ensuremath\bigsqcup}% 11152 1.1.1.3 mrg \DeclareUnicodeCharacter{2A3F}{\ensuremath\amalg}% 11153 1.1.1.3 mrg \DeclareUnicodeCharacter{2AAF}{\ensuremath\preceq}% 11154 1.1.1.3 mrg \DeclareUnicodeCharacter{2AB0}{\ensuremath\succeq}% 11155 1.1.1.3 mrg % 11156 1.1.1.3 mrg \global\mathchardef\checkmark="1370% actually the square root sign 11157 1.1.1.3 mrg \DeclareUnicodeCharacter{2713}{\ensuremath\checkmark}% 11158 1.1 mrg }% end of \unicodechardefs 11159 1.1.1.3 mrg 11160 1.1.1.3 mrg % UTF-8 byte sequence (pdfTeX) definitions (replacing and @U command) 11161 1.1.1.3 mrg % It makes the setting that replace UTF-8 byte sequence. 11162 1.1.1.3 mrg \def\utfeightchardefs{% 11163 1.1.1.3 mrg \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterUTFviii 11164 1.1.1.3 mrg \unicodechardefs 11165 1.1.1.3 mrg } 11166 1.1.1.3 mrg 11167 1.1.1.3 mrg % Whether the active definitions of non-ASCII characters expand to 11168 1.1.1.3 mrg % non-active tokens with the same character code. This is used to 11169 1.1.1.3 mrg % write characters literally, instead of using active definitions for 11170 1.1.1.3 mrg % printing the correct glyphs. 11171 1.1.1.3 mrg \newif\ifpassthroughchars 11172 1.1.1.3 mrg \passthroughcharsfalse 11173 1.1.1.3 mrg 11174 1.1.1.5 mrg % For native Unicode handling (XeTeX and LuaTeX), 11175 1.1.1.5 mrg % provide a definition macro to replace/pass-through a Unicode character 11176 1.1.1.5 mrg % 11177 1.1.1.5 mrg \def\DeclareUnicodeCharacterNative#1#2{% 11178 1.1.1.5 mrg \ifnum"#1>"7F % only make non-ASCII chars active 11179 1.1.1.5 mrg \catcode"#1=\active 11180 1.1.1.5 mrg \def\dodeclareunicodecharacternative##1##2##3{% 11181 1.1.1.5 mrg \begingroup 11182 1.1.1.5 mrg \uccode`\~="##2\relax 11183 1.1.1.5 mrg \uppercase{\gdef~}{% 11184 1.1.1.5 mrg \ifpassthroughchars 11185 1.1.1.5 mrg ##1% 11186 1.1.1.5 mrg \else 11187 1.1.1.5 mrg ##3% 11188 1.1.1.3 mrg \fi 11189 1.1.1.5 mrg } 11190 1.1.1.5 mrg \endgroup 11191 1.1.1.5 mrg } 11192 1.1.1.3 mrg \begingroup 11193 1.1.1.5 mrg \uccode`\.="#1\relax 11194 1.1.1.3 mrg \uppercase{\def\UTFNativeTmp{.}}% 11195 1.1 mrg \expandafter\dodeclareunicodecharacternative\UTFNativeTmp{#1}{#2}% 11196 1.1.1.3 mrg \endgroup 11197 1.1.1.3 mrg \fi 11198 1.1.1.3 mrg } 11199 1.1.1.3 mrg 11200 1.1.1.3 mrg % Native Unicode handling (XeTeX and LuaTeX) character replacing definition. 11201 1.1.1.3 mrg % It activates the setting that replaces Unicode characters. 11202 1.1.1.3 mrg \def\nativeunicodechardefs{% 11203 1.1.1.3 mrg \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNative 11204 1.1.1.3 mrg \unicodechardefs 11205 1.1.1.3 mrg } 11206 1.1.1.3 mrg 11207 1.1.1.3 mrg % For native Unicode handling (XeTeX and LuaTeX), 11208 1.1.1.3 mrg % make the character token expand 11209 1.1.1.3 mrg % to the sequences given in \unicodechardefs for printing. 11210 1.1.1.3 mrg \def\DeclareUnicodeCharacterNativeAtU#1#2{% 11211 1.1.1.3 mrg \def\UTFAtUTmp{#2} 11212 1.1.1.3 mrg \expandafter\globallet\csname uni:#1\endcsname \UTFAtUTmp 11213 1.1.1.3 mrg } 11214 1.1.1.3 mrg 11215 1.1.1.3 mrg % @U command definitions for native Unicode handling (XeTeX and LuaTeX). 11216 1.1 mrg \def\nativeunicodechardefsatu{% 11217 1.1 mrg \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNativeAtU 11218 1.1 mrg \unicodechardefs 11219 1.1 mrg } 11220 1.1 mrg 11221 1.1 mrg % US-ASCII character definitions. 11222 1.1.1.4 mrg \def\asciichardefs{% nothing need be done 11223 1.1.1.4 mrg \relax 11224 1.1.1.3 mrg } 11225 1.1.1.3 mrg 11226 1.1.1.3 mrg % Define all Unicode characters we know about. This makes UTF-8 the default 11227 1.1.1.3 mrg % input encoding and allows @U to work. 11228 1.1.1.3 mrg \iftxinativeunicodecapable 11229 1.1.1.3 mrg \nativeunicodechardefsatu 11230 1.1 mrg \else 11231 1.1 mrg \utfeightchardefs 11232 1.1 mrg \fi 11233 1.1 mrg 11234 1.1 mrg \message{formatting,} 11235 1.1 mrg 11236 1.1 mrg \newdimen\defaultparindent \defaultparindent = 15pt 11237 1.1 mrg 11238 1.1 mrg \chapheadingskip = 15pt plus 4pt minus 2pt 11239 1.1 mrg \secheadingskip = 12pt plus 3pt minus 2pt 11240 1.1 mrg \subsecheadingskip = 9pt plus 2pt minus 2pt 11241 1.1 mrg 11242 1.1 mrg % Prevent underfull vbox error messages. 11243 1.1 mrg \vbadness = 10000 11244 1.1 mrg 11245 1.1 mrg % Don't be very finicky about underfull hboxes, either. 11246 1.1 mrg \hbadness = 6666 11247 1.1 mrg 11248 1.1 mrg % Following George Bush, get rid of widows and orphans. 11249 1.1 mrg \widowpenalty=10000 11250 1.1 mrg \clubpenalty=10000 11251 1.1 mrg 11252 1.1 mrg % Use TeX 3.0's \emergencystretch to help line breaking, but if we're 11253 1.1 mrg % using an old version of TeX, don't do anything. We want the amount of 11254 1.1 mrg % stretch added to depend on the line length, hence the dependence on 11255 1.1 mrg % \hsize. We call this whenever the paper size is set. 11256 1.1 mrg % 11257 1.1 mrg \def\setemergencystretch{% 11258 1.1 mrg \ifx\emergencystretch\thisisundefined 11259 1.1 mrg % Allow us to assign to \emergencystretch anyway. 11260 1.1 mrg \def\emergencystretch{\dimen0}% 11261 1.1 mrg \else 11262 1.1 mrg \emergencystretch = .15\hsize 11263 1.1 mrg \fi 11264 1.1 mrg } 11265 1.1 mrg 11266 1.1 mrg % Parameters in order: 1) textheight; 2) textwidth; 11267 1.1 mrg % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip; 11268 1.1 mrg % 7) physical page height; 8) physical page width. 11269 1.1 mrg % 11270 1.1 mrg % We also call \setleading{\textleading}, so the caller should define 11271 1.1 mrg % \textleading. The caller should also set \parskip. 11272 1.1 mrg % 11273 1.1 mrg \def\internalpagesizes#1#2#3#4#5#6#7#8{% 11274 1.1 mrg \voffset = #3\relax 11275 1.1 mrg \topskip = #6\relax 11276 1.1.1.3 mrg \splittopskip = \topskip 11277 1.1 mrg % 11278 1.1 mrg \vsize = #1\relax 11279 1.1.1.3 mrg \advance\vsize by \topskip 11280 1.1 mrg \txipageheight = \vsize 11281 1.1 mrg % 11282 1.1 mrg \hsize = #2\relax 11283 1.1 mrg \txipagewidth = \hsize 11284 1.1 mrg % 11285 1.1 mrg \normaloffset = #4\relax 11286 1.1 mrg \bindingoffset = #5\relax 11287 1.1 mrg % 11288 1.1 mrg \ifpdf 11289 1.1 mrg \pdfpageheight #7\relax 11290 1.1 mrg \pdfpagewidth #8\relax 11291 1.1.1.3 mrg % if we don't reset these, they will remain at "1 true in" of 11292 1.1.1.3 mrg % whatever layout pdftex was dumped with. 11293 1.1.1.3 mrg \pdfhorigin = 1 true in 11294 1.1.1.3 mrg \pdfvorigin = 1 true in 11295 1.1.1.3 mrg \else 11296 1.1.1.3 mrg \ifx\XeTeXrevision\thisisundefined 11297 1.1.1.3 mrg \special{papersize=#8,#7}% 11298 1.1.1.3 mrg \else 11299 1.1 mrg \pdfpageheight #7\relax 11300 1.1 mrg \pdfpagewidth #8\relax 11301 1.1 mrg % XeTeX does not have \pdfhorigin and \pdfvorigin. 11302 1.1 mrg \fi 11303 1.1 mrg \fi 11304 1.1 mrg % 11305 1.1 mrg \setleading{\textleading} 11306 1.1 mrg % 11307 1.1 mrg \parindent = \defaultparindent 11308 1.1 mrg \setemergencystretch 11309 1.1 mrg } 11310 1.1 mrg 11311 1.1 mrg % @letterpaper (the default). 11312 1.1 mrg \def\letterpaper{{\globaldefs = 1 11313 1.1 mrg \parskip = 3pt plus 2pt minus 1pt 11314 1.1 mrg \textleading = 13.2pt 11315 1.1 mrg % 11316 1.1 mrg % If page is nothing but text, make it come out even. 11317 1.1 mrg \internalpagesizes{607.2pt}{6in}% that's 46 lines 11318 1.1 mrg {\voffset}{.25in}% 11319 1.1 mrg {\bindingoffset}{36pt}% 11320 1.1 mrg {11in}{8.5in}% 11321 1.1 mrg }} 11322 1.1 mrg 11323 1.1 mrg % Use @smallbook to reset parameters for 7x9.25 trim size. 11324 1.1 mrg \def\smallbook{{\globaldefs = 1 11325 1.1 mrg \parskip = 2pt plus 1pt 11326 1.1 mrg \textleading = 12pt 11327 1.1 mrg % 11328 1.1 mrg \internalpagesizes{7.5in}{5in}% 11329 1.1 mrg {-.2in}{0in}% 11330 1.1 mrg {\bindingoffset}{16pt}% 11331 1.1 mrg {9.25in}{7in}% 11332 1.1 mrg % 11333 1.1 mrg \lispnarrowing = 0.3in 11334 1.1 mrg \tolerance = 700 11335 1.1 mrg \contentsrightmargin = 0pt 11336 1.1 mrg \defbodyindent = .5cm 11337 1.1 mrg }} 11338 1.1 mrg 11339 1.1 mrg % Use @afourpaper to print on European A4 paper. 11340 1.1 mrg \def\afourpaper{{\globaldefs = 1 11341 1.1 mrg \parskip = 3pt plus 2pt minus 1pt 11342 1.1 mrg \textleading = 13.2pt 11343 1.1 mrg % 11344 1.1 mrg % Double-side printing via postscript on Laserjet 4050 11345 1.1 mrg % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm. 11346 1.1 mrg % To change the settings for a different printer or situation, adjust 11347 1.1 mrg % \normaloffset until the front-side and back-side texts align. Then 11348 1.1 mrg % do the same for \bindingoffset. You can set these for testing in 11349 1.1 mrg % your texinfo source file like this: 11350 1.1 mrg % @tex 11351 1.1 mrg % \global\normaloffset = -6mm 11352 1.1 mrg % \global\bindingoffset = 10mm 11353 1.1 mrg % @end tex 11354 1.1 mrg \internalpagesizes{673.2pt}{160mm}% that's 51 lines 11355 1.1 mrg {\voffset}{\hoffset}% 11356 1.1 mrg {\bindingoffset}{44pt}% 11357 1.1 mrg {297mm}{210mm}% 11358 1.1 mrg % 11359 1.1 mrg \tolerance = 700 11360 1.1 mrg \contentsrightmargin = 0pt 11361 1.1 mrg \defbodyindent = 5mm 11362 1.1 mrg }} 11363 1.1 mrg 11364 1.1 mrg % Use @afivepaper to print on European A5 paper. 11365 1.1 mrg % From romildo (a] urano.iceb.ufop.br, 2 July 2000. 11366 1.1 mrg % He also recommends making @example and @lisp be small. 11367 1.1 mrg \def\afivepaper{{\globaldefs = 1 11368 1.1.1.5 mrg \parskip = 2pt plus 1pt minus 0.1pt 11369 1.1 mrg \textleading = 12.5pt 11370 1.1 mrg % 11371 1.1 mrg \internalpagesizes{160mm}{120mm}% 11372 1.1 mrg {\voffset}{-11.4mm}% 11373 1.1 mrg {\bindingoffset}{8pt}% 11374 1.1 mrg {210mm}{148mm}% 11375 1.1 mrg % 11376 1.1 mrg \lispnarrowing = 0.2in 11377 1.1 mrg \tolerance = 800 11378 1.1 mrg \contentsrightmargin = 0pt 11379 1.1 mrg \defbodyindent = 2mm 11380 1.1 mrg \tableindent = 12mm 11381 1.1 mrg }} 11382 1.1 mrg 11383 1.1 mrg % A specific text layout, 24x15cm overall, intended for A4 paper. 11384 1.1 mrg \def\afourlatex{{\globaldefs = 1 11385 1.1 mrg \afourpaper 11386 1.1 mrg \internalpagesizes{237mm}{150mm}% 11387 1.1 mrg {\voffset}{4.6mm}% 11388 1.1 mrg {\bindingoffset}{7mm}% 11389 1.1 mrg {297mm}{210mm}% 11390 1.1 mrg % 11391 1.1 mrg % Must explicitly reset to 0 because we call \afourpaper. 11392 1.1 mrg \globaldefs = 0 11393 1.1 mrg }} 11394 1.1 mrg 11395 1.1 mrg % Use @afourwide to print on A4 paper in landscape format. 11396 1.1 mrg \def\afourwide{{\globaldefs = 1 11397 1.1 mrg \afourpaper 11398 1.1 mrg \internalpagesizes{241mm}{165mm}% 11399 1.1 mrg {\voffset}{-2.95mm}% 11400 1.1 mrg {\bindingoffset}{7mm}% 11401 1.1.1.5 mrg {297mm}{210mm}% 11402 1.1.1.5 mrg \globaldefs = 0 11403 1.1.1.5 mrg }} 11404 1.1.1.5 mrg 11405 1.1.1.5 mrg \def\bsixpaper{{\globaldefs = 1 11406 1.1.1.5 mrg \afourpaper 11407 1.1.1.5 mrg \internalpagesizes{140mm}{100mm}% 11408 1.1.1.5 mrg {-6.35mm}{-12.7mm}% 11409 1.1.1.5 mrg {\bindingoffset}{14pt}% 11410 1.1.1.5 mrg {176mm}{125mm}% 11411 1.1.1.5 mrg \let\SETdispenvsize=\smallword 11412 1.1.1.5 mrg \lispnarrowing = 0.2in 11413 1.1 mrg \globaldefs = 0 11414 1.1 mrg }} 11415 1.1 mrg 11416 1.1 mrg 11417 1.1 mrg % @pagesizes TEXTHEIGHT[,TEXTWIDTH] 11418 1.1 mrg % Perhaps we should allow setting the margins, \topskip, \parskip, 11419 1.1 mrg % and/or leading, also. Or perhaps we should compute them somehow. 11420 1.1 mrg % 11421 1.1 mrg \parseargdef\pagesizes{\pagesizesyyy #1,,\finish} 11422 1.1 mrg \def\pagesizesyyy#1,#2,#3\finish{{% 11423 1.1 mrg \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi 11424 1.1 mrg \globaldefs = 1 11425 1.1 mrg % 11426 1.1.1.5 mrg \parskip = 3pt plus 2pt minus 1pt 11427 1.1.1.5 mrg \setleading{\textleading}% 11428 1.1.1.5 mrg % 11429 1.1 mrg \dimen0 = #1\relax 11430 1.1 mrg \advance\dimen0 by 2.5in % default 1in margin above heading line 11431 1.1.1.5 mrg % and 1.5in to include heading, footing and 11432 1.1 mrg % bottom margin 11433 1.1 mrg % 11434 1.1 mrg \dimen2 = \hsize 11435 1.1 mrg \advance\dimen2 by 2in % default to 1 inch margin on each side 11436 1.1 mrg % 11437 1.1 mrg \internalpagesizes{#1}{\hsize}% 11438 1.1 mrg {\voffset}{\normaloffset}% 11439 1.1 mrg {\bindingoffset}{44pt}% 11440 1.1 mrg {\dimen0}{\dimen2}% 11441 1.1 mrg }} 11442 1.1 mrg 11443 1.1.1.3 mrg % Set default to letter. 11444 1.1.1.3 mrg % 11445 1.1.1.3 mrg \letterpaper 11446 1.1 mrg 11447 1.1.1.5 mrg % Default value of \hfuzz, for suppressing warnings about overfull hboxes. 11448 1.1.1.5 mrg \hfuzz = 1pt 11449 1.1.1.5 mrg 11450 1.1.1.5 mrg 11451 1.1.1.5 mrg \message{microtype,} 11452 1.1.1.5 mrg 11453 1.1.1.5 mrg % protrusion, from Thanh's protcode.tex. 11454 1.1.1.5 mrg \def\mtsetprotcode#1{% 11455 1.1.1.5 mrg \rpcode#1`\!=200 \rpcode#1`\,=700 \rpcode#1`\-=700 \rpcode#1`\.=700 11456 1.1.1.5 mrg \rpcode#1`\;=500 \rpcode#1`\:=500 \rpcode#1`\?=200 11457 1.1.1.5 mrg \rpcode#1`\'=700 11458 1.1.1.5 mrg \rpcode#1 34=500 % '' 11459 1.1.1.5 mrg \rpcode#1 123=300 % -- 11460 1.1.1.5 mrg \rpcode#1 124=200 % --- 11461 1.1.1.5 mrg \rpcode#1`\)=50 \rpcode#1`\A=50 \rpcode#1`\F=50 \rpcode#1`\K=50 11462 1.1.1.5 mrg \rpcode#1`\L=50 \rpcode#1`\T=50 \rpcode#1`\V=50 \rpcode#1`\W=50 11463 1.1.1.5 mrg \rpcode#1`\X=50 \rpcode#1`\Y=50 \rpcode#1`\k=50 \rpcode#1`\r=50 11464 1.1.1.5 mrg \rpcode#1`\t=50 \rpcode#1`\v=50 \rpcode#1`\w=50 \rpcode#1`\x=50 11465 1.1.1.5 mrg \rpcode#1`\y=50 11466 1.1.1.5 mrg % 11467 1.1.1.5 mrg \lpcode#1`\`=700 11468 1.1.1.5 mrg \lpcode#1 92=500 % `` 11469 1.1.1.5 mrg \lpcode#1`\(=50 \lpcode#1`\A=50 \lpcode#1`\J=50 \lpcode#1`\T=50 11470 1.1.1.5 mrg \lpcode#1`\V=50 \lpcode#1`\W=50 \lpcode#1`\X=50 \lpcode#1`\Y=50 11471 1.1.1.5 mrg \lpcode#1`\v=50 \lpcode#1`\w=50 \lpcode#1`\x=50 \lpcode#1`\y=0 11472 1.1.1.5 mrg % 11473 1.1.1.5 mrg \mtadjustprotcode#1\relax 11474 1.1.1.5 mrg } 11475 1.1.1.5 mrg 11476 1.1.1.5 mrg \newcount\countC 11477 1.1.1.5 mrg \def\mtadjustprotcode#1{% 11478 1.1.1.5 mrg \countC=0 11479 1.1.1.5 mrg \loop 11480 1.1.1.5 mrg \ifcase\lpcode#1\countC\else 11481 1.1.1.5 mrg \mtadjustcp\lpcode#1\countC 11482 1.1.1.5 mrg \fi 11483 1.1.1.5 mrg \ifcase\rpcode#1\countC\else 11484 1.1.1.5 mrg \mtadjustcp\rpcode#1\countC 11485 1.1.1.5 mrg \fi 11486 1.1.1.5 mrg \advance\countC 1 11487 1.1.1.5 mrg \ifnum\countC < 256 \repeat 11488 1.1.1.5 mrg } 11489 1.1.1.5 mrg 11490 1.1.1.5 mrg \newcount\countB 11491 1.1.1.5 mrg \def\mtadjustcp#1#2#3{% 11492 1.1.1.5 mrg \setbox\boxA=\hbox{% 11493 1.1.1.5 mrg \ifx#2\font\else#2\fi 11494 1.1.1.5 mrg \char#3}% 11495 1.1.1.5 mrg \countB=\wd\boxA 11496 1.1.1.5 mrg \multiply\countB #1#2#3\relax 11497 1.1.1.5 mrg \divide\countB \fontdimen6 #2\relax 11498 1.1.1.5 mrg #1#2#3=\countB\relax 11499 1.1.1.5 mrg } 11500 1.1.1.5 mrg 11501 1.1.1.5 mrg \ifx\XeTeXrevision\thisisundefined 11502 1.1.1.5 mrg \ifx\luatexversion\thisisundefined 11503 1.1.1.5 mrg \ifpdf % pdfTeX 11504 1.1.1.5 mrg \mtsetprotcode\textrm 11505 1.1.1.5 mrg \def\mtfontexpand#1{\pdffontexpand#1 20 20 1 autoexpand\relax} 11506 1.1.1.5 mrg \else % TeX 11507 1.1.1.5 mrg \def\mtfontexpand#1{} 11508 1.1.1.5 mrg \fi 11509 1.1.1.5 mrg \else % LuaTeX 11510 1.1.1.5 mrg \mtsetprotcode\textrm 11511 1.1.1.5 mrg \def\mtfontexpand#1{\expandglyphsinfont#1 20 20 1\relax} 11512 1.1.1.5 mrg \fi 11513 1.1.1.5 mrg \else % XeTeX 11514 1.1.1.5 mrg \mtsetprotcode\textrm 11515 1.1.1.5 mrg \def\mtfontexpand#1{} 11516 1.1.1.5 mrg \fi 11517 1.1.1.5 mrg 11518 1.1.1.5 mrg 11519 1.1.1.5 mrg \newif\ifmicrotype 11520 1.1.1.5 mrg 11521 1.1.1.5 mrg \def\microtypeON{% 11522 1.1.1.5 mrg \microtypetrue 11523 1.1.1.5 mrg % 11524 1.1.1.5 mrg \ifx\XeTeXrevision\thisisundefined 11525 1.1.1.5 mrg \ifx\luatexversion\thisisundefined 11526 1.1.1.5 mrg \ifpdf % pdfTeX 11527 1.1.1.5 mrg \pdfadjustspacing=2 11528 1.1.1.5 mrg \pdfprotrudechars=2 11529 1.1.1.5 mrg \fi 11530 1.1.1.5 mrg \else % LuaTeX 11531 1.1.1.5 mrg \adjustspacing=2 11532 1.1.1.5 mrg \protrudechars=2 11533 1.1.1.5 mrg \fi 11534 1.1.1.5 mrg \else % XeTeX 11535 1.1.1.5 mrg \XeTeXprotrudechars=2 11536 1.1.1.5 mrg \fi 11537 1.1.1.5 mrg % 11538 1.1.1.5 mrg \mtfontexpand\textrm 11539 1.1.1.5 mrg \mtfontexpand\textsl 11540 1.1.1.5 mrg \mtfontexpand\textbf 11541 1.1.1.5 mrg } 11542 1.1.1.5 mrg 11543 1.1.1.5 mrg \def\microtypeOFF{% 11544 1.1.1.5 mrg \microtypefalse 11545 1.1.1.5 mrg % 11546 1.1.1.5 mrg \ifx\XeTeXrevision\thisisundefined 11547 1.1.1.5 mrg \ifx\luatexversion\thisisundefined 11548 1.1.1.5 mrg \ifpdf % pdfTeX 11549 1.1.1.5 mrg \pdfadjustspacing=0 11550 1.1.1.5 mrg \pdfprotrudechars=0 11551 1.1.1.5 mrg \fi 11552 1.1.1.5 mrg \else % LuaTeX 11553 1.1.1.5 mrg \adjustspacing=0 11554 1.1.1.5 mrg \protrudechars=0 11555 1.1.1.5 mrg \fi 11556 1.1.1.5 mrg \else % XeTeX 11557 1.1.1.5 mrg \XeTeXprotrudechars=0 11558 1.1.1.5 mrg \fi 11559 1.1.1.5 mrg } 11560 1.1.1.5 mrg 11561 1.1.1.5 mrg \microtypeON 11562 1.1.1.5 mrg 11563 1.1.1.5 mrg \parseargdef\microtype{% 11564 1.1.1.5 mrg \def\txiarg{#1}% 11565 1.1.1.5 mrg \ifx\txiarg\onword 11566 1.1.1.5 mrg \microtypeON 11567 1.1.1.5 mrg \else\ifx\txiarg\offword 11568 1.1.1.5 mrg \microtypeOFF 11569 1.1.1.5 mrg \else 11570 1.1.1.5 mrg \errhelp = \EMsimple 11571 1.1.1.5 mrg \errmessage{Unknown @microtype option `\txiarg', must be on|off}% 11572 1.1 mrg \fi\fi 11573 1.1 mrg } 11574 1.1 mrg 11575 1.1.1.5 mrg 11576 1.1 mrg \message{and turning on texinfo input format.} 11577 1.1 mrg 11578 1.1 mrg \def^^L{\par} % remove \outer, so ^L can appear in an @comment 11579 1.1 mrg \catcode`\^^K = 10 % treat vertical tab as whitespace 11580 1.1 mrg 11581 1.1 mrg % DEL is a comment character, in case @c does not suffice. 11582 1.1 mrg \catcode`\^^? = 14 11583 1.1 mrg 11584 1.1 mrg % Define macros to output various characters with catcode for normal text. 11585 1.1 mrg \catcode`\"=\other \def\normaldoublequote{"} 11586 1.1 mrg \catcode`\$=\other \def\normaldollar{$}%$ font-lock fix 11587 1.1 mrg \catcode`\+=\other \def\normalplus{+} 11588 1.1 mrg \catcode`\<=\other \def\normalless{<} 11589 1.1 mrg \catcode`\>=\other \def\normalgreater{>} 11590 1.1 mrg \catcode`\^=\other \def\normalcaret{^} 11591 1.1.1.3 mrg \catcode`\_=\other \def\normalunderscore{_} 11592 1.1.1.3 mrg \catcode`\|=\other \def\normalverticalbar{|} 11593 1.1.1.3 mrg \catcode`\~=\other \def\normaltilde{~} 11594 1.1 mrg 11595 1.1 mrg % Set catcodes for Texinfo file 11596 1.1.1.3 mrg 11597 1.1 mrg % Active characters for printing the wanted glyph. 11598 1.1 mrg % Most of these we simply print from the \tt font, but for some, we can 11599 1.1 mrg % use math or other variants that look better in normal text. 11600 1.1.1.3 mrg % 11601 1.1.1.3 mrg \catcode`\"=\active 11602 1.1.1.3 mrg \def\activedoublequote{{\tt\char34}} 11603 1.1 mrg \let"=\activedoublequote 11604 1.1 mrg \catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde 11605 1.1 mrg \chardef\hatchar=`\^ 11606 1.1 mrg \catcode`\^=\active \def\activehat{{\tt \hatchar}} \let^ = \activehat 11607 1.1.1.3 mrg 11608 1.1.1.3 mrg \catcode`\_=\active 11609 1.1.1.3 mrg \def_{\ifusingtt\normalunderscore\_} 11610 1.1 mrg \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } 11611 1.1 mrg \let\realunder=_ 11612 1.1.1.3 mrg 11613 1.1 mrg \catcode`\|=\active \def|{{\tt\char124}} 11614 1.1.1.3 mrg 11615 1.1.1.3 mrg \chardef \less=`\< 11616 1.1.1.3 mrg \catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless 11617 1.1.1.3 mrg \chardef \gtr=`\> 11618 1.1.1.3 mrg \catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr 11619 1.1.1.3 mrg \catcode`\+=\active \def+{{\tt \char 43}} 11620 1.1.1.3 mrg \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix 11621 1.1.1.3 mrg \catcode`\-=\active \let-=\normaldash 11622 1.1.1.3 mrg 11623 1.1.1.3 mrg 11624 1.1.1.3 mrg % used for headline/footline in the output routine, in case the page 11625 1.1.1.5 mrg % breaks in the middle of an @tex block. 11626 1.1.1.3 mrg \def\texinfochars{% 11627 1.1.1.5 mrg \let< = \activeless 11628 1.1.1.3 mrg \let> = \activegtr 11629 1.1.1.3 mrg \let~ = \activetilde 11630 1.1.1.3 mrg \let^ = \activehat 11631 1.1.1.3 mrg \setregularquotes 11632 1.1 mrg \let\b = \strong 11633 1.1 mrg \let\i = \smartitalic 11634 1.1 mrg % in principle, all other definitions in \tex have to be undone too. 11635 1.1 mrg } 11636 1.1 mrg 11637 1.1 mrg % Used sometimes to turn off (effectively) the active characters even after 11638 1.1 mrg % parsing them. 11639 1.1 mrg \def\turnoffactive{% 11640 1.1 mrg \normalturnoffactive 11641 1.1 mrg \otherbackslash 11642 1.1 mrg } 11643 1.1 mrg 11644 1.1 mrg \catcode`\@=0 11645 1.1 mrg 11646 1.1.1.4 mrg % \backslashcurfont outputs one backslash character in current font, 11647 1.1.1.4 mrg % as in \char`\\. 11648 1.1 mrg \global\chardef\backslashcurfont=`\\ 11649 1.1.1.3 mrg 11650 1.1 mrg % \realbackslash is an actual character `\' with catcode other. 11651 1.1 mrg {\catcode`\\=\other @gdef@realbackslash{\}} 11652 1.1 mrg 11653 1.1.1.3 mrg % In Texinfo, backslash is an active character; it prints the backslash 11654 1.1.1.3 mrg % in fixed width font. 11655 1.1.1.3 mrg \catcode`\\=\active % @ for escape char from now on. 11656 1.1.1.3 mrg 11657 1.1.1.3 mrg % Print a typewriter backslash. For math mode, we can't simply use 11658 1.1 mrg % \backslashcurfont: the story here is that in math mode, the \char 11659 1.1 mrg % of \backslashcurfont ends up printing the roman \ from the math symbol 11660 1.1 mrg % font (because \char in math mode uses the \mathcode, and plain.tex 11661 1.1 mrg % sets \mathcode`\\="026E). Hence we use an explicit \mathchar, 11662 1.1.1.3 mrg % which is the decimal equivalent of "715c (class 7, e.g., use \fam; 11663 1.1.1.3 mrg % ignored family value; char position "5C). We can't use " for the 11664 1.1.1.3 mrg % usual hex value because it has already been made active. 11665 1.1 mrg 11666 1.1.1.4 mrg @def@ttbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} 11667 1.1 mrg @let@backslashchar = @ttbackslash % @backslashchar{} is for user documents. 11668 1.1 mrg 11669 1.1 mrg % \otherbackslash defines an active \ to be a literal `\' character with 11670 1.1.1.3 mrg % catcode other. 11671 1.1 mrg @gdef@otherbackslash{@let\=@realbackslash} 11672 1.1.1.2 mrg 11673 1.1.1.2 mrg % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of 11674 1.1.1.3 mrg % the literal character `\'. 11675 1.1.1.2 mrg % 11676 1.1.1.2 mrg {@catcode`- = @active 11677 1.1.1.2 mrg @gdef@normalturnoffactive{% 11678 1.1.1.2 mrg @passthroughcharstrue 11679 1.1.1.2 mrg @let-=@normaldash 11680 1.1.1.2 mrg @let"=@normaldoublequote 11681 1.1.1.2 mrg @let$=@normaldollar %$ font-lock fix 11682 1.1.1.2 mrg @let+=@normalplus 11683 1.1.1.2 mrg @let<=@normalless 11684 1.1.1.2 mrg @let>=@normalgreater 11685 1.1.1.3 mrg @let^=@normalcaret 11686 1.1.1.5 mrg @let_=@normalunderscore 11687 1.1.1.2 mrg @let|=@normalverticalbar 11688 1.1.1.2 mrg @let~=@normaltilde 11689 1.1 mrg @let\=@ttbackslash 11690 1.1 mrg @setregularquotes 11691 1.1.1.3 mrg @unsepspaces 11692 1.1.1.3 mrg } 11693 1.1.1.3 mrg } 11694 1.1.1.3 mrg 11695 1.1 mrg % If a .fmt file is being used, characters that might appear in a file 11696 1.1.1.3 mrg % name cannot be active until we have parsed the command line. 11697 1.1.1.3 mrg % So turn them off again, and have @fixbackslash turn them back on. 11698 1.1 mrg @catcode`+=@other @catcode`@_=@other 11699 1.1 mrg 11700 1.1 mrg % \enablebackslashhack - allow file to begin `\input texinfo' 11701 1.1.1.3 mrg % 11702 1.1.1.3 mrg % If a .fmt file is being used, we don't want the `\input texinfo' to show up. 11703 1.1.1.3 mrg % That is what \eatinput is for; after that, the `\' should revert to printing 11704 1.1.1.3 mrg % a backslash. 11705 1.1.1.3 mrg % If the file did not have a `\input texinfo', then it is turned off after 11706 1.1.1.3 mrg % the first line; otherwise the first `\' in the file would cause an error. 11707 1.1.1.3 mrg % This is used on the very last line of this file, texinfo.tex. 11708 1.1.1.3 mrg % We also use @c to call @fixbackslash, in case ends of lines are hidden. 11709 1.1.1.3 mrg { 11710 1.1.1.3 mrg @catcode`@^=7 11711 1.1.1.3 mrg @catcode`@^^M=13@gdef@enablebackslashhack{% 11712 1.1.1.3 mrg @global@let\ = @eatinput% 11713 1.1.1.3 mrg @catcode`@^^M=13% 11714 1.1.1.3 mrg @def@c{@fixbackslash@c}% 11715 1.1.1.3 mrg % Definition for the newline at the end of this file. 11716 1.1.1.3 mrg @def ^^M{@let^^M@secondlinenl}% 11717 1.1.1.3 mrg % Definition for a newline in the main Texinfo file. 11718 1.1.1.3 mrg @gdef @secondlinenl{@fixbackslash}% 11719 1.1.1.3 mrg % In case the first line has a whole-line command on it 11720 1.1.1.3 mrg @let@originalparsearg@parsearg 11721 1.1.1.3 mrg @def@parsearg{@fixbackslash@originalparsearg} 11722 1.1.1.3 mrg }} 11723 1.1.1.3 mrg 11724 1.1.1.3 mrg {@catcode`@^=7 @catcode`@^^M=13% 11725 1.1.1.3 mrg @gdef@eatinput input texinfo#1^^M{@fixbackslash}} 11726 1.1.1.3 mrg 11727 1.1.1.3 mrg % Emergency active definition of newline, in case an active newline token 11728 1.1.1.3 mrg % appears by mistake. 11729 1.1.1.3 mrg {@catcode`@^=7 @catcode13=13% 11730 1.1.1.3 mrg @gdef@enableemergencynewline{% 11731 1.1.1.3 mrg @gdef^^M{% 11732 1.1 mrg @par% 11733 1.1 mrg %<warning: active newline>@par% 11734 1.1.1.3 mrg }}} 11735 1.1.1.3 mrg 11736 1.1.1.3 mrg 11737 1.1.1.4 mrg @gdef@fixbackslash{% 11738 1.1.1.3 mrg @ifx\@eatinput @let\ = @ttbackslash @fi 11739 1.1.1.3 mrg @catcode13=5 % regular end of line 11740 1.1.1.3 mrg @enableemergencynewline 11741 1.1 mrg @let@c=@comment 11742 1.1 mrg @let@parsearg@originalparsearg 11743 1.1.1.3 mrg % Also turn back on active characters that might appear in the input 11744 1.1.1.3 mrg % file name, in case not using a pre-dumped format. 11745 1.1.1.3 mrg @catcode`+=@active 11746 1.1.1.3 mrg @catcode`@_=@active 11747 1.1.1.3 mrg % 11748 1.1.1.3 mrg % If texinfo.cnf is present on the system, read it. 11749 1.1.1.3 mrg % Useful for site-wide @afourpaper, etc. This macro, @fixbackslash, gets 11750 1.1.1.3 mrg % called at the beginning of every Texinfo file. Not opening texinfo.cnf 11751 1.1.1.3 mrg % directly in this file, texinfo.tex, makes it possible to make a format 11752 1.1.1.3 mrg % file for Texinfo. 11753 1.1 mrg % 11754 1.1 mrg @openin 1 texinfo.cnf 11755 1.1.1.3 mrg @ifeof 1 @else @input texinfo.cnf @fi 11756 1.1 mrg @closein 1 11757 1.1 mrg } 11758 1.1 mrg 11759 1.1 mrg 11760 1.1 mrg % Say @foo, not \foo, in error messages. 11761 1.1 mrg @escapechar = `@@ 11762 1.1 mrg 11763 1.1 mrg % These (along with & and #) are made active for url-breaking, so need 11764 1.1 mrg % active definitions as the normal characters. 11765 1.1 mrg @def@normaldot{.} 11766 1.1 mrg @def@normalquest{?} 11767 1.1 mrg @def@normalslash{/} 11768 1.1 mrg 11769 1.1 mrg % These look ok in all fonts, so just make them not special. 11770 1.1 mrg % @hashchar{} gets its own user-level command, because of #line. 11771 1.1 mrg @catcode`@& = @other @def@normalamp{&} 11772 1.1 mrg @catcode`@# = @other @def@normalhash{#} 11773 1.1 mrg @catcode`@% = @other @def@normalpercent{%} 11774 1.1 mrg 11775 1.1 mrg @let @hashchar = @normalhash 11776 1.1 mrg 11777 1.1 mrg @c Finally, make ` and ' active, so that txicodequoteundirected and 11778 1.1 mrg @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we 11779 1.1.1.5 mrg @c don't make ` and ' active, @code will not get them as active chars. 11780 1.1 mrg @c Do this last of all since we use ` in the previous @catcode assignments. 11781 1.1 mrg @catcode`@'=@active 11782 1.1.1.5 mrg @catcode`@`=@active 11783 1.1.1.5 mrg @setregularquotes 11784 1.1.1.3 mrg 11785 1.1 mrg @c Local variables: 11786 1.1 mrg @c eval: (add-hook 'before-save-hook 'time-stamp nil t) 11787 1.1 mrg @c time-stamp-pattern: "texinfoversion{%Y-%02m-%02d.%02H}" 11788 1.1 mrg @c page-delimiter: "^\\\\message\\|emacs-page" 11789 1.1.1.3 mrg @c End: 11790 1.1.1.5 mrg 11791 @c vim:sw=2: 11792 11793 @enablebackslashhack 11794 11795