1 1.1 mrg % texinfo.tex -- TeX macros to handle Texinfo files. 2 1.1 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.2 mrg \def\texinfoversion{2021-04-25.21} 7 1.1 mrg % 8 1.1.1.2 mrg % Copyright 1985, 1986, 1988, 1990-2021 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 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 mrg % restriction. This Exception is an additional permission under section 7 26 1.1 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 mrg % https://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or 31 1.1 mrg % https://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or 32 1.1 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.2 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 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 mrg % LaTeX's \typeout. This ensures that the messages it is used for 68 1.1 mrg % are identical in format to the corresponding ones from latex/pdflatex. 69 1.1 mrg \def\typeout{\immediate\write17}% 70 1.1 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 mrg \let\ptexsp=\sp 102 1.1 mrg \let\ptexstar=\* 103 1.1 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 mrg % Give the space character the catcode for a space. 163 1.1 mrg \def\spaceisspace{\catcode`\ =10\relax} 164 1.1 mrg 165 1.1 mrg % Likewise for ^^M, the end of line character. 166 1.1 mrg \def\endlineisspace{\catcode13=10\relax} 167 1.1 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 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 mrg % Output routine 237 1.1 mrg % 238 1.1 mrg 239 1.1 mrg % For a final copy, take out the rectangles 240 1.1 mrg % that mark overfull boxes (in case you have decided 241 1.1 mrg % that the text looks ok even though it passes the margin). 242 1.1 mrg % 243 1.1 mrg \def\finalout{\overfullrule=0pt } 244 1.1 mrg 245 1.1 mrg \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines 246 1.1 mrg \newdimen\topandbottommargin \topandbottommargin=.75in 247 1.1 mrg 248 1.1 mrg % Output a mark which sets \thischapter, \thissection and \thiscolor. 249 1.1 mrg % We dump everything together because we only have one kind of mark. 250 1.1 mrg % This works because we only use \botmark / \topmark, not \firstmark. 251 1.1 mrg % 252 1.1 mrg % A mark contains a subexpression of the \ifcase ... \fi construct. 253 1.1 mrg % \get*marks macros below extract the needed part using \ifcase. 254 1.1 mrg % 255 1.1 mrg % Another complication is to let the user choose whether \thischapter 256 1.1 mrg % (\thissection) refers to the chapter (section) in effect at the top 257 1.1 mrg % of a page, or that at the bottom of a page. 258 1.1 mrg 259 1.1 mrg % \domark is called twice inside \chapmacro, to add one 260 1.1 mrg % mark before the section break, and one after. 261 1.1 mrg % In the second call \prevchapterdefs is the same as \currentchapterdefs, 262 1.1 mrg % and \prevsectiondefs is the same as \currentsectiondefs. 263 1.1 mrg % Then if the page is not broken at the mark, some of the previous 264 1.1 mrg % section appears on the page, and we can get the name of this section 265 1.1 mrg % from \firstmark for @everyheadingmarks top. 266 1.1 mrg % @everyheadingmarks bottom uses \botmark. 267 1.1 mrg % 268 1.1 mrg % See page 260 of The TeXbook. 269 1.1 mrg \def\domark{% 270 1.1 mrg \toks0=\expandafter{\currentchapterdefs}% 271 1.1 mrg \toks2=\expandafter{\currentsectiondefs}% 272 1.1 mrg \toks4=\expandafter{\prevchapterdefs}% 273 1.1 mrg \toks6=\expandafter{\prevsectiondefs}% 274 1.1 mrg \toks8=\expandafter{\currentcolordefs}% 275 1.1 mrg \mark{% 276 1.1 mrg \the\toks0 \the\toks2 % 0: marks for @everyheadingmarks top 277 1.1 mrg \noexpand\or \the\toks4 \the\toks6 % 1: for @everyheadingmarks bottom 278 1.1 mrg \noexpand\else \the\toks8 % 2: color marks 279 1.1 mrg }% 280 1.1 mrg } 281 1.1 mrg 282 1.1 mrg % \gettopheadingmarks, \getbottomheadingmarks, 283 1.1 mrg % \getcolormarks - extract needed part of mark. 284 1.1 mrg % 285 1.1 mrg % \topmark doesn't work for the very first chapter (after the title 286 1.1 mrg % page or the contents), so we use \firstmark there -- this gets us 287 1.1 mrg % the mark with the chapter defs, unless the user sneaks in, e.g., 288 1.1 mrg % @setcolor (or @url, or @link, etc.) between @contents and the very 289 1.1 mrg % first @chapter. 290 1.1 mrg \def\gettopheadingmarks{% 291 1.1 mrg \ifcase0\the\savedtopmark\fi 292 1.1 mrg \ifx\thischapter\empty \ifcase0\firstmark\fi \fi 293 1.1 mrg } 294 1.1 mrg \def\getbottomheadingmarks{\ifcase1\botmark\fi} 295 1.1 mrg \def\getcolormarks{\ifcase2\the\savedtopmark\fi} 296 1.1 mrg 297 1.1 mrg % Avoid "undefined control sequence" errors. 298 1.1 mrg \def\currentchapterdefs{} 299 1.1 mrg \def\currentsectiondefs{} 300 1.1 mrg \def\currentsection{} 301 1.1 mrg \def\prevchapterdefs{} 302 1.1 mrg \def\prevsectiondefs{} 303 1.1 mrg \def\currentcolordefs{} 304 1.1 mrg 305 1.1 mrg % Margin to add to right of even pages, to left of odd pages. 306 1.1 mrg \newdimen\bindingoffset 307 1.1 mrg \newdimen\normaloffset 308 1.1 mrg \newdimen\txipagewidth \newdimen\txipageheight 309 1.1 mrg 310 1.1 mrg % Main output routine. 311 1.1 mrg % 312 1.1 mrg \chardef\PAGE = 255 313 1.1 mrg \newtoks\defaultoutput 314 1.1 mrg \defaultoutput = {\savetopmark\onepageout{\pagecontents\PAGE}} 315 1.1 mrg \output=\expandafter{\the\defaultoutput} 316 1.1 mrg 317 1.1 mrg \newbox\headlinebox 318 1.1 mrg \newbox\footlinebox 319 1.1 mrg 320 1.1 mrg % When outputting the double column layout for indices, an output routine 321 1.1 mrg % is run several times, which hides the original value of \topmark. This 322 1.1 mrg % can lead to a page heading being output and duplicating the chapter heading 323 1.1 mrg % of the index. Hence, save the contents of \topmark at the beginning of 324 1.1 mrg % the output routine. The saved contents are valid until we actually 325 1.1 mrg % \shipout a page. 326 1.1 mrg % 327 1.1 mrg % (We used to run a short output routine to actually set \topmark and 328 1.1 mrg % \firstmark to the right values, but if this was called with an empty page 329 1.1 mrg % containing whatsits for writing index entries, the whatsits would be thrown 330 1.1 mrg % away and the index auxiliary file would remain empty.) 331 1.1 mrg % 332 1.1 mrg \newtoks\savedtopmark 333 1.1 mrg \newif\iftopmarksaved 334 1.1 mrg \topmarksavedtrue 335 1.1 mrg \def\savetopmark{% 336 1.1 mrg \iftopmarksaved\else 337 1.1 mrg \global\savedtopmark=\expandafter{\topmark}% 338 1.1 mrg \global\topmarksavedtrue 339 1.1 mrg \fi 340 1.1 mrg } 341 1.1 mrg 342 1.1 mrg % \onepageout takes a vbox as an argument. 343 1.1 mrg % \shipout a vbox for a single page, adding an optional header, footer 344 1.1 mrg % and footnote. This also causes index entries for this page to be written 345 1.1 mrg % to the auxiliary files. 346 1.1 mrg % 347 1.1 mrg \def\onepageout#1{% 348 1.1 mrg \hoffset=\normaloffset 349 1.1 mrg % 350 1.1 mrg \ifodd\pageno \advance\hoffset by \bindingoffset 351 1.1 mrg \else \advance\hoffset by -\bindingoffset\fi 352 1.1.1.2 mrg % 353 1.1.1.2 mrg \checkchapterpage 354 1.1 mrg % 355 1.1 mrg % Retrieve the information for the headings from the marks in the page, 356 1.1 mrg % and call Plain TeX's \makeheadline and \makefootline, which use the 357 1.1 mrg % values in \headline and \footline. 358 1.1 mrg % 359 1.1 mrg % Common context changes for both heading and footing. 360 1.1 mrg % Do this outside of the \shipout so @code etc. will be expanded in 361 1.1 mrg % the headline as they should be, not taken literally (outputting ''code). 362 1.1 mrg \def\commonheadfootline{\let\hsize=\txipagewidth \texinfochars} 363 1.1.1.2 mrg % 364 1.1 mrg \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi 365 1.1 mrg \global\setbox\headlinebox = \vbox{\commonheadfootline \makeheadline}% 366 1.1 mrg \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi 367 1.1 mrg \global\setbox\footlinebox = \vbox{\commonheadfootline \makefootline}% 368 1.1 mrg % 369 1.1 mrg {% 370 1.1 mrg % Set context for writing to auxiliary files like index files. 371 1.1 mrg % Have to do this stuff outside the \shipout because we want it to 372 1.1 mrg % take effect in \write's, yet the group defined by the \vbox ends 373 1.1 mrg % before the \shipout runs. 374 1.1 mrg % 375 1.1 mrg \atdummies % don't expand commands in the output. 376 1.1 mrg \turnoffactive 377 1.1 mrg \shipout\vbox{% 378 1.1 mrg % Do this early so pdf references go to the beginning of the page. 379 1.1 mrg \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi 380 1.1 mrg % 381 1.1 mrg \unvbox\headlinebox 382 1.1 mrg \pagebody{#1}% 383 1.1 mrg \ifdim\ht\footlinebox > 0pt 384 1.1 mrg % Only leave this space if the footline is nonempty. 385 1.1 mrg % (We lessened \vsize for it in \oddfootingyyy.) 386 1.1 mrg % The \baselineskip=24pt in plain's \makefootline has no effect. 387 1.1 mrg \vskip 24pt 388 1.1 mrg \unvbox\footlinebox 389 1.1 mrg \fi 390 1.1 mrg % 391 1.1 mrg }% 392 1.1 mrg }% 393 1.1 mrg \global\topmarksavedfalse 394 1.1 mrg \advancepageno 395 1.1 mrg \ifnum\outputpenalty>-20000 \else\dosupereject\fi 396 1.1 mrg } 397 1.1 mrg 398 1.1 mrg \newinsert\margin \dimen\margin=\maxdimen 399 1.1 mrg 400 1.1 mrg % Main part of page, including any footnotes 401 1.1 mrg \def\pagebody#1{\vbox to\txipageheight{\boxmaxdepth=\maxdepth #1}} 402 1.1 mrg {\catcode`\@ =11 403 1.1 mrg \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi 404 1.1 mrg % marginal hacks, juha (a] viisa.uucp (Juha Takala) 405 1.1 mrg \ifvoid\margin\else % marginal info is present 406 1.1 mrg \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi 407 1.1 mrg \dimen@=\dp#1\relax \unvbox#1\relax 408 1.1 mrg \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi 409 1.1 mrg \ifr@ggedbottom \kern-\dimen@ \vfil \fi} 410 1.1 mrg } 411 1.1.1.2 mrg 412 1.1.1.2 mrg % Check if we are on the first page of a chapter. Used for printing headings. 413 1.1.1.2 mrg \newif\ifchapterpage 414 1.1.1.2 mrg \def\checkchapterpage{% 415 1.1.1.2 mrg % Get the chapter that was current at the end of the last page 416 1.1.1.2 mrg \ifcase1\the\savedtopmark\fi 417 1.1.1.2 mrg \let\prevchaptername\thischaptername 418 1.1.1.2 mrg % 419 1.1.1.2 mrg \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi 420 1.1.1.2 mrg \let\curchaptername\thischaptername 421 1.1.1.2 mrg % 422 1.1.1.2 mrg \ifx\curchaptername\prevchaptername 423 1.1.1.2 mrg \chapterpagefalse 424 1.1.1.2 mrg \else 425 1.1.1.2 mrg \chapterpagetrue 426 1.1.1.2 mrg \fi 427 1.1 mrg } 428 1.1 mrg 429 1.1 mrg % Argument parsing 430 1.1 mrg 431 1.1 mrg % Parse an argument, then pass it to #1. The argument is the rest of 432 1.1 mrg % the input line (except we remove a trailing comment). #1 should be a 433 1.1 mrg % macro which expects an ordinary undelimited TeX argument. 434 1.1 mrg % For example, \def\foo{\parsearg\fooxxx}. 435 1.1 mrg % 436 1.1 mrg \def\parsearg{\parseargusing{}} 437 1.1 mrg \def\parseargusing#1#2{% 438 1.1 mrg \def\argtorun{#2}% 439 1.1 mrg \begingroup 440 1.1 mrg \obeylines 441 1.1 mrg \spaceisspace 442 1.1 mrg #1% 443 1.1 mrg \parseargline\empty% Insert the \empty token, see \finishparsearg below. 444 1.1 mrg } 445 1.1 mrg 446 1.1 mrg {\obeylines % 447 1.1 mrg \gdef\parseargline#1^^M{% 448 1.1 mrg \endgroup % End of the group started in \parsearg. 449 1.1 mrg \argremovecomment #1\comment\ArgTerm% 450 1.1 mrg }% 451 1.1 mrg } 452 1.1 mrg 453 1.1 mrg % First remove any @comment, then any @c comment. Pass the result on to 454 1.1 mrg % \argcheckspaces. 455 1.1 mrg \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} 456 1.1 mrg \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} 457 1.1 mrg 458 1.1 mrg % Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space. 459 1.1 mrg % 460 1.1 mrg % \argremovec might leave us with trailing space, e.g., 461 1.1 mrg % @end itemize @c foo 462 1.1 mrg % This space token undergoes the same procedure and is eventually removed 463 1.1 mrg % by \finishparsearg. 464 1.1 mrg % 465 1.1 mrg \def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M} 466 1.1 mrg \def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M} 467 1.1 mrg \def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% 468 1.1 mrg \def\temp{#3}% 469 1.1 mrg \ifx\temp\empty 470 1.1 mrg % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp: 471 1.1 mrg \let\temp\finishparsearg 472 1.1 mrg \else 473 1.1 mrg \let\temp\argcheckspaces 474 1.1 mrg \fi 475 1.1 mrg % Put the space token in: 476 1.1 mrg \temp#1 #3\ArgTerm 477 1.1 mrg } 478 1.1 mrg 479 1.1 mrg % If a _delimited_ argument is enclosed in braces, they get stripped; so 480 1.1 mrg % to get _exactly_ the rest of the line, we had to prevent such situation. 481 1.1 mrg % We prepended an \empty token at the very beginning and we expand it now, 482 1.1 mrg % just before passing the control to \argtorun. 483 1.1 mrg % (Similarly, we have to think about #3 of \argcheckspacesY above: it is 484 1.1 mrg % either the null string, or it ends with \^^M---thus there is no danger 485 1.1 mrg % that a pair of braces would be stripped. 486 1.1 mrg % 487 1.1 mrg % But first, we have to remove the trailing space token. 488 1.1 mrg % 489 1.1 mrg \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}} 490 1.1 mrg 491 1.1 mrg 492 1.1 mrg % \parseargdef - define a command taking an argument on the line 493 1.1 mrg % 494 1.1 mrg % \parseargdef\foo{...} 495 1.1 mrg % is roughly equivalent to 496 1.1 mrg % \def\foo{\parsearg\Xfoo} 497 1.1 mrg % \def\Xfoo#1{...} 498 1.1 mrg \def\parseargdef#1{% 499 1.1 mrg \expandafter \doparseargdef \csname\string#1\endcsname #1% 500 1.1 mrg } 501 1.1 mrg \def\doparseargdef#1#2{% 502 1.1 mrg \def#2{\parsearg#1}% 503 1.1 mrg \def#1##1% 504 1.1 mrg } 505 1.1 mrg 506 1.1 mrg % Several utility definitions with active space: 507 1.1 mrg { 508 1.1 mrg \obeyspaces 509 1.1 mrg \gdef\obeyedspace{ } 510 1.1 mrg 511 1.1 mrg % Make each space character in the input produce a normal interword 512 1.1 mrg % space in the output. Don't allow a line break at this space, as this 513 1.1 mrg % is used only in environments like @example, where each line of input 514 1.1 mrg % should produce a line of output anyway. 515 1.1 mrg % 516 1.1 mrg \gdef\sepspaces{\obeyspaces\let =\tie} 517 1.1 mrg 518 1.1 mrg % If an index command is used in an @example environment, any spaces 519 1.1 mrg % therein should become regular spaces in the raw index file, not the 520 1.1 mrg % expansion of \tie (\leavevmode \penalty \@M \ ). 521 1.1 mrg \gdef\unsepspaces{\let =\space} 522 1.1 mrg } 523 1.1 mrg 524 1.1 mrg 525 1.1 mrg \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} 526 1.1 mrg 527 1.1 mrg % Define the framework for environments in texinfo.tex. It's used like this: 528 1.1 mrg % 529 1.1 mrg % \envdef\foo{...} 530 1.1 mrg % \def\Efoo{...} 531 1.1 mrg % 532 1.1 mrg % It's the responsibility of \envdef to insert \begingroup before the 533 1.1 mrg % actual body; @end closes the group after calling \Efoo. \envdef also 534 1.1 mrg % defines \thisenv, so the current environment is known; @end checks 535 1.1 mrg % whether the environment name matches. The \checkenv macro can also be 536 1.1 mrg % used to check whether the current environment is the one expected. 537 1.1 mrg % 538 1.1 mrg % Non-false conditionals (@iftex, @ifset) don't fit into this, so they 539 1.1 mrg % are not treated as environments; they don't open a group. (The 540 1.1 mrg % implementation of @end takes care not to call \endgroup in this 541 1.1 mrg % special case.) 542 1.1 mrg 543 1.1 mrg 544 1.1 mrg % At run-time, environments start with this: 545 1.1 mrg \def\startenvironment#1{\begingroup\def\thisenv{#1}} 546 1.1 mrg % initialize 547 1.1 mrg \let\thisenv\empty 548 1.1 mrg 549 1.1 mrg % ... but they get defined via ``\envdef\foo{...}'': 550 1.1 mrg \long\def\envdef#1#2{\def#1{\startenvironment#1#2}} 551 1.1 mrg \def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}} 552 1.1 mrg 553 1.1 mrg % Check whether we're in the right environment: 554 1.1 mrg \def\checkenv#1{% 555 1.1 mrg \def\temp{#1}% 556 1.1 mrg \ifx\thisenv\temp 557 1.1 mrg \else 558 1.1 mrg \badenverr 559 1.1 mrg \fi 560 1.1 mrg } 561 1.1 mrg 562 1.1 mrg % Environment mismatch, #1 expected: 563 1.1 mrg \def\badenverr{% 564 1.1 mrg \errhelp = \EMsimple 565 1.1 mrg \errmessage{This command can appear only \inenvironment\temp, 566 1.1 mrg not \inenvironment\thisenv}% 567 1.1 mrg } 568 1.1 mrg \def\inenvironment#1{% 569 1.1 mrg \ifx#1\empty 570 1.1 mrg outside of any environment% 571 1.1 mrg \else 572 1.1 mrg in environment \expandafter\string#1% 573 1.1 mrg \fi 574 1.1 mrg } 575 1.1.1.2 mrg 576 1.1.1.2 mrg 577 1.1 mrg % @end foo calls \checkenv and executes the definition of \Efoo. 578 1.1 mrg \parseargdef\end{% 579 1.1 mrg \if 1\csname iscond.#1\endcsname 580 1.1 mrg \else 581 1.1 mrg % The general wording of \badenverr may not be ideal. 582 1.1 mrg \expandafter\checkenv\csname#1\endcsname 583 1.1 mrg \csname E#1\endcsname 584 1.1 mrg \endgroup 585 1.1 mrg \fi 586 1.1 mrg } 587 1.1 mrg 588 1.1 mrg \newhelp\EMsimple{Press RETURN to continue.} 589 1.1 mrg 590 1.1 mrg 591 1.1 mrg % Be sure we're in horizontal mode when doing a tie, since we make space 592 1.1 mrg % equivalent to this in @example-like environments. Otherwise, a space 593 1.1 mrg % at the beginning of a line will start with \penalty -- and 594 1.1 mrg % since \penalty is valid in vertical mode, we'd end up putting the 595 1.1 mrg % penalty on the vertical list instead of in the new paragraph. 596 1.1 mrg {\catcode`@ = 11 597 1.1 mrg % Avoid using \@M directly, because that causes trouble 598 1.1 mrg % if the definition is written into an index file. 599 1.1 mrg \global\let\tiepenalty = \@M 600 1.1 mrg \gdef\tie{\leavevmode\penalty\tiepenalty\ } 601 1.1 mrg } 602 1.1 mrg 603 1.1 mrg % @: forces normal size whitespace following. 604 1.1 mrg \def\:{\spacefactor=1000 } 605 1.1 mrg 606 1.1 mrg % @* forces a line break. 607 1.1 mrg \def\*{\unskip\hfil\break\hbox{}\ignorespaces} 608 1.1 mrg 609 1.1 mrg % @/ allows a line break. 610 1.1 mrg \let\/=\allowbreak 611 1.1 mrg 612 1.1 mrg % @. is an end-of-sentence period. 613 1.1 mrg \def\.{.\spacefactor=\endofsentencespacefactor\space} 614 1.1 mrg 615 1.1 mrg % @! is an end-of-sentence bang. 616 1.1 mrg \def\!{!\spacefactor=\endofsentencespacefactor\space} 617 1.1 mrg 618 1.1 mrg % @? is an end-of-sentence query. 619 1.1 mrg \def\?{?\spacefactor=\endofsentencespacefactor\space} 620 1.1 mrg 621 1.1 mrg % @frenchspacing on|off says whether to put extra space after punctuation. 622 1.1 mrg % 623 1.1 mrg \def\onword{on} 624 1.1 mrg \def\offword{off} 625 1.1 mrg % 626 1.1 mrg \parseargdef\frenchspacing{% 627 1.1 mrg \def\temp{#1}% 628 1.1 mrg \ifx\temp\onword \plainfrenchspacing 629 1.1 mrg \else\ifx\temp\offword \plainnonfrenchspacing 630 1.1 mrg \else 631 1.1 mrg \errhelp = \EMsimple 632 1.1 mrg \errmessage{Unknown @frenchspacing option `\temp', must be on|off}% 633 1.1 mrg \fi\fi 634 1.1 mrg } 635 1.1 mrg 636 1.1 mrg % @w prevents a word break. Without the \leavevmode, @w at the 637 1.1 mrg % beginning of a paragraph, when TeX is still in vertical mode, would 638 1.1 mrg % produce a whole line of output instead of starting the paragraph. 639 1.1 mrg \def\w#1{\leavevmode\hbox{#1}} 640 1.1 mrg 641 1.1 mrg % @group ... @end group forces ... to be all on one page, by enclosing 642 1.1 mrg % it in a TeX vbox. We use \vtop instead of \vbox to construct the box 643 1.1 mrg % to keep its height that of a normal line. According to the rules for 644 1.1 mrg % \topskip (p.114 of the TeXbook), the glue inserted is 645 1.1 mrg % max (\topskip - \ht (first item), 0). If that height is large, 646 1.1 mrg % therefore, no glue is inserted, and the space between the headline and 647 1.1 mrg % the text is small, which looks bad. 648 1.1 mrg % 649 1.1 mrg % Another complication is that the group might be very large. This can 650 1.1 mrg % cause the glue on the previous page to be unduly stretched, because it 651 1.1 mrg % does not have much material. In this case, it's better to add an 652 1.1 mrg % explicit \vfill so that the extra space is at the bottom. The 653 1.1 mrg % threshold for doing this is if the group is more than \vfilllimit 654 1.1 mrg % percent of a page (\vfilllimit can be changed inside of @tex). 655 1.1 mrg % 656 1.1 mrg \newbox\groupbox 657 1.1 mrg \def\vfilllimit{0.7} 658 1.1 mrg % 659 1.1 mrg \envdef\group{% 660 1.1 mrg \ifnum\catcode`\^^M=\active \else 661 1.1 mrg \errhelp = \groupinvalidhelp 662 1.1 mrg \errmessage{@group invalid in context where filling is enabled}% 663 1.1 mrg \fi 664 1.1 mrg \startsavinginserts 665 1.1 mrg % 666 1.1 mrg \setbox\groupbox = \vtop\bgroup 667 1.1 mrg % Do @comment since we are called inside an environment such as 668 1.1 mrg % @example, where each end-of-line in the input causes an 669 1.1 mrg % end-of-line in the output. We don't want the end-of-line after 670 1.1 mrg % the `@group' to put extra space in the output. Since @group 671 1.1 mrg % should appear on a line by itself (according to the Texinfo 672 1.1 mrg % manual), we don't worry about eating any user text. 673 1.1 mrg \comment 674 1.1 mrg } 675 1.1 mrg % 676 1.1 mrg % The \vtop produces a box with normal height and large depth; thus, TeX puts 677 1.1 mrg % \baselineskip glue before it, and (when the next line of text is done) 678 1.1 mrg % \lineskip glue after it. Thus, space below is not quite equal to space 679 1.1 mrg % above. But it's pretty close. 680 1.1 mrg \def\Egroup{% 681 1.1 mrg % To get correct interline space between the last line of the group 682 1.1 mrg % and the first line afterwards, we have to propagate \prevdepth. 683 1.1 mrg \endgraf % Not \par, as it may have been set to \lisppar. 684 1.1 mrg \global\dimen1 = \prevdepth 685 1.1 mrg \egroup % End the \vtop. 686 1.1 mrg \addgroupbox 687 1.1 mrg \prevdepth = \dimen1 688 1.1 mrg \checkinserts 689 1.1 mrg } 690 1.1 mrg 691 1.1 mrg \def\addgroupbox{ 692 1.1 mrg % \dimen0 is the vertical size of the group's box. 693 1.1 mrg \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox 694 1.1 mrg % \dimen2 is how much space is left on the page (more or less). 695 1.1 mrg \dimen2 = \txipageheight \advance\dimen2 by -\pagetotal 696 1.1 mrg % if the group doesn't fit on the current page, and it's a big big 697 1.1 mrg % group, force a page break. 698 1.1 mrg \ifdim \dimen0 > \dimen2 699 1.1 mrg \ifdim \pagetotal < \vfilllimit\txipageheight 700 1.1 mrg \page 701 1.1 mrg \fi 702 1.1 mrg \fi 703 1.1 mrg \box\groupbox 704 1.1 mrg } 705 1.1 mrg 706 1.1 mrg % 707 1.1 mrg % TeX puts in an \escapechar (i.e., `@') at the beginning of the help 708 1.1 mrg % message, so this ends up printing `@group can only ...'. 709 1.1 mrg % 710 1.1 mrg \newhelp\groupinvalidhelp{% 711 1.1 mrg group can only be used in environments such as @example,^^J% 712 1.1 mrg where each line of input produces a line of output.} 713 1.1 mrg 714 1.1 mrg % @need space-in-mils 715 1.1 mrg % forces a page break if there is not space-in-mils remaining. 716 1.1 mrg 717 1.1 mrg \newdimen\mil \mil=0.001in 718 1.1 mrg 719 1.1 mrg \parseargdef\need{% 720 1.1 mrg % Ensure vertical mode, so we don't make a big box in the middle of a 721 1.1 mrg % paragraph. 722 1.1 mrg \par 723 1.1 mrg % 724 1.1 mrg % If the @need value is less than one line space, it's useless. 725 1.1 mrg \dimen0 = #1\mil 726 1.1 mrg \dimen2 = \ht\strutbox 727 1.1 mrg \advance\dimen2 by \dp\strutbox 728 1.1 mrg \ifdim\dimen0 > \dimen2 729 1.1 mrg % 730 1.1 mrg % Do a \strut just to make the height of this box be normal, so the 731 1.1 mrg % normal leading is inserted relative to the preceding line. 732 1.1 mrg % And a page break here is fine. 733 1.1 mrg \vtop to #1\mil{\strut\vfil}% 734 1.1 mrg % 735 1.1 mrg % TeX does not even consider page breaks if a penalty added to the 736 1.1 mrg % main vertical list is 10000 or more. But in order to see if the 737 1.1 mrg % empty box we just added fits on the page, we must make it consider 738 1.1 mrg % page breaks. On the other hand, we don't want to actually break the 739 1.1 mrg % page after the empty box. So we use a penalty of 9999. 740 1.1 mrg % 741 1.1 mrg % There is an extremely small chance that TeX will actually break the 742 1.1 mrg % page at this \penalty, if there are no other feasible breakpoints in 743 1.1 mrg % sight. (If the user is using lots of big @group commands, which 744 1.1 mrg % almost-but-not-quite fill up a page, TeX will have a hard time doing 745 1.1 mrg % good page breaking, for example.) However, I could not construct an 746 1.1 mrg % example where a page broke at this \penalty; if it happens in a real 747 1.1 mrg % document, then we can reconsider our strategy. 748 1.1 mrg \penalty9999 749 1.1 mrg % 750 1.1 mrg % Back up by the size of the box, whether we did a page break or not. 751 1.1 mrg \kern -#1\mil 752 1.1 mrg % 753 1.1 mrg % Do not allow a page break right after this kern. 754 1.1 mrg \nobreak 755 1.1 mrg \fi 756 1.1 mrg } 757 1.1 mrg 758 1.1 mrg % @br forces paragraph break (and is undocumented). 759 1.1 mrg 760 1.1 mrg \let\br = \par 761 1.1 mrg 762 1.1 mrg % @page forces the start of a new page. 763 1.1 mrg % 764 1.1 mrg \def\page{\par\vfill\supereject} 765 1.1 mrg 766 1.1 mrg % @exdent text.... 767 1.1 mrg % outputs text on separate line in roman font, starting at standard page margin 768 1.1 mrg 769 1.1 mrg % This records the amount of indent in the innermost environment. 770 1.1 mrg % That's how much \exdent should take out. 771 1.1 mrg \newskip\exdentamount 772 1.1 mrg 773 1.1 mrg % This defn is used inside fill environments such as @defun. 774 1.1 mrg \parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break} 775 1.1 mrg 776 1.1 mrg % This defn is used inside nofill environments such as @example. 777 1.1 mrg \parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount 778 1.1 mrg \leftline{\hskip\leftskip{\rm#1}}}} 779 1.1 mrg 780 1.1 mrg % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current 781 1.1 mrg % paragraph. For more general purposes, use the \margin insertion 782 1.1 mrg % class. WHICH is `l' or `r'. Not documented, written for gawk manual. 783 1.1 mrg % 784 1.1 mrg \newskip\inmarginspacing \inmarginspacing=1cm 785 1.1 mrg \def\strutdepth{\dp\strutbox} 786 1.1 mrg % 787 1.1 mrg \def\doinmargin#1#2{\strut\vadjust{% 788 1.1 mrg \nobreak 789 1.1 mrg \kern-\strutdepth 790 1.1 mrg \vtop to \strutdepth{% 791 1.1 mrg \baselineskip=\strutdepth 792 1.1 mrg \vss 793 1.1 mrg % if you have multiple lines of stuff to put here, you'll need to 794 1.1 mrg % make the vbox yourself of the appropriate size. 795 1.1 mrg \ifx#1l% 796 1.1 mrg \llap{\ignorespaces #2\hskip\inmarginspacing}% 797 1.1 mrg \else 798 1.1 mrg \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}% 799 1.1 mrg \fi 800 1.1 mrg \null 801 1.1 mrg }% 802 1.1 mrg }} 803 1.1 mrg \def\inleftmargin{\doinmargin l} 804 1.1 mrg \def\inrightmargin{\doinmargin r} 805 1.1 mrg % 806 1.1 mrg % @inmargin{TEXT [, RIGHT-TEXT]} 807 1.1 mrg % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; 808 1.1 mrg % else use TEXT for both). 809 1.1 mrg % 810 1.1 mrg \def\inmargin#1{\parseinmargin #1,,\finish} 811 1.1 mrg \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. 812 1.1 mrg \setbox0 = \hbox{\ignorespaces #2}% 813 1.1 mrg \ifdim\wd0 > 0pt 814 1.1 mrg \def\lefttext{#1}% have both texts 815 1.1 mrg \def\righttext{#2}% 816 1.1 mrg \else 817 1.1 mrg \def\lefttext{#1}% have only one text 818 1.1 mrg \def\righttext{#1}% 819 1.1 mrg \fi 820 1.1 mrg % 821 1.1 mrg \ifodd\pageno 822 1.1 mrg \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin 823 1.1 mrg \else 824 1.1 mrg \def\temp{\inleftmargin\lefttext}% 825 1.1 mrg \fi 826 1.1 mrg \temp 827 1.1 mrg } 828 1.1 mrg 829 1.1 mrg % @include FILE -- \input text of FILE. 830 1.1 mrg % 831 1.1 mrg \def\include{\parseargusing\filenamecatcodes\includezzz} 832 1.1 mrg \def\includezzz#1{% 833 1.1 mrg \pushthisfilestack 834 1.1 mrg \def\thisfile{#1}% 835 1.1 mrg {% 836 1.1 mrg \makevalueexpandable % we want to expand any @value in FILE. 837 1.1 mrg \turnoffactive % and allow special characters in the expansion 838 1.1 mrg \indexnofonts % Allow `@@' and other weird things in file names. 839 1.1 mrg \wlog{texinfo.tex: doing @include of #1^^J}% 840 1.1 mrg \edef\temp{\noexpand\input #1 }% 841 1.1 mrg % 842 1.1 mrg % This trickery is to read FILE outside of a group, in case it makes 843 1.1 mrg % definitions, etc. 844 1.1 mrg \expandafter 845 1.1 mrg }\temp 846 1.1 mrg \popthisfilestack 847 1.1 mrg } 848 1.1 mrg \def\filenamecatcodes{% 849 1.1 mrg \catcode`\\=\other 850 1.1 mrg \catcode`~=\other 851 1.1 mrg \catcode`^=\other 852 1.1 mrg \catcode`_=\other 853 1.1 mrg \catcode`|=\other 854 1.1 mrg \catcode`<=\other 855 1.1 mrg \catcode`>=\other 856 1.1 mrg \catcode`+=\other 857 1.1 mrg \catcode`-=\other 858 1.1 mrg \catcode`\`=\other 859 1.1 mrg \catcode`\'=\other 860 1.1 mrg } 861 1.1 mrg 862 1.1 mrg \def\pushthisfilestack{% 863 1.1 mrg \expandafter\pushthisfilestackX\popthisfilestack\StackTerm 864 1.1 mrg } 865 1.1 mrg \def\pushthisfilestackX{% 866 1.1 mrg \expandafter\pushthisfilestackY\thisfile\StackTerm 867 1.1 mrg } 868 1.1 mrg \def\pushthisfilestackY #1\StackTerm #2\StackTerm {% 869 1.1 mrg \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}% 870 1.1 mrg } 871 1.1 mrg 872 1.1 mrg \def\popthisfilestack{\errthisfilestackempty} 873 1.1 mrg \def\errthisfilestackempty{\errmessage{Internal error: 874 1.1 mrg the stack of filenames is empty.}} 875 1.1 mrg % 876 1.1 mrg \def\thisfile{} 877 1.1 mrg 878 1.1 mrg % @center line 879 1.1 mrg % outputs that line, centered. 880 1.1 mrg % 881 1.1 mrg \parseargdef\center{% 882 1.1 mrg \ifhmode 883 1.1 mrg \let\centersub\centerH 884 1.1 mrg \else 885 1.1 mrg \let\centersub\centerV 886 1.1 mrg \fi 887 1.1 mrg \centersub{\hfil \ignorespaces#1\unskip \hfil}% 888 1.1 mrg \let\centersub\relax % don't let the definition persist, just in case 889 1.1 mrg } 890 1.1 mrg \def\centerH#1{{% 891 1.1 mrg \hfil\break 892 1.1 mrg \advance\hsize by -\leftskip 893 1.1 mrg \advance\hsize by -\rightskip 894 1.1 mrg \line{#1}% 895 1.1 mrg \break 896 1.1 mrg }} 897 1.1 mrg % 898 1.1 mrg \newcount\centerpenalty 899 1.1 mrg \def\centerV#1{% 900 1.1 mrg % The idea here is the same as in \startdefun, \cartouche, etc.: if 901 1.1 mrg % @center is the first thing after a section heading, we need to wipe 902 1.1 mrg % out the negative parskip inserted by \sectionheading, but still 903 1.1 mrg % prevent a page break here. 904 1.1 mrg \centerpenalty = \lastpenalty 905 1.1 mrg \ifnum\centerpenalty>10000 \vskip\parskip \fi 906 1.1 mrg \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi 907 1.1 mrg \line{\kern\leftskip #1\kern\rightskip}% 908 1.1 mrg } 909 1.1 mrg 910 1.1 mrg % @sp n outputs n lines of vertical space 911 1.1 mrg % 912 1.1 mrg \parseargdef\sp{\vskip #1\baselineskip} 913 1.1 mrg 914 1.1 mrg % @comment ...line which is ignored... 915 1.1 mrg % @c is the same as @comment 916 1.1 mrg % @ignore ... @end ignore is another way to write a comment 917 1.1 mrg 918 1.1 mrg 919 1.1 mrg \def\c{\begingroup \catcode`\^^M=\active% 920 1.1 mrg \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% 921 1.1 mrg \cxxx} 922 1.1 mrg {\catcode`\^^M=\active \gdef\cxxx#1^^M{\endgroup}} 923 1.1 mrg % 924 1.1 mrg \let\comment\c 925 1.1 mrg 926 1.1 mrg % @paragraphindent NCHARS 927 1.1 mrg % We'll use ems for NCHARS, close enough. 928 1.1 mrg % NCHARS can also be the word `asis' or `none'. 929 1.1 mrg % We cannot feasibly implement @paragraphindent asis, though. 930 1.1 mrg % 931 1.1 mrg \def\asisword{asis} % no translation, these are keywords 932 1.1 mrg \def\noneword{none} 933 1.1 mrg % 934 1.1 mrg \parseargdef\paragraphindent{% 935 1.1 mrg \def\temp{#1}% 936 1.1 mrg \ifx\temp\asisword 937 1.1 mrg \else 938 1.1 mrg \ifx\temp\noneword 939 1.1 mrg \defaultparindent = 0pt 940 1.1 mrg \else 941 1.1 mrg \defaultparindent = #1em 942 1.1 mrg \fi 943 1.1 mrg \fi 944 1.1 mrg \parindent = \defaultparindent 945 1.1 mrg } 946 1.1 mrg 947 1.1 mrg % @exampleindent NCHARS 948 1.1 mrg % We'll use ems for NCHARS like @paragraphindent. 949 1.1 mrg % It seems @exampleindent asis isn't necessary, but 950 1.1 mrg % I preserve it to make it similar to @paragraphindent. 951 1.1 mrg \parseargdef\exampleindent{% 952 1.1 mrg \def\temp{#1}% 953 1.1 mrg \ifx\temp\asisword 954 1.1 mrg \else 955 1.1 mrg \ifx\temp\noneword 956 1.1 mrg \lispnarrowing = 0pt 957 1.1 mrg \else 958 1.1 mrg \lispnarrowing = #1em 959 1.1 mrg \fi 960 1.1 mrg \fi 961 1.1 mrg } 962 1.1 mrg 963 1.1 mrg % @firstparagraphindent WORD 964 1.1 mrg % If WORD is `none', then suppress indentation of the first paragraph 965 1.1 mrg % after a section heading. If WORD is `insert', then do indent at such 966 1.1 mrg % paragraphs. 967 1.1 mrg % 968 1.1 mrg % The paragraph indentation is suppressed or not by calling 969 1.1 mrg % \suppressfirstparagraphindent, which the sectioning commands do. 970 1.1 mrg % We switch the definition of this back and forth according to WORD. 971 1.1 mrg % By default, we suppress indentation. 972 1.1 mrg % 973 1.1 mrg \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} 974 1.1 mrg \def\insertword{insert} 975 1.1 mrg % 976 1.1 mrg \parseargdef\firstparagraphindent{% 977 1.1 mrg \def\temp{#1}% 978 1.1 mrg \ifx\temp\noneword 979 1.1 mrg \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent 980 1.1 mrg \else\ifx\temp\insertword 981 1.1 mrg \let\suppressfirstparagraphindent = \relax 982 1.1 mrg \else 983 1.1 mrg \errhelp = \EMsimple 984 1.1 mrg \errmessage{Unknown @firstparagraphindent option `\temp'}% 985 1.1 mrg \fi\fi 986 1.1 mrg } 987 1.1 mrg 988 1.1 mrg % Here is how we actually suppress indentation. Redefine \everypar to 989 1.1 mrg % \kern backwards by \parindent, and then reset itself to empty. 990 1.1 mrg % 991 1.1 mrg % We also make \indent itself not actually do anything until the next 992 1.1 mrg % paragraph. 993 1.1 mrg % 994 1.1 mrg \gdef\dosuppressfirstparagraphindent{% 995 1.1 mrg \gdef\indent {\restorefirstparagraphindent \indent}% 996 1.1 mrg \gdef\noindent{\restorefirstparagraphindent \noindent}% 997 1.1 mrg \global\everypar = {\kern -\parindent \restorefirstparagraphindent}% 998 1.1 mrg } 999 1.1 mrg % 1000 1.1 mrg \gdef\restorefirstparagraphindent{% 1001 1.1 mrg \global\let\indent = \ptexindent 1002 1.1 mrg \global\let\noindent = \ptexnoindent 1003 1.1 mrg \global\everypar = {}% 1004 1.1 mrg } 1005 1.1.1.2 mrg 1006 1.1.1.2 mrg % leave vertical mode without cancelling any first paragraph indent 1007 1.1.1.2 mrg \gdef\imageindent{% 1008 1.1.1.2 mrg \toks0=\everypar 1009 1.1.1.2 mrg \everypar={}% 1010 1.1.1.2 mrg \ptexnoindent 1011 1.1.1.2 mrg \global\everypar=\toks0 1012 1.1.1.2 mrg } 1013 1.1 mrg 1014 1.1 mrg 1015 1.1 mrg % @refill is a no-op. 1016 1.1 mrg \let\refill=\relax 1017 1.1 mrg 1018 1.1 mrg % @setfilename INFO-FILENAME - ignored 1019 1.1 mrg \let\setfilename=\comment 1020 1.1 mrg 1021 1.1.1.2 mrg % @bye. 1022 1.1 mrg \outer\def\bye{\chappager\pagelabels\tracingstats=1\ptexend} 1023 1.1 mrg 1024 1.1 mrg 1025 1.1 mrg \message{pdf,} 1026 1.1 mrg % adobe `portable' document format 1027 1.1 mrg \newcount\tempnum 1028 1.1 mrg \newcount\lnkcount 1029 1.1 mrg \newtoks\filename 1030 1.1 mrg \newcount\filenamelength 1031 1.1 mrg \newcount\pgn 1032 1.1 mrg \newtoks\toksA 1033 1.1 mrg \newtoks\toksB 1034 1.1 mrg \newtoks\toksC 1035 1.1 mrg \newtoks\toksD 1036 1.1 mrg \newbox\boxA 1037 1.1 mrg \newbox\boxB 1038 1.1 mrg \newcount\countA 1039 1.1 mrg \newif\ifpdf 1040 1.1 mrg \newif\ifpdfmakepagedest 1041 1.1 mrg 1042 1.1 mrg % 1043 1.1 mrg % For LuaTeX 1044 1.1 mrg % 1045 1.1 mrg 1046 1.1 mrg \newif\iftxiuseunicodedestname 1047 1.1 mrg \txiuseunicodedestnamefalse % For pdfTeX etc. 1048 1.1 mrg 1049 1.1 mrg \ifx\luatexversion\thisisundefined 1050 1.1 mrg \else 1051 1.1 mrg % Use Unicode destination names 1052 1.1 mrg \txiuseunicodedestnametrue 1053 1.1 mrg % Escape PDF strings with converting UTF-16 from UTF-8 1054 1.1 mrg \begingroup 1055 1.1 mrg \catcode`\%=12 1056 1.1 mrg \directlua{ 1057 1.1 mrg function UTF16oct(str) 1058 1.1 mrg tex.sprint(string.char(0x5c) .. '376' .. string.char(0x5c) .. '377') 1059 1.1 mrg for c in string.utfvalues(str) do 1060 1.1 mrg if c < 0x10000 then 1061 1.1 mrg tex.sprint( 1062 1.1 mrg string.format(string.char(0x5c) .. string.char(0x25) .. '03o' .. 1063 1.1 mrg string.char(0x5c) .. string.char(0x25) .. '03o', 1064 1.1 mrg math.floor(c / 256), math.floor(c % 256))) 1065 1.1 mrg else 1066 1.1 mrg c = c - 0x10000 1067 1.1 mrg local c_hi = c / 1024 + 0xd800 1068 1.1 mrg local c_lo = c % 1024 + 0xdc00 1069 1.1 mrg tex.sprint( 1070 1.1 mrg string.format(string.char(0x5c) .. string.char(0x25) .. '03o' .. 1071 1.1 mrg string.char(0x5c) .. string.char(0x25) .. '03o' .. 1072 1.1 mrg string.char(0x5c) .. string.char(0x25) .. '03o' .. 1073 1.1 mrg string.char(0x5c) .. string.char(0x25) .. '03o', 1074 1.1 mrg math.floor(c_hi / 256), math.floor(c_hi % 256), 1075 1.1 mrg math.floor(c_lo / 256), math.floor(c_lo % 256))) 1076 1.1 mrg end 1077 1.1 mrg end 1078 1.1 mrg end 1079 1.1 mrg } 1080 1.1 mrg \endgroup 1081 1.1 mrg \def\pdfescapestrutfsixteen#1{\directlua{UTF16oct('\luaescapestring{#1}')}} 1082 1.1 mrg % Escape PDF strings without converting 1083 1.1 mrg \begingroup 1084 1.1 mrg \directlua{ 1085 1.1 mrg function PDFescstr(str) 1086 1.1 mrg for c in string.bytes(str) do 1087 1.1 mrg if c <= 0x20 or c >= 0x80 or c == 0x28 or c == 0x29 or c == 0x5c then 1088 1.1 mrg tex.sprint(-2, 1089 1.1 mrg string.format(string.char(0x5c) .. string.char(0x25) .. '03o', 1090 1.1 mrg c)) 1091 1.1 mrg else 1092 1.1 mrg tex.sprint(-2, string.char(c)) 1093 1.1 mrg end 1094 1.1 mrg end 1095 1.1 mrg end 1096 1.1 mrg } 1097 1.1 mrg % The -2 in the arguments here gives all the input to TeX catcode 12 1098 1.1 mrg % (other) or 10 (space), preventing undefined control sequence errors. See 1099 1.1 mrg % https://lists.gnu.org/archive/html/bug-texinfo/2019-08/msg00031.html 1100 1.1 mrg % 1101 1.1 mrg \endgroup 1102 1.1 mrg \def\pdfescapestring#1{\directlua{PDFescstr('\luaescapestring{#1}')}} 1103 1.1 mrg \ifnum\luatexversion>84 1104 1.1 mrg % For LuaTeX >= 0.85 1105 1.1 mrg \def\pdfdest{\pdfextension dest} 1106 1.1 mrg \let\pdfoutput\outputmode 1107 1.1 mrg \def\pdfliteral{\pdfextension literal} 1108 1.1 mrg \def\pdfcatalog{\pdfextension catalog} 1109 1.1 mrg \def\pdftexversion{\numexpr\pdffeedback version\relax} 1110 1.1 mrg \let\pdfximage\saveimageresource 1111 1.1 mrg \let\pdfrefximage\useimageresource 1112 1.1 mrg \let\pdflastximage\lastsavedimageresourceindex 1113 1.1 mrg \def\pdfendlink{\pdfextension endlink\relax} 1114 1.1 mrg \def\pdfoutline{\pdfextension outline} 1115 1.1 mrg \def\pdfstartlink{\pdfextension startlink} 1116 1.1 mrg \def\pdffontattr{\pdfextension fontattr} 1117 1.1 mrg \def\pdfobj{\pdfextension obj} 1118 1.1 mrg \def\pdflastobj{\numexpr\pdffeedback lastobj\relax} 1119 1.1 mrg \let\pdfpagewidth\pagewidth 1120 1.1 mrg \let\pdfpageheight\pageheight 1121 1.1 mrg \edef\pdfhorigin{\pdfvariable horigin} 1122 1.1 mrg \edef\pdfvorigin{\pdfvariable vorigin} 1123 1.1 mrg \fi 1124 1.1 mrg \fi 1125 1.1 mrg 1126 1.1 mrg % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 1127 1.1 mrg % can be set). So we test for \relax and 0 as well as being undefined. 1128 1.1 mrg \ifx\pdfoutput\thisisundefined 1129 1.1 mrg \else 1130 1.1 mrg \ifx\pdfoutput\relax 1131 1.1 mrg \else 1132 1.1 mrg \ifcase\pdfoutput 1133 1.1 mrg \else 1134 1.1 mrg \pdftrue 1135 1.1 mrg \fi 1136 1.1 mrg \fi 1137 1.1 mrg \fi 1138 1.1 mrg 1139 1.1 mrg \newif\ifpdforxetex 1140 1.1 mrg \pdforxetexfalse 1141 1.1 mrg \ifpdf 1142 1.1 mrg \pdforxetextrue 1143 1.1 mrg \fi 1144 1.1 mrg \ifx\XeTeXrevision\thisisundefined\else 1145 1.1 mrg \pdforxetextrue 1146 1.1 mrg \fi 1147 1.1 mrg 1148 1.1.1.2 mrg 1149 1.1.1.2 mrg % Output page labels information. 1150 1.1.1.2 mrg % See PDF reference v.1.7 p.594, section 8.3.1. 1151 1.1.1.2 mrg \ifpdf 1152 1.1.1.2 mrg \def\pagelabels{% 1153 1.1.1.2 mrg \def\title{0 << /P (T-) /S /D >>}% 1154 1.1.1.2 mrg \edef\roman{\the\romancount << /S /r >>}% 1155 1.1.1.2 mrg \edef\arabic{\the\arabiccount << /S /D >>}% 1156 1.1.1.2 mrg % 1157 1.1.1.2 mrg % Page label ranges must be increasing. Remove any duplicates. 1158 1.1.1.2 mrg % (There is a slight chance of this being wrong if e.g. there is 1159 1.1.1.2 mrg % a @contents but no @titlepage, etc.) 1160 1.1.1.2 mrg % 1161 1.1.1.2 mrg \ifnum\romancount=0 \def\roman{}\fi 1162 1.1.1.2 mrg \ifnum\arabiccount=0 \def\title{}% 1163 1.1.1.2 mrg \else 1164 1.1.1.2 mrg \ifnum\romancount=\arabiccount \def\roman{}\fi 1165 1.1.1.2 mrg \fi 1166 1.1.1.2 mrg % 1167 1.1.1.2 mrg \ifnum\romancount<\arabiccount 1168 1.1.1.2 mrg \pdfcatalog{/PageLabels << /Nums [\title \roman \arabic ] >> }\relax 1169 1.1.1.2 mrg \else 1170 1.1.1.2 mrg \pdfcatalog{/PageLabels << /Nums [\title \arabic \roman ] >> }\relax 1171 1.1.1.2 mrg \fi 1172 1.1.1.2 mrg } 1173 1.1.1.2 mrg \else 1174 1.1.1.2 mrg \let\pagelabels\relax 1175 1.1.1.2 mrg \fi 1176 1.1.1.2 mrg 1177 1.1.1.2 mrg \newcount\pagecount \pagecount=0 1178 1.1.1.2 mrg \newcount\romancount \romancount=0 1179 1.1.1.2 mrg \newcount\arabiccount \arabiccount=0 1180 1.1.1.2 mrg \ifpdf 1181 1.1.1.2 mrg \let\ptxadvancepageno\advancepageno 1182 1.1.1.2 mrg \def\advancepageno{% 1183 1.1.1.2 mrg \ptxadvancepageno\global\advance\pagecount by 1 1184 1.1.1.2 mrg } 1185 1.1.1.2 mrg \fi 1186 1.1.1.2 mrg 1187 1.1 mrg 1188 1.1 mrg % PDF uses PostScript string constants for the names of xref targets, 1189 1.1 mrg % for display in the outlines, and in other places. Thus, we have to 1190 1.1 mrg % double any backslashes. Otherwise, a name like "\node" will be 1191 1.1 mrg % interpreted as a newline (\n), followed by o, d, e. Not good. 1192 1.1 mrg % 1193 1.1 mrg % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and 1194 1.1 mrg % related messages. The final outcome is that it is up to the TeX user 1195 1.1 mrg % to double the backslashes and otherwise make the string valid, so 1196 1.1 mrg % that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to 1197 1.1 mrg % do this reliably, so we use it. 1198 1.1 mrg 1199 1.1 mrg % #1 is a control sequence in which to do the replacements, 1200 1.1 mrg % which we \xdef. 1201 1.1 mrg \def\txiescapepdf#1{% 1202 1.1 mrg \ifx\pdfescapestring\thisisundefined 1203 1.1 mrg % No primitive available; should we give a warning or log? 1204 1.1 mrg % Many times it won't matter. 1205 1.1 mrg \xdef#1{#1}% 1206 1.1 mrg \else 1207 1.1 mrg % The expandable \pdfescapestring primitive escapes parentheses, 1208 1.1 mrg % backslashes, and other special chars. 1209 1.1 mrg \xdef#1{\pdfescapestring{#1}}% 1210 1.1 mrg \fi 1211 1.1 mrg } 1212 1.1 mrg \def\txiescapepdfutfsixteen#1{% 1213 1.1 mrg \ifx\pdfescapestrutfsixteen\thisisundefined 1214 1.1 mrg % No UTF-16 converting macro available. 1215 1.1 mrg \txiescapepdf{#1}% 1216 1.1 mrg \else 1217 1.1 mrg \xdef#1{\pdfescapestrutfsixteen{#1}}% 1218 1.1 mrg \fi 1219 1.1 mrg } 1220 1.1 mrg 1221 1.1 mrg \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images 1222 1.1 mrg with PDF output, and none of those formats could be found. (.eps cannot 1223 1.1 mrg be supported due to the design of the PDF format; use regular TeX (DVI 1224 1.1 mrg output) for that.)} 1225 1.1 mrg 1226 1.1 mrg \ifpdf 1227 1.1 mrg % 1228 1.1 mrg % Color manipulation macros using ideas from pdfcolor.tex, 1229 1.1 mrg % except using rgb instead of cmyk; the latter is said to render as a 1230 1.1 mrg % very dark gray on-screen and a very dark halftone in print, instead 1231 1.1 mrg % of actual black. The dark red here is dark enough to print on paper as 1232 1.1 mrg % nearly black, but still distinguishable for online viewing. We use 1233 1.1 mrg % black by default, though. 1234 1.1 mrg \def\rgbDarkRed{0.50 0.09 0.12} 1235 1.1 mrg \def\rgbBlack{0 0 0} 1236 1.1 mrg % 1237 1.1 mrg % rg sets the color for filling (usual text, etc.); 1238 1.1 mrg % RG sets the color for stroking (thin rules, e.g., normal _'s). 1239 1.1 mrg \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}} 1240 1.1 mrg % 1241 1.1 mrg % Set color, and create a mark which defines \thiscolor accordingly, 1242 1.1 mrg % so that \makeheadline knows which color to restore. 1243 1.1 mrg \def\setcolor#1{% 1244 1.1 mrg \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}% 1245 1.1 mrg \domark 1246 1.1 mrg \pdfsetcolor{#1}% 1247 1.1 mrg } 1248 1.1 mrg % 1249 1.1 mrg \def\maincolor{\rgbBlack} 1250 1.1 mrg \pdfsetcolor{\maincolor} 1251 1.1 mrg \edef\thiscolor{\maincolor} 1252 1.1 mrg \def\currentcolordefs{} 1253 1.1 mrg % 1254 1.1 mrg \def\makefootline{% 1255 1.1 mrg \baselineskip24pt 1256 1.1 mrg \line{\pdfsetcolor{\maincolor}\the\footline}% 1257 1.1 mrg } 1258 1.1 mrg % 1259 1.1 mrg \def\makeheadline{% 1260 1.1 mrg \vbox to 0pt{% 1261 1.1 mrg \vskip-22.5pt 1262 1.1 mrg \line{% 1263 1.1 mrg \vbox to8.5pt{}% 1264 1.1 mrg % Extract \thiscolor definition from the marks. 1265 1.1 mrg \getcolormarks 1266 1.1 mrg % Typeset the headline with \maincolor, then restore the color. 1267 1.1 mrg \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% 1268 1.1 mrg }% 1269 1.1 mrg \vss 1270 1.1 mrg }% 1271 1.1 mrg \nointerlineskip 1272 1.1 mrg } 1273 1.1 mrg % 1274 1.1 mrg % 1275 1.1 mrg \pdfcatalog{/PageMode /UseOutlines} 1276 1.1 mrg % 1277 1.1 mrg % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). 1278 1.1 mrg \def\dopdfimage#1#2#3{% 1279 1.1 mrg \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% 1280 1.1 mrg \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% 1281 1.1 mrg % 1282 1.1 mrg % pdftex (and the PDF format) support .pdf, .png, .jpg (among 1283 1.1 mrg % others). Let's try in that order, PDF first since if 1284 1.1 mrg % someone has a scalable image, presumably better to use that than a 1285 1.1 mrg % bitmap. 1286 1.1 mrg \let\pdfimgext=\empty 1287 1.1 mrg \begingroup 1288 1.1 mrg \openin 1 #1.pdf \ifeof 1 1289 1.1 mrg \openin 1 #1.PDF \ifeof 1 1290 1.1 mrg \openin 1 #1.png \ifeof 1 1291 1.1 mrg \openin 1 #1.jpg \ifeof 1 1292 1.1 mrg \openin 1 #1.jpeg \ifeof 1 1293 1.1 mrg \openin 1 #1.JPG \ifeof 1 1294 1.1 mrg \errhelp = \nopdfimagehelp 1295 1.1 mrg \errmessage{Could not find image file #1 for pdf}% 1296 1.1 mrg \else \gdef\pdfimgext{JPG}% 1297 1.1 mrg \fi 1298 1.1 mrg \else \gdef\pdfimgext{jpeg}% 1299 1.1 mrg \fi 1300 1.1 mrg \else \gdef\pdfimgext{jpg}% 1301 1.1 mrg \fi 1302 1.1 mrg \else \gdef\pdfimgext{png}% 1303 1.1 mrg \fi 1304 1.1 mrg \else \gdef\pdfimgext{PDF}% 1305 1.1 mrg \fi 1306 1.1 mrg \else \gdef\pdfimgext{pdf}% 1307 1.1 mrg \fi 1308 1.1 mrg \closein 1 1309 1.1 mrg \endgroup 1310 1.1 mrg % 1311 1.1 mrg % without \immediate, ancient pdftex seg faults when the same image is 1312 1.1 mrg % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) 1313 1.1 mrg \ifnum\pdftexversion < 14 1314 1.1 mrg \immediate\pdfimage 1315 1.1 mrg \else 1316 1.1 mrg \immediate\pdfximage 1317 1.1 mrg \fi 1318 1.1 mrg \ifdim \wd0 >0pt width \pdfimagewidth \fi 1319 1.1 mrg \ifdim \wd2 >0pt height \pdfimageheight \fi 1320 1.1 mrg \ifnum\pdftexversion<13 1321 1.1 mrg #1.\pdfimgext 1322 1.1 mrg \else 1323 1.1 mrg {#1.\pdfimgext}% 1324 1.1 mrg \fi 1325 1.1 mrg \ifnum\pdftexversion < 14 \else 1326 1.1 mrg \pdfrefximage \pdflastximage 1327 1.1 mrg \fi} 1328 1.1 mrg % 1329 1.1 mrg \def\setpdfdestname#1{{% 1330 1.1 mrg % We have to set dummies so commands such as @code, and characters 1331 1.1 mrg % such as \, aren't expanded when present in a section title. 1332 1.1 mrg \indexnofonts 1333 1.1 mrg \makevalueexpandable 1334 1.1 mrg \turnoffactive 1335 1.1 mrg \iftxiuseunicodedestname 1336 1.1 mrg \ifx \declaredencoding \latone 1337 1.1 mrg % Pass through Latin-1 characters. 1338 1.1 mrg % LuaTeX with byte wise I/O converts Latin-1 characters to Unicode. 1339 1.1 mrg \else 1340 1.1 mrg \ifx \declaredencoding \utfeight 1341 1.1 mrg % Pass through Unicode characters. 1342 1.1 mrg \else 1343 1.1 mrg % Use ASCII approximations in destination names. 1344 1.1 mrg \passthroughcharsfalse 1345 1.1 mrg \fi 1346 1.1 mrg \fi 1347 1.1 mrg \else 1348 1.1 mrg % Use ASCII approximations in destination names. 1349 1.1 mrg \passthroughcharsfalse 1350 1.1 mrg \fi 1351 1.1 mrg \def\pdfdestname{#1}% 1352 1.1 mrg \txiescapepdf\pdfdestname 1353 1.1 mrg }} 1354 1.1 mrg % 1355 1.1 mrg \def\setpdfoutlinetext#1{{% 1356 1.1 mrg \indexnofonts 1357 1.1 mrg \makevalueexpandable 1358 1.1 mrg \turnoffactive 1359 1.1 mrg \ifx \declaredencoding \latone 1360 1.1 mrg % The PDF format can use an extended form of Latin-1 in bookmark 1361 1.1 mrg % strings. See Appendix D of the PDF Reference, Sixth Edition, for 1362 1.1 mrg % the "PDFDocEncoding". 1363 1.1 mrg \passthroughcharstrue 1364 1.1 mrg % Pass through Latin-1 characters. 1365 1.1 mrg % LuaTeX: Convert to Unicode 1366 1.1 mrg % pdfTeX: Use Latin-1 as PDFDocEncoding 1367 1.1 mrg \def\pdfoutlinetext{#1}% 1368 1.1 mrg \else 1369 1.1 mrg \ifx \declaredencoding \utfeight 1370 1.1 mrg \ifx\luatexversion\thisisundefined 1371 1.1 mrg % For pdfTeX with UTF-8. 1372 1.1 mrg % TODO: the PDF format can use UTF-16 in bookmark strings, 1373 1.1 mrg % but the code for this isn't done yet. 1374 1.1 mrg % Use ASCII approximations. 1375 1.1 mrg \passthroughcharsfalse 1376 1.1 mrg \def\pdfoutlinetext{#1}% 1377 1.1 mrg \else 1378 1.1 mrg % For LuaTeX with UTF-8. 1379 1.1 mrg % Pass through Unicode characters for title texts. 1380 1.1 mrg \passthroughcharstrue 1381 1.1 mrg \def\pdfoutlinetext{#1}% 1382 1.1 mrg \fi 1383 1.1 mrg \else 1384 1.1 mrg % For non-Latin-1 or non-UTF-8 encodings. 1385 1.1 mrg % Use ASCII approximations. 1386 1.1 mrg \passthroughcharsfalse 1387 1.1 mrg \def\pdfoutlinetext{#1}% 1388 1.1 mrg \fi 1389 1.1 mrg \fi 1390 1.1 mrg % LuaTeX: Convert to UTF-16 1391 1.1 mrg % pdfTeX: Use Latin-1 as PDFDocEncoding 1392 1.1 mrg \txiescapepdfutfsixteen\pdfoutlinetext 1393 1.1 mrg }} 1394 1.1 mrg % 1395 1.1 mrg \def\pdfmkdest#1{% 1396 1.1 mrg \setpdfdestname{#1}% 1397 1.1 mrg \safewhatsit{\pdfdest name{\pdfdestname} xyz}% 1398 1.1 mrg } 1399 1.1 mrg % 1400 1.1 mrg % used to mark target names; must be expandable. 1401 1.1 mrg \def\pdfmkpgn#1{#1} 1402 1.1 mrg % 1403 1.1 mrg % by default, use black for everything. 1404 1.1 mrg \def\urlcolor{\rgbBlack} 1405 1.1 mrg \def\linkcolor{\rgbBlack} 1406 1.1 mrg \def\endlink{\setcolor{\maincolor}\pdfendlink} 1407 1.1 mrg % 1408 1.1 mrg % Adding outlines to PDF; macros for calculating structure of outlines 1409 1.1 mrg % come from Petr Olsak 1410 1.1 mrg \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% 1411 1.1 mrg \else \csname#1\endcsname \fi} 1412 1.1 mrg \def\advancenumber#1{\tempnum=\expnumber{#1}\relax 1413 1.1 mrg \advance\tempnum by 1 1414 1.1 mrg \expandafter\xdef\csname#1\endcsname{\the\tempnum}} 1415 1.1 mrg % 1416 1.1 mrg % #1 is the section text, which is what will be displayed in the 1417 1.1 mrg % outline by the pdf viewer. #2 is the pdf expression for the number 1418 1.1 mrg % of subentries (or empty, for subsubsections). #3 is the node text, 1419 1.1 mrg % which might be empty if this toc entry had no corresponding node. 1420 1.1 mrg % #4 is the page number 1421 1.1 mrg % 1422 1.1 mrg \def\dopdfoutline#1#2#3#4{% 1423 1.1 mrg % Generate a link to the node text if that exists; else, use the 1424 1.1 mrg % page number. We could generate a destination for the section 1425 1.1 mrg % text in the case where a section has no node, but it doesn't 1426 1.1 mrg % seem worth the trouble, since most documents are normally structured. 1427 1.1 mrg \setpdfoutlinetext{#1} 1428 1.1 mrg \setpdfdestname{#3} 1429 1.1 mrg \ifx\pdfdestname\empty 1430 1.1 mrg \def\pdfdestname{#4}% 1431 1.1 mrg \fi 1432 1.1 mrg % 1433 1.1 mrg \pdfoutline goto name{\pdfmkpgn{\pdfdestname}}#2{\pdfoutlinetext}% 1434 1.1 mrg } 1435 1.1 mrg % 1436 1.1 mrg \def\pdfmakeoutlines{% 1437 1.1 mrg \begingroup 1438 1.1 mrg % Read toc silently, to get counts of subentries for \pdfoutline. 1439 1.1 mrg \def\partentry##1##2##3##4{}% ignore parts in the outlines 1440 1.1 mrg \def\numchapentry##1##2##3##4{% 1441 1.1 mrg \def\thischapnum{##2}% 1442 1.1 mrg \def\thissecnum{0}% 1443 1.1 mrg \def\thissubsecnum{0}% 1444 1.1 mrg }% 1445 1.1 mrg \def\numsecentry##1##2##3##4{% 1446 1.1 mrg \advancenumber{chap\thischapnum}% 1447 1.1 mrg \def\thissecnum{##2}% 1448 1.1 mrg \def\thissubsecnum{0}% 1449 1.1 mrg }% 1450 1.1 mrg \def\numsubsecentry##1##2##3##4{% 1451 1.1 mrg \advancenumber{sec\thissecnum}% 1452 1.1 mrg \def\thissubsecnum{##2}% 1453 1.1 mrg }% 1454 1.1 mrg \def\numsubsubsecentry##1##2##3##4{% 1455 1.1 mrg \advancenumber{subsec\thissubsecnum}% 1456 1.1 mrg }% 1457 1.1 mrg \def\thischapnum{0}% 1458 1.1 mrg \def\thissecnum{0}% 1459 1.1 mrg \def\thissubsecnum{0}% 1460 1.1 mrg % 1461 1.1 mrg % use \def rather than \let here because we redefine \chapentry et 1462 1.1 mrg % al. a second time, below. 1463 1.1 mrg \def\appentry{\numchapentry}% 1464 1.1 mrg \def\appsecentry{\numsecentry}% 1465 1.1 mrg \def\appsubsecentry{\numsubsecentry}% 1466 1.1 mrg \def\appsubsubsecentry{\numsubsubsecentry}% 1467 1.1 mrg \def\unnchapentry{\numchapentry}% 1468 1.1 mrg \def\unnsecentry{\numsecentry}% 1469 1.1 mrg \def\unnsubsecentry{\numsubsecentry}% 1470 1.1 mrg \def\unnsubsubsecentry{\numsubsubsecentry}% 1471 1.1 mrg \readdatafile{toc}% 1472 1.1 mrg % 1473 1.1 mrg % Read toc second time, this time actually producing the outlines. 1474 1.1 mrg % The `-' means take the \expnumber as the absolute number of 1475 1.1 mrg % subentries, which we calculated on our first read of the .toc above. 1476 1.1 mrg % 1477 1.1.1.2 mrg % We use the node names as the destinations. 1478 1.1.1.2 mrg % 1479 1.1.1.2 mrg % Currently we prefix the section name with the section number 1480 1.1.1.2 mrg % for chapter and appendix headings only in order to avoid too much 1481 1.1 mrg % horizontal space being required in the PDF viewer. 1482 1.1.1.2 mrg \def\numchapentry##1##2##3##4{% 1483 1.1.1.2 mrg \dopdfoutline{##2 ##1}{count-\expnumber{chap##2}}{##3}{##4}}% 1484 1.1 mrg \def\unnchapentry##1##2##3##4{% 1485 1.1 mrg \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% 1486 1.1 mrg \def\numsecentry##1##2##3##4{% 1487 1.1 mrg \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% 1488 1.1 mrg \def\numsubsecentry##1##2##3##4{% 1489 1.1 mrg \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}% 1490 1.1 mrg \def\numsubsubsecentry##1##2##3##4{% count is always zero 1491 1.1 mrg \dopdfoutline{##1}{}{##3}{##4}}% 1492 1.1 mrg % 1493 1.1 mrg % PDF outlines are displayed using system fonts, instead of 1494 1.1 mrg % document fonts. Therefore we cannot use special characters, 1495 1.1 mrg % since the encoding is unknown. For example, the eogonek from 1496 1.1 mrg % Latin 2 (0xea) gets translated to a | character. Info from 1497 1.1 mrg % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. 1498 1.1 mrg % 1499 1.1 mrg % TODO this right, we have to translate 8-bit characters to 1500 1.1 mrg % their "best" equivalent, based on the @documentencoding. Too 1501 1.1 mrg % much work for too little return. Just use the ASCII equivalents 1502 1.1 mrg % we use for the index sort strings. 1503 1.1 mrg % 1504 1.1 mrg \indexnofonts 1505 1.1 mrg \setupdatafile 1506 1.1 mrg % We can have normal brace characters in the PDF outlines, unlike 1507 1.1 mrg % Texinfo index files. So set that up. 1508 1.1 mrg \def\{{\lbracecharliteral}% 1509 1.1 mrg \def\}{\rbracecharliteral}% 1510 1.1 mrg \catcode`\\=\active \otherbackslash 1511 1.1 mrg \input \tocreadfilename 1512 1.1 mrg \endgroup 1513 1.1 mrg } 1514 1.1 mrg {\catcode`[=1 \catcode`]=2 1515 1.1 mrg \catcode`{=\other \catcode`}=\other 1516 1.1 mrg \gdef\lbracecharliteral[{]% 1517 1.1 mrg \gdef\rbracecharliteral[}]% 1518 1.1 mrg ] 1519 1.1 mrg % 1520 1.1 mrg \def\skipspaces#1{\def\PP{#1}\def\D{|}% 1521 1.1 mrg \ifx\PP\D\let\nextsp\relax 1522 1.1 mrg \else\let\nextsp\skipspaces 1523 1.1 mrg \addtokens{\filename}{\PP}% 1524 1.1 mrg \advance\filenamelength by 1 1525 1.1 mrg \fi 1526 1.1 mrg \nextsp} 1527 1.1 mrg \def\getfilename#1{% 1528 1.1 mrg \filenamelength=0 1529 1.1 mrg % If we don't expand the argument now, \skipspaces will get 1530 1.1 mrg % snagged on things like "@value{foo}". 1531 1.1 mrg \edef\temp{#1}% 1532 1.1 mrg \expandafter\skipspaces\temp|\relax 1533 1.1 mrg } 1534 1.1 mrg \ifnum\pdftexversion < 14 1535 1.1 mrg \let \startlink \pdfannotlink 1536 1.1 mrg \else 1537 1.1 mrg \let \startlink \pdfstartlink 1538 1.1 mrg \fi 1539 1.1 mrg % make a live url in pdf output. 1540 1.1 mrg \def\pdfurl#1{% 1541 1.1 mrg \begingroup 1542 1.1 mrg % it seems we really need yet another set of dummies; have not 1543 1.1 mrg % tried to figure out what each command should do in the context 1544 1.1 mrg % of @url. for now, just make @/ a no-op, that's the only one 1545 1.1 mrg % people have actually reported a problem with. 1546 1.1 mrg % 1547 1.1 mrg \normalturnoffactive 1548 1.1 mrg \def\@{@}% 1549 1.1 mrg \let\/=\empty 1550 1.1 mrg \makevalueexpandable 1551 1.1 mrg % do we want to go so far as to use \indexnofonts instead of just 1552 1.1 mrg % special-casing \var here? 1553 1.1 mrg \def\var##1{##1}% 1554 1.1 mrg % 1555 1.1 mrg \leavevmode\setcolor{\urlcolor}% 1556 1.1 mrg \startlink attr{/Border [0 0 0]}% 1557 1.1 mrg user{/Subtype /Link /A << /S /URI /URI (#1) >>}% 1558 1.1 mrg \endgroup} 1559 1.1 mrg % \pdfgettoks - Surround page numbers in #1 with @pdflink. #1 may 1560 1.1 mrg % be a simple number, or a list of numbers in the case of an index 1561 1.1 mrg % entry. 1562 1.1 mrg \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} 1563 1.1 mrg \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} 1564 1.1 mrg \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} 1565 1.1 mrg \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} 1566 1.1 mrg \def\maketoks{% 1567 1.1 mrg \expandafter\poptoks\the\toksA|ENDTOKS|\relax 1568 1.1 mrg \ifx\first0\adn0 1569 1.1 mrg \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 1570 1.1 mrg \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 1571 1.1 mrg \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 1572 1.1 mrg \else 1573 1.1 mrg \ifnum0=\countA\else\makelink\fi 1574 1.1 mrg \ifx\first.\let\next=\done\else 1575 1.1 mrg \let\next=\maketoks 1576 1.1 mrg \addtokens{\toksB}{\the\toksD} 1577 1.1 mrg \ifx\first,\addtokens{\toksB}{\space}\fi 1578 1.1 mrg \fi 1579 1.1 mrg \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi 1580 1.1 mrg \next} 1581 1.1 mrg \def\makelink{\addtokens{\toksB}% 1582 1.1 mrg {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} 1583 1.1 mrg \def\pdflink#1{% 1584 1.1 mrg \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} 1585 1.1 mrg \setcolor{\linkcolor}#1\endlink} 1586 1.1 mrg \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} 1587 1.1 mrg \else 1588 1.1 mrg % non-pdf mode 1589 1.1 mrg \let\pdfmkdest = \gobble 1590 1.1 mrg \let\pdfurl = \gobble 1591 1.1 mrg \let\endlink = \relax 1592 1.1 mrg \let\setcolor = \gobble 1593 1.1 mrg \let\pdfsetcolor = \gobble 1594 1.1 mrg \let\pdfmakeoutlines = \relax 1595 1.1 mrg \fi % \ifx\pdfoutput 1596 1.1 mrg 1597 1.1 mrg % 1598 1.1 mrg % For XeTeX 1599 1.1 mrg % 1600 1.1 mrg \ifx\XeTeXrevision\thisisundefined 1601 1.1 mrg \else 1602 1.1 mrg % 1603 1.1 mrg % XeTeX version check 1604 1.1 mrg % 1605 1.1 mrg \ifnum\strcmp{\the\XeTeXversion\XeTeXrevision}{0.99996}>-1 1606 1.1 mrg % TeX Live 2016 contains XeTeX 0.99996 and xdvipdfmx 20160307. 1607 1.1 mrg % It can use the `dvipdfmx:config' special (from TeX Live SVN r40941). 1608 1.1 mrg % For avoiding PDF destination name replacement, we use this special 1609 1.1 mrg % instead of xdvipdfmx's command line option `-C 0x0010'. 1610 1.1 mrg \special{dvipdfmx:config C 0x0010} 1611 1.1 mrg % XeTeX 0.99995+ comes with xdvipdfmx 20160307+. 1612 1.1 mrg % It can handle Unicode destination names for PDF. 1613 1.1 mrg \txiuseunicodedestnametrue 1614 1.1 mrg \else 1615 1.1 mrg % XeTeX < 0.99996 (TeX Live < 2016) cannot use the 1616 1.1 mrg % `dvipdfmx:config' special. 1617 1.1 mrg % So for avoiding PDF destination name replacement, 1618 1.1 mrg % xdvipdfmx's command line option `-C 0x0010' is necessary. 1619 1.1 mrg % 1620 1.1 mrg % XeTeX < 0.99995 can not handle Unicode destination names for PDF 1621 1.1 mrg % because xdvipdfmx 20150315 has a UTF-16 conversion issue. 1622 1.1 mrg % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753). 1623 1.1 mrg \txiuseunicodedestnamefalse 1624 1.1 mrg \fi 1625 1.1 mrg % 1626 1.1 mrg % Color support 1627 1.1 mrg % 1628 1.1 mrg \def\rgbDarkRed{0.50 0.09 0.12} 1629 1.1 mrg \def\rgbBlack{0 0 0} 1630 1.1 mrg % 1631 1.1 mrg \def\pdfsetcolor#1{\special{pdf:scolor [#1]}} 1632 1.1 mrg % 1633 1.1 mrg % Set color, and create a mark which defines \thiscolor accordingly, 1634 1.1 mrg % so that \makeheadline knows which color to restore. 1635 1.1 mrg \def\setcolor#1{% 1636 1.1 mrg \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}% 1637 1.1 mrg \domark 1638 1.1 mrg \pdfsetcolor{#1}% 1639 1.1 mrg } 1640 1.1 mrg % 1641 1.1 mrg \def\maincolor{\rgbBlack} 1642 1.1 mrg \pdfsetcolor{\maincolor} 1643 1.1 mrg \edef\thiscolor{\maincolor} 1644 1.1 mrg \def\currentcolordefs{} 1645 1.1 mrg % 1646 1.1 mrg \def\makefootline{% 1647 1.1 mrg \baselineskip24pt 1648 1.1 mrg \line{\pdfsetcolor{\maincolor}\the\footline}% 1649 1.1 mrg } 1650 1.1 mrg % 1651 1.1 mrg \def\makeheadline{% 1652 1.1 mrg \vbox to 0pt{% 1653 1.1 mrg \vskip-22.5pt 1654 1.1 mrg \line{% 1655 1.1 mrg \vbox to8.5pt{}% 1656 1.1 mrg % Extract \thiscolor definition from the marks. 1657 1.1 mrg \getcolormarks 1658 1.1 mrg % Typeset the headline with \maincolor, then restore the color. 1659 1.1 mrg \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% 1660 1.1 mrg }% 1661 1.1 mrg \vss 1662 1.1 mrg }% 1663 1.1 mrg \nointerlineskip 1664 1.1 mrg } 1665 1.1 mrg % 1666 1.1 mrg % PDF outline support 1667 1.1 mrg % 1668 1.1 mrg % Emulate pdfTeX primitive 1669 1.1 mrg \def\pdfdest name#1 xyz{% 1670 1.1 mrg \special{pdf:dest (#1) [@thispage /XYZ @xpos @ypos null]}% 1671 1.1 mrg } 1672 1.1 mrg % 1673 1.1 mrg \def\setpdfdestname#1{{% 1674 1.1 mrg % We have to set dummies so commands such as @code, and characters 1675 1.1 mrg % such as \, aren't expanded when present in a section title. 1676 1.1 mrg \indexnofonts 1677 1.1 mrg \makevalueexpandable 1678 1.1 mrg \turnoffactive 1679 1.1 mrg \iftxiuseunicodedestname 1680 1.1 mrg % Pass through Unicode characters. 1681 1.1 mrg \else 1682 1.1 mrg % Use ASCII approximations in destination names. 1683 1.1 mrg \passthroughcharsfalse 1684 1.1 mrg \fi 1685 1.1 mrg \def\pdfdestname{#1}% 1686 1.1 mrg \txiescapepdf\pdfdestname 1687 1.1 mrg }} 1688 1.1 mrg % 1689 1.1 mrg \def\setpdfoutlinetext#1{{% 1690 1.1 mrg \turnoffactive 1691 1.1 mrg % Always use Unicode characters in title texts. 1692 1.1 mrg \def\pdfoutlinetext{#1}% 1693 1.1 mrg % For XeTeX, xdvipdfmx converts to UTF-16. 1694 1.1 mrg % So we do not convert. 1695 1.1 mrg \txiescapepdf\pdfoutlinetext 1696 1.1 mrg }} 1697 1.1 mrg % 1698 1.1 mrg \def\pdfmkdest#1{% 1699 1.1 mrg \setpdfdestname{#1}% 1700 1.1 mrg \safewhatsit{\pdfdest name{\pdfdestname} xyz}% 1701 1.1 mrg } 1702 1.1 mrg % 1703 1.1 mrg % by default, use black for everything. 1704 1.1 mrg \def\urlcolor{\rgbBlack} 1705 1.1 mrg \def\linkcolor{\rgbBlack} 1706 1.1 mrg \def\endlink{\setcolor{\maincolor}\pdfendlink} 1707 1.1 mrg % 1708 1.1 mrg \def\dopdfoutline#1#2#3#4{% 1709 1.1 mrg \setpdfoutlinetext{#1} 1710 1.1 mrg \setpdfdestname{#3} 1711 1.1 mrg \ifx\pdfdestname\empty 1712 1.1 mrg \def\pdfdestname{#4}% 1713 1.1 mrg \fi 1714 1.1 mrg % 1715 1.1 mrg \special{pdf:out [-] #2 << /Title (\pdfoutlinetext) /A 1716 1.1 mrg << /S /GoTo /D (\pdfdestname) >> >> }% 1717 1.1 mrg } 1718 1.1 mrg % 1719 1.1 mrg \def\pdfmakeoutlines{% 1720 1.1 mrg \begingroup 1721 1.1 mrg % 1722 1.1 mrg % For XeTeX, counts of subentries are not necessary. 1723 1.1 mrg % Therefore, we read toc only once. 1724 1.1 mrg % 1725 1.1.1.2 mrg % We use node names as destinations. 1726 1.1.1.2 mrg % 1727 1.1.1.2 mrg % Currently we prefix the section name with the section number 1728 1.1.1.2 mrg % for chapter and appendix headings only in order to avoid too much 1729 1.1 mrg % horizontal space being required in the PDF viewer. 1730 1.1 mrg \def\partentry##1##2##3##4{}% ignore parts in the outlines 1731 1.1.1.2 mrg \def\numchapentry##1##2##3##4{% 1732 1.1 mrg \dopdfoutline{##2 ##1}{1}{##3}{##4}}% 1733 1.1 mrg \def\numsecentry##1##2##3##4{% 1734 1.1 mrg \dopdfoutline{##1}{2}{##3}{##4}}% 1735 1.1 mrg \def\numsubsecentry##1##2##3##4{% 1736 1.1 mrg \dopdfoutline{##1}{3}{##3}{##4}}% 1737 1.1 mrg \def\numsubsubsecentry##1##2##3##4{% 1738 1.1 mrg \dopdfoutline{##1}{4}{##3}{##4}}% 1739 1.1 mrg % 1740 1.1 mrg \let\appentry\numchapentry% 1741 1.1 mrg \let\appsecentry\numsecentry% 1742 1.1 mrg \let\appsubsecentry\numsubsecentry% 1743 1.1.1.2 mrg \let\appsubsubsecentry\numsubsubsecentry% 1744 1.1.1.2 mrg \def\unnchapentry##1##2##3##4{% 1745 1.1 mrg \dopdfoutline{##1}{1}{##3}{##4}}% 1746 1.1 mrg \let\unnsecentry\numsecentry% 1747 1.1 mrg \let\unnsubsecentry\numsubsecentry% 1748 1.1 mrg \let\unnsubsubsecentry\numsubsubsecentry% 1749 1.1 mrg % 1750 1.1 mrg % For XeTeX, xdvipdfmx converts strings to UTF-16. 1751 1.1 mrg % Therefore, the encoding and the language may not be considered. 1752 1.1 mrg % 1753 1.1 mrg \indexnofonts 1754 1.1 mrg \setupdatafile 1755 1.1 mrg % We can have normal brace characters in the PDF outlines, unlike 1756 1.1 mrg % Texinfo index files. So set that up. 1757 1.1 mrg \def\{{\lbracecharliteral}% 1758 1.1 mrg \def\}{\rbracecharliteral}% 1759 1.1 mrg \catcode`\\=\active \otherbackslash 1760 1.1 mrg \input \tocreadfilename 1761 1.1 mrg \endgroup 1762 1.1 mrg } 1763 1.1 mrg {\catcode`[=1 \catcode`]=2 1764 1.1 mrg \catcode`{=\other \catcode`}=\other 1765 1.1 mrg \gdef\lbracecharliteral[{]% 1766 1.1 mrg \gdef\rbracecharliteral[}]% 1767 1.1 mrg ] 1768 1.1 mrg 1769 1.1 mrg \special{pdf:docview << /PageMode /UseOutlines >> } 1770 1.1 mrg % ``\special{pdf:tounicode ...}'' is not necessary 1771 1.1 mrg % because xdvipdfmx converts strings from UTF-8 to UTF-16 without it. 1772 1.1 mrg % However, due to a UTF-16 conversion issue of xdvipdfmx 20150315, 1773 1.1 mrg % ``\special{pdf:dest ...}'' cannot handle non-ASCII strings. 1774 1.1 mrg % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753). 1775 1.1 mrg % 1776 1.1 mrg \def\skipspaces#1{\def\PP{#1}\def\D{|}% 1777 1.1 mrg \ifx\PP\D\let\nextsp\relax 1778 1.1 mrg \else\let\nextsp\skipspaces 1779 1.1 mrg \addtokens{\filename}{\PP}% 1780 1.1 mrg \advance\filenamelength by 1 1781 1.1 mrg \fi 1782 1.1 mrg \nextsp} 1783 1.1 mrg \def\getfilename#1{% 1784 1.1 mrg \filenamelength=0 1785 1.1 mrg % If we don't expand the argument now, \skipspaces will get 1786 1.1 mrg % snagged on things like "@value{foo}". 1787 1.1 mrg \edef\temp{#1}% 1788 1.1 mrg \expandafter\skipspaces\temp|\relax 1789 1.1 mrg } 1790 1.1 mrg % make a live url in pdf output. 1791 1.1 mrg \def\pdfurl#1{% 1792 1.1 mrg \begingroup 1793 1.1 mrg % it seems we really need yet another set of dummies; have not 1794 1.1 mrg % tried to figure out what each command should do in the context 1795 1.1 mrg % of @url. for now, just make @/ a no-op, that's the only one 1796 1.1 mrg % people have actually reported a problem with. 1797 1.1 mrg % 1798 1.1 mrg \normalturnoffactive 1799 1.1 mrg \def\@{@}% 1800 1.1 mrg \let\/=\empty 1801 1.1 mrg \makevalueexpandable 1802 1.1 mrg % do we want to go so far as to use \indexnofonts instead of just 1803 1.1 mrg % special-casing \var here? 1804 1.1 mrg \def\var##1{##1}% 1805 1.1 mrg % 1806 1.1 mrg \leavevmode\setcolor{\urlcolor}% 1807 1.1 mrg \special{pdf:bann << /Border [0 0 0] 1808 1.1 mrg /Subtype /Link /A << /S /URI /URI (#1) >> >>}% 1809 1.1 mrg \endgroup} 1810 1.1 mrg \def\endlink{\setcolor{\maincolor}\special{pdf:eann}} 1811 1.1 mrg \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} 1812 1.1 mrg \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} 1813 1.1 mrg \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} 1814 1.1 mrg \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} 1815 1.1 mrg \def\maketoks{% 1816 1.1 mrg \expandafter\poptoks\the\toksA|ENDTOKS|\relax 1817 1.1 mrg \ifx\first0\adn0 1818 1.1 mrg \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 1819 1.1 mrg \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 1820 1.1 mrg \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 1821 1.1 mrg \else 1822 1.1 mrg \ifnum0=\countA\else\makelink\fi 1823 1.1 mrg \ifx\first.\let\next=\done\else 1824 1.1 mrg \let\next=\maketoks 1825 1.1 mrg \addtokens{\toksB}{\the\toksD} 1826 1.1 mrg \ifx\first,\addtokens{\toksB}{\space}\fi 1827 1.1 mrg \fi 1828 1.1 mrg \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi 1829 1.1 mrg \next} 1830 1.1 mrg \def\makelink{\addtokens{\toksB}% 1831 1.1 mrg {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} 1832 1.1 mrg \def\pdflink#1{% 1833 1.1 mrg \special{pdf:bann << /Border [0 0 0] 1834 1.1 mrg /Type /Annot /Subtype /Link /A << /S /GoTo /D (#1) >> >>}% 1835 1.1 mrg \setcolor{\linkcolor}#1\endlink} 1836 1.1 mrg \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} 1837 1.1 mrg % 1838 1.1 mrg % 1839 1.1 mrg % @image support 1840 1.1 mrg % 1841 1.1 mrg % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). 1842 1.1 mrg \def\doxeteximage#1#2#3{% 1843 1.1 mrg \def\xeteximagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% 1844 1.1 mrg \def\xeteximageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% 1845 1.1 mrg % 1846 1.1 mrg % XeTeX (and the PDF format) supports .pdf, .png, .jpg (among 1847 1.1 mrg % others). Let's try in that order, PDF first since if 1848 1.1 mrg % someone has a scalable image, presumably better to use that than a 1849 1.1 mrg % bitmap. 1850 1.1 mrg \let\xeteximgext=\empty 1851 1.1 mrg \begingroup 1852 1.1 mrg \openin 1 #1.pdf \ifeof 1 1853 1.1 mrg \openin 1 #1.PDF \ifeof 1 1854 1.1 mrg \openin 1 #1.png \ifeof 1 1855 1.1 mrg \openin 1 #1.jpg \ifeof 1 1856 1.1 mrg \openin 1 #1.jpeg \ifeof 1 1857 1.1 mrg \openin 1 #1.JPG \ifeof 1 1858 1.1 mrg \errmessage{Could not find image file #1 for XeTeX}% 1859 1.1 mrg \else \gdef\xeteximgext{JPG}% 1860 1.1 mrg \fi 1861 1.1 mrg \else \gdef\xeteximgext{jpeg}% 1862 1.1 mrg \fi 1863 1.1 mrg \else \gdef\xeteximgext{jpg}% 1864 1.1 mrg \fi 1865 1.1 mrg \else \gdef\xeteximgext{png}% 1866 1.1 mrg \fi 1867 1.1 mrg \else \gdef\xeteximgext{PDF}% 1868 1.1 mrg \fi 1869 1.1 mrg \else \gdef\xeteximgext{pdf}% 1870 1.1 mrg \fi 1871 1.1 mrg \closein 1 1872 1.1 mrg \endgroup 1873 1.1.1.2 mrg % 1874 1.1.1.2 mrg % Putting an \hbox around the image can prevent an over-long line 1875 1.1.1.2 mrg % after the image. 1876 1.1.1.2 mrg \hbox\bgroup 1877 1.1 mrg \def\xetexpdfext{pdf}% 1878 1.1 mrg \ifx\xeteximgext\xetexpdfext 1879 1.1 mrg \XeTeXpdffile "#1".\xeteximgext "" 1880 1.1.1.2 mrg \else 1881 1.1.1.2 mrg \def\xetexpdfext{PDF}% 1882 1.1.1.2 mrg \ifx\xeteximgext\xetexpdfext 1883 1.1.1.2 mrg \XeTeXpdffile "#1".\xeteximgext "" 1884 1.1.1.2 mrg \else 1885 1.1.1.2 mrg \XeTeXpicfile "#1".\xeteximgext "" 1886 1.1 mrg \fi 1887 1.1.1.2 mrg \fi 1888 1.1.1.2 mrg \ifdim \wd0 >0pt width \xeteximagewidth \fi 1889 1.1.1.2 mrg \ifdim \wd2 >0pt height \xeteximageheight \fi \relax 1890 1.1 mrg \egroup 1891 1.1 mrg } 1892 1.1 mrg \fi 1893 1.1 mrg 1894 1.1 mrg 1895 1.1 mrg % 1896 1.1 mrg \message{fonts,} 1897 1.1 mrg 1898 1.1 mrg % Set the baselineskip to #1, and the lineskip and strut size 1899 1.1 mrg % correspondingly. There is no deep meaning behind these magic numbers 1900 1.1 mrg % used as factors; they just match (closely enough) what Knuth defined. 1901 1.1 mrg % 1902 1.1 mrg \def\lineskipfactor{.08333} 1903 1.1 mrg \def\strutheightpercent{.70833} 1904 1.1 mrg \def\strutdepthpercent {.29167} 1905 1.1 mrg % 1906 1.1 mrg % can get a sort of poor man's double spacing by redefining this. 1907 1.1 mrg \def\baselinefactor{1} 1908 1.1 mrg % 1909 1.1 mrg \newdimen\textleading 1910 1.1 mrg \def\setleading#1{% 1911 1.1 mrg \dimen0 = #1\relax 1912 1.1 mrg \normalbaselineskip = \baselinefactor\dimen0 1913 1.1 mrg \normallineskip = \lineskipfactor\normalbaselineskip 1914 1.1 mrg \normalbaselines 1915 1.1 mrg \setbox\strutbox =\hbox{% 1916 1.1 mrg \vrule width0pt height\strutheightpercent\baselineskip 1917 1.1 mrg depth \strutdepthpercent \baselineskip 1918 1.1 mrg }% 1919 1.1 mrg } 1920 1.1 mrg 1921 1.1 mrg % PDF CMaps. See also LaTeX's t1.cmap. 1922 1.1 mrg % 1923 1.1 mrg % do nothing with this by default. 1924 1.1 mrg \expandafter\let\csname cmapOT1\endcsname\gobble 1925 1.1 mrg \expandafter\let\csname cmapOT1IT\endcsname\gobble 1926 1.1 mrg \expandafter\let\csname cmapOT1TT\endcsname\gobble 1927 1.1 mrg 1928 1.1 mrg % if we are producing pdf, and we have \pdffontattr, then define cmaps. 1929 1.1 mrg % (\pdffontattr was introduced many years ago, but people still run 1930 1.1 mrg % older pdftex's; it's easy to conditionalize, so we do.) 1931 1.1 mrg \ifpdf \ifx\pdffontattr\thisisundefined \else 1932 1.1 mrg \begingroup 1933 1.1 mrg \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. 1934 1.1 mrg \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap 1935 1.1 mrg %%DocumentNeededResources: ProcSet (CIDInit) 1936 1.1 mrg %%IncludeResource: ProcSet (CIDInit) 1937 1.1 mrg %%BeginResource: CMap (TeX-OT1-0) 1938 1.1 mrg %%Title: (TeX-OT1-0 TeX OT1 0) 1939 1.1 mrg %%Version: 1.000 1940 1.1 mrg %%EndComments 1941 1.1 mrg /CIDInit /ProcSet findresource begin 1942 1.1 mrg 12 dict begin 1943 1.1 mrg begincmap 1944 1.1 mrg /CIDSystemInfo 1945 1.1 mrg << /Registry (TeX) 1946 1.1 mrg /Ordering (OT1) 1947 1.1 mrg /Supplement 0 1948 1.1 mrg >> def 1949 1.1 mrg /CMapName /TeX-OT1-0 def 1950 1.1 mrg /CMapType 2 def 1951 1.1 mrg 1 begincodespacerange 1952 1.1 mrg <00> <7F> 1953 1.1 mrg endcodespacerange 1954 1.1 mrg 8 beginbfrange 1955 1.1 mrg <00> <01> <0393> 1956 1.1 mrg <09> <0A> <03A8> 1957 1.1 mrg <23> <26> <0023> 1958 1.1 mrg <28> <3B> <0028> 1959 1.1 mrg <3F> <5B> <003F> 1960 1.1 mrg <5D> <5E> <005D> 1961 1.1 mrg <61> <7A> <0061> 1962 1.1 mrg <7B> <7C> <2013> 1963 1.1 mrg endbfrange 1964 1.1 mrg 40 beginbfchar 1965 1.1 mrg <02> <0398> 1966 1.1 mrg <03> <039B> 1967 1.1 mrg <04> <039E> 1968 1.1 mrg <05> <03A0> 1969 1.1 mrg <06> <03A3> 1970 1.1 mrg <07> <03D2> 1971 1.1 mrg <08> <03A6> 1972 1.1 mrg <0B> <00660066> 1973 1.1 mrg <0C> <00660069> 1974 1.1 mrg <0D> <0066006C> 1975 1.1 mrg <0E> <006600660069> 1976 1.1 mrg <0F> <00660066006C> 1977 1.1 mrg <10> <0131> 1978 1.1 mrg <11> <0237> 1979 1.1 mrg <12> <0060> 1980 1.1 mrg <13> <00B4> 1981 1.1 mrg <14> <02C7> 1982 1.1 mrg <15> <02D8> 1983 1.1 mrg <16> <00AF> 1984 1.1 mrg <17> <02DA> 1985 1.1 mrg <18> <00B8> 1986 1.1 mrg <19> <00DF> 1987 1.1 mrg <1A> <00E6> 1988 1.1 mrg <1B> <0153> 1989 1.1 mrg <1C> <00F8> 1990 1.1 mrg <1D> <00C6> 1991 1.1 mrg <1E> <0152> 1992 1.1 mrg <1F> <00D8> 1993 1.1 mrg <21> <0021> 1994 1.1 mrg <22> <201D> 1995 1.1 mrg <27> <2019> 1996 1.1 mrg <3C> <00A1> 1997 1.1 mrg <3D> <003D> 1998 1.1 mrg <3E> <00BF> 1999 1.1 mrg <5C> <201C> 2000 1.1 mrg <5F> <02D9> 2001 1.1 mrg <60> <2018> 2002 1.1 mrg <7D> <02DD> 2003 1.1 mrg <7E> <007E> 2004 1.1 mrg <7F> <00A8> 2005 1.1 mrg endbfchar 2006 1.1 mrg endcmap 2007 1.1 mrg CMapName currentdict /CMap defineresource pop 2008 1.1 mrg end 2009 1.1 mrg end 2010 1.1 mrg %%EndResource 2011 1.1 mrg %%EOF 2012 1.1 mrg }\endgroup 2013 1.1 mrg \expandafter\edef\csname cmapOT1\endcsname#1{% 2014 1.1 mrg \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% 2015 1.1 mrg }% 2016 1.1 mrg % 2017 1.1 mrg % \cmapOT1IT 2018 1.1 mrg \begingroup 2019 1.1 mrg \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. 2020 1.1 mrg \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap 2021 1.1 mrg %%DocumentNeededResources: ProcSet (CIDInit) 2022 1.1 mrg %%IncludeResource: ProcSet (CIDInit) 2023 1.1 mrg %%BeginResource: CMap (TeX-OT1IT-0) 2024 1.1 mrg %%Title: (TeX-OT1IT-0 TeX OT1IT 0) 2025 1.1 mrg %%Version: 1.000 2026 1.1 mrg %%EndComments 2027 1.1 mrg /CIDInit /ProcSet findresource begin 2028 1.1 mrg 12 dict begin 2029 1.1 mrg begincmap 2030 1.1 mrg /CIDSystemInfo 2031 1.1 mrg << /Registry (TeX) 2032 1.1 mrg /Ordering (OT1IT) 2033 1.1 mrg /Supplement 0 2034 1.1 mrg >> def 2035 1.1 mrg /CMapName /TeX-OT1IT-0 def 2036 1.1 mrg /CMapType 2 def 2037 1.1 mrg 1 begincodespacerange 2038 1.1 mrg <00> <7F> 2039 1.1 mrg endcodespacerange 2040 1.1 mrg 8 beginbfrange 2041 1.1 mrg <00> <01> <0393> 2042 1.1 mrg <09> <0A> <03A8> 2043 1.1 mrg <25> <26> <0025> 2044 1.1 mrg <28> <3B> <0028> 2045 1.1 mrg <3F> <5B> <003F> 2046 1.1 mrg <5D> <5E> <005D> 2047 1.1 mrg <61> <7A> <0061> 2048 1.1 mrg <7B> <7C> <2013> 2049 1.1 mrg endbfrange 2050 1.1 mrg 42 beginbfchar 2051 1.1 mrg <02> <0398> 2052 1.1 mrg <03> <039B> 2053 1.1 mrg <04> <039E> 2054 1.1 mrg <05> <03A0> 2055 1.1 mrg <06> <03A3> 2056 1.1 mrg <07> <03D2> 2057 1.1 mrg <08> <03A6> 2058 1.1 mrg <0B> <00660066> 2059 1.1 mrg <0C> <00660069> 2060 1.1 mrg <0D> <0066006C> 2061 1.1 mrg <0E> <006600660069> 2062 1.1 mrg <0F> <00660066006C> 2063 1.1 mrg <10> <0131> 2064 1.1 mrg <11> <0237> 2065 1.1 mrg <12> <0060> 2066 1.1 mrg <13> <00B4> 2067 1.1 mrg <14> <02C7> 2068 1.1 mrg <15> <02D8> 2069 1.1 mrg <16> <00AF> 2070 1.1 mrg <17> <02DA> 2071 1.1 mrg <18> <00B8> 2072 1.1 mrg <19> <00DF> 2073 1.1 mrg <1A> <00E6> 2074 1.1 mrg <1B> <0153> 2075 1.1 mrg <1C> <00F8> 2076 1.1 mrg <1D> <00C6> 2077 1.1 mrg <1E> <0152> 2078 1.1 mrg <1F> <00D8> 2079 1.1 mrg <21> <0021> 2080 1.1 mrg <22> <201D> 2081 1.1 mrg <23> <0023> 2082 1.1 mrg <24> <00A3> 2083 1.1 mrg <27> <2019> 2084 1.1 mrg <3C> <00A1> 2085 1.1 mrg <3D> <003D> 2086 1.1 mrg <3E> <00BF> 2087 1.1 mrg <5C> <201C> 2088 1.1 mrg <5F> <02D9> 2089 1.1 mrg <60> <2018> 2090 1.1 mrg <7D> <02DD> 2091 1.1 mrg <7E> <007E> 2092 1.1 mrg <7F> <00A8> 2093 1.1 mrg endbfchar 2094 1.1 mrg endcmap 2095 1.1 mrg CMapName currentdict /CMap defineresource pop 2096 1.1 mrg end 2097 1.1 mrg end 2098 1.1 mrg %%EndResource 2099 1.1 mrg %%EOF 2100 1.1 mrg }\endgroup 2101 1.1 mrg \expandafter\edef\csname cmapOT1IT\endcsname#1{% 2102 1.1 mrg \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% 2103 1.1 mrg }% 2104 1.1 mrg % 2105 1.1 mrg % \cmapOT1TT 2106 1.1 mrg \begingroup 2107 1.1 mrg \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. 2108 1.1 mrg \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap 2109 1.1 mrg %%DocumentNeededResources: ProcSet (CIDInit) 2110 1.1 mrg %%IncludeResource: ProcSet (CIDInit) 2111 1.1 mrg %%BeginResource: CMap (TeX-OT1TT-0) 2112 1.1 mrg %%Title: (TeX-OT1TT-0 TeX OT1TT 0) 2113 1.1 mrg %%Version: 1.000 2114 1.1 mrg %%EndComments 2115 1.1 mrg /CIDInit /ProcSet findresource begin 2116 1.1 mrg 12 dict begin 2117 1.1 mrg begincmap 2118 1.1 mrg /CIDSystemInfo 2119 1.1 mrg << /Registry (TeX) 2120 1.1 mrg /Ordering (OT1TT) 2121 1.1 mrg /Supplement 0 2122 1.1 mrg >> def 2123 1.1 mrg /CMapName /TeX-OT1TT-0 def 2124 1.1 mrg /CMapType 2 def 2125 1.1 mrg 1 begincodespacerange 2126 1.1 mrg <00> <7F> 2127 1.1 mrg endcodespacerange 2128 1.1 mrg 5 beginbfrange 2129 1.1 mrg <00> <01> <0393> 2130 1.1 mrg <09> <0A> <03A8> 2131 1.1 mrg <21> <26> <0021> 2132 1.1 mrg <28> <5F> <0028> 2133 1.1 mrg <61> <7E> <0061> 2134 1.1 mrg endbfrange 2135 1.1 mrg 32 beginbfchar 2136 1.1 mrg <02> <0398> 2137 1.1 mrg <03> <039B> 2138 1.1 mrg <04> <039E> 2139 1.1 mrg <05> <03A0> 2140 1.1 mrg <06> <03A3> 2141 1.1 mrg <07> <03D2> 2142 1.1 mrg <08> <03A6> 2143 1.1 mrg <0B> <2191> 2144 1.1 mrg <0C> <2193> 2145 1.1 mrg <0D> <0027> 2146 1.1 mrg <0E> <00A1> 2147 1.1 mrg <0F> <00BF> 2148 1.1 mrg <10> <0131> 2149 1.1 mrg <11> <0237> 2150 1.1 mrg <12> <0060> 2151 1.1 mrg <13> <00B4> 2152 1.1 mrg <14> <02C7> 2153 1.1 mrg <15> <02D8> 2154 1.1 mrg <16> <00AF> 2155 1.1 mrg <17> <02DA> 2156 1.1 mrg <18> <00B8> 2157 1.1 mrg <19> <00DF> 2158 1.1 mrg <1A> <00E6> 2159 1.1 mrg <1B> <0153> 2160 1.1 mrg <1C> <00F8> 2161 1.1 mrg <1D> <00C6> 2162 1.1 mrg <1E> <0152> 2163 1.1 mrg <1F> <00D8> 2164 1.1 mrg <20> <2423> 2165 1.1 mrg <27> <2019> 2166 1.1 mrg <60> <2018> 2167 1.1 mrg <7F> <00A8> 2168 1.1 mrg endbfchar 2169 1.1 mrg endcmap 2170 1.1 mrg CMapName currentdict /CMap defineresource pop 2171 1.1 mrg end 2172 1.1 mrg end 2173 1.1 mrg %%EndResource 2174 1.1 mrg %%EOF 2175 1.1 mrg }\endgroup 2176 1.1 mrg \expandafter\edef\csname cmapOT1TT\endcsname#1{% 2177 1.1 mrg \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% 2178 1.1 mrg }% 2179 1.1 mrg \fi\fi 2180 1.1 mrg 2181 1.1 mrg 2182 1.1 mrg % Set the font macro #1 to the font named \fontprefix#2. 2183 1.1 mrg % #3 is the font's design size, #4 is a scale factor, #5 is the CMap 2184 1.1 mrg % encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit). 2185 1.1 mrg % Example: 2186 1.1 mrg % #1 = \textrm 2187 1.1 mrg % #2 = \rmshape 2188 1.1 mrg % #3 = 10 2189 1.1 mrg % #4 = \mainmagstep 2190 1.1 mrg % #5 = OT1 2191 1.1 mrg % 2192 1.1 mrg \def\setfont#1#2#3#4#5{% 2193 1.1 mrg \font#1=\fontprefix#2#3 scaled #4 2194 1.1 mrg \csname cmap#5\endcsname#1% 2195 1.1 mrg } 2196 1.1 mrg % This is what gets called when #5 of \setfont is empty. 2197 1.1 mrg \let\cmap\gobble 2198 1.1 mrg % 2199 1.1 mrg % (end of cmaps) 2200 1.1 mrg 2201 1.1 mrg % Use cm as the default font prefix. 2202 1.1 mrg % To specify the font prefix, you must define \fontprefix 2203 1.1 mrg % before you read in texinfo.tex. 2204 1.1 mrg \ifx\fontprefix\thisisundefined 2205 1.1 mrg \def\fontprefix{cm} 2206 1.1 mrg \fi 2207 1.1 mrg % Support font families that don't use the same naming scheme as CM. 2208 1.1 mrg \def\rmshape{r} 2209 1.1 mrg \def\rmbshape{bx} % where the normal face is bold 2210 1.1 mrg \def\bfshape{b} 2211 1.1 mrg \def\bxshape{bx} 2212 1.1 mrg \def\ttshape{tt} 2213 1.1 mrg \def\ttbshape{tt} 2214 1.1 mrg \def\ttslshape{sltt} 2215 1.1 mrg \def\itshape{ti} 2216 1.1 mrg \def\itbshape{bxti} 2217 1.1 mrg \def\slshape{sl} 2218 1.1 mrg \def\slbshape{bxsl} 2219 1.1 mrg \def\sfshape{ss} 2220 1.1 mrg \def\sfbshape{ss} 2221 1.1 mrg \def\scshape{csc} 2222 1.1 mrg \def\scbshape{csc} 2223 1.1 mrg 2224 1.1 mrg % Definitions for a main text size of 11pt. (The default in Texinfo.) 2225 1.1 mrg % 2226 1.1 mrg \def\definetextfontsizexi{% 2227 1.1 mrg % Text fonts (11.2pt, magstep1). 2228 1.1 mrg \def\textnominalsize{11pt} 2229 1.1 mrg \edef\mainmagstep{\magstephalf} 2230 1.1 mrg \setfont\textrm\rmshape{10}{\mainmagstep}{OT1} 2231 1.1 mrg \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} 2232 1.1 mrg \setfont\textbf\bfshape{10}{\mainmagstep}{OT1} 2233 1.1 mrg \setfont\textit\itshape{10}{\mainmagstep}{OT1IT} 2234 1.1 mrg \setfont\textsl\slshape{10}{\mainmagstep}{OT1} 2235 1.1 mrg \setfont\textsf\sfshape{10}{\mainmagstep}{OT1} 2236 1.1 mrg \setfont\textsc\scshape{10}{\mainmagstep}{OT1} 2237 1.1 mrg \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} 2238 1.1 mrg \font\texti=cmmi10 scaled \mainmagstep 2239 1.1 mrg \font\textsy=cmsy10 scaled \mainmagstep 2240 1.1 mrg \def\textecsize{1095} 2241 1.1 mrg 2242 1.1 mrg % A few fonts for @defun names and args. 2243 1.1 mrg \setfont\defbf\bfshape{10}{\magstep1}{OT1} 2244 1.1 mrg \setfont\deftt\ttshape{10}{\magstep1}{OT1TT} 2245 1.1 mrg \setfont\defsl\slshape{10}{\magstep1}{OT1} 2246 1.1 mrg \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} 2247 1.1 mrg \def\df{\let\ttfont=\deftt \let\bffont = \defbf 2248 1.1 mrg \let\ttslfont=\defttsl \let\slfont=\defsl \bf} 2249 1.1 mrg 2250 1.1 mrg % Fonts for indices, footnotes, small examples (9pt). 2251 1.1 mrg \def\smallnominalsize{9pt} 2252 1.1 mrg \setfont\smallrm\rmshape{9}{1000}{OT1} 2253 1.1 mrg \setfont\smalltt\ttshape{9}{1000}{OT1TT} 2254 1.1 mrg \setfont\smallbf\bfshape{10}{900}{OT1} 2255 1.1 mrg \setfont\smallit\itshape{9}{1000}{OT1IT} 2256 1.1 mrg \setfont\smallsl\slshape{9}{1000}{OT1} 2257 1.1 mrg \setfont\smallsf\sfshape{9}{1000}{OT1} 2258 1.1 mrg \setfont\smallsc\scshape{10}{900}{OT1} 2259 1.1 mrg \setfont\smallttsl\ttslshape{10}{900}{OT1TT} 2260 1.1 mrg \font\smalli=cmmi9 2261 1.1 mrg \font\smallsy=cmsy9 2262 1.1 mrg \def\smallecsize{0900} 2263 1.1 mrg 2264 1.1 mrg % Fonts for small examples (8pt). 2265 1.1 mrg \def\smallernominalsize{8pt} 2266 1.1 mrg \setfont\smallerrm\rmshape{8}{1000}{OT1} 2267 1.1 mrg \setfont\smallertt\ttshape{8}{1000}{OT1TT} 2268 1.1 mrg \setfont\smallerbf\bfshape{10}{800}{OT1} 2269 1.1 mrg \setfont\smallerit\itshape{8}{1000}{OT1IT} 2270 1.1 mrg \setfont\smallersl\slshape{8}{1000}{OT1} 2271 1.1 mrg \setfont\smallersf\sfshape{8}{1000}{OT1} 2272 1.1 mrg \setfont\smallersc\scshape{10}{800}{OT1} 2273 1.1 mrg \setfont\smallerttsl\ttslshape{10}{800}{OT1TT} 2274 1.1 mrg \font\smalleri=cmmi8 2275 1.1 mrg \font\smallersy=cmsy8 2276 1.1 mrg \def\smallerecsize{0800} 2277 1.1 mrg 2278 1.1 mrg % Fonts for math mode superscripts (7pt). 2279 1.1 mrg \def\sevennominalsize{7pt} 2280 1.1 mrg \setfont\sevenrm\rmshape{7}{1000}{OT1} 2281 1.1 mrg \setfont\seventt\ttshape{10}{700}{OT1TT} 2282 1.1 mrg \setfont\sevenbf\bfshape{10}{700}{OT1} 2283 1.1 mrg \setfont\sevenit\itshape{7}{1000}{OT1IT} 2284 1.1 mrg \setfont\sevensl\slshape{10}{700}{OT1} 2285 1.1 mrg \setfont\sevensf\sfshape{10}{700}{OT1} 2286 1.1 mrg \setfont\sevensc\scshape{10}{700}{OT1} 2287 1.1 mrg \setfont\seventtsl\ttslshape{10}{700}{OT1TT} 2288 1.1 mrg \font\seveni=cmmi7 2289 1.1 mrg \font\sevensy=cmsy7 2290 1.1 mrg \def\sevenecsize{0700} 2291 1.1 mrg 2292 1.1 mrg % Fonts for title page (20.4pt): 2293 1.1 mrg \def\titlenominalsize{20pt} 2294 1.1 mrg \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} 2295 1.1 mrg \setfont\titleit\itbshape{10}{\magstep4}{OT1IT} 2296 1.1 mrg \setfont\titlesl\slbshape{10}{\magstep4}{OT1} 2297 1.1 mrg \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} 2298 1.1 mrg \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} 2299 1.1 mrg \setfont\titlesf\sfbshape{17}{\magstep1}{OT1} 2300 1.1 mrg \let\titlebf=\titlerm 2301 1.1 mrg \setfont\titlesc\scbshape{10}{\magstep4}{OT1} 2302 1.1 mrg \font\titlei=cmmi12 scaled \magstep3 2303 1.1 mrg \font\titlesy=cmsy10 scaled \magstep4 2304 1.1 mrg \def\titleecsize{2074} 2305 1.1 mrg 2306 1.1 mrg % Chapter (and unnumbered) fonts (17.28pt). 2307 1.1 mrg \def\chapnominalsize{17pt} 2308 1.1 mrg \setfont\chaprm\rmbshape{12}{\magstep2}{OT1} 2309 1.1 mrg \setfont\chapit\itbshape{10}{\magstep3}{OT1IT} 2310 1.1 mrg \setfont\chapsl\slbshape{10}{\magstep3}{OT1} 2311 1.1 mrg \setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT} 2312 1.1 mrg \setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT} 2313 1.1 mrg \setfont\chapsf\sfbshape{17}{1000}{OT1} 2314 1.1 mrg \let\chapbf=\chaprm 2315 1.1 mrg \setfont\chapsc\scbshape{10}{\magstep3}{OT1} 2316 1.1 mrg \font\chapi=cmmi12 scaled \magstep2 2317 1.1 mrg \font\chapsy=cmsy10 scaled \magstep3 2318 1.1 mrg \def\chapecsize{1728} 2319 1.1 mrg 2320 1.1 mrg % Section fonts (14.4pt). 2321 1.1 mrg \def\secnominalsize{14pt} 2322 1.1 mrg \setfont\secrm\rmbshape{12}{\magstep1}{OT1} 2323 1.1 mrg \setfont\secrmnotbold\rmshape{12}{\magstep1}{OT1} 2324 1.1 mrg \setfont\secit\itbshape{10}{\magstep2}{OT1IT} 2325 1.1 mrg \setfont\secsl\slbshape{10}{\magstep2}{OT1} 2326 1.1 mrg \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT} 2327 1.1 mrg \setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT} 2328 1.1 mrg \setfont\secsf\sfbshape{12}{\magstep1}{OT1} 2329 1.1 mrg \let\secbf\secrm 2330 1.1 mrg \setfont\secsc\scbshape{10}{\magstep2}{OT1} 2331 1.1 mrg \font\seci=cmmi12 scaled \magstep1 2332 1.1 mrg \font\secsy=cmsy10 scaled \magstep2 2333 1.1 mrg \def\sececsize{1440} 2334 1.1 mrg 2335 1.1 mrg % Subsection fonts (13.15pt). 2336 1.1 mrg \def\ssecnominalsize{13pt} 2337 1.1 mrg \setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1} 2338 1.1 mrg \setfont\ssecit\itbshape{10}{1315}{OT1IT} 2339 1.1 mrg \setfont\ssecsl\slbshape{10}{1315}{OT1} 2340 1.1 mrg \setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT} 2341 1.1 mrg \setfont\ssecttsl\ttslshape{10}{1315}{OT1TT} 2342 1.1 mrg \setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1} 2343 1.1 mrg \let\ssecbf\ssecrm 2344 1.1 mrg \setfont\ssecsc\scbshape{10}{1315}{OT1} 2345 1.1 mrg \font\sseci=cmmi12 scaled \magstephalf 2346 1.1 mrg \font\ssecsy=cmsy10 scaled 1315 2347 1.1 mrg \def\ssececsize{1200} 2348 1.1 mrg 2349 1.1 mrg % Reduced fonts for @acronym in text (10pt). 2350 1.1 mrg \def\reducednominalsize{10pt} 2351 1.1 mrg \setfont\reducedrm\rmshape{10}{1000}{OT1} 2352 1.1 mrg \setfont\reducedtt\ttshape{10}{1000}{OT1TT} 2353 1.1 mrg \setfont\reducedbf\bfshape{10}{1000}{OT1} 2354 1.1 mrg \setfont\reducedit\itshape{10}{1000}{OT1IT} 2355 1.1 mrg \setfont\reducedsl\slshape{10}{1000}{OT1} 2356 1.1 mrg \setfont\reducedsf\sfshape{10}{1000}{OT1} 2357 1.1 mrg \setfont\reducedsc\scshape{10}{1000}{OT1} 2358 1.1 mrg \setfont\reducedttsl\ttslshape{10}{1000}{OT1TT} 2359 1.1 mrg \font\reducedi=cmmi10 2360 1.1 mrg \font\reducedsy=cmsy10 2361 1.1 mrg \def\reducedecsize{1000} 2362 1.1 mrg 2363 1.1 mrg \textleading = 13.2pt % line spacing for 11pt CM 2364 1.1 mrg \textfonts % reset the current fonts 2365 1.1 mrg \rm 2366 1.1 mrg } % end of 11pt text font size definitions, \definetextfontsizexi 2367 1.1 mrg 2368 1.1 mrg 2369 1.1 mrg % Definitions to make the main text be 10pt Computer Modern, with 2370 1.1 mrg % section, chapter, etc., sizes following suit. This is for the GNU 2371 1.1 mrg % Press printing of the Emacs 22 manual. Maybe other manuals in the 2372 1.1 mrg % future. Used with @smallbook, which sets the leading to 12pt. 2373 1.1 mrg % 2374 1.1 mrg \def\definetextfontsizex{% 2375 1.1 mrg % Text fonts (10pt). 2376 1.1 mrg \def\textnominalsize{10pt} 2377 1.1 mrg \edef\mainmagstep{1000} 2378 1.1 mrg \setfont\textrm\rmshape{10}{\mainmagstep}{OT1} 2379 1.1 mrg \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} 2380 1.1 mrg \setfont\textbf\bfshape{10}{\mainmagstep}{OT1} 2381 1.1 mrg \setfont\textit\itshape{10}{\mainmagstep}{OT1IT} 2382 1.1 mrg \setfont\textsl\slshape{10}{\mainmagstep}{OT1} 2383 1.1 mrg \setfont\textsf\sfshape{10}{\mainmagstep}{OT1} 2384 1.1 mrg \setfont\textsc\scshape{10}{\mainmagstep}{OT1} 2385 1.1 mrg \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} 2386 1.1 mrg \font\texti=cmmi10 scaled \mainmagstep 2387 1.1 mrg \font\textsy=cmsy10 scaled \mainmagstep 2388 1.1 mrg \def\textecsize{1000} 2389 1.1 mrg 2390 1.1 mrg % A few fonts for @defun names and args. 2391 1.1 mrg \setfont\defbf\bfshape{10}{\magstephalf}{OT1} 2392 1.1 mrg \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} 2393 1.1 mrg \setfont\defsl\slshape{10}{\magstephalf}{OT1} 2394 1.1 mrg \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} 2395 1.1 mrg \def\df{\let\ttfont=\deftt \let\bffont = \defbf 2396 1.1 mrg \let\slfont=\defsl \let\ttslfont=\defttsl \bf} 2397 1.1 mrg 2398 1.1 mrg % Fonts for indices, footnotes, small examples (9pt). 2399 1.1 mrg \def\smallnominalsize{9pt} 2400 1.1 mrg \setfont\smallrm\rmshape{9}{1000}{OT1} 2401 1.1 mrg \setfont\smalltt\ttshape{9}{1000}{OT1TT} 2402 1.1 mrg \setfont\smallbf\bfshape{10}{900}{OT1} 2403 1.1 mrg \setfont\smallit\itshape{9}{1000}{OT1IT} 2404 1.1 mrg \setfont\smallsl\slshape{9}{1000}{OT1} 2405 1.1 mrg \setfont\smallsf\sfshape{9}{1000}{OT1} 2406 1.1 mrg \setfont\smallsc\scshape{10}{900}{OT1} 2407 1.1 mrg \setfont\smallttsl\ttslshape{10}{900}{OT1TT} 2408 1.1 mrg \font\smalli=cmmi9 2409 1.1 mrg \font\smallsy=cmsy9 2410 1.1 mrg \def\smallecsize{0900} 2411 1.1 mrg 2412 1.1 mrg % Fonts for small examples (8pt). 2413 1.1 mrg \def\smallernominalsize{8pt} 2414 1.1 mrg \setfont\smallerrm\rmshape{8}{1000}{OT1} 2415 1.1 mrg \setfont\smallertt\ttshape{8}{1000}{OT1TT} 2416 1.1 mrg \setfont\smallerbf\bfshape{10}{800}{OT1} 2417 1.1 mrg \setfont\smallerit\itshape{8}{1000}{OT1IT} 2418 1.1 mrg \setfont\smallersl\slshape{8}{1000}{OT1} 2419 1.1 mrg \setfont\smallersf\sfshape{8}{1000}{OT1} 2420 1.1 mrg \setfont\smallersc\scshape{10}{800}{OT1} 2421 1.1 mrg \setfont\smallerttsl\ttslshape{10}{800}{OT1TT} 2422 1.1 mrg \font\smalleri=cmmi8 2423 1.1 mrg \font\smallersy=cmsy8 2424 1.1 mrg \def\smallerecsize{0800} 2425 1.1 mrg 2426 1.1 mrg % Fonts for math mode superscripts (7pt). 2427 1.1 mrg \def\sevennominalsize{7pt} 2428 1.1 mrg \setfont\sevenrm\rmshape{7}{1000}{OT1} 2429 1.1 mrg \setfont\seventt\ttshape{10}{700}{OT1TT} 2430 1.1 mrg \setfont\sevenbf\bfshape{10}{700}{OT1} 2431 1.1 mrg \setfont\sevenit\itshape{7}{1000}{OT1IT} 2432 1.1 mrg \setfont\sevensl\slshape{10}{700}{OT1} 2433 1.1 mrg \setfont\sevensf\sfshape{10}{700}{OT1} 2434 1.1 mrg \setfont\sevensc\scshape{10}{700}{OT1} 2435 1.1 mrg \setfont\seventtsl\ttslshape{10}{700}{OT1TT} 2436 1.1 mrg \font\seveni=cmmi7 2437 1.1 mrg \font\sevensy=cmsy7 2438 1.1 mrg \def\sevenecsize{0700} 2439 1.1 mrg 2440 1.1 mrg % Fonts for title page (20.4pt): 2441 1.1 mrg \def\titlenominalsize{20pt} 2442 1.1 mrg \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} 2443 1.1 mrg \setfont\titleit\itbshape{10}{\magstep4}{OT1IT} 2444 1.1 mrg \setfont\titlesl\slbshape{10}{\magstep4}{OT1} 2445 1.1 mrg \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} 2446 1.1 mrg \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} 2447 1.1 mrg \setfont\titlesf\sfbshape{17}{\magstep1}{OT1} 2448 1.1 mrg \let\titlebf=\titlerm 2449 1.1 mrg \setfont\titlesc\scbshape{10}{\magstep4}{OT1} 2450 1.1 mrg \font\titlei=cmmi12 scaled \magstep3 2451 1.1 mrg \font\titlesy=cmsy10 scaled \magstep4 2452 1.1 mrg \def\titleecsize{2074} 2453 1.1 mrg 2454 1.1 mrg % Chapter fonts (14.4pt). 2455 1.1 mrg \def\chapnominalsize{14pt} 2456 1.1 mrg \setfont\chaprm\rmbshape{12}{\magstep1}{OT1} 2457 1.1 mrg \setfont\chapit\itbshape{10}{\magstep2}{OT1IT} 2458 1.1 mrg \setfont\chapsl\slbshape{10}{\magstep2}{OT1} 2459 1.1 mrg \setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT} 2460 1.1 mrg \setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT} 2461 1.1 mrg \setfont\chapsf\sfbshape{12}{\magstep1}{OT1} 2462 1.1 mrg \let\chapbf\chaprm 2463 1.1 mrg \setfont\chapsc\scbshape{10}{\magstep2}{OT1} 2464 1.1 mrg \font\chapi=cmmi12 scaled \magstep1 2465 1.1 mrg \font\chapsy=cmsy10 scaled \magstep2 2466 1.1 mrg \def\chapecsize{1440} 2467 1.1 mrg 2468 1.1 mrg % Section fonts (12pt). 2469 1.1 mrg \def\secnominalsize{12pt} 2470 1.1 mrg \setfont\secrm\rmbshape{12}{1000}{OT1} 2471 1.1 mrg \setfont\secit\itbshape{10}{\magstep1}{OT1IT} 2472 1.1 mrg \setfont\secsl\slbshape{10}{\magstep1}{OT1} 2473 1.1 mrg \setfont\sectt\ttbshape{12}{1000}{OT1TT} 2474 1.1 mrg \setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT} 2475 1.1 mrg \setfont\secsf\sfbshape{12}{1000}{OT1} 2476 1.1 mrg \let\secbf\secrm 2477 1.1 mrg \setfont\secsc\scbshape{10}{\magstep1}{OT1} 2478 1.1 mrg \font\seci=cmmi12 2479 1.1 mrg \font\secsy=cmsy10 scaled \magstep1 2480 1.1 mrg \def\sececsize{1200} 2481 1.1 mrg 2482 1.1 mrg % Subsection fonts (10pt). 2483 1.1 mrg \def\ssecnominalsize{10pt} 2484 1.1 mrg \setfont\ssecrm\rmbshape{10}{1000}{OT1} 2485 1.1 mrg \setfont\ssecit\itbshape{10}{1000}{OT1IT} 2486 1.1 mrg \setfont\ssecsl\slbshape{10}{1000}{OT1} 2487 1.1 mrg \setfont\ssectt\ttbshape{10}{1000}{OT1TT} 2488 1.1 mrg \setfont\ssecttsl\ttslshape{10}{1000}{OT1TT} 2489 1.1 mrg \setfont\ssecsf\sfbshape{10}{1000}{OT1} 2490 1.1 mrg \let\ssecbf\ssecrm 2491 1.1 mrg \setfont\ssecsc\scbshape{10}{1000}{OT1} 2492 1.1 mrg \font\sseci=cmmi10 2493 1.1 mrg \font\ssecsy=cmsy10 2494 1.1 mrg \def\ssececsize{1000} 2495 1.1 mrg 2496 1.1 mrg % Reduced fonts for @acronym in text (9pt). 2497 1.1 mrg \def\reducednominalsize{9pt} 2498 1.1 mrg \setfont\reducedrm\rmshape{9}{1000}{OT1} 2499 1.1 mrg \setfont\reducedtt\ttshape{9}{1000}{OT1TT} 2500 1.1 mrg \setfont\reducedbf\bfshape{10}{900}{OT1} 2501 1.1 mrg \setfont\reducedit\itshape{9}{1000}{OT1IT} 2502 1.1 mrg \setfont\reducedsl\slshape{9}{1000}{OT1} 2503 1.1 mrg \setfont\reducedsf\sfshape{9}{1000}{OT1} 2504 1.1 mrg \setfont\reducedsc\scshape{10}{900}{OT1} 2505 1.1 mrg \setfont\reducedttsl\ttslshape{10}{900}{OT1TT} 2506 1.1 mrg \font\reducedi=cmmi9 2507 1.1 mrg \font\reducedsy=cmsy9 2508 1.1 mrg \def\reducedecsize{0900} 2509 1.1 mrg 2510 1.1 mrg \divide\parskip by 2 % reduce space between paragraphs 2511 1.1 mrg \textleading = 12pt % line spacing for 10pt CM 2512 1.1 mrg \textfonts % reset the current fonts 2513 1.1 mrg \rm 2514 1.1 mrg } % end of 10pt text font size definitions, \definetextfontsizex 2515 1.1 mrg 2516 1.1 mrg % Fonts for short table of contents. 2517 1.1 mrg \setfont\shortcontrm\rmshape{12}{1000}{OT1} 2518 1.1 mrg \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 2519 1.1 mrg \setfont\shortcontsl\slshape{12}{1000}{OT1} 2520 1.1 mrg \setfont\shortconttt\ttshape{12}{1000}{OT1TT} 2521 1.1 mrg 2522 1.1 mrg 2523 1.1 mrg % We provide the user-level command 2524 1.1 mrg % @fonttextsize 10 2525 1.1 mrg % (or 11) to redefine the text font size. pt is assumed. 2526 1.1 mrg % 2527 1.1 mrg \def\xiword{11} 2528 1.1 mrg \def\xword{10} 2529 1.1 mrg \def\xwordpt{10pt} 2530 1.1 mrg % 2531 1.1 mrg \parseargdef\fonttextsize{% 2532 1.1 mrg \def\textsizearg{#1}% 2533 1.1 mrg %\wlog{doing @fonttextsize \textsizearg}% 2534 1.1 mrg % 2535 1.1 mrg % Set \globaldefs so that documents can use this inside @tex, since 2536 1.1 mrg % makeinfo 4.8 does not support it, but we need it nonetheless. 2537 1.1 mrg % 2538 1.1 mrg \begingroup \globaldefs=1 2539 1.1 mrg \ifx\textsizearg\xword \definetextfontsizex 2540 1.1 mrg \else \ifx\textsizearg\xiword \definetextfontsizexi 2541 1.1 mrg \else 2542 1.1 mrg \errhelp=\EMsimple 2543 1.1 mrg \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'} 2544 1.1 mrg \fi\fi 2545 1.1 mrg \endgroup 2546 1.1 mrg } 2547 1.1 mrg 2548 1.1 mrg % 2549 1.1 mrg % Change the current font style to #1, remembering it in \curfontstyle. 2550 1.1 mrg % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in 2551 1.1 mrg % italics, not bold italics. 2552 1.1 mrg % 2553 1.1 mrg \def\setfontstyle#1{% 2554 1.1 mrg \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. 2555 1.1 mrg \csname #1font\endcsname % change the current font 2556 1.1 mrg } 2557 1.1 mrg 2558 1.1 mrg \def\rm{\fam=0 \setfontstyle{rm}} 2559 1.1 mrg \def\it{\fam=\itfam \setfontstyle{it}} 2560 1.1 mrg \def\sl{\fam=\slfam \setfontstyle{sl}} 2561 1.1.1.2 mrg \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} 2562 1.1 mrg \def\tt{\fam=\ttfam \setfontstyle{tt}}\def\ttstylename{tt} 2563 1.1 mrg 2564 1.1 mrg % Texinfo sort of supports the sans serif font style, which plain TeX does not. 2565 1.1 mrg % So we set up a \sf. 2566 1.1 mrg \newfam\sffam 2567 1.1 mrg \def\sf{\fam=\sffam \setfontstyle{sf}} 2568 1.1 mrg 2569 1.1 mrg % We don't need math for this font style. 2570 1.1 mrg \def\ttsl{\setfontstyle{ttsl}} 2571 1.1 mrg 2572 1.1 mrg 2573 1.1 mrg % In order for the font changes to affect most math symbols and letters, 2574 1.1 mrg % we have to define the \textfont of the standard families. 2575 1.1 mrg % We don't bother to reset \scriptscriptfont; awaiting user need. 2576 1.1 mrg % 2577 1.1 mrg \def\resetmathfonts{% 2578 1.1 mrg \textfont0=\rmfont \textfont1=\ifont \textfont2=\syfont 2579 1.1 mrg \textfont\itfam=\itfont \textfont\slfam=\slfont \textfont\bffam=\bffont 2580 1.1 mrg \textfont\ttfam=\ttfont \textfont\sffam=\sffont 2581 1.1 mrg % 2582 1.1 mrg % Fonts for superscript. Note that the 7pt fonts are used regardless 2583 1.1 mrg % of the current font size. 2584 1.1 mrg \scriptfont0=\sevenrm \scriptfont1=\seveni \scriptfont2=\sevensy 2585 1.1 mrg \scriptfont\itfam=\sevenit \scriptfont\slfam=\sevensl 2586 1.1 mrg \scriptfont\bffam=\sevenbf \scriptfont\ttfam=\seventt 2587 1.1 mrg \scriptfont\sffam=\sevensf 2588 1.1 mrg } 2589 1.1 mrg 2590 1.1 mrg % 2591 1.1 mrg 2592 1.1 mrg % The font-changing commands (all called \...fonts) redefine the meanings 2593 1.1 mrg % of \STYLEfont, instead of just \STYLE. We do this because \STYLE needs 2594 1.1 mrg % to also set the current \fam for math mode. Our \STYLE (e.g., \rm) 2595 1.1 mrg % commands hardwire \STYLEfont to set the current font. 2596 1.1 mrg % 2597 1.1 mrg % The fonts used for \ifont are for "math italics" (\itfont is for italics 2598 1.1 mrg % in regular text). \syfont is also used in math mode only. 2599 1.1 mrg % 2600 1.1 mrg % Each font-changing command also sets the names \lsize (one size lower) 2601 1.1 mrg % and \lllsize (three sizes lower). These relative commands are used 2602 1.1 mrg % in, e.g., the LaTeX logo and acronyms. 2603 1.1 mrg % 2604 1.1 mrg % This all needs generalizing, badly. 2605 1.1 mrg % 2606 1.1 mrg 2607 1.1 mrg \def\assignfonts#1{% 2608 1.1 mrg \expandafter\let\expandafter\rmfont\csname #1rm\endcsname 2609 1.1 mrg \expandafter\let\expandafter\itfont\csname #1it\endcsname 2610 1.1 mrg \expandafter\let\expandafter\slfont\csname #1sl\endcsname 2611 1.1 mrg \expandafter\let\expandafter\bffont\csname #1bf\endcsname 2612 1.1 mrg \expandafter\let\expandafter\ttfont\csname #1tt\endcsname 2613 1.1 mrg \expandafter\let\expandafter\smallcaps\csname #1sc\endcsname 2614 1.1 mrg \expandafter\let\expandafter\sffont \csname #1sf\endcsname 2615 1.1 mrg \expandafter\let\expandafter\ifont \csname #1i\endcsname 2616 1.1 mrg \expandafter\let\expandafter\syfont \csname #1sy\endcsname 2617 1.1 mrg \expandafter\let\expandafter\ttslfont\csname #1ttsl\endcsname 2618 1.1 mrg } 2619 1.1 mrg 2620 1.1 mrg \newif\ifrmisbold 2621 1.1 mrg 2622 1.1 mrg % Select smaller font size with the current style. Used to change font size 2623 1.1 mrg % in, e.g., the LaTeX logo and acronyms. If we are using bold fonts for 2624 1.1 mrg % normal roman text, also use bold fonts for roman text in the smaller size. 2625 1.1 mrg \def\switchtolllsize{% 2626 1.1 mrg \expandafter\assignfonts\expandafter{\lllsize}% 2627 1.1 mrg \ifrmisbold 2628 1.1 mrg \let\rmfont\bffont 2629 1.1 mrg \fi 2630 1.1 mrg \csname\curfontstyle\endcsname 2631 1.1 mrg }% 2632 1.1 mrg 2633 1.1 mrg \def\switchtolsize{% 2634 1.1 mrg \expandafter\assignfonts\expandafter{\lsize}% 2635 1.1 mrg \ifrmisbold 2636 1.1 mrg \let\rmfont\bffont 2637 1.1 mrg \fi 2638 1.1 mrg \csname\curfontstyle\endcsname 2639 1.1 mrg }% 2640 1.1 mrg 2641 1.1 mrg \def\definefontsetatsize#1#2#3#4#5{% 2642 1.1 mrg \expandafter\def\csname #1fonts\endcsname{% 2643 1.1 mrg \def\curfontsize{#1}% 2644 1.1 mrg \def\lsize{#2}\def\lllsize{#3}% 2645 1.1 mrg \csname rmisbold#5\endcsname 2646 1.1 mrg \assignfonts{#1}% 2647 1.1 mrg \resetmathfonts 2648 1.1 mrg \setleading{#4}% 2649 1.1 mrg }} 2650 1.1 mrg 2651 1.1 mrg \definefontsetatsize{text} {reduced}{smaller}{\textleading}{false} 2652 1.1 mrg \definefontsetatsize{title} {chap} {subsec} {27pt} {true} 2653 1.1 mrg \definefontsetatsize{chap} {sec} {text} {19pt} {true} 2654 1.1 mrg \definefontsetatsize{sec} {subsec} {reduced}{17pt} {true} 2655 1.1 mrg \definefontsetatsize{ssec} {text} {small} {15pt} {true} 2656 1.1 mrg \definefontsetatsize{reduced}{small} {smaller}{10.5pt}{false} 2657 1.1 mrg \definefontsetatsize{small} {smaller}{smaller}{10.5pt}{false} 2658 1.1 mrg \definefontsetatsize{smaller}{smaller}{smaller}{9.5pt} {false} 2659 1.1 mrg 2660 1.1 mrg \def\titlefont#1{{\titlefonts\rm #1}} 2661 1.1 mrg \let\subsecfonts = \ssecfonts 2662 1.1 mrg \let\subsubsecfonts = \ssecfonts 2663 1.1 mrg 2664 1.1 mrg % Define these just so they can be easily changed for other fonts. 2665 1.1 mrg \def\angleleft{$\langle$} 2666 1.1 mrg \def\angleright{$\rangle$} 2667 1.1 mrg 2668 1.1 mrg % Set the fonts to use with the @small... environments. 2669 1.1 mrg \let\smallexamplefonts = \smallfonts 2670 1.1 mrg 2671 1.1 mrg % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample 2672 1.1 mrg % can fit this many characters: 2673 1.1 mrg % 8.5x11=86 smallbook=72 a4=90 a5=69 2674 1.1 mrg % If we use \scriptfonts (8pt), then we can fit this many characters: 2675 1.1 mrg % 8.5x11=90+ smallbook=80 a4=90+ a5=77 2676 1.1 mrg % For me, subjectively, the few extra characters that fit aren't worth 2677 1.1 mrg % the additional smallness of 8pt. So I'm making the default 9pt. 2678 1.1 mrg % 2679 1.1 mrg % By the way, for comparison, here's what fits with @example (10pt): 2680 1.1 mrg % 8.5x11=71 smallbook=60 a4=75 a5=58 2681 1.1 mrg % --karl, 24jan03. 2682 1.1 mrg 2683 1.1 mrg % Set up the default fonts, so we can use them for creating boxes. 2684 1.1 mrg % 2685 1.1 mrg \definetextfontsizexi 2686 1.1 mrg 2687 1.1 mrg 2688 1.1 mrg % Check if we are currently using a typewriter font. Since all the 2689 1.1 mrg % Computer Modern typewriter fonts have zero interword stretch (and 2690 1.1 mrg % shrink), and it is reasonable to expect all typewriter fonts to have 2691 1.1 mrg % this property, we can check that font parameter. 2692 1.1 mrg % 2693 1.1 mrg \def\ifmonospace{\ifdim\fontdimen3\font=0pt } 2694 1.1 mrg 2695 1.1 mrg { 2696 1.1 mrg \catcode`\'=\active 2697 1.1 mrg \catcode`\`=\active 2698 1.1.1.2 mrg 2699 1.1.1.2 mrg \gdef\setcodequotes{\let`\codequoteleft \let'\codequoteright} 2700 1.1 mrg \gdef\setregularquotes{\let`\lq \let'\rq} 2701 1.1 mrg } 2702 1.1 mrg 2703 1.1 mrg % Allow an option to not use regular directed right quote/apostrophe 2704 1.1 mrg % (char 0x27), but instead the undirected quote from cmtt (char 0x0d). 2705 1.1 mrg % The undirected quote is ugly, so don't make it the default, but it 2706 1.1 mrg % works for pasting with more pdf viewers (at least evince), the 2707 1.1 mrg % lilypond developers report. xpdf does work with the regular 0x27. 2708 1.1 mrg % 2709 1.1 mrg \def\codequoteright{% 2710 1.1 mrg \ifmonospace 2711 1.1 mrg \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax 2712 1.1 mrg \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax 2713 1.1 mrg '% 2714 1.1 mrg \else \char'15 \fi 2715 1.1 mrg \else \char'15 \fi 2716 1.1 mrg \else 2717 1.1 mrg '% 2718 1.1 mrg \fi 2719 1.1 mrg } 2720 1.1 mrg % 2721 1.1 mrg % and a similar option for the left quote char vs. a grave accent. 2722 1.1 mrg % Modern fonts display ASCII 0x60 as a grave accent, so some people like 2723 1.1 mrg % the code environments to do likewise. 2724 1.1 mrg % 2725 1.1 mrg \def\codequoteleft{% 2726 1.1 mrg \ifmonospace 2727 1.1 mrg \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax 2728 1.1 mrg \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax 2729 1.1 mrg % [Knuth] pp. 380,381,391 2730 1.1 mrg % \relax disables Spanish ligatures ?` and !` of \tt font. 2731 1.1 mrg \relax`% 2732 1.1 mrg \else \char'22 \fi 2733 1.1 mrg \else \char'22 \fi 2734 1.1 mrg \else 2735 1.1 mrg \relax`% 2736 1.1 mrg \fi 2737 1.1 mrg } 2738 1.1 mrg 2739 1.1 mrg % Commands to set the quote options. 2740 1.1 mrg % 2741 1.1 mrg \parseargdef\codequoteundirected{% 2742 1.1 mrg \def\temp{#1}% 2743 1.1 mrg \ifx\temp\onword 2744 1.1 mrg \expandafter\let\csname SETtxicodequoteundirected\endcsname 2745 1.1 mrg = t% 2746 1.1 mrg \else\ifx\temp\offword 2747 1.1 mrg \expandafter\let\csname SETtxicodequoteundirected\endcsname 2748 1.1 mrg = \relax 2749 1.1 mrg \else 2750 1.1 mrg \errhelp = \EMsimple 2751 1.1 mrg \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}% 2752 1.1 mrg \fi\fi 2753 1.1 mrg } 2754 1.1 mrg % 2755 1.1 mrg \parseargdef\codequotebacktick{% 2756 1.1 mrg \def\temp{#1}% 2757 1.1 mrg \ifx\temp\onword 2758 1.1 mrg \expandafter\let\csname SETtxicodequotebacktick\endcsname 2759 1.1 mrg = t% 2760 1.1 mrg \else\ifx\temp\offword 2761 1.1 mrg \expandafter\let\csname SETtxicodequotebacktick\endcsname 2762 1.1 mrg = \relax 2763 1.1 mrg \else 2764 1.1 mrg \errhelp = \EMsimple 2765 1.1 mrg \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}% 2766 1.1 mrg \fi\fi 2767 1.1 mrg } 2768 1.1 mrg 2769 1.1 mrg % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font. 2770 1.1 mrg \def\noligaturesquoteleft{\relax\lq} 2771 1.1 mrg 2772 1.1 mrg % Count depth in font-changes, for error checks 2773 1.1 mrg \newcount\fontdepth \fontdepth=0 2774 1.1 mrg 2775 1.1 mrg % Font commands. 2776 1.1 mrg 2777 1.1 mrg % #1 is the font command (\sl or \it), #2 is the text to slant. 2778 1.1 mrg % If we are in a monospaced environment, however, 1) always use \ttsl, 2779 1.1 mrg % and 2) do not add an italic correction. 2780 1.1 mrg \def\dosmartslant#1#2{% 2781 1.1 mrg \ifusingtt 2782 1.1 mrg {{\ttsl #2}\let\next=\relax}% 2783 1.1 mrg {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}% 2784 1.1 mrg \next 2785 1.1 mrg } 2786 1.1 mrg \def\smartslanted{\dosmartslant\sl} 2787 1.1 mrg \def\smartitalic{\dosmartslant\it} 2788 1.1 mrg 2789 1.1 mrg % Output an italic correction unless \next (presumed to be the following 2790 1.1 mrg % character) is such as not to need one. 2791 1.1 mrg \def\smartitaliccorrection{% 2792 1.1 mrg \ifx\next,% 2793 1.1 mrg \else\ifx\next-% 2794 1.1 mrg \else\ifx\next.% 2795 1.1 mrg \else\ifx\next\.% 2796 1.1 mrg \else\ifx\next\comma% 2797 1.1 mrg \else\ptexslash 2798 1.1 mrg \fi\fi\fi\fi\fi 2799 1.1 mrg \aftersmartic 2800 1.1 mrg } 2801 1.1 mrg 2802 1.1 mrg % Unconditional use \ttsl, and no ic. @var is set to this for defuns. 2803 1.1 mrg \def\ttslanted#1{{\ttsl #1}} 2804 1.1 mrg 2805 1.1 mrg % @cite is like \smartslanted except unconditionally use \sl. We never want 2806 1.1 mrg % ttsl for book titles, do we? 2807 1.1 mrg \def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection} 2808 1.1 mrg 2809 1.1 mrg \def\aftersmartic{} 2810 1.1 mrg \def\var#1{% 2811 1.1 mrg \let\saveaftersmartic = \aftersmartic 2812 1.1 mrg \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}% 2813 1.1 mrg \smartslanted{#1}% 2814 1.1 mrg } 2815 1.1 mrg 2816 1.1 mrg \let\i=\smartitalic 2817 1.1 mrg \let\slanted=\smartslanted 2818 1.1 mrg \let\dfn=\smartslanted 2819 1.1 mrg \let\emph=\smartitalic 2820 1.1 mrg 2821 1.1 mrg % Explicit font changes: @r, @sc, undocumented @ii. 2822 1.1 mrg \def\r#1{{\rm #1}} % roman font 2823 1.1 mrg \def\sc#1{{\smallcaps#1}} % smallcaps font 2824 1.1 mrg \def\ii#1{{\it #1}} % italic font 2825 1.1 mrg 2826 1.1 mrg % @b, explicit bold. Also @strong. 2827 1.1 mrg \def\b#1{{\bf #1}} 2828 1.1 mrg \let\strong=\b 2829 1.1 mrg 2830 1.1 mrg % @sansserif, explicit sans. 2831 1.1 mrg \def\sansserif#1{{\sf #1}} 2832 1.1 mrg 2833 1.1 mrg % We can't just use \exhyphenpenalty, because that only has effect at 2834 1.1 mrg % the end of a paragraph. Restore normal hyphenation at the end of the 2835 1.1 mrg % group within which \nohyphenation is presumably called. 2836 1.1 mrg % 2837 1.1 mrg \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} 2838 1.1 mrg \def\restorehyphenation{\hyphenchar\font = `- } 2839 1.1 mrg 2840 1.1 mrg % Set sfcode to normal for the chars that usually have another value. 2841 1.1 mrg % Can't use plain's \frenchspacing because it uses the `\x notation, and 2842 1.1 mrg % sometimes \x has an active definition that messes things up. 2843 1.1 mrg % 2844 1.1 mrg \catcode`@=11 2845 1.1 mrg \def\plainfrenchspacing{% 2846 1.1 mrg \sfcode`\.=\@m \sfcode`\?=\@m \sfcode`\!=\@m 2847 1.1 mrg \sfcode`\:=\@m \sfcode`\;=\@m \sfcode`\,=\@m 2848 1.1 mrg \def\endofsentencespacefactor{1000}% for @. and friends 2849 1.1 mrg } 2850 1.1 mrg \def\plainnonfrenchspacing{% 2851 1.1 mrg \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000 2852 1.1 mrg \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250 2853 1.1 mrg \def\endofsentencespacefactor{3000}% for @. and friends 2854 1.1 mrg } 2855 1.1 mrg \catcode`@=\other 2856 1.1 mrg \def\endofsentencespacefactor{3000}% default 2857 1.1 mrg 2858 1.1 mrg % @t, explicit typewriter. 2859 1.1 mrg \def\t#1{% 2860 1.1 mrg {\tt \plainfrenchspacing #1}% 2861 1.1 mrg \null 2862 1.1 mrg } 2863 1.1 mrg 2864 1.1.1.2 mrg % @samp. 2865 1.1 mrg \def\samp#1{{\setcodequotes\lq\tclose{#1}\rq\null}} 2866 1.1 mrg 2867 1.1 mrg % @indicateurl is \samp, that is, with quotes. 2868 1.1 mrg \let\indicateurl=\samp 2869 1.1 mrg 2870 1.1 mrg % @code (and similar) prints in typewriter, but with spaces the same 2871 1.1 mrg % size as normal in the surrounding text, without hyphenation, etc. 2872 1.1 mrg % This is a subroutine for that. 2873 1.1 mrg \def\tclose#1{% 2874 1.1 mrg {% 2875 1.1 mrg % Change normal interword space to be same as for the current font. 2876 1.1 mrg \spaceskip = \fontdimen2\font 2877 1.1 mrg % 2878 1.1 mrg % Switch to typewriter. 2879 1.1 mrg \tt 2880 1.1 mrg % 2881 1.1 mrg % But `\ ' produces the large typewriter interword space. 2882 1.1 mrg \def\ {{\spaceskip = 0pt{} }}% 2883 1.1 mrg % 2884 1.1 mrg % Turn off hyphenation. 2885 1.1 mrg \nohyphenation 2886 1.1 mrg % 2887 1.1 mrg \plainfrenchspacing 2888 1.1 mrg #1% 2889 1.1 mrg }% 2890 1.1 mrg \null % reset spacefactor to 1000 2891 1.1 mrg } 2892 1.1 mrg 2893 1.1 mrg % We *must* turn on hyphenation at `-' and `_' in @code. 2894 1.1 mrg % (But see \codedashfinish below.) 2895 1.1 mrg % Otherwise, it is too hard to avoid overfull hboxes 2896 1.1 mrg % in the Emacs manual, the Library manual, etc. 2897 1.1 mrg % 2898 1.1 mrg % Unfortunately, TeX uses one parameter (\hyphenchar) to control 2899 1.1 mrg % both hyphenation at - and hyphenation within words. 2900 1.1 mrg % We must therefore turn them both off (\tclose does that) 2901 1.1 mrg % and arrange explicitly to hyphenate at a dash. -- rms. 2902 1.1 mrg { 2903 1.1 mrg \catcode`\-=\active \catcode`\_=\active 2904 1.1 mrg \catcode`\'=\active \catcode`\`=\active 2905 1.1 mrg \global\let'=\rq \global\let`=\lq % default definitions 2906 1.1 mrg % 2907 1.1.1.2 mrg \global\def\code{\begingroup 2908 1.1 mrg \setcodequotes 2909 1.1 mrg \catcode\dashChar=\active \catcode\underChar=\active 2910 1.1 mrg \ifallowcodebreaks 2911 1.1 mrg \let-\codedash 2912 1.1 mrg \let_\codeunder 2913 1.1 mrg \else 2914 1.1 mrg \let-\normaldash 2915 1.1 mrg \let_\realunder 2916 1.1 mrg \fi 2917 1.1 mrg % Given -foo (with a single dash), we do not want to allow a break 2918 1.1 mrg % after the hyphen. 2919 1.1 mrg \global\let\codedashprev=\codedash 2920 1.1 mrg % 2921 1.1 mrg \codex 2922 1.1 mrg } 2923 1.1 mrg % 2924 1.1 mrg \gdef\codedash{\futurelet\next\codedashfinish} 2925 1.1 mrg \gdef\codedashfinish{% 2926 1.1 mrg \normaldash % always output the dash character itself. 2927 1.1 mrg % 2928 1.1 mrg % Now, output a discretionary to allow a line break, unless 2929 1.1 mrg % (a) the next character is a -, or 2930 1.1 mrg % (b) the preceding character is a -. 2931 1.1 mrg % E.g., given --posix, we do not want to allow a break after either -. 2932 1.1 mrg % Given --foo-bar, we do want to allow a break between the - and the b. 2933 1.1 mrg \ifx\next\codedash \else 2934 1.1 mrg \ifx\codedashprev\codedash 2935 1.1 mrg \else \discretionary{}{}{}\fi 2936 1.1 mrg \fi 2937 1.1 mrg % we need the space after the = for the case when \next itself is a 2938 1.1 mrg % space token; it would get swallowed otherwise. As in @code{- a}. 2939 1.1 mrg \global\let\codedashprev= \next 2940 1.1 mrg } 2941 1.1 mrg } 2942 1.1 mrg \def\normaldash{-} 2943 1.1 mrg % 2944 1.1 mrg \def\codex #1{\tclose{#1}\endgroup} 2945 1.1 mrg 2946 1.1 mrg \def\codeunder{% 2947 1.1 mrg % this is all so @math{@code{var_name}+1} can work. In math mode, _ 2948 1.1 mrg % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) 2949 1.1 mrg % will therefore expand the active definition of _, which is us 2950 1.1 mrg % (inside @code that is), therefore an endless loop. 2951 1.1 mrg \ifusingtt{\ifmmode 2952 1.1 mrg \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_. 2953 1.1 mrg \else\normalunderscore \fi 2954 1.1 mrg \discretionary{}{}{}}% 2955 1.1 mrg {\_}% 2956 1.1 mrg } 2957 1.1 mrg 2958 1.1 mrg % An additional complication: the above will allow breaks after, e.g., 2959 1.1 mrg % each of the four underscores in __typeof__. This is bad. 2960 1.1 mrg % @allowcodebreaks provides a document-level way to turn breaking at - 2961 1.1 mrg % and _ on and off. 2962 1.1 mrg % 2963 1.1 mrg \newif\ifallowcodebreaks \allowcodebreakstrue 2964 1.1 mrg 2965 1.1 mrg \def\keywordtrue{true} 2966 1.1 mrg \def\keywordfalse{false} 2967 1.1 mrg 2968 1.1 mrg \parseargdef\allowcodebreaks{% 2969 1.1 mrg \def\txiarg{#1}% 2970 1.1 mrg \ifx\txiarg\keywordtrue 2971 1.1 mrg \allowcodebreakstrue 2972 1.1 mrg \else\ifx\txiarg\keywordfalse 2973 1.1 mrg \allowcodebreaksfalse 2974 1.1 mrg \else 2975 1.1 mrg \errhelp = \EMsimple 2976 1.1 mrg \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}% 2977 1.1 mrg \fi\fi 2978 1.1 mrg } 2979 1.1 mrg 2980 1.1 mrg % For @command, @env, @file, @option quotes seem unnecessary, 2981 1.1 mrg % so use \code rather than \samp. 2982 1.1 mrg \let\command=\code 2983 1.1 mrg \let\env=\code 2984 1.1 mrg \let\file=\code 2985 1.1 mrg \let\option=\code 2986 1.1 mrg 2987 1.1 mrg % @uref (abbreviation for `urlref') aka @url takes an optional 2988 1.1 mrg % (comma-separated) second argument specifying the text to display and 2989 1.1 mrg % an optional third arg as text to display instead of (rather than in 2990 1.1 mrg % addition to) the url itself. First (mandatory) arg is the url. 2991 1.1 mrg 2992 1.1 mrg % TeX-only option to allow changing PDF output to show only the second 2993 1.1 mrg % arg (if given), and not the url (which is then just the link target). 2994 1.1 mrg \newif\ifurefurlonlylink 2995 1.1.1.2 mrg 2996 1.1.1.2 mrg % The default \pretolerance setting stops the penalty inserted in 2997 1.1.1.2 mrg % \urefallowbreak being a discouragement to line breaking. Set it to 2998 1.1.1.2 mrg % a negative value for this paragraph only. Hopefully this does not 2999 1.1.1.2 mrg % conflict with redefinitions of \par done elsewhere. 3000 1.1.1.2 mrg \def\nopretolerance{% 3001 1.1.1.2 mrg \pretolerance=-1 3002 1.1.1.2 mrg \def\par{\endgraf\pretolerance=100 \let\par\endgraf}% 3003 1.1.1.2 mrg } 3004 1.1 mrg 3005 1.1.1.2 mrg % The main macro is \urefbreak, which allows breaking at expected 3006 1.1.1.2 mrg % places within the url. 3007 1.1 mrg \def\urefbreak{\nopretolerance \begingroup \urefcatcodes \dourefbreak} 3008 1.1 mrg \let\uref=\urefbreak 3009 1.1 mrg % 3010 1.1 mrg \def\dourefbreak#1{\urefbreakfinish #1,,,\finish} 3011 1.1 mrg \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example 3012 1.1 mrg \unsepspaces 3013 1.1 mrg \pdfurl{#1}% 3014 1.1 mrg \setbox0 = \hbox{\ignorespaces #3}% 3015 1.1 mrg \ifdim\wd0 > 0pt 3016 1.1 mrg \unhbox0 % third arg given, show only that 3017 1.1 mrg \else 3018 1.1 mrg \setbox0 = \hbox{\ignorespaces #2}% look for second arg 3019 1.1 mrg \ifdim\wd0 > 0pt 3020 1.1 mrg \ifpdf 3021 1.1 mrg % For pdfTeX and LuaTeX 3022 1.1 mrg \ifurefurlonlylink 3023 1.1 mrg % PDF plus option to not display url, show just arg 3024 1.1 mrg \unhbox0 3025 1.1 mrg \else 3026 1.1 mrg % PDF, normally display both arg and url for consistency, 3027 1.1 mrg % visibility, if the pdf is eventually used to print, etc. 3028 1.1 mrg \unhbox0\ (\urefcode{#1})% 3029 1.1 mrg \fi 3030 1.1 mrg \else 3031 1.1 mrg \ifx\XeTeXrevision\thisisundefined 3032 1.1 mrg \unhbox0\ (\urefcode{#1})% DVI, always show arg and url 3033 1.1 mrg \else 3034 1.1 mrg % For XeTeX 3035 1.1 mrg \ifurefurlonlylink 3036 1.1 mrg % PDF plus option to not display url, show just arg 3037 1.1 mrg \unhbox0 3038 1.1 mrg \else 3039 1.1 mrg % PDF, normally display both arg and url for consistency, 3040 1.1 mrg % visibility, if the pdf is eventually used to print, etc. 3041 1.1 mrg \unhbox0\ (\urefcode{#1})% 3042 1.1 mrg \fi 3043 1.1 mrg \fi 3044 1.1 mrg \fi 3045 1.1 mrg \else 3046 1.1 mrg \urefcode{#1}% only url given, so show it 3047 1.1 mrg \fi 3048 1.1 mrg \fi 3049 1.1 mrg \endlink 3050 1.1 mrg \endgroup} 3051 1.1 mrg 3052 1.1 mrg % Allow line breaks around only a few characters (only). 3053 1.1 mrg \def\urefcatcodes{% 3054 1.1 mrg \catcode`\&=\active \catcode`\.=\active 3055 1.1 mrg \catcode`\#=\active \catcode`\?=\active 3056 1.1 mrg \catcode`\/=\active 3057 1.1 mrg } 3058 1.1 mrg { 3059 1.1 mrg \urefcatcodes 3060 1.1 mrg % 3061 1.1.1.2 mrg \global\def\urefcode{\begingroup 3062 1.1 mrg \setcodequotes 3063 1.1 mrg \urefcatcodes 3064 1.1 mrg \let&\urefcodeamp 3065 1.1 mrg \let.\urefcodedot 3066 1.1 mrg \let#\urefcodehash 3067 1.1 mrg \let?\urefcodequest 3068 1.1 mrg \let/\urefcodeslash 3069 1.1 mrg \codex 3070 1.1 mrg } 3071 1.1 mrg % 3072 1.1 mrg % By default, they are just regular characters. 3073 1.1 mrg \global\def&{\normalamp} 3074 1.1 mrg \global\def.{\normaldot} 3075 1.1 mrg \global\def#{\normalhash} 3076 1.1 mrg \global\def?{\normalquest} 3077 1.1 mrg \global\def/{\normalslash} 3078 1.1 mrg } 3079 1.1 mrg 3080 1.1 mrg \def\urefcodeamp{\urefprebreak \&\urefpostbreak} 3081 1.1 mrg \def\urefcodedot{\urefprebreak .\urefpostbreak} 3082 1.1 mrg \def\urefcodehash{\urefprebreak \#\urefpostbreak} 3083 1.1 mrg \def\urefcodequest{\urefprebreak ?\urefpostbreak} 3084 1.1 mrg \def\urefcodeslash{\futurelet\next\urefcodeslashfinish} 3085 1.1 mrg { 3086 1.1 mrg \catcode`\/=\active 3087 1.1 mrg \global\def\urefcodeslashfinish{% 3088 1.1 mrg \urefprebreak \slashChar 3089 1.1 mrg % Allow line break only after the final / in a sequence of 3090 1.1 mrg % slashes, to avoid line break between the slashes in http://. 3091 1.1 mrg \ifx\next/\else \urefpostbreak \fi 3092 1.1 mrg } 3093 1.1 mrg } 3094 1.1 mrg 3095 1.1 mrg % By default we'll break after the special characters, but some people like to 3096 1.1 mrg % break before the special chars, so allow that. Also allow no breaking at 3097 1.1 mrg % all, for manual control. 3098 1.1 mrg % 3099 1.1 mrg \parseargdef\urefbreakstyle{% 3100 1.1 mrg \def\txiarg{#1}% 3101 1.1 mrg \ifx\txiarg\wordnone 3102 1.1 mrg \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak} 3103 1.1 mrg \else\ifx\txiarg\wordbefore 3104 1.1 mrg \def\urefprebreak{\urefallowbreak}\def\urefpostbreak{\nobreak} 3105 1.1 mrg \else\ifx\txiarg\wordafter 3106 1.1 mrg \def\urefprebreak{\nobreak}\def\urefpostbreak{\urefallowbreak} 3107 1.1 mrg \else 3108 1.1 mrg \errhelp = \EMsimple 3109 1.1 mrg \errmessage{Unknown @urefbreakstyle setting `\txiarg'}% 3110 1.1 mrg \fi\fi\fi 3111 1.1 mrg } 3112 1.1 mrg \def\wordafter{after} 3113 1.1 mrg \def\wordbefore{before} 3114 1.1 mrg \def\wordnone{none} 3115 1.1 mrg 3116 1.1 mrg % Allow a ragged right output to aid breaking long URL's. There can 3117 1.1.1.2 mrg % be a break at the \allowbreak with no extra glue (if the existing stretch in 3118 1.1 mrg % the line is sufficient), a break at the \penalty with extra glue added 3119 1.1 mrg % at the end of the line, or no break at all here. 3120 1.1.1.2 mrg % Changing the value of the penalty and/or the amount of stretch affects how 3121 1.1 mrg % preferable one choice is over the other. 3122 1.1.1.2 mrg \def\urefallowbreak{% 3123 1.1 mrg \penalty0\relax 3124 1.1.1.2 mrg \hskip 0pt plus 2 em\relax 3125 1.1 mrg \penalty1000\relax 3126 1.1 mrg \hskip 0pt plus -2 em\relax 3127 1.1 mrg } 3128 1.1 mrg 3129 1.1 mrg \urefbreakstyle after 3130 1.1 mrg 3131 1.1 mrg % @url synonym for @uref, since that's how everyone uses it. 3132 1.1 mrg % 3133 1.1 mrg \let\url=\uref 3134 1.1 mrg 3135 1.1 mrg % rms does not like angle brackets --karl, 17may97. 3136 1.1 mrg % So now @email is just like @uref, unless we are pdf. 3137 1.1 mrg % 3138 1.1 mrg %\def\email#1{\angleleft{\tt #1}\angleright} 3139 1.1 mrg \ifpdforxetex 3140 1.1 mrg \def\email#1{\doemail#1,,\finish} 3141 1.1 mrg \def\doemail#1,#2,#3\finish{\begingroup 3142 1.1 mrg \unsepspaces 3143 1.1 mrg \pdfurl{mailto:#1}% 3144 1.1 mrg \setbox0 = \hbox{\ignorespaces #2}% 3145 1.1 mrg \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi 3146 1.1 mrg \endlink 3147 1.1 mrg \endgroup} 3148 1.1 mrg \else 3149 1.1 mrg \let\email=\uref 3150 1.1 mrg \fi 3151 1.1 mrg 3152 1.1 mrg % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), 3153 1.1 mrg % `example' (@kbd uses ttsl only inside of @example and friends), 3154 1.1 mrg % or `code' (@kbd uses normal tty font always). 3155 1.1 mrg \parseargdef\kbdinputstyle{% 3156 1.1 mrg \def\txiarg{#1}% 3157 1.1 mrg \ifx\txiarg\worddistinct 3158 1.1 mrg \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% 3159 1.1 mrg \else\ifx\txiarg\wordexample 3160 1.1 mrg \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% 3161 1.1 mrg \else\ifx\txiarg\wordcode 3162 1.1 mrg \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% 3163 1.1 mrg \else 3164 1.1 mrg \errhelp = \EMsimple 3165 1.1 mrg \errmessage{Unknown @kbdinputstyle setting `\txiarg'}% 3166 1.1 mrg \fi\fi\fi 3167 1.1 mrg } 3168 1.1 mrg \def\worddistinct{distinct} 3169 1.1 mrg \def\wordexample{example} 3170 1.1 mrg \def\wordcode{code} 3171 1.1 mrg 3172 1.1 mrg % Default is `distinct'. 3173 1.1 mrg \kbdinputstyle distinct 3174 1.1 mrg 3175 1.1 mrg % @kbd is like @code, except that if the argument is just one @key command, 3176 1.1 mrg % then @kbd has no effect. 3177 1.1 mrg \def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}} 3178 1.1 mrg 3179 1.1 mrg \def\xkey{\key} 3180 1.1 mrg \def\kbdsub#1#2#3\par{% 3181 1.1 mrg \def\one{#1}\def\three{#3}\def\threex{??}% 3182 1.1.1.2 mrg \ifx\one\xkey\ifx\threex\three \key{#2}% 3183 1.1.1.2 mrg \else{\tclose{\kbdfont\setcodequotes\look}}\fi 3184 1.1 mrg \else{\tclose{\kbdfont\setcodequotes\look}}\fi 3185 1.1 mrg } 3186 1.1 mrg 3187 1.1 mrg % definition of @key that produces a lozenge. Doesn't adjust to text size. 3188 1.1 mrg %\setfont\keyrm\rmshape{8}{1000}{OT1} 3189 1.1 mrg %\font\keysy=cmsy9 3190 1.1 mrg %\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% 3191 1.1 mrg % \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% 3192 1.1 mrg % \vbox{\hrule\kern-0.4pt 3193 1.1 mrg % \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% 3194 1.1 mrg % \kern-0.4pt\hrule}% 3195 1.1 mrg % \kern-.06em\raise0.4pt\hbox{\angleright}}}} 3196 1.1 mrg 3197 1.1 mrg % definition of @key with no lozenge. If the current font is already 3198 1.1 mrg % monospace, don't change it; that way, we respect @kbdinputstyle. But 3199 1.1 mrg % if it isn't monospace, then use \tt. 3200 1.1.1.2 mrg % 3201 1.1 mrg \def\key#1{{\setregularquotes 3202 1.1 mrg \nohyphenation 3203 1.1 mrg \ifmonospace\else\tt\fi 3204 1.1 mrg #1}\null} 3205 1.1 mrg 3206 1.1 mrg % @clicksequence{File @click{} Open ...} 3207 1.1 mrg \def\clicksequence#1{\begingroup #1\endgroup} 3208 1.1 mrg 3209 1.1 mrg % @clickstyle @arrow (by default) 3210 1.1 mrg \parseargdef\clickstyle{\def\click{#1}} 3211 1.1 mrg \def\click{\arrow} 3212 1.1 mrg 3213 1.1 mrg % Typeset a dimension, e.g., `in' or `pt'. The only reason for the 3214 1.1 mrg % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. 3215 1.1 mrg % 3216 1.1 mrg \def\dmn#1{\thinspace #1} 3217 1.1 mrg 3218 1.1 mrg % @acronym for "FBI", "NATO", and the like. 3219 1.1 mrg % We print this one point size smaller, since it's intended for 3220 1.1 mrg % all-uppercase. 3221 1.1 mrg % 3222 1.1 mrg \def\acronym#1{\doacronym #1,,\finish} 3223 1.1 mrg \def\doacronym#1,#2,#3\finish{% 3224 1.1 mrg {\switchtolsize #1}% 3225 1.1 mrg \def\temp{#2}% 3226 1.1 mrg \ifx\temp\empty \else 3227 1.1 mrg \space ({\unsepspaces \ignorespaces \temp \unskip})% 3228 1.1 mrg \fi 3229 1.1 mrg \null % reset \spacefactor=1000 3230 1.1 mrg } 3231 1.1 mrg 3232 1.1 mrg % @abbr for "Comput. J." and the like. 3233 1.1 mrg % No font change, but don't do end-of-sentence spacing. 3234 1.1 mrg % 3235 1.1 mrg \def\abbr#1{\doabbr #1,,\finish} 3236 1.1 mrg \def\doabbr#1,#2,#3\finish{% 3237 1.1 mrg {\plainfrenchspacing #1}% 3238 1.1 mrg \def\temp{#2}% 3239 1.1 mrg \ifx\temp\empty \else 3240 1.1 mrg \space ({\unsepspaces \ignorespaces \temp \unskip})% 3241 1.1 mrg \fi 3242 1.1 mrg \null % reset \spacefactor=1000 3243 1.1 mrg } 3244 1.1 mrg 3245 1.1 mrg % @asis just yields its argument. Used with @table, for example. 3246 1.1 mrg % 3247 1.1 mrg \def\asis#1{#1} 3248 1.1 mrg 3249 1.1 mrg % @math outputs its argument in math mode. 3250 1.1 mrg % 3251 1.1 mrg % One complication: _ usually means subscripts, but it could also mean 3252 1.1 mrg % an actual _ character, as in @math{@var{some_variable} + 1}. So make 3253 1.1 mrg % _ active, and distinguish by seeing if the current family is \slfam, 3254 1.1 mrg % which is what @var uses. 3255 1.1 mrg { 3256 1.1 mrg \catcode`\_ = \active 3257 1.1 mrg \gdef\mathunderscore{% 3258 1.1 mrg \catcode`\_=\active 3259 1.1 mrg \def_{\ifnum\fam=\slfam \_\else\sb\fi}% 3260 1.1 mrg } 3261 1.1 mrg } 3262 1.1 mrg % Another complication: we want \\ (and @\) to output a math (or tt) \. 3263 1.1 mrg % FYI, plain.tex uses \\ as a temporary control sequence (for no 3264 1.1 mrg % particular reason), but this is not advertised and we don't care. 3265 1.1 mrg % 3266 1.1 mrg % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. 3267 1.1 mrg \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} 3268 1.1 mrg % 3269 1.1 mrg \def\math{% 3270 1.1 mrg \ifmmode\else % only go into math if not in math mode already 3271 1.1 mrg \tex 3272 1.1 mrg \mathunderscore 3273 1.1 mrg \let\\ = \mathbackslash 3274 1.1 mrg \mathactive 3275 1.1 mrg % make the texinfo accent commands work in math mode 3276 1.1 mrg \let\"=\ddot 3277 1.1 mrg \let\'=\acute 3278 1.1 mrg \let\==\bar 3279 1.1 mrg \let\^=\hat 3280 1.1 mrg \let\`=\grave 3281 1.1 mrg \let\u=\breve 3282 1.1 mrg \let\v=\check 3283 1.1 mrg \let\~=\tilde 3284 1.1 mrg \let\dotaccent=\dot 3285 1.1 mrg % have to provide another name for sup operator 3286 1.1 mrg \let\mathopsup=\sup 3287 1.1 mrg $\expandafter\finishmath\fi 3288 1.1 mrg } 3289 1.1 mrg \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. 3290 1.1 mrg 3291 1.1 mrg % Some active characters (such as <) are spaced differently in math. 3292 1.1 mrg % We have to reset their definitions in case the @math was an argument 3293 1.1 mrg % to a command which sets the catcodes (such as @item or @section). 3294 1.1 mrg % 3295 1.1 mrg { 3296 1.1 mrg \catcode`^ = \active 3297 1.1 mrg \catcode`< = \active 3298 1.1 mrg \catcode`> = \active 3299 1.1 mrg \catcode`+ = \active 3300 1.1 mrg \catcode`' = \active 3301 1.1 mrg \gdef\mathactive{% 3302 1.1 mrg \let^ = \ptexhat 3303 1.1 mrg \let< = \ptexless 3304 1.1 mrg \let> = \ptexgtr 3305 1.1 mrg \let+ = \ptexplus 3306 1.1 mrg \let' = \ptexquoteright 3307 1.1 mrg } 3308 1.1 mrg } 3309 1.1 mrg 3310 1.1 mrg % for @sub and @sup, if in math mode, just do a normal sub/superscript. 3311 1.1 mrg % If in text, use math to place as sub/superscript, but switch 3312 1.1 mrg % into text mode, with smaller fonts. This is a different font than the 3313 1.1 mrg % one used for real math sub/superscripts (8pt vs. 7pt), but let's not 3314 1.1 mrg % fix it (significant additions to font machinery) until someone notices. 3315 1.1 mrg % 3316 1.1 mrg \def\sub{\ifmmode \expandafter\sb \else \expandafter\finishsub\fi} 3317 1.1 mrg \def\finishsub#1{$\sb{\hbox{\switchtolllsize #1}}$}% 3318 1.1 mrg % 3319 1.1 mrg \def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi} 3320 1.1 mrg \def\finishsup#1{$\ptexsp{\hbox{\switchtolllsize #1}}$}% 3321 1.1.1.2 mrg 3322 1.1.1.2 mrg % provide this command from LaTeX as it is very common 3323 1.1.1.2 mrg \def\frac#1#2{{{#1}\over{#2}}} 3324 1.1.1.2 mrg 3325 1.1.1.2 mrg % @displaymath. 3326 1.1.1.2 mrg % \globaldefs is needed to recognize the end lines in \tex and 3327 1.1.1.2 mrg % \end tex. Set \thisenv as @end displaymath is seen before @end tex. 3328 1.1.1.2 mrg {\obeylines 3329 1.1.1.2 mrg \globaldefs=1 3330 1.1.1.2 mrg \envdef\displaymath{% 3331 1.1.1.2 mrg \tex% 3332 1.1.1.2 mrg \def\thisenv{\displaymath}% 3333 1.1.1.2 mrg \begingroup\let\end\displaymathend% 3334 1.1.1.2 mrg $$% 3335 1.1.1.2 mrg } 3336 1.1.1.2 mrg 3337 1.1.1.2 mrg \def\displaymathend{$$\endgroup\end}% 3338 1.1.1.2 mrg 3339 1.1.1.2 mrg \def\Edisplaymath{% 3340 1.1.1.2 mrg \def\thisenv{\tex}% 3341 1.1.1.2 mrg \end tex 3342 1.1.1.2 mrg }} 3343 1.1.1.2 mrg 3344 1.1 mrg 3345 1.1 mrg % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. 3346 1.1 mrg % Ignore unless FMTNAME == tex; then it is like @iftex and @tex, 3347 1.1 mrg % except specified as a normal braced arg, so no newlines to worry about. 3348 1.1 mrg % 3349 1.1 mrg \def\outfmtnametex{tex} 3350 1.1 mrg % 3351 1.1 mrg \long\def\inlinefmt#1{\doinlinefmt #1,\finish} 3352 1.1 mrg \long\def\doinlinefmt#1,#2,\finish{% 3353 1.1 mrg \def\inlinefmtname{#1}% 3354 1.1 mrg \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi 3355 1.1 mrg } 3356 1.1 mrg % 3357 1.1 mrg % @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if 3358 1.1 mrg % FMTNAME is tex, else ELSE-TEXT. 3359 1.1 mrg \long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish} 3360 1.1 mrg \long\def\doinlinefmtifelse#1,#2,#3,#4,\finish{% 3361 1.1 mrg \def\inlinefmtname{#1}% 3362 1.1 mrg \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\else \ignorespaces #3\fi 3363 1.1 mrg } 3364 1.1 mrg % 3365 1.1 mrg % For raw, must switch into @tex before parsing the argument, to avoid 3366 1.1 mrg % setting catcodes prematurely. Doing it this way means that, for 3367 1.1 mrg % example, @inlineraw{html, foo{bar} gets a parse error instead of being 3368 1.1 mrg % ignored. But this isn't important because if people want a literal 3369 1.1 mrg % *right* brace they would have to use a command anyway, so they may as 3370 1.1 mrg % well use a command to get a left brace too. We could re-use the 3371 1.1 mrg % delimiter character idea from \verb, but it seems like overkill. 3372 1.1 mrg % 3373 1.1 mrg \long\def\inlineraw{\tex \doinlineraw} 3374 1.1 mrg \long\def\doinlineraw#1{\doinlinerawtwo #1,\finish} 3375 1.1 mrg \def\doinlinerawtwo#1,#2,\finish{% 3376 1.1 mrg \def\inlinerawname{#1}% 3377 1.1 mrg \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi 3378 1.1 mrg \endgroup % close group opened by \tex. 3379 1.1 mrg } 3380 1.1 mrg 3381 1.1 mrg % @inlineifset{VAR, TEXT} expands TEXT if VAR is @set. 3382 1.1 mrg % 3383 1.1 mrg \long\def\inlineifset#1{\doinlineifset #1,\finish} 3384 1.1 mrg \long\def\doinlineifset#1,#2,\finish{% 3385 1.1 mrg \def\inlinevarname{#1}% 3386 1.1 mrg \expandafter\ifx\csname SET\inlinevarname\endcsname\relax 3387 1.1 mrg \else\ignorespaces#2\fi 3388 1.1 mrg } 3389 1.1 mrg 3390 1.1 mrg % @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set. 3391 1.1 mrg % 3392 1.1 mrg \long\def\inlineifclear#1{\doinlineifclear #1,\finish} 3393 1.1 mrg \long\def\doinlineifclear#1,#2,\finish{% 3394 1.1 mrg \def\inlinevarname{#1}% 3395 1.1 mrg \expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces#2\fi 3396 1.1 mrg } 3397 1.1 mrg 3398 1.1 mrg 3399 1.1 mrg \message{glyphs,} 3400 1.1 mrg % and logos. 3401 1.1 mrg 3402 1.1 mrg % @@ prints an @, as does @atchar{}. 3403 1.1 mrg \def\@{\char64 } 3404 1.1 mrg \let\atchar=\@ 3405 1.1 mrg 3406 1.1 mrg % @{ @} @lbracechar{} @rbracechar{} all generate brace characters. 3407 1.1 mrg \def\lbracechar{{\ifmonospace\char123\else\ensuremath\lbrace\fi}} 3408 1.1 mrg \def\rbracechar{{\ifmonospace\char125\else\ensuremath\rbrace\fi}} 3409 1.1 mrg \let\{=\lbracechar 3410 1.1 mrg \let\}=\rbracechar 3411 1.1 mrg 3412 1.1 mrg % @comma{} to avoid , parsing problems. 3413 1.1 mrg \let\comma = , 3414 1.1 mrg 3415 1.1 mrg % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent 3416 1.1 mrg % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. 3417 1.1 mrg \let\, = \ptexc 3418 1.1 mrg \let\dotaccent = \ptexdot 3419 1.1 mrg \def\ringaccent#1{{\accent23 #1}} 3420 1.1 mrg \let\tieaccent = \ptext 3421 1.1 mrg \let\ubaraccent = \ptexb 3422 1.1 mrg \let\udotaccent = \d 3423 1.1 mrg 3424 1.1 mrg % Other special characters: @questiondown @exclamdown @ordf @ordm 3425 1.1 mrg % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. 3426 1.1 mrg \def\questiondown{?`} 3427 1.1 mrg \def\exclamdown{!`} 3428 1.1 mrg \def\ordf{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{a}}} 3429 1.1 mrg \def\ordm{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{o}}} 3430 1.1 mrg 3431 1.1 mrg % Dotless i and dotless j, used for accents. 3432 1.1 mrg \def\imacro{i} 3433 1.1 mrg \def\jmacro{j} 3434 1.1 mrg \def\dotless#1{% 3435 1.1 mrg \def\temp{#1}% 3436 1.1 mrg \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi 3437 1.1 mrg \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi 3438 1.1 mrg \else \errmessage{@dotless can be used only with i or j}% 3439 1.1 mrg \fi\fi 3440 1.1 mrg } 3441 1.1 mrg 3442 1.1 mrg % The \TeX{} logo, as in plain, but resetting the spacing so that a 3443 1.1 mrg % period following counts as ending a sentence. (Idea found in latex.) 3444 1.1 mrg % 3445 1.1 mrg \edef\TeX{\TeX \spacefactor=1000 } 3446 1.1 mrg 3447 1.1 mrg % @LaTeX{} logo. Not quite the same results as the definition in 3448 1.1 mrg % latex.ltx, since we use a different font for the raised A; it's most 3449 1.1 mrg % convenient for us to use an explicitly smaller font, rather than using 3450 1.1 mrg % the \scriptstyle font (since we don't reset \scriptstyle and 3451 1.1 mrg % \scriptscriptstyle). 3452 1.1 mrg % 3453 1.1 mrg \def\LaTeX{% 3454 1.1 mrg L\kern-.36em 3455 1.1 mrg {\setbox0=\hbox{T}% 3456 1.1 mrg \vbox to \ht0{\hbox{% 3457 1.1 mrg \ifx\textnominalsize\xwordpt 3458 1.1 mrg % for 10pt running text, lllsize (8pt) is too small for the A in LaTeX. 3459 1.1 mrg % Revert to plain's \scriptsize, which is 7pt. 3460 1.1 mrg \count255=\the\fam $\fam\count255 \scriptstyle A$% 3461 1.1 mrg \else 3462 1.1 mrg % For 11pt, we can use our lllsize. 3463 1.1 mrg \switchtolllsize A% 3464 1.1 mrg \fi 3465 1.1 mrg }% 3466 1.1 mrg \vss 3467 1.1 mrg }}% 3468 1.1 mrg \kern-.15em 3469 1.1 mrg \TeX 3470 1.1 mrg } 3471 1.1 mrg 3472 1.1 mrg % Some math mode symbols. Define \ensuremath to switch into math mode 3473 1.1 mrg % unless we are already there. Expansion tricks may not be needed here, 3474 1.1 mrg % but safer, and can't hurt. 3475 1.1 mrg \def\ensuremath{\ifmmode \expandafter\asis \else\expandafter\ensuredmath \fi} 3476 1.1 mrg \def\ensuredmath#1{$\relax#1$} 3477 1.1 mrg % 3478 1.1 mrg \def\bullet{\ensuremath\ptexbullet} 3479 1.1 mrg \def\geq{\ensuremath\ge} 3480 1.1 mrg \def\leq{\ensuremath\le} 3481 1.1 mrg \def\minus{\ensuremath-} 3482 1.1 mrg 3483 1.1 mrg % @dots{} outputs an ellipsis using the current font. 3484 1.1 mrg % We do .5em per period so that it has the same spacing in the cm 3485 1.1 mrg % typewriter fonts as three actual period characters; on the other hand, 3486 1.1 mrg % in other typewriter fonts three periods are wider than 1.5em. So do 3487 1.1 mrg % whichever is larger. 3488 1.1 mrg % 3489 1.1 mrg \def\dots{% 3490 1.1 mrg \leavevmode 3491 1.1 mrg \setbox0=\hbox{...}% get width of three periods 3492 1.1 mrg \ifdim\wd0 > 1.5em 3493 1.1 mrg \dimen0 = \wd0 3494 1.1 mrg \else 3495 1.1 mrg \dimen0 = 1.5em 3496 1.1 mrg \fi 3497 1.1 mrg \hbox to \dimen0{% 3498 1.1 mrg \hskip 0pt plus.25fil 3499 1.1 mrg .\hskip 0pt plus1fil 3500 1.1 mrg .\hskip 0pt plus1fil 3501 1.1 mrg .\hskip 0pt plus.5fil 3502 1.1 mrg }% 3503 1.1 mrg } 3504 1.1 mrg 3505 1.1 mrg % @enddots{} is an end-of-sentence ellipsis. 3506 1.1 mrg % 3507 1.1 mrg \def\enddots{% 3508 1.1 mrg \dots 3509 1.1 mrg \spacefactor=\endofsentencespacefactor 3510 1.1 mrg } 3511 1.1 mrg 3512 1.1 mrg % @point{}, @result{}, @expansion{}, @print{}, @equiv{}. 3513 1.1 mrg % 3514 1.1 mrg % Since these characters are used in examples, they should be an even number of 3515 1.1 mrg % \tt widths. Each \tt character is 1en, so two makes it 1em. 3516 1.1 mrg % 3517 1.1 mrg \def\point{$\star$} 3518 1.1 mrg \def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}} 3519 1.1 mrg \def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} 3520 1.1 mrg \def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}} 3521 1.1 mrg \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} 3522 1.1 mrg \def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}} 3523 1.1 mrg 3524 1.1 mrg % The @error{} command. 3525 1.1 mrg % Adapted from the TeXbook's \boxit. 3526 1.1 mrg % 3527 1.1 mrg \newbox\errorbox 3528 1.1 mrg % 3529 1.1 mrg {\ttfont \global\dimen0 = 3em}% Width of the box. 3530 1.1 mrg \dimen2 = .55pt % Thickness of rules 3531 1.1 mrg % The text. (`r' is open on the right, `e' somewhat less so on the left.) 3532 1.1 mrg \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt} 3533 1.1 mrg % 3534 1.1 mrg \setbox\errorbox=\hbox to \dimen0{\hfil 3535 1.1 mrg \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. 3536 1.1 mrg \advance\hsize by -2\dimen2 % Rules. 3537 1.1 mrg \vbox{% 3538 1.1 mrg \hrule height\dimen2 3539 1.1 mrg \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. 3540 1.1 mrg \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. 3541 1.1 mrg \kern3pt\vrule width\dimen2}% Space to right. 3542 1.1 mrg \hrule height\dimen2} 3543 1.1 mrg \hfil} 3544 1.1 mrg % 3545 1.1 mrg \def\error{\leavevmode\lower.7ex\copy\errorbox} 3546 1.1 mrg 3547 1.1 mrg % @pounds{} is a sterling sign, which Knuth put in the CM italic font. 3548 1.1.1.2 mrg % 3549 1.1 mrg \def\pounds{\ifmonospace{\ecfont\char"BF}\else{\it\$}\fi} 3550 1.1 mrg 3551 1.1 mrg % @euro{} comes from a separate font, depending on the current style. 3552 1.1 mrg % We use the free feym* fonts from the eurosym package by Henrik 3553 1.1 mrg % Theiling, which support regular, slanted, bold and bold slanted (and 3554 1.1 mrg % "outlined" (blackboard board, sort of) versions, which we don't need). 3555 1.1 mrg % It is available from http://www.ctan.org/tex-archive/fonts/eurosym. 3556 1.1 mrg % 3557 1.1 mrg % Although only regular is the truly official Euro symbol, we ignore 3558 1.1 mrg % that. The Euro is designed to be slightly taller than the regular 3559 1.1 mrg % font height. 3560 1.1 mrg % 3561 1.1 mrg % feymr - regular 3562 1.1 mrg % feymo - slanted 3563 1.1 mrg % feybr - bold 3564 1.1 mrg % feybo - bold slanted 3565 1.1 mrg % 3566 1.1 mrg % There is no good (free) typewriter version, to my knowledge. 3567 1.1 mrg % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide. 3568 1.1 mrg % Hmm. 3569 1.1 mrg % 3570 1.1 mrg % Also doesn't work in math. Do we need to do math with euro symbols? 3571 1.1 mrg % Hope not. 3572 1.1 mrg % 3573 1.1 mrg % 3574 1.1 mrg \def\euro{{\eurofont e}} 3575 1.1 mrg \def\eurofont{% 3576 1.1 mrg % We set the font at each command, rather than predefining it in 3577 1.1 mrg % \textfonts and the other font-switching commands, so that 3578 1.1 mrg % installations which never need the symbol don't have to have the 3579 1.1 mrg % font installed. 3580 1.1 mrg % 3581 1.1 mrg % There is only one designed size (nominal 10pt), so we always scale 3582 1.1 mrg % that to the current nominal size. 3583 1.1 mrg % 3584 1.1 mrg % By the way, simply using "at 1em" works for cmr10 and the like, but 3585 1.1 mrg % does not work for cmbx10 and other extended/shrunken fonts. 3586 1.1 mrg % 3587 1.1 mrg \def\eurosize{\csname\curfontsize nominalsize\endcsname}% 3588 1.1 mrg % 3589 1.1 mrg \ifx\curfontstyle\bfstylename 3590 1.1 mrg % bold: 3591 1.1 mrg \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize 3592 1.1 mrg \else 3593 1.1 mrg % regular: 3594 1.1 mrg \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize 3595 1.1 mrg \fi 3596 1.1 mrg \thiseurofont 3597 1.1 mrg } 3598 1.1 mrg 3599 1.1 mrg % Glyphs from the EC fonts. We don't use \let for the aliases, because 3600 1.1 mrg % sometimes we redefine the original macro, and the alias should reflect 3601 1.1 mrg % the redefinition. 3602 1.1 mrg % 3603 1.1 mrg % Use LaTeX names for the Icelandic letters. 3604 1.1 mrg \def\DH{{\ecfont \char"D0}} % Eth 3605 1.1 mrg \def\dh{{\ecfont \char"F0}} % eth 3606 1.1 mrg \def\TH{{\ecfont \char"DE}} % Thorn 3607 1.1 mrg \def\th{{\ecfont \char"FE}} % thorn 3608 1.1 mrg % 3609 1.1 mrg \def\guillemetleft{{\ecfont \char"13}} 3610 1.1 mrg \def\guillemotleft{\guillemetleft} 3611 1.1 mrg \def\guillemetright{{\ecfont \char"14}} 3612 1.1 mrg \def\guillemotright{\guillemetright} 3613 1.1 mrg \def\guilsinglleft{{\ecfont \char"0E}} 3614 1.1 mrg \def\guilsinglright{{\ecfont \char"0F}} 3615 1.1 mrg \def\quotedblbase{{\ecfont \char"12}} 3616 1.1 mrg \def\quotesinglbase{{\ecfont \char"0D}} 3617 1.1 mrg % 3618 1.1 mrg % This positioning is not perfect (see the ogonek LaTeX package), but 3619 1.1 mrg % we have the precomposed glyphs for the most common cases. We put the 3620 1.1 mrg % tests to use those glyphs in the single \ogonek macro so we have fewer 3621 1.1 mrg % dummy definitions to worry about for index entries, etc. 3622 1.1 mrg % 3623 1.1 mrg % ogonek is also used with other letters in Lithuanian (IOU), but using 3624 1.1 mrg % the precomposed glyphs for those is not so easy since they aren't in 3625 1.1 mrg % the same EC font. 3626 1.1 mrg \def\ogonek#1{{% 3627 1.1 mrg \def\temp{#1}% 3628 1.1 mrg \ifx\temp\macrocharA\Aogonek 3629 1.1 mrg \else\ifx\temp\macrochara\aogonek 3630 1.1 mrg \else\ifx\temp\macrocharE\Eogonek 3631 1.1 mrg \else\ifx\temp\macrochare\eogonek 3632 1.1 mrg \else 3633 1.1 mrg \ecfont \setbox0=\hbox{#1}% 3634 1.1 mrg \ifdim\ht0=1ex\accent"0C #1% 3635 1.1 mrg \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}% 3636 1.1 mrg \fi 3637 1.1 mrg \fi\fi\fi\fi 3638 1.1 mrg }% 3639 1.1 mrg } 3640 1.1 mrg \def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A} 3641 1.1 mrg \def\aogonek{{\ecfont \char"A1}}\def\macrochara{a} 3642 1.1 mrg \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E} 3643 1.1 mrg \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e} 3644 1.1 mrg % 3645 1.1 mrg % Use the European Computer Modern fonts (cm-super in outline format) 3646 1.1 mrg % for non-CM glyphs. That is ec* for regular text and tc* for the text 3647 1.1 mrg % companion symbols (LaTeX TS1 encoding). Both are part of the ec 3648 1.1 mrg % package and follow the same conventions. 3649 1.1 mrg % 3650 1.1 mrg \def\ecfont{\etcfont{e}} 3651 1.1 mrg \def\tcfont{\etcfont{t}} 3652 1.1 mrg % 3653 1.1 mrg \def\etcfont#1{% 3654 1.1 mrg % We can't distinguish serif/sans and italic/slanted, but this 3655 1.1 mrg % is used for crude hacks anyway (like adding French and German 3656 1.1 mrg % quotes to documents typeset with CM, where we lose kerning), so 3657 1.1 mrg % hopefully nobody will notice/care. 3658 1.1 mrg \edef\ecsize{\csname\curfontsize ecsize\endcsname}% 3659 1.1 mrg \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% 3660 1.1 mrg \ifmonospace 3661 1.1 mrg % typewriter: 3662 1.1 mrg \font\thisecfont = #1ctt\ecsize \space at \nominalsize 3663 1.1 mrg \else 3664 1.1 mrg \ifx\curfontstyle\bfstylename 3665 1.1 mrg % bold: 3666 1.1 mrg \font\thisecfont = #1cb\ifusingit{i}{x}\ecsize \space at \nominalsize 3667 1.1 mrg \else 3668 1.1 mrg % regular: 3669 1.1 mrg \font\thisecfont = #1c\ifusingit{ti}{rm}\ecsize \space at \nominalsize 3670 1.1 mrg \fi 3671 1.1 mrg \fi 3672 1.1 mrg \thisecfont 3673 1.1 mrg } 3674 1.1 mrg 3675 1.1 mrg % @registeredsymbol - R in a circle. The font for the R should really 3676 1.1 mrg % be smaller yet, but lllsize is the best we can do for now. 3677 1.1 mrg % Adapted from the plain.tex definition of \copyright. 3678 1.1 mrg % 3679 1.1 mrg \def\registeredsymbol{% 3680 1.1 mrg $^{{\ooalign{\hfil\raise.07ex\hbox{\switchtolllsize R}% 3681 1.1 mrg \hfil\crcr\Orb}}% 3682 1.1 mrg }$% 3683 1.1 mrg } 3684 1.1 mrg 3685 1.1 mrg % @textdegree - the normal degrees sign. 3686 1.1 mrg % 3687 1.1 mrg \def\textdegree{$^\circ$} 3688 1.1 mrg 3689 1.1 mrg % Laurent Siebenmann reports \Orb undefined with: 3690 1.1 mrg % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 3691 1.1 mrg % so we'll define it if necessary. 3692 1.1 mrg % 3693 1.1 mrg \ifx\Orb\thisisundefined 3694 1.1 mrg \def\Orb{\mathhexbox20D} 3695 1.1 mrg \fi 3696 1.1 mrg 3697 1.1 mrg % Quotes. 3698 1.1 mrg \chardef\quoteleft=`\` 3699 1.1 mrg \chardef\quoteright=`\' 3700 1.1.1.2 mrg 3701 1.1.1.2 mrg % only change font for tt for correct kerning and to avoid using 3702 1.1.1.2 mrg % \ecfont unless necessary. 3703 1.1.1.2 mrg \def\quotedblleft{% 3704 1.1.1.2 mrg \ifmonospace{\ecfont\char"10}\else{\char"5C}\fi 3705 1.1.1.2 mrg } 3706 1.1.1.2 mrg 3707 1.1.1.2 mrg \def\quotedblright{% 3708 1.1.1.2 mrg \ifmonospace{\ecfont\char"11}\else{\char`\"}\fi 3709 1.1.1.2 mrg } 3710 1.1 mrg 3711 1.1 mrg 3712 1.1 mrg \message{page headings,} 3713 1.1 mrg 3714 1.1 mrg \newskip\titlepagetopglue \titlepagetopglue = 1.5in 3715 1.1 mrg \newskip\titlepagebottomglue \titlepagebottomglue = 2pc 3716 1.1 mrg 3717 1.1 mrg % First the title page. Must do @settitle before @titlepage. 3718 1.1 mrg \newif\ifseenauthor 3719 1.1 mrg \newif\iffinishedtitlepage 3720 1.1 mrg 3721 1.1 mrg % @setcontentsaftertitlepage used to do an implicit @contents or 3722 1.1 mrg % @shortcontents after @end titlepage, but it is now obsolete. 3723 1.1 mrg \def\setcontentsaftertitlepage{% 3724 1.1 mrg \errmessage{@setcontentsaftertitlepage has been removed as a Texinfo 3725 1.1 mrg command; move your @contents command if you want the contents 3726 1.1 mrg after the title page.}}% 3727 1.1 mrg \def\setshortcontentsaftertitlepage{% 3728 1.1 mrg \errmessage{@setshortcontentsaftertitlepage has been removed as a Texinfo 3729 1.1 mrg command; move your @shortcontents and @contents commands if you 3730 1.1 mrg want the contents after the title page.}}% 3731 1.1 mrg 3732 1.1 mrg \parseargdef\shorttitlepage{% 3733 1.1 mrg \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}% 3734 1.1 mrg \endgroup\page\hbox{}\page} 3735 1.1 mrg 3736 1.1 mrg \envdef\titlepage{% 3737 1.1 mrg % Open one extra group, as we want to close it in the middle of \Etitlepage. 3738 1.1 mrg \begingroup 3739 1.1 mrg \parindent=0pt \textfonts 3740 1.1 mrg % Leave some space at the very top of the page. 3741 1.1 mrg \vglue\titlepagetopglue 3742 1.1 mrg % No rule at page bottom unless we print one at the top with @title. 3743 1.1 mrg \finishedtitlepagetrue 3744 1.1 mrg % 3745 1.1 mrg % Most title ``pages'' are actually two pages long, with space 3746 1.1 mrg % at the top of the second. We don't want the ragged left on the second. 3747 1.1 mrg \let\oldpage = \page 3748 1.1 mrg \def\page{% 3749 1.1 mrg \iffinishedtitlepage\else 3750 1.1 mrg \finishtitlepage 3751 1.1 mrg \fi 3752 1.1 mrg \let\page = \oldpage 3753 1.1 mrg \page 3754 1.1 mrg \null 3755 1.1 mrg }% 3756 1.1 mrg } 3757 1.1 mrg 3758 1.1 mrg \def\Etitlepage{% 3759 1.1 mrg \iffinishedtitlepage\else 3760 1.1 mrg \finishtitlepage 3761 1.1 mrg \fi 3762 1.1 mrg % It is important to do the page break before ending the group, 3763 1.1 mrg % because the headline and footline are only empty inside the group. 3764 1.1 mrg % If we use the new definition of \page, we always get a blank page 3765 1.1 mrg % after the title page, which we certainly don't want. 3766 1.1 mrg \oldpage 3767 1.1 mrg \endgroup 3768 1.1 mrg % 3769 1.1 mrg % Need this before the \...aftertitlepage checks so that if they are 3770 1.1 mrg % in effect the toc pages will come out with page numbers. 3771 1.1 mrg \HEADINGSon 3772 1.1 mrg } 3773 1.1 mrg 3774 1.1 mrg \def\finishtitlepage{% 3775 1.1 mrg \vskip4pt \hrule height 2pt width \hsize 3776 1.1 mrg \vskip\titlepagebottomglue 3777 1.1 mrg \finishedtitlepagetrue 3778 1.1 mrg } 3779 1.1 mrg 3780 1.1 mrg % Settings used for typesetting titles: no hyphenation, no indentation, 3781 1.1 mrg % don't worry much about spacing, ragged right. This should be used 3782 1.1 mrg % inside a \vbox, and fonts need to be set appropriately first. \par should 3783 1.1 mrg % be specified before the end of the \vbox, since a vbox is a group. 3784 1.1 mrg % 3785 1.1 mrg \def\raggedtitlesettings{% 3786 1.1 mrg \rm 3787 1.1 mrg \hyphenpenalty=10000 3788 1.1 mrg \parindent=0pt 3789 1.1 mrg \tolerance=5000 3790 1.1 mrg \ptexraggedright 3791 1.1 mrg } 3792 1.1 mrg 3793 1.1 mrg % Macros to be used within @titlepage: 3794 1.1 mrg 3795 1.1 mrg \let\subtitlerm=\rmfont 3796 1.1 mrg \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} 3797 1.1 mrg 3798 1.1 mrg \parseargdef\title{% 3799 1.1 mrg \checkenv\titlepage 3800 1.1 mrg \vbox{\titlefonts \raggedtitlesettings #1\par}% 3801 1.1 mrg % print a rule at the page bottom also. 3802 1.1 mrg \finishedtitlepagefalse 3803 1.1 mrg \vskip4pt \hrule height 4pt width \hsize \vskip4pt 3804 1.1 mrg } 3805 1.1 mrg 3806 1.1 mrg \parseargdef\subtitle{% 3807 1.1 mrg \checkenv\titlepage 3808 1.1 mrg {\subtitlefont \rightline{#1}}% 3809 1.1 mrg } 3810 1.1 mrg 3811 1.1 mrg % @author should come last, but may come many times. 3812 1.1 mrg % It can also be used inside @quotation. 3813 1.1 mrg % 3814 1.1 mrg \parseargdef\author{% 3815 1.1 mrg \def\temp{\quotation}% 3816 1.1 mrg \ifx\thisenv\temp 3817 1.1 mrg \def\quotationauthor{#1}% printed in \Equotation. 3818 1.1 mrg \else 3819 1.1 mrg \checkenv\titlepage 3820 1.1 mrg \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi 3821 1.1 mrg {\secfonts\rm \leftline{#1}}% 3822 1.1 mrg \fi 3823 1.1 mrg } 3824 1.1 mrg 3825 1.1 mrg 3826 1.1 mrg % Set up page headings and footings. 3827 1.1 mrg 3828 1.1 mrg \let\thispage=\folio 3829 1.1 mrg 3830 1.1 mrg \newtoks\evenheadline % headline on even pages 3831 1.1.1.2 mrg \newtoks\oddheadline % headline on odd pages 3832 1.1.1.2 mrg \newtoks\evenchapheadline% headline on even pages with a new chapter 3833 1.1 mrg \newtoks\oddchapheadline % headline on odd pages with a new chapter 3834 1.1 mrg \newtoks\evenfootline % footline on even pages 3835 1.1 mrg \newtoks\oddfootline % footline on odd pages 3836 1.1 mrg 3837 1.1.1.2 mrg % Now make \makeheadline and \makefootline in Plain TeX use those variables 3838 1.1.1.2 mrg \headline={{\textfonts\rm 3839 1.1.1.2 mrg \ifchapterpage 3840 1.1.1.2 mrg \ifodd\pageno\the\oddchapheadline\else\the\evenchapheadline\fi 3841 1.1.1.2 mrg \else 3842 1.1.1.2 mrg \ifodd\pageno\the\oddheadline\else\the\evenheadline\fi 3843 1.1.1.2 mrg \fi}} 3844 1.1 mrg 3845 1.1 mrg \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline 3846 1.1 mrg \else \the\evenfootline \fi}\HEADINGShook} 3847 1.1 mrg \let\HEADINGShook=\relax 3848 1.1 mrg 3849 1.1 mrg % Commands to set those variables. 3850 1.1 mrg % For example, this is what @headings on does 3851 1.1 mrg % @evenheading @thistitle|@thispage|@thischapter 3852 1.1 mrg % @oddheading @thischapter|@thispage|@thistitle 3853 1.1 mrg % @evenfooting @thisfile|| 3854 1.1 mrg % @oddfooting ||@thisfile 3855 1.1 mrg 3856 1.1 mrg 3857 1.1 mrg \def\evenheading{\parsearg\evenheadingxxx} 3858 1.1 mrg \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} 3859 1.1.1.2 mrg \def\evenheadingyyy #1\|#2\|#3\|#4\finish{% 3860 1.1.1.2 mrg \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}} 3861 1.1 mrg \global\evenchapheadline=\evenheadline} 3862 1.1 mrg 3863 1.1 mrg \def\oddheading{\parsearg\oddheadingxxx} 3864 1.1 mrg \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} 3865 1.1.1.2 mrg \def\oddheadingyyy #1\|#2\|#3\|#4\finish{% 3866 1.1.1.2 mrg \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}% 3867 1.1 mrg \global\oddchapheadline=\oddheadline} 3868 1.1 mrg 3869 1.1 mrg \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% 3870 1.1 mrg 3871 1.1 mrg \def\evenfooting{\parsearg\evenfootingxxx} 3872 1.1 mrg \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish} 3873 1.1 mrg \def\evenfootingyyy #1\|#2\|#3\|#4\finish{% 3874 1.1 mrg \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} 3875 1.1 mrg 3876 1.1 mrg \def\oddfooting{\parsearg\oddfootingxxx} 3877 1.1 mrg \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish} 3878 1.1 mrg \def\oddfootingyyy #1\|#2\|#3\|#4\finish{% 3879 1.1 mrg \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% 3880 1.1 mrg % 3881 1.1 mrg % Leave some space for the footline. Hopefully ok to assume 3882 1.1 mrg % @evenfooting will not be used by itself. 3883 1.1 mrg \global\advance\txipageheight by -12pt 3884 1.1 mrg \global\advance\vsize by -12pt 3885 1.1 mrg } 3886 1.1 mrg 3887 1.1 mrg \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} 3888 1.1 mrg 3889 1.1 mrg % @evenheadingmarks top \thischapter <- chapter at the top of a page 3890 1.1 mrg % @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page 3891 1.1 mrg % 3892 1.1 mrg % The same set of arguments for: 3893 1.1 mrg % 3894 1.1 mrg % @oddheadingmarks 3895 1.1 mrg % @evenfootingmarks 3896 1.1 mrg % @oddfootingmarks 3897 1.1 mrg % @everyheadingmarks 3898 1.1 mrg % @everyfootingmarks 3899 1.1 mrg 3900 1.1 mrg % These define \getoddheadingmarks, \getevenheadingmarks, 3901 1.1 mrg % \getoddfootingmarks, and \getevenfootingmarks, each to one of 3902 1.1 mrg % \gettopheadingmarks, \getbottomheadingmarks. 3903 1.1 mrg % 3904 1.1 mrg \def\evenheadingmarks{\headingmarks{even}{heading}} 3905 1.1 mrg \def\oddheadingmarks{\headingmarks{odd}{heading}} 3906 1.1 mrg \def\evenfootingmarks{\headingmarks{even}{footing}} 3907 1.1 mrg \def\oddfootingmarks{\headingmarks{odd}{footing}} 3908 1.1 mrg \parseargdef\everyheadingmarks{\headingmarks{even}{heading}{#1} 3909 1.1 mrg \headingmarks{odd}{heading}{#1} } 3910 1.1 mrg \parseargdef\everyfootingmarks{\headingmarks{even}{footing}{#1} 3911 1.1 mrg \headingmarks{odd}{footing}{#1} } 3912 1.1 mrg % #1 = even/odd, #2 = heading/footing, #3 = top/bottom. 3913 1.1 mrg \def\headingmarks#1#2#3 {% 3914 1.1 mrg \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname 3915 1.1 mrg \global\expandafter\let\csname get#1#2marks\endcsname \temp 3916 1.1 mrg } 3917 1.1 mrg 3918 1.1 mrg \everyheadingmarks bottom 3919 1.1 mrg \everyfootingmarks bottom 3920 1.1 mrg 3921 1.1 mrg % @headings double turns headings on for double-sided printing. 3922 1.1 mrg % @headings single turns headings on for single-sided printing. 3923 1.1 mrg % @headings off turns them off. 3924 1.1 mrg % @headings on same as @headings double, retained for compatibility. 3925 1.1 mrg % @headings after turns on double-sided headings after this page. 3926 1.1 mrg % @headings doubleafter turns on double-sided headings after this page. 3927 1.1 mrg % @headings singleafter turns on single-sided headings after this page. 3928 1.1 mrg % By default, they are off at the start of a document, 3929 1.1 mrg % and turned `on' after @end titlepage. 3930 1.1 mrg 3931 1.1 mrg \parseargdef\headings{\csname HEADINGS#1\endcsname} 3932 1.1 mrg 3933 1.1.1.2 mrg \def\headingsoff{% non-global headings elimination 3934 1.1.1.2 mrg \evenheadline={\hfil}\evenfootline={\hfil}\evenchapheadline={\hfil}% 3935 1.1 mrg \oddheadline={\hfil}\oddfootline={\hfil}\oddchapheadline={\hfil}% 3936 1.1 mrg } 3937 1.1 mrg 3938 1.1 mrg \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting 3939 1.1 mrg \HEADINGSoff % it's the default 3940 1.1 mrg 3941 1.1.1.2 mrg % When we turn headings on, set the page number to 1. 3942 1.1.1.2 mrg \def\pageone{ 3943 1.1.1.2 mrg \global\pageno=1 3944 1.1.1.2 mrg \global\arabiccount = \pagecount 3945 1.1.1.2 mrg } 3946 1.1 mrg 3947 1.1 mrg % For double-sided printing, put current file name in lower left corner, 3948 1.1 mrg % chapter name on inside top of right hand pages, document 3949 1.1 mrg % title on inside top of left hand pages, and page numbers on outside top 3950 1.1 mrg % edge of all pages. 3951 1.1.1.2 mrg \def\HEADINGSdouble{% 3952 1.1.1.2 mrg \pageone 3953 1.1 mrg \HEADINGSdoublex 3954 1.1 mrg } 3955 1.1 mrg \let\contentsalignmacro = \chappager 3956 1.1 mrg 3957 1.1 mrg % For single-sided printing, chapter title goes across top left of page, 3958 1.1 mrg % page number on top right. 3959 1.1.1.2 mrg \def\HEADINGSsingle{% 3960 1.1.1.2 mrg \pageone 3961 1.1 mrg \HEADINGSsinglex 3962 1.1 mrg } 3963 1.1 mrg \def\HEADINGSon{\HEADINGSdouble} 3964 1.1 mrg 3965 1.1 mrg \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} 3966 1.1 mrg \let\HEADINGSdoubleafter=\HEADINGSafter 3967 1.1 mrg \def\HEADINGSdoublex{% 3968 1.1 mrg \global\evenfootline={\hfil} 3969 1.1 mrg \global\oddfootline={\hfil} 3970 1.1.1.2 mrg \global\evenheadline={\line{\folio\hfil\thistitle}} 3971 1.1.1.2 mrg \global\oddheadline={\line{\thischapter\hfil\folio}} 3972 1.1.1.2 mrg \global\evenchapheadline={\line{\folio\hfil}} 3973 1.1 mrg \global\oddchapheadline={\line{\hfil\folio}} 3974 1.1 mrg \global\let\contentsalignmacro = \chapoddpage 3975 1.1 mrg } 3976 1.1 mrg 3977 1.1 mrg \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} 3978 1.1 mrg \def\HEADINGSsinglex{% 3979 1.1 mrg \global\evenfootline={\hfil} 3980 1.1.1.2 mrg \global\oddfootline={\hfil} 3981 1.1.1.2 mrg \global\evenheadline={\line{\thischapter\hfil\folio}} 3982 1.1.1.2 mrg \global\oddheadline={\line{\thischapter\hfil\folio}} 3983 1.1.1.2 mrg \global\evenchapheadline={\line{\hfil\folio}} 3984 1.1.1.2 mrg \global\oddchapheadline={\line{\hfil\folio}} 3985 1.1.1.2 mrg \global\let\contentsalignmacro = \chappager 3986 1.1.1.2 mrg } 3987 1.1.1.2 mrg 3988 1.1.1.2 mrg % for @setchapternewpage off 3989 1.1.1.2 mrg \def\HEADINGSsinglechapoff{% 3990 1.1.1.2 mrg \pageone 3991 1.1.1.2 mrg \global\evenfootline={\hfil} 3992 1.1.1.2 mrg \global\oddfootline={\hfil} 3993 1.1.1.2 mrg \global\evenheadline={\line{\thischapter\hfil\folio}} 3994 1.1.1.2 mrg \global\oddheadline={\line{\thischapter\hfil\folio}} 3995 1.1.1.2 mrg \global\evenchapheadline=\evenheadline 3996 1.1 mrg \global\oddchapheadline=\oddheadline 3997 1.1 mrg \global\let\contentsalignmacro = \chappager 3998 1.1 mrg } 3999 1.1 mrg 4000 1.1 mrg % Subroutines used in generating headings 4001 1.1 mrg % This produces Day Month Year style of output. 4002 1.1 mrg % Only define if not already defined, in case a txi-??.tex file has set 4003 1.1 mrg % up a different format (e.g., txi-cs.tex does this). 4004 1.1 mrg \ifx\today\thisisundefined 4005 1.1 mrg \def\today{% 4006 1.1 mrg \number\day\space 4007 1.1 mrg \ifcase\month 4008 1.1 mrg \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr 4009 1.1 mrg \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug 4010 1.1 mrg \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec 4011 1.1 mrg \fi 4012 1.1 mrg \space\number\year} 4013 1.1 mrg \fi 4014 1.1 mrg 4015 1.1 mrg % @settitle line... specifies the title of the document, for headings. 4016 1.1 mrg % It generates no output of its own. 4017 1.1 mrg \def\thistitle{\putwordNoTitle} 4018 1.1 mrg \def\settitle{\parsearg{\gdef\thistitle}} 4019 1.1 mrg 4020 1.1 mrg 4021 1.1 mrg \message{tables,} 4022 1.1 mrg % Tables -- @table, @ftable, @vtable, @item(x). 4023 1.1 mrg 4024 1.1 mrg % default indentation of table text 4025 1.1 mrg \newdimen\tableindent \tableindent=.8in 4026 1.1 mrg % default indentation of @itemize and @enumerate text 4027 1.1 mrg \newdimen\itemindent \itemindent=.3in 4028 1.1 mrg % margin between end of table item and start of table text. 4029 1.1 mrg \newdimen\itemmargin \itemmargin=.1in 4030 1.1 mrg 4031 1.1 mrg % used internally for \itemindent minus \itemmargin 4032 1.1 mrg \newdimen\itemmax 4033 1.1 mrg 4034 1.1 mrg % Note @table, @ftable, and @vtable define @item, @itemx, etc., with 4035 1.1 mrg % these defs. 4036 1.1 mrg % They also define \itemindex 4037 1.1 mrg % to index the item name in whatever manner is desired (perhaps none). 4038 1.1 mrg 4039 1.1 mrg \newif\ifitemxneedsnegativevskip 4040 1.1 mrg 4041 1.1 mrg \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} 4042 1.1 mrg 4043 1.1 mrg \def\internalBitem{\smallbreak \parsearg\itemzzz} 4044 1.1 mrg \def\internalBitemx{\itemxpar \parsearg\itemzzz} 4045 1.1 mrg 4046 1.1 mrg \def\itemzzz #1{\begingroup % 4047 1.1 mrg \advance\hsize by -\rightskip 4048 1.1 mrg \advance\hsize by -\tableindent 4049 1.1 mrg \setbox0=\hbox{\itemindicate{#1}}% 4050 1.1 mrg \itemindex{#1}% 4051 1.1 mrg \nobreak % This prevents a break before @itemx. 4052 1.1 mrg % 4053 1.1 mrg % If the item text does not fit in the space we have, put it on a line 4054 1.1 mrg % by itself, and do not allow a page break either before or after that 4055 1.1 mrg % line. We do not start a paragraph here because then if the next 4056 1.1 mrg % command is, e.g., @kindex, the whatsit would get put into the 4057 1.1 mrg % horizontal list on a line by itself, resulting in extra blank space. 4058 1.1 mrg \ifdim \wd0>\itemmax 4059 1.1 mrg % 4060 1.1 mrg % Make this a paragraph so we get the \parskip glue and wrapping, 4061 1.1 mrg % but leave it ragged-right. 4062 1.1 mrg \begingroup 4063 1.1 mrg \advance\leftskip by-\tableindent 4064 1.1 mrg \advance\hsize by\tableindent 4065 1.1 mrg \advance\rightskip by0pt plus1fil\relax 4066 1.1 mrg \leavevmode\unhbox0\par 4067 1.1 mrg \endgroup 4068 1.1 mrg % 4069 1.1 mrg % We're going to be starting a paragraph, but we don't want the 4070 1.1 mrg % \parskip glue -- logically it's part of the @item we just started. 4071 1.1 mrg \nobreak \vskip-\parskip 4072 1.1 mrg % 4073 1.1 mrg % Stop a page break at the \parskip glue coming up. However, if 4074 1.1 mrg % what follows is an environment such as @example, there will be no 4075 1.1 mrg % \parskip glue; then the negative vskip we just inserted would 4076 1.1 mrg % cause the example and the item to crash together. So we use this 4077 1.1 mrg % bizarre value of 10001 as a signal to \aboveenvbreak to insert 4078 1.1 mrg % \parskip glue after all. Section titles are handled this way also. 4079 1.1 mrg % 4080 1.1 mrg \penalty 10001 4081 1.1 mrg \endgroup 4082 1.1 mrg \itemxneedsnegativevskipfalse 4083 1.1 mrg \else 4084 1.1 mrg % The item text fits into the space. Start a paragraph, so that the 4085 1.1 mrg % following text (if any) will end up on the same line. 4086 1.1 mrg \noindent 4087 1.1 mrg % Do this with kerns and \unhbox so that if there is a footnote in 4088 1.1 mrg % the item text, it can migrate to the main vertical list and 4089 1.1 mrg % eventually be printed. 4090 1.1 mrg \nobreak\kern-\tableindent 4091 1.1 mrg \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 4092 1.1 mrg \unhbox0 4093 1.1 mrg \nobreak\kern\dimen0 4094 1.1 mrg \endgroup 4095 1.1 mrg \itemxneedsnegativevskiptrue 4096 1.1 mrg \fi 4097 1.1 mrg } 4098 1.1 mrg 4099 1.1 mrg \def\item{\errmessage{@item while not in a list environment}} 4100 1.1 mrg \def\itemx{\errmessage{@itemx while not in a list environment}} 4101 1.1 mrg 4102 1.1 mrg % @table, @ftable, @vtable. 4103 1.1 mrg \envdef\table{% 4104 1.1 mrg \let\itemindex\gobble 4105 1.1 mrg \tablecheck{table}% 4106 1.1 mrg } 4107 1.1 mrg \envdef\ftable{% 4108 1.1 mrg \def\itemindex ##1{\doind {fn}{\code{##1}}}% 4109 1.1 mrg \tablecheck{ftable}% 4110 1.1 mrg } 4111 1.1 mrg \envdef\vtable{% 4112 1.1 mrg \def\itemindex ##1{\doind {vr}{\code{##1}}}% 4113 1.1 mrg \tablecheck{vtable}% 4114 1.1 mrg } 4115 1.1 mrg \def\tablecheck#1{% 4116 1.1 mrg \ifnum \the\catcode`\^^M=\active 4117 1.1 mrg \endgroup 4118 1.1 mrg \errmessage{This command won't work in this context; perhaps the problem is 4119 1.1 mrg that we are \inenvironment\thisenv}% 4120 1.1 mrg \def\next{\doignore{#1}}% 4121 1.1 mrg \else 4122 1.1 mrg \let\next\tablex 4123 1.1 mrg \fi 4124 1.1 mrg \next 4125 1.1 mrg } 4126 1.1 mrg \def\tablex#1{% 4127 1.1 mrg \def\itemindicate{#1}% 4128 1.1 mrg \parsearg\tabley 4129 1.1 mrg } 4130 1.1 mrg \def\tabley#1{% 4131 1.1 mrg {% 4132 1.1 mrg \makevalueexpandable 4133 1.1 mrg \edef\temp{\noexpand\tablez #1\space\space\space}% 4134 1.1 mrg \expandafter 4135 1.1 mrg }\temp \endtablez 4136 1.1 mrg } 4137 1.1 mrg \def\tablez #1 #2 #3 #4\endtablez{% 4138 1.1 mrg \aboveenvbreak 4139 1.1 mrg \ifnum 0#1>0 \advance \leftskip by #1\mil \fi 4140 1.1 mrg \ifnum 0#2>0 \tableindent=#2\mil \fi 4141 1.1 mrg \ifnum 0#3>0 \advance \rightskip by #3\mil \fi 4142 1.1 mrg \itemmax=\tableindent 4143 1.1 mrg \advance \itemmax by -\itemmargin 4144 1.1 mrg \advance \leftskip by \tableindent 4145 1.1 mrg \exdentamount=\tableindent 4146 1.1 mrg \parindent = 0pt 4147 1.1 mrg \parskip = \smallskipamount 4148 1.1 mrg \ifdim \parskip=0pt \parskip=2pt \fi 4149 1.1 mrg \let\item = \internalBitem 4150 1.1 mrg \let\itemx = \internalBitemx 4151 1.1 mrg } 4152 1.1 mrg \def\Etable{\endgraf\afterenvbreak} 4153 1.1 mrg \let\Eftable\Etable 4154 1.1 mrg \let\Evtable\Etable 4155 1.1 mrg \let\Eitemize\Etable 4156 1.1 mrg \let\Eenumerate\Etable 4157 1.1 mrg 4158 1.1 mrg % This is the counter used by @enumerate, which is really @itemize 4159 1.1 mrg 4160 1.1 mrg \newcount \itemno 4161 1.1 mrg 4162 1.1 mrg \envdef\itemize{\parsearg\doitemize} 4163 1.1 mrg 4164 1.1 mrg \def\doitemize#1{% 4165 1.1 mrg \aboveenvbreak 4166 1.1 mrg \itemmax=\itemindent 4167 1.1 mrg \advance\itemmax by -\itemmargin 4168 1.1 mrg \advance\leftskip by \itemindent 4169 1.1 mrg \exdentamount=\itemindent 4170 1.1 mrg \parindent=0pt 4171 1.1 mrg \parskip=\smallskipamount 4172 1.1 mrg \ifdim\parskip=0pt \parskip=2pt \fi 4173 1.1 mrg % 4174 1.1 mrg % Try typesetting the item mark so that if the document erroneously says 4175 1.1 mrg % something like @itemize @samp (intending @table), there's an error 4176 1.1 mrg % right away at the @itemize. It's not the best error message in the 4177 1.1 mrg % world, but it's better than leaving it to the @item. This means if 4178 1.1 mrg % the user wants an empty mark, they have to say @w{} not just @w. 4179 1.1 mrg \def\itemcontents{#1}% 4180 1.1 mrg \setbox0 = \hbox{\itemcontents}% 4181 1.1 mrg % 4182 1.1 mrg % @itemize with no arg is equivalent to @itemize @bullet. 4183 1.1 mrg \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi 4184 1.1 mrg % 4185 1.1 mrg \let\item=\itemizeitem 4186 1.1 mrg } 4187 1.1 mrg 4188 1.1 mrg % Definition of @item while inside @itemize and @enumerate. 4189 1.1 mrg % 4190 1.1 mrg \def\itemizeitem{% 4191 1.1 mrg \advance\itemno by 1 % for enumerations 4192 1.1 mrg {\let\par=\endgraf \smallbreak}% reasonable place to break 4193 1.1 mrg {% 4194 1.1 mrg % If the document has an @itemize directly after a section title, a 4195 1.1 mrg % \nobreak will be last on the list, and \sectionheading will have 4196 1.1 mrg % done a \vskip-\parskip. In that case, we don't want to zero 4197 1.1 mrg % parskip, or the item text will crash with the heading. On the 4198 1.1 mrg % other hand, when there is normal text preceding the item (as there 4199 1.1 mrg % usually is), we do want to zero parskip, or there would be too much 4200 1.1 mrg % space. In that case, we won't have a \nobreak before. At least 4201 1.1 mrg % that's the theory. 4202 1.1 mrg \ifnum\lastpenalty<10000 \parskip=0in \fi 4203 1.1 mrg \noindent 4204 1.1 mrg \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% 4205 1.1 mrg % 4206 1.1 mrg \ifinner\else 4207 1.1 mrg \vadjust{\penalty 1200}% not good to break after first line of item. 4208 1.1 mrg \fi 4209 1.1 mrg % We can be in inner vertical mode in a footnote, although an 4210 1.1 mrg % @itemize looks awful there. 4211 1.1 mrg }% 4212 1.1 mrg \flushcr 4213 1.1 mrg } 4214 1.1 mrg 4215 1.1 mrg % \splitoff TOKENS\endmark defines \first to be the first token in 4216 1.1 mrg % TOKENS, and \rest to be the remainder. 4217 1.1 mrg % 4218 1.1 mrg \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% 4219 1.1 mrg 4220 1.1 mrg % Allow an optional argument of an uppercase letter, lowercase letter, 4221 1.1 mrg % or number, to specify the first label in the enumerated list. No 4222 1.1 mrg % argument is the same as `1'. 4223 1.1 mrg % 4224 1.1 mrg \envparseargdef\enumerate{\enumeratey #1 \endenumeratey} 4225 1.1 mrg \def\enumeratey #1 #2\endenumeratey{% 4226 1.1 mrg % If we were given no argument, pretend we were given `1'. 4227 1.1 mrg \def\thearg{#1}% 4228 1.1 mrg \ifx\thearg\empty \def\thearg{1}\fi 4229 1.1 mrg % 4230 1.1 mrg % Detect if the argument is a single token. If so, it might be a 4231 1.1 mrg % letter. Otherwise, the only valid thing it can be is a number. 4232 1.1 mrg % (We will always have one token, because of the test we just made. 4233 1.1 mrg % This is a good thing, since \splitoff doesn't work given nothing at 4234 1.1 mrg % all -- the first parameter is undelimited.) 4235 1.1 mrg \expandafter\splitoff\thearg\endmark 4236 1.1 mrg \ifx\rest\empty 4237 1.1 mrg % Only one token in the argument. It could still be anything. 4238 1.1 mrg % A ``lowercase letter'' is one whose \lccode is nonzero. 4239 1.1 mrg % An ``uppercase letter'' is one whose \lccode is both nonzero, and 4240 1.1 mrg % not equal to itself. 4241 1.1 mrg % Otherwise, we assume it's a number. 4242 1.1 mrg % 4243 1.1 mrg % We need the \relax at the end of the \ifnum lines to stop TeX from 4244 1.1 mrg % continuing to look for a <number>. 4245 1.1 mrg % 4246 1.1 mrg \ifnum\lccode\expandafter`\thearg=0\relax 4247 1.1 mrg \numericenumerate % a number (we hope) 4248 1.1 mrg \else 4249 1.1 mrg % It's a letter. 4250 1.1 mrg \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax 4251 1.1 mrg \lowercaseenumerate % lowercase letter 4252 1.1 mrg \else 4253 1.1 mrg \uppercaseenumerate % uppercase letter 4254 1.1 mrg \fi 4255 1.1 mrg \fi 4256 1.1 mrg \else 4257 1.1 mrg % Multiple tokens in the argument. We hope it's a number. 4258 1.1 mrg \numericenumerate 4259 1.1 mrg \fi 4260 1.1 mrg } 4261 1.1 mrg 4262 1.1 mrg % An @enumerate whose labels are integers. The starting integer is 4263 1.1 mrg % given in \thearg. 4264 1.1 mrg % 4265 1.1 mrg \def\numericenumerate{% 4266 1.1 mrg \itemno = \thearg 4267 1.1 mrg \startenumeration{\the\itemno}% 4268 1.1 mrg } 4269 1.1 mrg 4270 1.1 mrg % The starting (lowercase) letter is in \thearg. 4271 1.1 mrg \def\lowercaseenumerate{% 4272 1.1 mrg \itemno = \expandafter`\thearg 4273 1.1 mrg \startenumeration{% 4274 1.1 mrg % Be sure we're not beyond the end of the alphabet. 4275 1.1 mrg \ifnum\itemno=0 4276 1.1 mrg \errmessage{No more lowercase letters in @enumerate; get a bigger 4277 1.1 mrg alphabet}% 4278 1.1 mrg \fi 4279 1.1 mrg \char\lccode\itemno 4280 1.1 mrg }% 4281 1.1 mrg } 4282 1.1 mrg 4283 1.1 mrg % The starting (uppercase) letter is in \thearg. 4284 1.1 mrg \def\uppercaseenumerate{% 4285 1.1 mrg \itemno = \expandafter`\thearg 4286 1.1 mrg \startenumeration{% 4287 1.1 mrg % Be sure we're not beyond the end of the alphabet. 4288 1.1 mrg \ifnum\itemno=0 4289 1.1 mrg \errmessage{No more uppercase letters in @enumerate; get a bigger 4290 1.1 mrg alphabet} 4291 1.1 mrg \fi 4292 1.1 mrg \char\uccode\itemno 4293 1.1 mrg }% 4294 1.1 mrg } 4295 1.1 mrg 4296 1.1 mrg % Call \doitemize, adding a period to the first argument and supplying the 4297 1.1 mrg % common last two arguments. Also subtract one from the initial value in 4298 1.1 mrg % \itemno, since @item increments \itemno. 4299 1.1 mrg % 4300 1.1 mrg \def\startenumeration#1{% 4301 1.1 mrg \advance\itemno by -1 4302 1.1 mrg \doitemize{#1.}\flushcr 4303 1.1 mrg } 4304 1.1 mrg 4305 1.1 mrg 4306 1.1 mrg % @multitable macros 4307 1.1 mrg 4308 1.1 mrg % Macros used to set up halign preamble: 4309 1.1 mrg % 4310 1.1 mrg \let\endsetuptable\relax 4311 1.1 mrg \def\xendsetuptable{\endsetuptable} 4312 1.1 mrg \let\columnfractions\relax 4313 1.1 mrg \def\xcolumnfractions{\columnfractions} 4314 1.1 mrg \newif\ifsetpercent 4315 1.1 mrg 4316 1.1 mrg % #1 is the @columnfraction, usually a decimal number like .5, but might 4317 1.1 mrg % be just 1. We just use it, whatever it is. 4318 1.1 mrg % 4319 1.1 mrg \def\pickupwholefraction#1 {% 4320 1.1 mrg \global\advance\colcount by 1 4321 1.1 mrg \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}% 4322 1.1 mrg \setuptable 4323 1.1 mrg } 4324 1.1 mrg 4325 1.1 mrg \newcount\colcount 4326 1.1 mrg \def\setuptable#1{% 4327 1.1 mrg \def\firstarg{#1}% 4328 1.1 mrg \ifx\firstarg\xendsetuptable 4329 1.1 mrg \let\go = \relax 4330 1.1 mrg \else 4331 1.1 mrg \ifx\firstarg\xcolumnfractions 4332 1.1 mrg \global\setpercenttrue 4333 1.1 mrg \else 4334 1.1 mrg \ifsetpercent 4335 1.1 mrg \let\go\pickupwholefraction 4336 1.1 mrg \else 4337 1.1 mrg \global\advance\colcount by 1 4338 1.1 mrg \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a 4339 1.1 mrg % separator; typically that is always in the input, anyway. 4340 1.1 mrg \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% 4341 1.1 mrg \fi 4342 1.1 mrg \fi 4343 1.1 mrg \ifx\go\pickupwholefraction 4344 1.1 mrg % Put the argument back for the \pickupwholefraction call, so 4345 1.1 mrg % we'll always have a period there to be parsed. 4346 1.1 mrg \def\go{\pickupwholefraction#1}% 4347 1.1 mrg \else 4348 1.1 mrg \let\go = \setuptable 4349 1.1 mrg \fi% 4350 1.1 mrg \fi 4351 1.1 mrg \go 4352 1.1 mrg } 4353 1.1 mrg 4354 1.1 mrg % @headitem starts a heading row, which we typeset in bold. Assignments 4355 1.1 mrg % have to be global since we are inside the implicit group of an 4356 1.1 mrg % alignment entry. \everycr below resets \everytab so we don't have to 4357 1.1 mrg % undo it ourselves. 4358 1.1 mrg \def\headitemfont{\b}% for people to use in the template row; not changeable 4359 1.1 mrg \def\headitem{% 4360 1.1 mrg \checkenv\multitable 4361 1.1 mrg \crcr 4362 1.1 mrg \gdef\headitemcrhook{\nobreak}% attempt to avoid page break after headings 4363 1.1 mrg \global\everytab={\bf}% can't use \headitemfont since the parsing differs 4364 1.1 mrg \the\everytab % for the first item 4365 1.1 mrg }% 4366 1.1 mrg % 4367 1.1 mrg % default for tables with no headings. 4368 1.1 mrg \let\headitemcrhook=\relax 4369 1.1 mrg % 4370 1.1 mrg \def\tab{\checkenv\multitable &\the\everytab}% 4371 1.1 mrg 4372 1.1 mrg \newtoks\everytab % insert after every tab. 4373 1.1 mrg % 4374 1.1 mrg \envdef\multitable{% 4375 1.1 mrg \vskip\parskip 4376 1.1 mrg \startsavinginserts 4377 1.1 mrg % 4378 1.1 mrg % @item within a multitable starts a normal row. 4379 1.1 mrg % We use \def instead of \let so that if one of the multitable entries 4380 1.1 mrg % contains an @itemize, we don't choke on the \item (seen as \crcr aka 4381 1.1 mrg % \endtemplate) expanding \doitemize. 4382 1.1 mrg \def\item{\crcr}% 4383 1.1 mrg % 4384 1.1 mrg \tolerance=9500 4385 1.1.1.2 mrg \hbadness=9500 4386 1.1.1.2 mrg \parskip=0pt 4387 1.1 mrg \parindent=6pt 4388 1.1 mrg \overfullrule=0pt 4389 1.1 mrg \global\colcount=0 4390 1.1 mrg % 4391 1.1 mrg \everycr = {% 4392 1.1 mrg \noalign{% 4393 1.1 mrg \global\everytab={}% Reset from possible headitem. 4394 1.1 mrg \global\colcount=0 % Reset the column counter. 4395 1.1 mrg % 4396 1.1 mrg % Check for saved footnotes, etc.: 4397 1.1 mrg \checkinserts 4398 1.1 mrg % 4399 1.1 mrg % Perhaps a \nobreak, then reset: 4400 1.1 mrg \headitemcrhook 4401 1.1 mrg \global\let\headitemcrhook=\relax 4402 1.1 mrg }% 4403 1.1 mrg }% 4404 1.1 mrg % 4405 1.1 mrg \parsearg\domultitable 4406 1.1 mrg } 4407 1.1 mrg \def\domultitable#1{% 4408 1.1 mrg % To parse everything between @multitable and @item: 4409 1.1 mrg \setuptable#1 \endsetuptable 4410 1.1 mrg % 4411 1.1 mrg % This preamble sets up a generic column definition, which will 4412 1.1 mrg % be used as many times as user calls for columns. 4413 1.1 mrg % \vtop will set a single line and will also let text wrap and 4414 1.1 mrg % continue for many paragraphs if desired. 4415 1.1 mrg \halign\bgroup &% 4416 1.1.1.2 mrg \global\advance\colcount by 1 4417 1.1 mrg \strut 4418 1.1.1.2 mrg \vtop{% 4419 1.1.1.2 mrg \advance\hsize by -1\leftskip 4420 1.1 mrg % Find the correct column width 4421 1.1 mrg \hsize=\expandafter\csname col\the\colcount\endcsname 4422 1.1 mrg % 4423 1.1 mrg \rightskip=0pt 4424 1.1.1.2 mrg \ifnum\colcount=1 4425 1.1 mrg \advance\hsize by\leftskip % Add indent of surrounding text 4426 1.1.1.2 mrg \else 4427 1.1.1.2 mrg % In order to keep entries from bumping into each other. 4428 1.1.1.2 mrg \leftskip=12pt 4429 1.1.1.2 mrg \ifsetpercent \else 4430 1.1.1.2 mrg % If a template has been used 4431 1.1.1.2 mrg \advance\hsize by \leftskip 4432 1.1 mrg \fi 4433 1.1.1.2 mrg \fi 4434 1.1 mrg \noindent\ignorespaces##\unskip\strut 4435 1.1 mrg }\cr 4436 1.1 mrg } 4437 1.1 mrg \def\Emultitable{% 4438 1.1 mrg \crcr 4439 1.1 mrg \egroup % end the \halign 4440 1.1 mrg \global\setpercentfalse 4441 1.1 mrg } 4442 1.1 mrg 4443 1.1 mrg 4444 1.1 mrg \message{conditionals,} 4445 1.1 mrg 4446 1.1 mrg % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext, 4447 1.1 mrg % @ifnotxml always succeed. They currently do nothing; we don't 4448 1.1 mrg % attempt to check whether the conditionals are properly nested. But we 4449 1.1 mrg % have to remember that they are conditionals, so that @end doesn't 4450 1.1 mrg % attempt to close an environment group. 4451 1.1 mrg % 4452 1.1 mrg \def\makecond#1{% 4453 1.1 mrg \expandafter\let\csname #1\endcsname = \relax 4454 1.1 mrg \expandafter\let\csname iscond.#1\endcsname = 1 4455 1.1 mrg } 4456 1.1 mrg \makecond{iftex} 4457 1.1 mrg \makecond{ifnotdocbook} 4458 1.1 mrg \makecond{ifnothtml} 4459 1.1 mrg \makecond{ifnotinfo} 4460 1.1 mrg \makecond{ifnotplaintext} 4461 1.1 mrg \makecond{ifnotxml} 4462 1.1 mrg 4463 1.1 mrg % Ignore @ignore, @ifhtml, @ifinfo, and the like. 4464 1.1 mrg % 4465 1.1 mrg \def\direntry{\doignore{direntry}} 4466 1.1 mrg \def\documentdescription{\doignore{documentdescription}} 4467 1.1 mrg \def\docbook{\doignore{docbook}} 4468 1.1 mrg \def\html{\doignore{html}} 4469 1.1 mrg \def\ifdocbook{\doignore{ifdocbook}} 4470 1.1 mrg \def\ifhtml{\doignore{ifhtml}} 4471 1.1 mrg \def\ifinfo{\doignore{ifinfo}} 4472 1.1 mrg \def\ifnottex{\doignore{ifnottex}} 4473 1.1 mrg \def\ifplaintext{\doignore{ifplaintext}} 4474 1.1 mrg \def\ifxml{\doignore{ifxml}} 4475 1.1 mrg \def\ignore{\doignore{ignore}} 4476 1.1 mrg \def\menu{\doignore{menu}} 4477 1.1 mrg \def\xml{\doignore{xml}} 4478 1.1 mrg 4479 1.1 mrg % Ignore text until a line `@end #1', keeping track of nested conditionals. 4480 1.1 mrg % 4481 1.1 mrg % A count to remember the depth of nesting. 4482 1.1 mrg \newcount\doignorecount 4483 1.1 mrg 4484 1.1 mrg \def\doignore#1{\begingroup 4485 1.1 mrg % Scan in ``verbatim'' mode: 4486 1.1 mrg \obeylines 4487 1.1 mrg \catcode`\@ = \other 4488 1.1 mrg \catcode`\{ = \other 4489 1.1 mrg \catcode`\} = \other 4490 1.1 mrg % 4491 1.1 mrg % Make sure that spaces turn into tokens that match what \doignoretext wants. 4492 1.1 mrg \spaceisspace 4493 1.1 mrg % 4494 1.1 mrg % Count number of #1's that we've seen. 4495 1.1 mrg \doignorecount = 0 4496 1.1 mrg % 4497 1.1 mrg % Swallow text until we reach the matching `@end #1'. 4498 1.1 mrg \dodoignore{#1}% 4499 1.1 mrg } 4500 1.1 mrg 4501 1.1 mrg { \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source. 4502 1.1 mrg \obeylines % 4503 1.1 mrg % 4504 1.1 mrg \gdef\dodoignore#1{% 4505 1.1 mrg % #1 contains the command name as a string, e.g., `ifinfo'. 4506 1.1 mrg % 4507 1.1 mrg % Define a command to find the next `@end #1'. 4508 1.1 mrg \long\def\doignoretext##1^^M@end #1{% 4509 1.1 mrg \doignoretextyyy##1^^M@#1\_STOP_}% 4510 1.1 mrg % 4511 1.1 mrg % And this command to find another #1 command, at the beginning of a 4512 1.1 mrg % line. (Otherwise, we would consider a line `@c @ifset', for 4513 1.1 mrg % example, to count as an @ifset for nesting.) 4514 1.1 mrg \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}% 4515 1.1 mrg % 4516 1.1 mrg % And now expand that command. 4517 1.1 mrg \doignoretext ^^M% 4518 1.1 mrg }% 4519 1.1 mrg } 4520 1.1 mrg 4521 1.1 mrg \def\doignoreyyy#1{% 4522 1.1 mrg \def\temp{#1}% 4523 1.1 mrg \ifx\temp\empty % Nothing found. 4524 1.1 mrg \let\next\doignoretextzzz 4525 1.1 mrg \else % Found a nested condition, ... 4526 1.1 mrg \advance\doignorecount by 1 4527 1.1 mrg \let\next\doignoretextyyy % ..., look for another. 4528 1.1 mrg % If we're here, #1 ends with ^^M\ifinfo (for example). 4529 1.1 mrg \fi 4530 1.1 mrg \next #1% the token \_STOP_ is present just after this macro. 4531 1.1 mrg } 4532 1.1 mrg 4533 1.1 mrg % We have to swallow the remaining "\_STOP_". 4534 1.1 mrg % 4535 1.1 mrg \def\doignoretextzzz#1{% 4536 1.1 mrg \ifnum\doignorecount = 0 % We have just found the outermost @end. 4537 1.1 mrg \let\next\enddoignore 4538 1.1 mrg \else % Still inside a nested condition. 4539 1.1 mrg \advance\doignorecount by -1 4540 1.1 mrg \let\next\doignoretext % Look for the next @end. 4541 1.1 mrg \fi 4542 1.1 mrg \next 4543 1.1 mrg } 4544 1.1 mrg 4545 1.1 mrg % Finish off ignored text. 4546 1.1 mrg { \obeylines% 4547 1.1 mrg % Ignore anything after the last `@end #1'; this matters in verbatim 4548 1.1 mrg % environments, where otherwise the newline after an ignored conditional 4549 1.1 mrg % would result in a blank line in the output. 4550 1.1 mrg \gdef\enddoignore#1^^M{\endgroup\ignorespaces}% 4551 1.1 mrg } 4552 1.1 mrg 4553 1.1 mrg 4554 1.1 mrg % @set VAR sets the variable VAR to an empty value. 4555 1.1 mrg % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. 4556 1.1 mrg % 4557 1.1 mrg % Since we want to separate VAR from REST-OF-LINE (which might be 4558 1.1 mrg % empty), we can't just use \parsearg; we have to insert a space of our 4559 1.1 mrg % own to delimit the rest of the line, and then take it out again if we 4560 1.1 mrg % didn't need it. 4561 1.1 mrg % We rely on the fact that \parsearg sets \catcode`\ =10. 4562 1.1 mrg % 4563 1.1 mrg \parseargdef\set{\setyyy#1 \endsetyyy} 4564 1.1 mrg \def\setyyy#1 #2\endsetyyy{% 4565 1.1 mrg {% 4566 1.1 mrg \makevalueexpandable 4567 1.1 mrg \def\temp{#2}% 4568 1.1 mrg \edef\next{\gdef\makecsname{SET#1}}% 4569 1.1 mrg \ifx\temp\empty 4570 1.1 mrg \next{}% 4571 1.1 mrg \else 4572 1.1 mrg \setzzz#2\endsetzzz 4573 1.1 mrg \fi 4574 1.1 mrg }% 4575 1.1 mrg } 4576 1.1 mrg % Remove the trailing space \setxxx inserted. 4577 1.1 mrg \def\setzzz#1 \endsetzzz{\next{#1}} 4578 1.1 mrg 4579 1.1 mrg % @clear VAR clears (i.e., unsets) the variable VAR. 4580 1.1 mrg % 4581 1.1 mrg \parseargdef\clear{% 4582 1.1 mrg {% 4583 1.1 mrg \makevalueexpandable 4584 1.1 mrg \global\expandafter\let\csname SET#1\endcsname=\relax 4585 1.1 mrg }% 4586 1.1 mrg } 4587 1.1 mrg 4588 1.1 mrg % @value{foo} gets the text saved in variable foo. 4589 1.1 mrg \def\value{\begingroup\makevalueexpandable\valuexxx} 4590 1.1 mrg \def\valuexxx#1{\expandablevalue{#1}\endgroup} 4591 1.1 mrg { 4592 1.1 mrg \catcode`\-=\active \catcode`\_=\active 4593 1.1 mrg % 4594 1.1 mrg \gdef\makevalueexpandable{% 4595 1.1 mrg \let\value = \expandablevalue 4596 1.1 mrg % We don't want these characters active, ... 4597 1.1 mrg \catcode`\-=\other \catcode`\_=\other 4598 1.1 mrg % ..., but we might end up with active ones in the argument if 4599 1.1 mrg % we're called from @code, as @code{@value{foo-bar_}}, though. 4600 1.1 mrg % So \let them to their normal equivalents. 4601 1.1 mrg \let-\normaldash \let_\normalunderscore 4602 1.1 mrg } 4603 1.1 mrg } 4604 1.1 mrg 4605 1.1 mrg \def\expandablevalue#1{% 4606 1.1 mrg \expandafter\ifx\csname SET#1\endcsname\relax 4607 1.1 mrg {[No value for ``#1'']}% 4608 1.1 mrg \message{Variable `#1', used in @value, is not set.}% 4609 1.1 mrg \else 4610 1.1 mrg \csname SET#1\endcsname 4611 1.1 mrg \fi 4612 1.1 mrg } 4613 1.1 mrg 4614 1.1 mrg % Like \expandablevalue, but completely expandable (the \message in the 4615 1.1 mrg % definition above operates at the execution level of TeX). Used when 4616 1.1 mrg % writing to auxiliary files, due to the expansion that \write does. 4617 1.1 mrg % If flag is undefined, pass through an unexpanded @value command: maybe it 4618 1.1 mrg % will be set by the time it is read back in. 4619 1.1 mrg % 4620 1.1 mrg % NB flag names containing - or _ may not work here. 4621 1.1 mrg \def\dummyvalue#1{% 4622 1.1 mrg \expandafter\ifx\csname SET#1\endcsname\relax 4623 1.1 mrg \string\value{#1}% 4624 1.1 mrg \else 4625 1.1 mrg \csname SET#1\endcsname 4626 1.1 mrg \fi 4627 1.1 mrg } 4628 1.1 mrg 4629 1.1 mrg % Used for @value's in index entries to form the sort key: expand the @value 4630 1.1 mrg % if possible, otherwise sort late. 4631 1.1 mrg \def\indexnofontsvalue#1{% 4632 1.1 mrg \expandafter\ifx\csname SET#1\endcsname\relax 4633 1.1 mrg ZZZZZZZ% 4634 1.1 mrg \else 4635 1.1 mrg \csname SET#1\endcsname 4636 1.1 mrg \fi 4637 1.1 mrg } 4638 1.1 mrg 4639 1.1 mrg % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined 4640 1.1 mrg % with @set. 4641 1.1 mrg % 4642 1.1 mrg % To get the special treatment we need for `@end ifset,' we call 4643 1.1 mrg % \makecond and then redefine. 4644 1.1 mrg % 4645 1.1 mrg \makecond{ifset} 4646 1.1 mrg \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}} 4647 1.1 mrg \def\doifset#1#2{% 4648 1.1 mrg {% 4649 1.1 mrg \makevalueexpandable 4650 1.1 mrg \let\next=\empty 4651 1.1 mrg \expandafter\ifx\csname SET#2\endcsname\relax 4652 1.1 mrg #1% If not set, redefine \next. 4653 1.1 mrg \fi 4654 1.1 mrg \expandafter 4655 1.1 mrg }\next 4656 1.1 mrg } 4657 1.1 mrg \def\ifsetfail{\doignore{ifset}} 4658 1.1 mrg 4659 1.1 mrg % @ifclear VAR ... @end executes the `...' iff VAR has never been 4660 1.1 mrg % defined with @set, or has been undefined with @clear. 4661 1.1 mrg % 4662 1.1 mrg % The `\else' inside the `\doifset' parameter is a trick to reuse the 4663 1.1 mrg % above code: if the variable is not set, do nothing, if it is set, 4664 1.1 mrg % then redefine \next to \ifclearfail. 4665 1.1 mrg % 4666 1.1 mrg \makecond{ifclear} 4667 1.1 mrg \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} 4668 1.1 mrg \def\ifclearfail{\doignore{ifclear}} 4669 1.1 mrg 4670 1.1 mrg % @ifcommandisdefined CMD ... @end executes the `...' if CMD (written 4671 1.1 mrg % without the @) is in fact defined. We can only feasibly check at the 4672 1.1 mrg % TeX level, so something like `mathcode' is going to considered 4673 1.1 mrg % defined even though it is not a Texinfo command. 4674 1.1 mrg % 4675 1.1 mrg \makecond{ifcommanddefined} 4676 1.1 mrg \def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}} 4677 1.1 mrg % 4678 1.1 mrg \def\doifcmddefined#1#2{{% 4679 1.1 mrg \makevalueexpandable 4680 1.1 mrg \let\next=\empty 4681 1.1 mrg \expandafter\ifx\csname #2\endcsname\relax 4682 1.1 mrg #1% If not defined, \let\next as above. 4683 1.1 mrg \fi 4684 1.1 mrg \expandafter 4685 1.1 mrg }\next 4686 1.1 mrg } 4687 1.1 mrg \def\ifcmddefinedfail{\doignore{ifcommanddefined}} 4688 1.1 mrg 4689 1.1 mrg % @ifcommandnotdefined CMD ... handled similar to @ifclear above. 4690 1.1 mrg \makecond{ifcommandnotdefined} 4691 1.1 mrg \def\ifcommandnotdefined{% 4692 1.1 mrg \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}} 4693 1.1 mrg \def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}} 4694 1.1 mrg 4695 1.1 mrg % Set the `txicommandconditionals' variable, so documents have a way to 4696 1.1 mrg % test if the @ifcommand...defined conditionals are available. 4697 1.1 mrg \set txicommandconditionals 4698 1.1 mrg 4699 1.1 mrg % @dircategory CATEGORY -- specify a category of the dir file 4700 1.1 mrg % which this file should belong to. Ignore this in TeX. 4701 1.1 mrg \let\dircategory=\comment 4702 1.1 mrg 4703 1.1 mrg % @defininfoenclose. 4704 1.1 mrg \let\definfoenclose=\comment 4705 1.1 mrg 4706 1.1 mrg 4707 1.1 mrg \message{indexing,} 4708 1.1 mrg % Index generation facilities 4709 1.1 mrg 4710 1.1 mrg % Define \newwrite to be identical to plain tex's \newwrite 4711 1.1 mrg % except not \outer, so it can be used within macros and \if's. 4712 1.1 mrg \edef\newwrite{\makecsname{ptexnewwrite}} 4713 1.1 mrg 4714 1.1 mrg % \newindex {foo} defines an index named IX. 4715 1.1 mrg % It automatically defines \IXindex such that 4716 1.1 mrg % \IXindex ...rest of line... puts an entry in the index IX. 4717 1.1 mrg % It also defines \IXindfile to be the number of the output channel for 4718 1.1 mrg % the file that accumulates this index. The file's extension is IX. 4719 1.1 mrg % The name of an index should be no more than 2 characters long 4720 1.1 mrg % for the sake of vms. 4721 1.1 mrg % 4722 1.1 mrg \def\newindex#1{% 4723 1.1 mrg \expandafter\chardef\csname#1indfile\endcsname=0 4724 1.1 mrg \expandafter\xdef\csname#1index\endcsname{% % Define @#1index 4725 1.1 mrg \noexpand\doindex{#1}} 4726 1.1 mrg } 4727 1.1 mrg 4728 1.1 mrg % @defindex foo == \newindex{foo} 4729 1.1 mrg % 4730 1.1 mrg \def\defindex{\parsearg\newindex} 4731 1.1 mrg 4732 1.1 mrg % Define @defcodeindex, like @defindex except put all entries in @code. 4733 1.1 mrg % 4734 1.1 mrg \def\defcodeindex{\parsearg\newcodeindex} 4735 1.1 mrg % 4736 1.1 mrg \def\newcodeindex#1{% 4737 1.1 mrg \expandafter\chardef\csname#1indfile\endcsname=0 4738 1.1 mrg \expandafter\xdef\csname#1index\endcsname{% 4739 1.1 mrg \noexpand\docodeindex{#1}}% 4740 1.1 mrg } 4741 1.1 mrg 4742 1.1 mrg % The default indices: 4743 1.1 mrg \newindex{cp}% concepts, 4744 1.1 mrg \newcodeindex{fn}% functions, 4745 1.1 mrg \newcodeindex{vr}% variables, 4746 1.1 mrg \newcodeindex{tp}% types, 4747 1.1 mrg \newcodeindex{ky}% keys 4748 1.1 mrg \newcodeindex{pg}% and programs. 4749 1.1 mrg 4750 1.1 mrg 4751 1.1 mrg % @synindex foo bar makes index foo feed into index bar. 4752 1.1 mrg % Do this instead of @defindex foo if you don't want it as a separate index. 4753 1.1 mrg % 4754 1.1 mrg % @syncodeindex foo bar similar, but put all entries made for index foo 4755 1.1 mrg % inside @code. 4756 1.1 mrg % 4757 1.1 mrg \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} 4758 1.1 mrg \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} 4759 1.1 mrg 4760 1.1 mrg % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), 4761 1.1 mrg % #3 the target index (bar). 4762 1.1 mrg \def\dosynindex#1#2#3{% 4763 1.1 mrg \requireopenindexfile{#3}% 4764 1.1 mrg % redefine \fooindfile: 4765 1.1 mrg \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname 4766 1.1 mrg \expandafter\let\csname#2indfile\endcsname=\temp 4767 1.1 mrg % redefine \fooindex: 4768 1.1 mrg \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% 4769 1.1 mrg } 4770 1.1 mrg 4771 1.1 mrg % Define \doindex, the driver for all index macros. 4772 1.1 mrg % Argument #1 is generated by the calling \fooindex macro, 4773 1.1 mrg % and it is the two-letter name of the index. 4774 1.1 mrg 4775 1.1 mrg \def\doindex#1{\edef\indexname{#1}\parsearg\doindexxxx} 4776 1.1 mrg \def\doindexxxx #1{\doind{\indexname}{#1}} 4777 1.1 mrg 4778 1.1 mrg % like the previous two, but they put @code around the argument. 4779 1.1.1.2 mrg \def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx} 4780 1.1 mrg \def\docodeindexxxx #1{\docind{\indexname}{#1}} 4781 1.1 mrg 4782 1.1 mrg 4783 1.1 mrg % Used for the aux, toc and index files to prevent expansion of Texinfo 4784 1.1 mrg % commands. 4785 1.1 mrg % 4786 1.1 mrg \def\atdummies{% 4787 1.1 mrg \definedummyletter\@% 4788 1.1 mrg \definedummyletter\ % 4789 1.1 mrg \definedummyletter\{% 4790 1.1 mrg \definedummyletter\}% 4791 1.1 mrg \definedummyletter\&% 4792 1.1 mrg % 4793 1.1 mrg % Do the redefinitions. 4794 1.1 mrg \definedummies 4795 1.1 mrg \otherbackslash 4796 1.1 mrg } 4797 1.1 mrg 4798 1.1 mrg % \definedummyword defines \#1 as \string\#1\space, thus effectively 4799 1.1 mrg % preventing its expansion. This is used only for control words, 4800 1.1 mrg % not control letters, because the \space would be incorrect for 4801 1.1 mrg % control characters, but is needed to separate the control word 4802 1.1 mrg % from whatever follows. 4803 1.1 mrg % 4804 1.1 mrg % These can be used both for control words that take an argument and 4805 1.1 mrg % those that do not. If it is followed by {arg} in the input, then 4806 1.1 mrg % that will dutifully get written to the index (or wherever). 4807 1.1 mrg % 4808 1.1 mrg % For control letters, we have \definedummyletter, which omits the 4809 1.1 mrg % space. 4810 1.1 mrg % 4811 1.1 mrg \def\definedummyword #1{\def#1{\string#1\space}}% 4812 1.1 mrg \def\definedummyletter#1{\def#1{\string#1}}% 4813 1.1 mrg \let\definedummyaccent\definedummyletter 4814 1.1 mrg 4815 1.1 mrg % Called from \atdummies to prevent the expansion of commands. 4816 1.1 mrg % 4817 1.1 mrg \def\definedummies{% 4818 1.1 mrg % 4819 1.1 mrg \let\commondummyword\definedummyword 4820 1.1 mrg \let\commondummyletter\definedummyletter 4821 1.1 mrg \let\commondummyaccent\definedummyaccent 4822 1.1 mrg \commondummiesnofonts 4823 1.1 mrg % 4824 1.1 mrg \definedummyletter\_% 4825 1.1 mrg \definedummyletter\-% 4826 1.1 mrg % 4827 1.1 mrg % Non-English letters. 4828 1.1 mrg \definedummyword\AA 4829 1.1 mrg \definedummyword\AE 4830 1.1 mrg \definedummyword\DH 4831 1.1 mrg \definedummyword\L 4832 1.1 mrg \definedummyword\O 4833 1.1 mrg \definedummyword\OE 4834 1.1 mrg \definedummyword\TH 4835 1.1 mrg \definedummyword\aa 4836 1.1 mrg \definedummyword\ae 4837 1.1 mrg \definedummyword\dh 4838 1.1 mrg \definedummyword\exclamdown 4839 1.1 mrg \definedummyword\l 4840 1.1 mrg \definedummyword\o 4841 1.1 mrg \definedummyword\oe 4842 1.1 mrg \definedummyword\ordf 4843 1.1 mrg \definedummyword\ordm 4844 1.1 mrg \definedummyword\questiondown 4845 1.1 mrg \definedummyword\ss 4846 1.1 mrg \definedummyword\th 4847 1.1 mrg % 4848 1.1 mrg % Although these internal commands shouldn't show up, sometimes they do. 4849 1.1 mrg \definedummyword\bf 4850 1.1 mrg \definedummyword\gtr 4851 1.1 mrg \definedummyword\hat 4852 1.1 mrg \definedummyword\less 4853 1.1 mrg \definedummyword\sf 4854 1.1 mrg \definedummyword\sl 4855 1.1 mrg \definedummyword\tclose 4856 1.1 mrg \definedummyword\tt 4857 1.1 mrg % 4858 1.1 mrg \definedummyword\LaTeX 4859 1.1 mrg \definedummyword\TeX 4860 1.1 mrg % 4861 1.1 mrg % Assorted special characters. 4862 1.1 mrg \definedummyword\ampchar 4863 1.1 mrg \definedummyword\atchar 4864 1.1 mrg \definedummyword\arrow 4865 1.1 mrg \definedummyword\backslashchar 4866 1.1 mrg \definedummyword\bullet 4867 1.1 mrg \definedummyword\comma 4868 1.1 mrg \definedummyword\copyright 4869 1.1 mrg \definedummyword\registeredsymbol 4870 1.1 mrg \definedummyword\dots 4871 1.1 mrg \definedummyword\enddots 4872 1.1 mrg \definedummyword\entrybreak 4873 1.1 mrg \definedummyword\equiv 4874 1.1 mrg \definedummyword\error 4875 1.1 mrg \definedummyword\euro 4876 1.1 mrg \definedummyword\expansion 4877 1.1 mrg \definedummyword\geq 4878 1.1 mrg \definedummyword\guillemetleft 4879 1.1 mrg \definedummyword\guillemetright 4880 1.1 mrg \definedummyword\guilsinglleft 4881 1.1 mrg \definedummyword\guilsinglright 4882 1.1 mrg \definedummyword\lbracechar 4883 1.1 mrg \definedummyword\leq 4884 1.1 mrg \definedummyword\mathopsup 4885 1.1 mrg \definedummyword\minus 4886 1.1 mrg \definedummyword\ogonek 4887 1.1 mrg \definedummyword\pounds 4888 1.1 mrg \definedummyword\point 4889 1.1 mrg \definedummyword\print 4890 1.1 mrg \definedummyword\quotedblbase 4891 1.1 mrg \definedummyword\quotedblleft 4892 1.1 mrg \definedummyword\quotedblright 4893 1.1 mrg \definedummyword\quoteleft 4894 1.1 mrg \definedummyword\quoteright 4895 1.1 mrg \definedummyword\quotesinglbase 4896 1.1 mrg \definedummyword\rbracechar 4897 1.1 mrg \definedummyword\result 4898 1.1 mrg \definedummyword\sub 4899 1.1 mrg \definedummyword\sup 4900 1.1 mrg \definedummyword\textdegree 4901 1.1 mrg % 4902 1.1 mrg \definedummyword\subentry 4903 1.1 mrg % 4904 1.1 mrg % We want to disable all macros so that they are not expanded by \write. 4905 1.1 mrg \macrolist 4906 1.1 mrg \let\value\dummyvalue 4907 1.1 mrg % 4908 1.1 mrg \normalturnoffactive 4909 1.1 mrg } 4910 1.1 mrg 4911 1.1 mrg % \commondummiesnofonts: common to \definedummies and \indexnofonts. 4912 1.1 mrg % Define \commondummyletter, \commondummyaccent and \commondummyword before 4913 1.1 mrg % using. Used for accents, font commands, and various control letters. 4914 1.1 mrg % 4915 1.1 mrg \def\commondummiesnofonts{% 4916 1.1 mrg % Control letters and accents. 4917 1.1 mrg \commondummyletter\!% 4918 1.1 mrg \commondummyaccent\"% 4919 1.1 mrg \commondummyaccent\'% 4920 1.1 mrg \commondummyletter\*% 4921 1.1 mrg \commondummyaccent\,% 4922 1.1 mrg \commondummyletter\.% 4923 1.1 mrg \commondummyletter\/% 4924 1.1 mrg \commondummyletter\:% 4925 1.1 mrg \commondummyaccent\=% 4926 1.1 mrg \commondummyletter\?% 4927 1.1 mrg \commondummyaccent\^% 4928 1.1 mrg \commondummyaccent\`% 4929 1.1 mrg \commondummyaccent\~% 4930 1.1 mrg \commondummyword\u 4931 1.1 mrg \commondummyword\v 4932 1.1 mrg \commondummyword\H 4933 1.1 mrg \commondummyword\dotaccent 4934 1.1 mrg \commondummyword\ogonek 4935 1.1 mrg \commondummyword\ringaccent 4936 1.1 mrg \commondummyword\tieaccent 4937 1.1 mrg \commondummyword\ubaraccent 4938 1.1 mrg \commondummyword\udotaccent 4939 1.1 mrg \commondummyword\dotless 4940 1.1 mrg % 4941 1.1 mrg % Texinfo font commands. 4942 1.1 mrg \commondummyword\b 4943 1.1 mrg \commondummyword\i 4944 1.1 mrg \commondummyword\r 4945 1.1 mrg \commondummyword\sansserif 4946 1.1 mrg \commondummyword\sc 4947 1.1 mrg \commondummyword\slanted 4948 1.1 mrg \commondummyword\t 4949 1.1 mrg % 4950 1.1 mrg % Commands that take arguments. 4951 1.1 mrg \commondummyword\abbr 4952 1.1 mrg \commondummyword\acronym 4953 1.1 mrg \commondummyword\anchor 4954 1.1 mrg \commondummyword\cite 4955 1.1 mrg \commondummyword\code 4956 1.1 mrg \commondummyword\command 4957 1.1 mrg \commondummyword\dfn 4958 1.1 mrg \commondummyword\dmn 4959 1.1 mrg \commondummyword\email 4960 1.1 mrg \commondummyword\emph 4961 1.1 mrg \commondummyword\env 4962 1.1 mrg \commondummyword\file 4963 1.1 mrg \commondummyword\image 4964 1.1 mrg \commondummyword\indicateurl 4965 1.1 mrg \commondummyword\inforef 4966 1.1 mrg \commondummyword\kbd 4967 1.1 mrg \commondummyword\key 4968 1.1 mrg \commondummyword\math 4969 1.1 mrg \commondummyword\option 4970 1.1 mrg \commondummyword\pxref 4971 1.1 mrg \commondummyword\ref 4972 1.1 mrg \commondummyword\samp 4973 1.1 mrg \commondummyword\strong 4974 1.1 mrg \commondummyword\tie 4975 1.1 mrg \commondummyword\U 4976 1.1 mrg \commondummyword\uref 4977 1.1 mrg \commondummyword\url 4978 1.1 mrg \commondummyword\var 4979 1.1 mrg \commondummyword\verb 4980 1.1 mrg \commondummyword\w 4981 1.1 mrg \commondummyword\xref 4982 1.1 mrg } 4983 1.1 mrg 4984 1.1 mrg \let\indexlbrace\relax 4985 1.1 mrg \let\indexrbrace\relax 4986 1.1 mrg \let\indexatchar\relax 4987 1.1 mrg \let\indexbackslash\relax 4988 1.1 mrg 4989 1.1 mrg {\catcode`\@=0 4990 1.1 mrg \catcode`\\=13 4991 1.1 mrg @gdef@backslashdisappear{@def\{}} 4992 1.1 mrg } 4993 1.1 mrg 4994 1.1 mrg { 4995 1.1 mrg \catcode`\<=13 4996 1.1 mrg \catcode`\-=13 4997 1.1 mrg \catcode`\`=13 4998 1.1 mrg \gdef\indexnonalnumdisappear{% 4999 1.1 mrg \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax\else 5000 1.1 mrg % @set txiindexlquoteignore makes us ignore left quotes in the sort term. 5001 1.1 mrg % (Introduced for FSFS 2nd ed.) 5002 1.1 mrg \let`=\empty 5003 1.1 mrg \fi 5004 1.1 mrg % 5005 1.1 mrg \expandafter\ifx\csname SETtxiindexbackslashignore\endcsname\relax\else 5006 1.1 mrg \backslashdisappear 5007 1.1 mrg \fi 5008 1.1 mrg % 5009 1.1 mrg \expandafter\ifx\csname SETtxiindexhyphenignore\endcsname\relax\else 5010 1.1 mrg \def-{}% 5011 1.1 mrg \fi 5012 1.1 mrg \expandafter\ifx\csname SETtxiindexlessthanignore\endcsname\relax\else 5013 1.1 mrg \def<{}% 5014 1.1 mrg \fi 5015 1.1 mrg \expandafter\ifx\csname SETtxiindexatsignignore\endcsname\relax\else 5016 1.1 mrg \def\@{}% 5017 1.1 mrg \fi 5018 1.1 mrg } 5019 1.1 mrg 5020 1.1 mrg \gdef\indexnonalnumreappear{% 5021 1.1 mrg \let-\normaldash 5022 1.1 mrg \let<\normalless 5023 1.1 mrg } 5024 1.1 mrg } 5025 1.1 mrg 5026 1.1 mrg 5027 1.1 mrg % \indexnofonts is used when outputting the strings to sort the index 5028 1.1 mrg % by, and when constructing control sequence names. It eliminates all 5029 1.1 mrg % control sequences and just writes whatever the best ASCII sort string 5030 1.1 mrg % would be for a given command (usually its argument). 5031 1.1 mrg % 5032 1.1 mrg \def\indexnofonts{% 5033 1.1 mrg % Accent commands should become @asis. 5034 1.1 mrg \def\commondummyaccent##1{\let##1\asis}% 5035 1.1 mrg % We can just ignore other control letters. 5036 1.1 mrg \def\commondummyletter##1{\let##1\empty}% 5037 1.1 mrg % All control words become @asis by default; overrides below. 5038 1.1 mrg \let\commondummyword\commondummyaccent 5039 1.1 mrg \commondummiesnofonts 5040 1.1 mrg % 5041 1.1 mrg % Don't no-op \tt, since it isn't a user-level command 5042 1.1 mrg % and is used in the definitions of the active chars like <, >, |, etc. 5043 1.1 mrg % Likewise with the other plain tex font commands. 5044 1.1 mrg %\let\tt=\asis 5045 1.1 mrg % 5046 1.1 mrg \def\ { }% 5047 1.1 mrg \def\@{@}% 5048 1.1 mrg \def\_{\normalunderscore}% 5049 1.1 mrg \def\-{}% @- shouldn't affect sorting 5050 1.1 mrg % 5051 1.1 mrg \uccode`\1=`\{ \uppercase{\def\{{1}}% 5052 1.1 mrg \uccode`\1=`\} \uppercase{\def\}{1}}% 5053 1.1 mrg \let\lbracechar\{% 5054 1.1 mrg \let\rbracechar\}% 5055 1.1 mrg % 5056 1.1 mrg % Non-English letters. 5057 1.1 mrg \def\AA{AA}% 5058 1.1 mrg \def\AE{AE}% 5059 1.1 mrg \def\DH{DZZ}% 5060 1.1 mrg \def\L{L}% 5061 1.1 mrg \def\OE{OE}% 5062 1.1 mrg \def\O{O}% 5063 1.1 mrg \def\TH{TH}% 5064 1.1 mrg \def\aa{aa}% 5065 1.1 mrg \def\ae{ae}% 5066 1.1 mrg \def\dh{dzz}% 5067 1.1 mrg \def\exclamdown{!}% 5068 1.1 mrg \def\l{l}% 5069 1.1 mrg \def\oe{oe}% 5070 1.1 mrg \def\ordf{a}% 5071 1.1 mrg \def\ordm{o}% 5072 1.1 mrg \def\o{o}% 5073 1.1 mrg \def\questiondown{?}% 5074 1.1 mrg \def\ss{ss}% 5075 1.1 mrg \def\th{th}% 5076 1.1.1.2 mrg % 5077 1.1.1.2 mrg \let\do\indexnofontsdef 5078 1.1.1.2 mrg % 5079 1.1.1.2 mrg \do\LaTeX{LaTeX}% 5080 1.1 mrg \do\TeX{TeX}% 5081 1.1.1.2 mrg % 5082 1.1.1.2 mrg % Assorted special characters. 5083 1.1.1.2 mrg \do\atchar{@}% 5084 1.1.1.2 mrg \do\arrow{->}% 5085 1.1.1.2 mrg \do\bullet{bullet}% 5086 1.1.1.2 mrg \do\comma{,}% 5087 1.1.1.2 mrg \do\copyright{copyright}% 5088 1.1.1.2 mrg \do\dots{...}% 5089 1.1.1.2 mrg \do\enddots{...}% 5090 1.1.1.2 mrg \do\equiv{==}% 5091 1.1.1.2 mrg \do\error{error}% 5092 1.1.1.2 mrg \do\euro{euro}% 5093 1.1.1.2 mrg \do\expansion{==>}% 5094 1.1.1.2 mrg \do\geq{>=}% 5095 1.1.1.2 mrg \do\guillemetleft{<<}% 5096 1.1.1.2 mrg \do\guillemetright{>>}% 5097 1.1.1.2 mrg \do\guilsinglleft{<}% 5098 1.1.1.2 mrg \do\guilsinglright{>}% 5099 1.1.1.2 mrg \do\leq{<=}% 5100 1.1.1.2 mrg \do\lbracechar{\{}% 5101 1.1.1.2 mrg \do\minus{-}% 5102 1.1.1.2 mrg \do\point{.}% 5103 1.1.1.2 mrg \do\pounds{pounds}% 5104 1.1.1.2 mrg \do\print{-|}% 5105 1.1.1.2 mrg \do\quotedblbase{"}% 5106 1.1.1.2 mrg \do\quotedblleft{"}% 5107 1.1.1.2 mrg \do\quotedblright{"}% 5108 1.1.1.2 mrg \do\quoteleft{`}% 5109 1.1.1.2 mrg \do\quoteright{'}% 5110 1.1.1.2 mrg \do\quotesinglbase{,}% 5111 1.1.1.2 mrg \do\rbracechar{\}}% 5112 1.1.1.2 mrg \do\registeredsymbol{R}% 5113 1.1.1.2 mrg \do\result{=>}% 5114 1.1 mrg \do\textdegree{o}% 5115 1.1 mrg % 5116 1.1 mrg % We need to get rid of all macros, leaving only the arguments (if present). 5117 1.1 mrg % Of course this is not nearly correct, but it is the best we can do for now. 5118 1.1 mrg % makeinfo does not expand macros in the argument to @deffn, which ends up 5119 1.1 mrg % writing an index entry, and texindex isn't prepared for an index sort entry 5120 1.1 mrg % that starts with \. 5121 1.1 mrg % 5122 1.1 mrg % Since macro invocations are followed by braces, we can just redefine them 5123 1.1 mrg % to take a single TeX argument. The case of a macro invocation that 5124 1.1 mrg % goes to end-of-line is not handled. 5125 1.1 mrg % 5126 1.1 mrg \macrolist 5127 1.1 mrg \let\value\indexnofontsvalue 5128 1.1.1.2 mrg } 5129 1.1.1.2 mrg 5130 1.1.1.2 mrg % Give the control sequence a definition that removes the {} that follows 5131 1.1.1.2 mrg % its use, e.g. @AA{} -> AA 5132 1.1 mrg \def\indexnofontsdef#1#2{\def#1##1{#2}}% 5133 1.1 mrg 5134 1.1 mrg 5135 1.1 mrg 5136 1.1 mrg 5137 1.1 mrg % #1 is the index name, #2 is the entry text. 5138 1.1 mrg \def\doind#1#2{% 5139 1.1 mrg \iflinks 5140 1.1 mrg {% 5141 1.1 mrg % 5142 1.1 mrg \requireopenindexfile{#1}% 5143 1.1 mrg \edef\writeto{\csname#1indfile\endcsname}% 5144 1.1 mrg % 5145 1.1 mrg \def\indextext{#2}% 5146 1.1 mrg \safewhatsit\doindwrite 5147 1.1 mrg }% 5148 1.1 mrg \fi 5149 1.1 mrg } 5150 1.1.1.2 mrg 5151 1.1.1.2 mrg % Same as \doind, but for code indices 5152 1.1.1.2 mrg \def\docind#1#2{% 5153 1.1.1.2 mrg \iflinks 5154 1.1.1.2 mrg {% 5155 1.1.1.2 mrg % 5156 1.1.1.2 mrg \requireopenindexfile{#1}% 5157 1.1.1.2 mrg \edef\writeto{\csname#1indfile\endcsname}% 5158 1.1.1.2 mrg % 5159 1.1.1.2 mrg \def\indextext{#2}% 5160 1.1.1.2 mrg \safewhatsit\docindwrite 5161 1.1.1.2 mrg }% 5162 1.1.1.2 mrg \fi 5163 1.1.1.2 mrg } 5164 1.1 mrg 5165 1.1 mrg % Check if an index file has been opened, and if not, open it. 5166 1.1 mrg \def\requireopenindexfile#1{% 5167 1.1 mrg \ifnum\csname #1indfile\endcsname=0 5168 1.1 mrg \expandafter\newwrite \csname#1indfile\endcsname 5169 1.1 mrg \edef\suffix{#1}% 5170 1.1 mrg % A .fls suffix would conflict with the file extension for the output 5171 1.1 mrg % of -recorder, so use .f1s instead. 5172 1.1 mrg \ifx\suffix\indexisfl\def\suffix{f1}\fi 5173 1.1 mrg % Open the file 5174 1.1 mrg \immediate\openout\csname#1indfile\endcsname \jobname.\suffix 5175 1.1 mrg % Using \immediate above here prevents an object entering into the current 5176 1.1 mrg % box, which could confound checks such as those in \safewhatsit for 5177 1.1 mrg % preceding skips. 5178 1.1 mrg \typeout{Writing index file \jobname.\suffix}% 5179 1.1 mrg \fi} 5180 1.1 mrg \def\indexisfl{fl} 5181 1.1 mrg 5182 1.1 mrg % Definition for writing index entry sort key. 5183 1.1 mrg { 5184 1.1 mrg \catcode`\-=13 5185 1.1 mrg \gdef\indexwritesortas{% 5186 1.1 mrg \begingroup 5187 1.1 mrg \indexnonalnumreappear 5188 1.1 mrg \indexwritesortasxxx} 5189 1.1 mrg \gdef\indexwritesortasxxx#1{% 5190 1.1 mrg \xdef\indexsortkey{#1}\endgroup} 5191 1.1 mrg } 5192 1.1 mrg 5193 1.1 mrg \def\indexwriteseealso#1{ 5194 1.1 mrg \gdef\pagenumbertext{\string\seealso{#1}}% 5195 1.1 mrg } 5196 1.1 mrg \def\indexwriteseeentry#1{ 5197 1.1 mrg \gdef\pagenumbertext{\string\seeentry{#1}}% 5198 1.1 mrg } 5199 1.1 mrg 5200 1.1 mrg % The default definitions 5201 1.1 mrg \def\sortas#1{}% 5202 1.1 mrg \def\seealso#1{\i{\putwordSeeAlso}\ #1}% for sorted index file only 5203 1.1 mrg \def\putwordSeeAlso{See also} 5204 1.1 mrg \def\seeentry#1{\i{\putwordSee}\ #1}% for sorted index file only 5205 1.1 mrg 5206 1.1 mrg 5207 1.1 mrg % Given index entry text like "aaa @subentry bbb @sortas{ZZZ}": 5208 1.1 mrg % * Set \bracedtext to "{aaa}{bbb}" 5209 1.1 mrg % * Set \fullindexsortkey to "aaa @subentry ZZZ" 5210 1.1 mrg % * If @seealso occurs, set \pagenumbertext 5211 1.1 mrg % 5212 1.1 mrg \def\splitindexentry#1{% 5213 1.1 mrg \gdef\fullindexsortkey{}% 5214 1.1 mrg \xdef\bracedtext{}% 5215 1.1 mrg \def\sep{}% 5216 1.1 mrg \def\seealso##1{}% 5217 1.1 mrg \def\seeentry##1{}% 5218 1.1 mrg \expandafter\doindexsegment#1\subentry\finish\subentry 5219 1.1 mrg } 5220 1.1 mrg 5221 1.1 mrg % append the results from the next segment 5222 1.1 mrg \def\doindexsegment#1\subentry{% 5223 1.1 mrg \def\segment{#1}% 5224 1.1 mrg \ifx\segment\isfinish 5225 1.1 mrg \else 5226 1.1 mrg % 5227 1.1 mrg % Fully expand the segment, throwing away any @sortas directives, and 5228 1.1 mrg % trim spaces. 5229 1.1 mrg \edef\trimmed{\segment}% 5230 1.1.1.2 mrg \edef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}% 5231 1.1.1.2 mrg \ifincodeindex 5232 1.1.1.2 mrg \edef\trimmed{\noexpand\code{\trimmed}}% 5233 1.1 mrg \fi 5234 1.1 mrg % 5235 1.1 mrg \xdef\bracedtext{\bracedtext{\trimmed}}% 5236 1.1 mrg % 5237 1.1 mrg % Get the string to sort by. Process the segment with all 5238 1.1 mrg % font commands turned off. 5239 1.1 mrg \bgroup 5240 1.1 mrg \let\sortas\indexwritesortas 5241 1.1 mrg \let\seealso\indexwriteseealso 5242 1.1 mrg \let\seeentry\indexwriteseeentry 5243 1.1 mrg \indexnofonts 5244 1.1 mrg % The braces around the commands are recognized by texindex. 5245 1.1 mrg \def\lbracechar{{\string\indexlbrace}}% 5246 1.1 mrg \def\rbracechar{{\string\indexrbrace}}% 5247 1.1 mrg \let\{=\lbracechar 5248 1.1 mrg \let\}=\rbracechar 5249 1.1 mrg \def\@{{\string\indexatchar}}% 5250 1.1 mrg \def\atchar##1{\@}% 5251 1.1 mrg \def\backslashchar{{\string\indexbackslash}}% 5252 1.1 mrg \uccode`\~=`\\ \uppercase{\let~\backslashchar}% 5253 1.1 mrg % 5254 1.1 mrg \let\indexsortkey\empty 5255 1.1 mrg \global\let\pagenumbertext\empty 5256 1.1 mrg % Execute the segment and throw away the typeset output. This executes 5257 1.1 mrg % any @sortas or @seealso commands in this segment. 5258 1.1 mrg \setbox\dummybox = \hbox{\segment}% 5259 1.1 mrg \ifx\indexsortkey\empty{% 5260 1.1 mrg \indexnonalnumdisappear 5261 1.1 mrg \xdef\trimmed{\segment}% 5262 1.1 mrg \xdef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}% 5263 1.1 mrg \xdef\indexsortkey{\trimmed}% 5264 1.1 mrg \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi 5265 1.1 mrg }\fi 5266 1.1 mrg % 5267 1.1 mrg % Append to \fullindexsortkey. 5268 1.1 mrg \edef\tmp{\gdef\noexpand\fullindexsortkey{% 5269 1.1 mrg \fullindexsortkey\sep\indexsortkey}}% 5270 1.1 mrg \tmp 5271 1.1 mrg \egroup 5272 1.1 mrg \def\sep{\subentry}% 5273 1.1 mrg % 5274 1.1 mrg \expandafter\doindexsegment 5275 1.1 mrg \fi 5276 1.1 mrg } 5277 1.1 mrg \def\isfinish{\finish}% 5278 1.1 mrg \newbox\dummybox % used above 5279 1.1 mrg 5280 1.1 mrg \let\subentry\relax 5281 1.1 mrg 5282 1.1 mrg % Use \ instead of @ in index files. To support old texi2dvi and texindex. 5283 1.1 mrg % This works without changing the escape character used in the toc or aux 5284 1.1 mrg % files because the index entries are fully expanded here, and \string uses 5285 1.1 mrg % the current value of \escapechar. 5286 1.1 mrg \def\escapeisbackslash{\escapechar=`\\} 5287 1.1 mrg 5288 1.1 mrg % Use \ in index files by default. texi2dvi didn't support @ as the escape 5289 1.1 mrg % character (as it checked for "\entry" in the files, and not "@entry"). When 5290 1.1 mrg % the new version of texi2dvi has had a chance to become more prevalent, then 5291 1.1 mrg % the escape character can change back to @ again. This should be an easy 5292 1.1 mrg % change to make now because both @ and \ are only used as escape characters in 5293 1.1 mrg % index files, never standing for themselves. 5294 1.1 mrg % 5295 1.1 mrg \set txiindexescapeisbackslash 5296 1.1 mrg 5297 1.1 mrg % Write the entry in \indextext to the index file. 5298 1.1.1.2 mrg % 5299 1.1.1.2 mrg 5300 1.1.1.2 mrg \newif\ifincodeindex 5301 1.1.1.2 mrg \def\doindwrite{\incodeindexfalse\doindwritex} 5302 1.1.1.2 mrg \def\docindwrite{\incodeindextrue\doindwritex} 5303 1.1.1.2 mrg 5304 1.1 mrg \def\doindwritex{% 5305 1.1 mrg \maybemarginindex 5306 1.1 mrg % 5307 1.1 mrg \atdummies 5308 1.1 mrg % 5309 1.1 mrg \expandafter\ifx\csname SETtxiindexescapeisbackslash\endcsname\relax\else 5310 1.1 mrg \escapeisbackslash 5311 1.1 mrg \fi 5312 1.1 mrg % 5313 1.1 mrg % For texindex which always views { and } as separators. 5314 1.1 mrg \def\{{\lbracechar{}}% 5315 1.1 mrg \def\}{\rbracechar{}}% 5316 1.1 mrg \uccode`\~=`\\ \uppercase{\def~{\backslashchar{}}}% 5317 1.1 mrg % 5318 1.1 mrg % Split the entry into primary entry and any subentries, and get the index 5319 1.1 mrg % sort key. 5320 1.1 mrg \splitindexentry\indextext 5321 1.1 mrg % 5322 1.1 mrg % Set up the complete index entry, with both the sort key and 5323 1.1 mrg % the original text, including any font commands. We write 5324 1.1 mrg % three arguments to \entry to the .?? file (four in the 5325 1.1 mrg % subentry case), texindex reduces to two when writing the .??s 5326 1.1 mrg % sorted result. 5327 1.1 mrg % 5328 1.1 mrg \edef\temp{% 5329 1.1 mrg \write\writeto{% 5330 1.1 mrg \string\entry{\fullindexsortkey}% 5331 1.1 mrg {\ifx\pagenumbertext\empty\noexpand\folio\else\pagenumbertext\fi}% 5332 1.1 mrg \bracedtext}% 5333 1.1 mrg }% 5334 1.1 mrg \temp 5335 1.1 mrg } 5336 1.1 mrg 5337 1.1 mrg % Put the index entry in the margin if desired (undocumented). 5338 1.1 mrg \def\maybemarginindex{% 5339 1.1 mrg \ifx\SETmarginindex\relax\else 5340 1.1 mrg \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \relax\indextext}}% 5341 1.1 mrg \fi 5342 1.1 mrg } 5343 1.1 mrg \let\SETmarginindex=\relax 5344 1.1 mrg 5345 1.1 mrg 5346 1.1 mrg % Take care of unwanted page breaks/skips around a whatsit: 5347 1.1 mrg % 5348 1.1 mrg % If a skip is the last thing on the list now, preserve it 5349 1.1 mrg % by backing up by \lastskip, doing the \write, then inserting 5350 1.1 mrg % the skip again. Otherwise, the whatsit generated by the 5351 1.1 mrg % \write or \pdfdest will make \lastskip zero. The result is that 5352 1.1 mrg % sequences like this: 5353 1.1 mrg % @end defun 5354 1.1 mrg % @tindex whatever 5355 1.1 mrg % @defun ... 5356 1.1 mrg % will have extra space inserted, because the \medbreak in the 5357 1.1 mrg % start of the @defun won't see the skip inserted by the @end of 5358 1.1 mrg % the previous defun. 5359 1.1 mrg % 5360 1.1 mrg % But don't do any of this if we're not in vertical mode. We 5361 1.1 mrg % don't want to do a \vskip and prematurely end a paragraph. 5362 1.1 mrg % 5363 1.1 mrg % Avoid page breaks due to these extra skips, too. 5364 1.1 mrg % 5365 1.1 mrg % But wait, there is a catch there: 5366 1.1 mrg % We'll have to check whether \lastskip is zero skip. \ifdim is not 5367 1.1 mrg % sufficient for this purpose, as it ignores stretch and shrink parts 5368 1.1 mrg % of the skip. The only way seems to be to check the textual 5369 1.1 mrg % representation of the skip. 5370 1.1 mrg % 5371 1.1 mrg % The following is almost like \def\zeroskipmacro{0.0pt} except that 5372 1.1 mrg % the ``p'' and ``t'' characters have catcode \other, not 11 (letter). 5373 1.1 mrg % 5374 1.1 mrg \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname} 5375 1.1 mrg % 5376 1.1 mrg \newskip\whatsitskip 5377 1.1 mrg \newcount\whatsitpenalty 5378 1.1 mrg % 5379 1.1 mrg % ..., ready, GO: 5380 1.1 mrg % 5381 1.1 mrg \def\safewhatsit#1{\ifhmode 5382 1.1 mrg #1% 5383 1.1 mrg \else 5384 1.1 mrg % \lastskip and \lastpenalty cannot both be nonzero simultaneously. 5385 1.1 mrg \whatsitskip = \lastskip 5386 1.1 mrg \edef\lastskipmacro{\the\lastskip}% 5387 1.1 mrg \whatsitpenalty = \lastpenalty 5388 1.1 mrg % 5389 1.1 mrg % If \lastskip is nonzero, that means the last item was a 5390 1.1 mrg % skip. And since a skip is discardable, that means this 5391 1.1 mrg % -\whatsitskip glue we're inserting is preceded by a 5392 1.1 mrg % non-discardable item, therefore it is not a potential 5393 1.1 mrg % breakpoint, therefore no \nobreak needed. 5394 1.1 mrg \ifx\lastskipmacro\zeroskipmacro 5395 1.1 mrg \else 5396 1.1 mrg \vskip-\whatsitskip 5397 1.1 mrg \fi 5398 1.1 mrg % 5399 1.1 mrg #1% 5400 1.1 mrg % 5401 1.1 mrg \ifx\lastskipmacro\zeroskipmacro 5402 1.1 mrg % If \lastskip was zero, perhaps the last item was a penalty, and 5403 1.1 mrg % perhaps it was >=10000, e.g., a \nobreak. In that case, we want 5404 1.1 mrg % to re-insert the same penalty (values >10000 are used for various 5405 1.1 mrg % signals); since we just inserted a non-discardable item, any 5406 1.1 mrg % following glue (such as a \parskip) would be a breakpoint. For example: 5407 1.1 mrg % @deffn deffn-whatever 5408 1.1 mrg % @vindex index-whatever 5409 1.1 mrg % Description. 5410 1.1 mrg % would allow a break between the index-whatever whatsit 5411 1.1 mrg % and the "Description." paragraph. 5412 1.1 mrg \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi 5413 1.1 mrg \else 5414 1.1 mrg % On the other hand, if we had a nonzero \lastskip, 5415 1.1 mrg % this make-up glue would be preceded by a non-discardable item 5416 1.1 mrg % (the whatsit from the \write), so we must insert a \nobreak. 5417 1.1 mrg \nobreak\vskip\whatsitskip 5418 1.1 mrg \fi 5419 1.1 mrg \fi} 5420 1.1 mrg 5421 1.1 mrg % The index entry written in the file actually looks like 5422 1.1 mrg % \entry {sortstring}{page}{topic} 5423 1.1 mrg % or 5424 1.1 mrg % \entry {sortstring}{page}{topic}{subtopic} 5425 1.1 mrg % The texindex program reads in these files and writes files 5426 1.1 mrg % containing these kinds of lines: 5427 1.1 mrg % \initial {c} 5428 1.1 mrg % before the first topic whose initial is c 5429 1.1 mrg % \entry {topic}{pagelist} 5430 1.1 mrg % for a topic that is used without subtopics 5431 1.1 mrg % \primary {topic} 5432 1.1 mrg % \entry {topic}{} 5433 1.1 mrg % for the beginning of a topic that is used with subtopics 5434 1.1 mrg % \secondary {subtopic}{pagelist} 5435 1.1 mrg % for each subtopic. 5436 1.1 mrg % \secondary {subtopic}{} 5437 1.1 mrg % for a subtopic with sub-subtopics 5438 1.1 mrg % \tertiary {subtopic}{subsubtopic}{pagelist} 5439 1.1 mrg % for each sub-subtopic. 5440 1.1 mrg 5441 1.1 mrg % Define the user-accessible indexing commands 5442 1.1 mrg % @findex, @vindex, @kindex, @cindex. 5443 1.1 mrg 5444 1.1 mrg \def\findex {\fnindex} 5445 1.1 mrg \def\kindex {\kyindex} 5446 1.1 mrg \def\cindex {\cpindex} 5447 1.1 mrg \def\vindex {\vrindex} 5448 1.1 mrg \def\tindex {\tpindex} 5449 1.1 mrg \def\pindex {\pgindex} 5450 1.1 mrg 5451 1.1 mrg % Define the macros used in formatting output of the sorted index material. 5452 1.1 mrg 5453 1.1 mrg % @printindex causes a particular index (the ??s file) to get printed. 5454 1.1 mrg % It does not print any chapter heading (usually an @unnumbered). 5455 1.1 mrg % 5456 1.1 mrg \parseargdef\printindex{\begingroup 5457 1.1 mrg \dobreak \chapheadingskip{10000}% 5458 1.1 mrg % 5459 1.1 mrg \smallfonts \rm 5460 1.1 mrg \tolerance = 9500 5461 1.1 mrg \plainfrenchspacing 5462 1.1 mrg \everypar = {}% don't want the \kern\-parindent from indentation suppression. 5463 1.1 mrg % 5464 1.1 mrg % See comment in \requireopenindexfile. 5465 1.1 mrg \def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi 5466 1.1 mrg % 5467 1.1 mrg % See if the index file exists and is nonempty. 5468 1.1 mrg \openin 1 \jobname.\indexname s 5469 1.1 mrg \ifeof 1 5470 1.1 mrg % \enddoublecolumns gets confused if there is no text in the index, 5471 1.1 mrg % and it loses the chapter title and the aux file entries for the 5472 1.1 mrg % index. The easiest way to prevent this problem is to make sure 5473 1.1 mrg % there is some text. 5474 1.1 mrg \putwordIndexNonexistent 5475 1.1 mrg \typeout{No file \jobname.\indexname s.}% 5476 1.1 mrg \else 5477 1.1 mrg % If the index file exists but is empty, then \openin leaves \ifeof 5478 1.1 mrg % false. We have to make TeX try to read something from the file, so 5479 1.1 mrg % it can discover if there is anything in it. 5480 1.1 mrg \read 1 to \thisline 5481 1.1 mrg \ifeof 1 5482 1.1 mrg \putwordIndexIsEmpty 5483 1.1 mrg \else 5484 1.1 mrg \expandafter\printindexzz\thisline\relax\relax\finish% 5485 1.1 mrg \fi 5486 1.1 mrg \fi 5487 1.1 mrg \closein 1 5488 1.1 mrg \endgroup} 5489 1.1 mrg 5490 1.1 mrg % If the index file starts with a backslash, forgo reading the index 5491 1.1 mrg % file altogether. If somebody upgrades texinfo.tex they may still have 5492 1.1 mrg % old index files using \ as the escape character. Reading this would 5493 1.1 mrg % at best lead to typesetting garbage, at worst a TeX syntax error. 5494 1.1 mrg \def\printindexzz#1#2\finish{% 5495 1.1 mrg \expandafter\ifx\csname SETtxiindexescapeisbackslash\endcsname\relax 5496 1.1 mrg \uccode`\~=`\\ \uppercase{\if\noexpand~}\noexpand#1 5497 1.1 mrg \expandafter\ifx\csname SETtxiskipindexfileswithbackslash\endcsname\relax 5498 1.1 mrg \errmessage{% 5499 1.1 mrg ERROR: A sorted index file in an obsolete format was skipped. 5500 1.1 mrg To fix this problem, please upgrade your version of 'texi2dvi' 5501 1.1 mrg or 'texi2pdf' to that at <https://ftp.gnu.org/gnu/texinfo>. 5502 1.1 mrg If you are using an old version of 'texindex' (part of the Texinfo 5503 1.1 mrg distribution), you may also need to upgrade to a newer version (at least 6.0). 5504 1.1 mrg You may be able to typeset the index if you run 5505 1.1 mrg 'texindex \jobname.\indexname' yourself. 5506 1.1 mrg You could also try setting the 'txiindexescapeisbackslash' flag by 5507 1.1 mrg running a command like 5508 1.1 mrg 'texi2dvi -t "@set txiindexescapeisbackslash" \jobname.texi'. If you do 5509 1.1 mrg this, Texinfo will try to use index files in the old format. 5510 1.1 mrg If you continue to have problems, deleting the index files and starting again 5511 1.1 mrg might help (with 'rm \jobname.?? \jobname.??s')% 5512 1.1 mrg }% 5513 1.1 mrg \else 5514 1.1 mrg (Skipped sorted index file in obsolete format) 5515 1.1 mrg \fi 5516 1.1 mrg \else 5517 1.1 mrg \begindoublecolumns 5518 1.1 mrg \input \jobname.\indexname s 5519 1.1 mrg \enddoublecolumns 5520 1.1 mrg \fi 5521 1.1 mrg \else 5522 1.1 mrg \begindoublecolumns 5523 1.1.1.2 mrg \catcode`\\=0\relax 5524 1.1.1.2 mrg % 5525 1.1.1.2 mrg % Make @ an escape character to give macros a chance to work. This 5526 1.1.1.2 mrg % should work because we (hopefully) don't otherwise use @ in index files. 5527 1.1.1.2 mrg %\catcode`\@=12\relax 5528 1.1 mrg \catcode`\@=0\relax 5529 1.1 mrg \input \jobname.\indexname s 5530 1.1 mrg \enddoublecolumns 5531 1.1 mrg \fi 5532 1.1 mrg } 5533 1.1 mrg 5534 1.1 mrg % These macros are used by the sorted index file itself. 5535 1.1 mrg % Change them to control the appearance of the index. 5536 1.1 mrg 5537 1.1 mrg {\catcode`\/=13 \catcode`\-=13 \catcode`\^=13 \catcode`\~=13 \catcode`\_=13 5538 1.1 mrg \catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13 5539 1.1 mrg \catcode`\$=3 5540 1.1 mrg \gdef\initialglyphs{% 5541 1.1 mrg % special control sequences used in the index sort key 5542 1.1 mrg \let\indexlbrace\{% 5543 1.1 mrg \let\indexrbrace\}% 5544 1.1 mrg \let\indexatchar\@% 5545 1.1 mrg \def\indexbackslash{\math{\backslash}}% 5546 1.1 mrg % 5547 1.1 mrg % Some changes for non-alphabetic characters. Using the glyphs from the 5548 1.1 mrg % math fonts looks more consistent than the typewriter font used elsewhere 5549 1.1 mrg % for these characters. 5550 1.1 mrg \uccode`\~=`\\ \uppercase{\def~{\math{\backslash}}} 5551 1.1 mrg % 5552 1.1 mrg % In case @\ is used for backslash 5553 1.1 mrg \uppercase{\let\\=~} 5554 1.1 mrg % Can't get bold backslash so don't use bold forward slash 5555 1.1 mrg \catcode`\/=13 5556 1.1 mrg \def/{{\secrmnotbold \normalslash}}% 5557 1.1 mrg \def-{{\normaldash\normaldash}}% en dash `--' 5558 1.1 mrg \def^{{\chapbf \normalcaret}}% 5559 1.1 mrg \def~{{\chapbf \normaltilde}}% 5560 1.1 mrg \def\_{% 5561 1.1 mrg \leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }% 5562 1.1 mrg \def|{$\vert$}% 5563 1.1 mrg \def<{$\less$}% 5564 1.1 mrg \def>{$\gtr$}% 5565 1.1 mrg \def+{$\normalplus$}% 5566 1.1 mrg }} 5567 1.1 mrg 5568 1.1 mrg \def\initial{% 5569 1.1 mrg \bgroup 5570 1.1 mrg \initialglyphs 5571 1.1 mrg \initialx 5572 1.1 mrg } 5573 1.1 mrg 5574 1.1 mrg \def\initialx#1{% 5575 1.1 mrg % Remove any glue we may have, we'll be inserting our own. 5576 1.1 mrg \removelastskip 5577 1.1 mrg % 5578 1.1 mrg % We like breaks before the index initials, so insert a bonus. 5579 1.1 mrg % The glue before the bonus allows a little bit of space at the 5580 1.1 mrg % bottom of a column to reduce an increase in inter-line spacing. 5581 1.1 mrg \nobreak 5582 1.1 mrg \vskip 0pt plus 5\baselineskip 5583 1.1 mrg \penalty -300 5584 1.1 mrg \vskip 0pt plus -5\baselineskip 5585 1.1 mrg % 5586 1.1 mrg % Typeset the initial. Making this add up to a whole number of 5587 1.1 mrg % baselineskips increases the chance of the dots lining up from column 5588 1.1 mrg % to column. It still won't often be perfect, because of the stretch 5589 1.1 mrg % we need before each entry, but it's better. 5590 1.1 mrg % 5591 1.1 mrg % No shrink because it confuses \balancecolumns. 5592 1.1 mrg \vskip 1.67\baselineskip plus 1\baselineskip 5593 1.1 mrg \leftline{\secfonts \kern-0.05em \secbf #1}% 5594 1.1 mrg % \secfonts is inside the argument of \leftline so that the change of 5595 1.1 mrg % \baselineskip will not affect any glue inserted before the vbox that 5596 1.1 mrg % \leftline creates. 5597 1.1 mrg % Do our best not to break after the initial. 5598 1.1 mrg \nobreak 5599 1.1 mrg \vskip .33\baselineskip plus .1\baselineskip 5600 1.1 mrg \egroup % \initialglyphs 5601 1.1 mrg } 5602 1.1 mrg 5603 1.1 mrg \newdimen\entryrightmargin 5604 1.1 mrg \entryrightmargin=0pt 5605 1.1 mrg 5606 1.1 mrg % \entry typesets a paragraph consisting of the text (#1), dot leaders, and 5607 1.1 mrg % then page number (#2) flushed to the right margin. It is used for index 5608 1.1 mrg % and table of contents entries. The paragraph is indented by \leftskip. 5609 1.1 mrg % 5610 1.1 mrg \def\entry{% 5611 1.1 mrg \begingroup 5612 1.1 mrg % 5613 1.1 mrg % Start a new paragraph if necessary, so our assignments below can't 5614 1.1 mrg % affect previous text. 5615 1.1 mrg \par 5616 1.1 mrg % 5617 1.1 mrg % No extra space above this paragraph. 5618 1.1 mrg \parskip = 0in 5619 1.1 mrg % 5620 1.1 mrg % When reading the text of entry, convert explicit line breaks 5621 1.1 mrg % from @* into spaces. The user might give these in long section 5622 1.1 mrg % titles, for instance. 5623 1.1 mrg \def\*{\unskip\space\ignorespaces}% 5624 1.1 mrg \def\entrybreak{\hfil\break}% An undocumented command 5625 1.1 mrg % 5626 1.1 mrg % Swallow the left brace of the text (first parameter): 5627 1.1 mrg \afterassignment\doentry 5628 1.1 mrg \let\temp = 5629 1.1 mrg } 5630 1.1 mrg \def\entrybreak{\unskip\space\ignorespaces}% 5631 1.1 mrg \def\doentry{% 5632 1.1 mrg % Save the text of the entry 5633 1.1 mrg \global\setbox\boxA=\hbox\bgroup 5634 1.1 mrg \bgroup % Instead of the swallowed brace. 5635 1.1 mrg \noindent 5636 1.1 mrg \aftergroup\finishentry 5637 1.1 mrg % And now comes the text of the entry. 5638 1.1 mrg % Not absorbing as a macro argument reduces the chance of problems 5639 1.1 mrg % with catcodes occurring. 5640 1.1 mrg } 5641 1.1 mrg {\catcode`\@=11 5642 1.1 mrg \gdef\finishentry#1{% 5643 1.1 mrg \egroup % end box A 5644 1.1 mrg \dimen@ = \wd\boxA % Length of text of entry 5645 1.1 mrg \global\setbox\boxA=\hbox\bgroup 5646 1.1 mrg \unhbox\boxA 5647 1.1 mrg % #1 is the page number. 5648 1.1 mrg % 5649 1.1 mrg % Get the width of the page numbers, and only use 5650 1.1 mrg % leaders if they are present. 5651 1.1 mrg \global\setbox\boxB = \hbox{#1}% 5652 1.1 mrg \ifdim\wd\boxB = 0pt 5653 1.1 mrg \null\nobreak\hfill\ % 5654 1.1 mrg \else 5655 1.1 mrg % 5656 1.1 mrg \null\nobreak\indexdotfill % Have leaders before the page number. 5657 1.1 mrg % 5658 1.1 mrg \ifpdforxetex 5659 1.1 mrg \pdfgettoks#1.% 5660 1.1 mrg \hskip\skip\thinshrinkable\the\toksA 5661 1.1 mrg \else 5662 1.1 mrg \hskip\skip\thinshrinkable #1% 5663 1.1 mrg \fi 5664 1.1 mrg \fi 5665 1.1 mrg \egroup % end \boxA 5666 1.1 mrg \ifdim\wd\boxB = 0pt 5667 1.1 mrg \noindent\unhbox\boxA\par 5668 1.1 mrg \nobreak 5669 1.1 mrg \else\bgroup 5670 1.1 mrg % We want the text of the entries to be aligned to the left, and the 5671 1.1 mrg % page numbers to be aligned to the right. 5672 1.1 mrg % 5673 1.1 mrg \parindent = 0pt 5674 1.1 mrg \advance\leftskip by 0pt plus 1fil 5675 1.1 mrg \advance\leftskip by 0pt plus -1fill 5676 1.1 mrg \rightskip = 0pt plus -1fil 5677 1.1 mrg \advance\rightskip by 0pt plus 1fill 5678 1.1 mrg % Cause last line, which could consist of page numbers on their own 5679 1.1 mrg % if the list of page numbers is long, to be aligned to the right. 5680 1.1 mrg \parfillskip=0pt plus -1fill 5681 1.1 mrg % 5682 1.1 mrg \advance\rightskip by \entryrightmargin 5683 1.1 mrg % Determine how far we can stretch into the margin. 5684 1.1 mrg % This allows, e.g., "Appendix H GNU Free Documentation License" to 5685 1.1 mrg % fit on one line in @letterpaper format. 5686 1.1 mrg \ifdim\entryrightmargin>2.1em 5687 1.1 mrg \dimen@i=2.1em 5688 1.1 mrg \else 5689 1.1 mrg \dimen@i=0em 5690 1.1 mrg \fi 5691 1.1 mrg \advance \parfillskip by 0pt minus 1\dimen@i 5692 1.1 mrg % 5693 1.1 mrg \dimen@ii = \hsize 5694 1.1 mrg \advance\dimen@ii by -1\leftskip 5695 1.1 mrg \advance\dimen@ii by -1\entryrightmargin 5696 1.1 mrg \advance\dimen@ii by 1\dimen@i 5697 1.1 mrg \ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line 5698 1.1 mrg \ifdim\dimen@ > 0.8\dimen@ii % due to long index text 5699 1.1 mrg % Try to split the text roughly evenly. \dimen@ will be the length of 5700 1.1 mrg % the first line. 5701 1.1 mrg \dimen@ = 0.7\dimen@ 5702 1.1 mrg \dimen@ii = \hsize 5703 1.1 mrg \ifnum\dimen@>\dimen@ii 5704 1.1 mrg % If the entry is too long (for example, if it needs more than 5705 1.1 mrg % two lines), use all the space in the first line. 5706 1.1 mrg \dimen@ = \dimen@ii 5707 1.1 mrg \fi 5708 1.1 mrg \advance\leftskip by 0pt plus 1fill % ragged right 5709 1.1 mrg \advance \dimen@ by 1\rightskip 5710 1.1 mrg \parshape = 2 0pt \dimen@ 0em \dimen@ii 5711 1.1 mrg % Ideally we'd add a finite glue at the end of the first line only, 5712 1.1 mrg % instead of using \parshape with explicit line lengths, but TeX 5713 1.1 mrg % doesn't seem to provide a way to do such a thing. 5714 1.1 mrg % 5715 1.1 mrg % Indent all lines but the first one. 5716 1.1 mrg \advance\leftskip by 1em 5717 1.1 mrg \advance\parindent by -1em 5718 1.1 mrg \fi\fi 5719 1.1 mrg \indent % start paragraph 5720 1.1 mrg \unhbox\boxA 5721 1.1 mrg % 5722 1.1 mrg % Do not prefer a separate line ending with a hyphen to fewer lines. 5723 1.1 mrg \finalhyphendemerits = 0 5724 1.1 mrg % 5725 1.1 mrg % Word spacing - no stretch 5726 1.1 mrg \spaceskip=\fontdimen2\font minus \fontdimen4\font 5727 1.1 mrg % 5728 1.1 mrg \linepenalty=1000 % Discourage line breaks. 5729 1.1 mrg \hyphenpenalty=5000 % Discourage hyphenation. 5730 1.1 mrg % 5731 1.1 mrg \par % format the paragraph 5732 1.1 mrg \egroup % The \vbox 5733 1.1 mrg \fi 5734 1.1 mrg \endgroup 5735 1.1 mrg }} 5736 1.1 mrg 5737 1.1 mrg \newskip\thinshrinkable 5738 1.1 mrg \skip\thinshrinkable=.15em minus .15em 5739 1.1 mrg 5740 1.1 mrg % Like plain.tex's \dotfill, except uses up at least 1 em. 5741 1.1 mrg % The filll stretch here overpowers both the fil and fill stretch to push 5742 1.1 mrg % the page number to the right. 5743 1.1 mrg \def\indexdotfill{\cleaders 5744 1.1 mrg \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1filll} 5745 1.1 mrg 5746 1.1 mrg 5747 1.1 mrg \def\primary #1{\line{#1\hfil}} 5748 1.1 mrg 5749 1.1 mrg \def\secondary{\indententry{0.5cm}} 5750 1.1 mrg \def\tertiary{\indententry{1cm}} 5751 1.1 mrg 5752 1.1 mrg \def\indententry#1#2#3{% 5753 1.1 mrg \bgroup 5754 1.1 mrg \leftskip=#1 5755 1.1 mrg \entry{#2}{#3}% 5756 1.1 mrg \egroup 5757 1.1 mrg } 5758 1.1 mrg 5759 1.1 mrg % Define two-column mode, which we use to typeset indexes. 5760 1.1 mrg % Adapted from the TeXbook, page 416, which is to say, 5761 1.1 mrg % the manmac.tex format used to print the TeXbook itself. 5762 1.1 mrg \catcode`\@=11 % private names 5763 1.1 mrg 5764 1.1 mrg \newbox\partialpage 5765 1.1 mrg \newdimen\doublecolumnhsize 5766 1.1 mrg 5767 1.1 mrg \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns 5768 1.1 mrg % If not much space left on page, start a new page. 5769 1.1 mrg \ifdim\pagetotal>0.8\vsize\vfill\eject\fi 5770 1.1 mrg % 5771 1.1 mrg % Grab any single-column material above us. 5772 1.1 mrg \output = {% 5773 1.1 mrg \savetopmark 5774 1.1 mrg % 5775 1.1 mrg \global\setbox\partialpage = \vbox{% 5776 1.1 mrg % Unvbox the main output page. 5777 1.1 mrg \unvbox\PAGE 5778 1.1 mrg \kern-\topskip \kern\baselineskip 5779 1.1 mrg }% 5780 1.1 mrg }% 5781 1.1 mrg \eject % run that output routine to set \partialpage 5782 1.1 mrg % 5783 1.1 mrg % Use the double-column output routine for subsequent pages. 5784 1.1 mrg \output = {\doublecolumnout}% 5785 1.1 mrg % 5786 1.1 mrg % Change the page size parameters. We could do this once outside this 5787 1.1 mrg % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 5788 1.1 mrg % format, but then we repeat the same computation. Repeating a couple 5789 1.1 mrg % of assignments once per index is clearly meaningless for the 5790 1.1 mrg % execution time, so we may as well do it in one place. 5791 1.1 mrg % 5792 1.1 mrg % First we halve the line length, less a little for the gutter between 5793 1.1 mrg % the columns. We compute the gutter based on the line length, so it 5794 1.1 mrg % changes automatically with the paper format. The magic constant 5795 1.1 mrg % below is chosen so that the gutter has the same value (well, +-<1pt) 5796 1.1 mrg % as it did when we hard-coded it. 5797 1.1 mrg % 5798 1.1 mrg % We put the result in a separate register, \doublecolumhsize, so we 5799 1.1 mrg % can restore it in \pagesofar, after \hsize itself has (potentially) 5800 1.1 mrg % been clobbered. 5801 1.1 mrg % 5802 1.1 mrg \doublecolumnhsize = \hsize 5803 1.1 mrg \advance\doublecolumnhsize by -.04154\hsize 5804 1.1 mrg \divide\doublecolumnhsize by 2 5805 1.1 mrg \hsize = \doublecolumnhsize 5806 1.1 mrg % 5807 1.1 mrg % Get the available space for the double columns -- the normal 5808 1.1 mrg % (undoubled) page height minus any material left over from the 5809 1.1 mrg % previous page. 5810 1.1 mrg \advance\vsize by -\ht\partialpage 5811 1.1 mrg \vsize = 2\vsize 5812 1.1 mrg % 5813 1.1 mrg % For the benefit of balancing columns 5814 1.1 mrg \advance\baselineskip by 0pt plus 0.5pt 5815 1.1 mrg } 5816 1.1 mrg 5817 1.1 mrg % The double-column output routine for all double-column pages except 5818 1.1 mrg % the last, which is done by \balancecolumns. 5819 1.1 mrg % 5820 1.1 mrg \def\doublecolumnout{% 5821 1.1 mrg % 5822 1.1 mrg \savetopmark 5823 1.1 mrg \splittopskip=\topskip \splitmaxdepth=\maxdepth 5824 1.1 mrg \dimen@ = \vsize 5825 1.1 mrg \divide\dimen@ by 2 5826 1.1 mrg % 5827 1.1 mrg % box0 will be the left-hand column, box2 the right. 5828 1.1 mrg \setbox0=\vsplit\PAGE to\dimen@ \setbox2=\vsplit\PAGE to\dimen@ 5829 1.1 mrg \global\advance\vsize by 2\ht\partialpage 5830 1.1 mrg \onepageout\pagesofar % empty except for the first time we are called 5831 1.1 mrg \unvbox\PAGE 5832 1.1 mrg \penalty\outputpenalty 5833 1.1 mrg } 5834 1.1 mrg % 5835 1.1 mrg % Re-output the contents of the output page -- any previous material, 5836 1.1 mrg % followed by the two boxes we just split, in box0 and box2. 5837 1.1 mrg \def\pagesofar{% 5838 1.1 mrg \unvbox\partialpage 5839 1.1 mrg % 5840 1.1 mrg \hsize = \doublecolumnhsize 5841 1.1 mrg \wd0=\hsize \wd2=\hsize 5842 1.1 mrg \hbox to\txipagewidth{\box0\hfil\box2}% 5843 1.1 mrg } 5844 1.1 mrg 5845 1.1 mrg 5846 1.1 mrg % Finished with double columns. 5847 1.1 mrg \def\enddoublecolumns{% 5848 1.1 mrg % The following penalty ensures that the page builder is exercised 5849 1.1 mrg % _before_ we change the output routine. This is necessary in the 5850 1.1 mrg % following situation: 5851 1.1 mrg % 5852 1.1 mrg % The last section of the index consists only of a single entry. 5853 1.1 mrg % Before this section, \pagetotal is less than \pagegoal, so no 5854 1.1 mrg % break occurs before the last section starts. However, the last 5855 1.1 mrg % section, consisting of \initial and the single \entry, does not 5856 1.1 mrg % fit on the page and has to be broken off. Without the following 5857 1.1 mrg % penalty the page builder will not be exercised until \eject 5858 1.1 mrg % below, and by that time we'll already have changed the output 5859 1.1 mrg % routine to the \balancecolumns version, so the next-to-last 5860 1.1 mrg % double-column page will be processed with \balancecolumns, which 5861 1.1 mrg % is wrong: The two columns will go to the main vertical list, with 5862 1.1 mrg % the broken-off section in the recent contributions. As soon as 5863 1.1 mrg % the output routine finishes, TeX starts reconsidering the page 5864 1.1 mrg % break. The two columns and the broken-off section both fit on the 5865 1.1 mrg % page, because the two columns now take up only half of the page 5866 1.1 mrg % goal. When TeX sees \eject from below which follows the final 5867 1.1 mrg % section, it invokes the new output routine that we've set after 5868 1.1 mrg % \balancecolumns below; \onepageout will try to fit the two columns 5869 1.1 mrg % and the final section into the vbox of \txipageheight (see 5870 1.1 mrg % \pagebody), causing an overfull box. 5871 1.1 mrg % 5872 1.1 mrg % Note that glue won't work here, because glue does not exercise the 5873 1.1 mrg % page builder, unlike penalties (see The TeXbook, pp. 280-281). 5874 1.1 mrg \penalty0 5875 1.1 mrg % 5876 1.1 mrg \output = {% 5877 1.1 mrg % Split the last of the double-column material. 5878 1.1 mrg \savetopmark 5879 1.1 mrg \balancecolumns 5880 1.1 mrg }% 5881 1.1 mrg \eject % call the \output just set 5882 1.1 mrg \ifdim\pagetotal=0pt 5883 1.1 mrg % Having called \balancecolumns once, we do not 5884 1.1 mrg % want to call it again. Therefore, reset \output to its normal 5885 1.1 mrg % definition right away. 5886 1.1 mrg \global\output=\expandafter{\the\defaultoutput} 5887 1.1 mrg % 5888 1.1 mrg \endgroup % started in \begindoublecolumns 5889 1.1 mrg % Leave the double-column material on the current page, no automatic 5890 1.1 mrg % page break. 5891 1.1 mrg \box\balancedcolumns 5892 1.1 mrg % 5893 1.1 mrg % \pagegoal was set to the doubled \vsize above, since we restarted 5894 1.1 mrg % the current page. We're now back to normal single-column 5895 1.1 mrg % typesetting, so reset \pagegoal to the normal \vsize. 5896 1.1 mrg \global\vsize = \txipageheight % 5897 1.1 mrg \pagegoal = \txipageheight % 5898 1.1 mrg \else 5899 1.1 mrg % We had some left-over material. This might happen when \doublecolumnout 5900 1.1 mrg % is called in \balancecolumns. Try again. 5901 1.1 mrg \expandafter\enddoublecolumns 5902 1.1 mrg \fi 5903 1.1 mrg } 5904 1.1 mrg \newbox\balancedcolumns 5905 1.1 mrg \setbox\balancedcolumns=\vbox{shouldnt see this}% 5906 1.1 mrg % 5907 1.1 mrg % Only called for the last of the double column material. \doublecolumnout 5908 1.1 mrg % does the others. 5909 1.1 mrg \def\balancecolumns{% 5910 1.1 mrg \setbox0 = \vbox{\unvbox\PAGE}% like \box255 but more efficient, see p.120. 5911 1.1 mrg \dimen@ = \ht0 5912 1.1 mrg \ifdim\dimen@<7\baselineskip 5913 1.1 mrg % Don't split a short final column in two. 5914 1.1 mrg \setbox2=\vbox{}% 5915 1.1 mrg \global\setbox\balancedcolumns=\vbox{\pagesofar}% 5916 1.1 mrg \else 5917 1.1 mrg % double the leading vertical space 5918 1.1 mrg \advance\dimen@ by \topskip 5919 1.1 mrg \advance\dimen@ by-\baselineskip 5920 1.1 mrg \divide\dimen@ by 2 % target to split to 5921 1.1 mrg \dimen@ii = \dimen@ 5922 1.1 mrg \splittopskip = \topskip 5923 1.1 mrg % Loop until left column is at least as high as the right column. 5924 1.1 mrg {% 5925 1.1 mrg \vbadness = 10000 5926 1.1 mrg \loop 5927 1.1 mrg \global\setbox3 = \copy0 5928 1.1 mrg \global\setbox1 = \vsplit3 to \dimen@ 5929 1.1 mrg \ifdim\ht1<\ht3 5930 1.1 mrg \global\advance\dimen@ by 1pt 5931 1.1 mrg \repeat 5932 1.1 mrg }% 5933 1.1 mrg % Now the left column is in box 1, and the right column in box 3. 5934 1.1 mrg % 5935 1.1 mrg % Check whether the left column has come out higher than the page itself. 5936 1.1 mrg % (Note that we have doubled \vsize for the double columns, so 5937 1.1 mrg % the actual height of the page is 0.5\vsize). 5938 1.1 mrg \ifdim2\ht1>\vsize 5939 1.1 mrg % It appears that we have been called upon to balance too much material. 5940 1.1 mrg % Output some of it with \doublecolumnout, leaving the rest on the page. 5941 1.1 mrg \setbox\PAGE=\box0 5942 1.1 mrg \doublecolumnout 5943 1.1 mrg \else 5944 1.1 mrg % Compare the heights of the two columns. 5945 1.1 mrg \ifdim4\ht1>5\ht3 5946 1.1 mrg % Column heights are too different, so don't make their bottoms 5947 1.1 mrg % flush with each other. 5948 1.1 mrg \setbox2=\vbox to \ht1 {\unvbox3\vfill}% 5949 1.1 mrg \setbox0=\vbox to \ht1 {\unvbox1\vfill}% 5950 1.1 mrg \else 5951 1.1 mrg % Make column bottoms flush with each other. 5952 1.1 mrg \setbox2=\vbox to\ht1{\unvbox3\unskip}% 5953 1.1 mrg \setbox0=\vbox to\ht1{\unvbox1\unskip}% 5954 1.1 mrg \fi 5955 1.1 mrg \global\setbox\balancedcolumns=\vbox{\pagesofar}% 5956 1.1 mrg \fi 5957 1.1 mrg \fi 5958 1.1 mrg % 5959 1.1 mrg } 5960 1.1 mrg \catcode`\@ = \other 5961 1.1 mrg 5962 1.1 mrg 5963 1.1 mrg \message{sectioning,} 5964 1.1 mrg % Chapters, sections, etc. 5965 1.1 mrg 5966 1.1 mrg % Let's start with @part. 5967 1.1 mrg \outer\parseargdef\part{\partzzz{#1}} 5968 1.1 mrg \def\partzzz#1{% 5969 1.1 mrg \chapoddpage 5970 1.1 mrg \null 5971 1.1 mrg \vskip.3\vsize % move it down on the page a bit 5972 1.1 mrg \begingroup 5973 1.1 mrg \noindent \titlefonts\rm #1\par % the text 5974 1.1 mrg \let\lastnode=\empty % no node to associate with 5975 1.1 mrg \writetocentry{part}{#1}{}% but put it in the toc 5976 1.1 mrg \headingsoff % no headline or footline on the part page 5977 1.1 mrg % This outputs a mark at the end of the page that clears \thischapter 5978 1.1 mrg % and \thissection, as is done in \startcontents. 5979 1.1 mrg \let\pchapsepmacro\relax 5980 1.1 mrg \chapmacro{}{Yomitfromtoc}{}% 5981 1.1 mrg \chapoddpage 5982 1.1 mrg \endgroup 5983 1.1 mrg } 5984 1.1 mrg 5985 1.1 mrg % \unnumberedno is an oxymoron. But we count the unnumbered 5986 1.1 mrg % sections so that we can refer to them unambiguously in the pdf 5987 1.1 mrg % outlines by their "section number". We avoid collisions with chapter 5988 1.1 mrg % numbers by starting them at 10000. (If a document ever has 10000 5989 1.1 mrg % chapters, we're in trouble anyway, I'm sure.) 5990 1.1 mrg \newcount\unnumberedno \unnumberedno = 10000 5991 1.1 mrg \newcount\chapno 5992 1.1 mrg \newcount\secno \secno=0 5993 1.1 mrg \newcount\subsecno \subsecno=0 5994 1.1 mrg \newcount\subsubsecno \subsubsecno=0 5995 1.1 mrg 5996 1.1 mrg % This counter is funny since it counts through charcodes of letters A, B, ... 5997 1.1 mrg \newcount\appendixno \appendixno = `\@ 5998 1.1 mrg % 5999 1.1 mrg % \def\appendixletter{\char\the\appendixno} 6000 1.1 mrg % We do the following ugly conditional instead of the above simple 6001 1.1 mrg % construct for the sake of pdftex, which needs the actual 6002 1.1 mrg % letter in the expansion, not just typeset. 6003 1.1 mrg % 6004 1.1 mrg \def\appendixletter{% 6005 1.1 mrg \ifnum\appendixno=`A A% 6006 1.1 mrg \else\ifnum\appendixno=`B B% 6007 1.1 mrg \else\ifnum\appendixno=`C C% 6008 1.1 mrg \else\ifnum\appendixno=`D D% 6009 1.1 mrg \else\ifnum\appendixno=`E E% 6010 1.1 mrg \else\ifnum\appendixno=`F F% 6011 1.1 mrg \else\ifnum\appendixno=`G G% 6012 1.1 mrg \else\ifnum\appendixno=`H H% 6013 1.1 mrg \else\ifnum\appendixno=`I I% 6014 1.1 mrg \else\ifnum\appendixno=`J J% 6015 1.1 mrg \else\ifnum\appendixno=`K K% 6016 1.1 mrg \else\ifnum\appendixno=`L L% 6017 1.1 mrg \else\ifnum\appendixno=`M M% 6018 1.1 mrg \else\ifnum\appendixno=`N N% 6019 1.1 mrg \else\ifnum\appendixno=`O O% 6020 1.1 mrg \else\ifnum\appendixno=`P P% 6021 1.1 mrg \else\ifnum\appendixno=`Q Q% 6022 1.1 mrg \else\ifnum\appendixno=`R R% 6023 1.1 mrg \else\ifnum\appendixno=`S S% 6024 1.1 mrg \else\ifnum\appendixno=`T T% 6025 1.1 mrg \else\ifnum\appendixno=`U U% 6026 1.1 mrg \else\ifnum\appendixno=`V V% 6027 1.1 mrg \else\ifnum\appendixno=`W W% 6028 1.1 mrg \else\ifnum\appendixno=`X X% 6029 1.1 mrg \else\ifnum\appendixno=`Y Y% 6030 1.1 mrg \else\ifnum\appendixno=`Z Z% 6031 1.1 mrg % The \the is necessary, despite appearances, because \appendixletter is 6032 1.1 mrg % expanded while writing the .toc file. \char\appendixno is not 6033 1.1 mrg % expandable, thus it is written literally, thus all appendixes come out 6034 1.1 mrg % with the same letter (or @) in the toc without it. 6035 1.1 mrg \else\char\the\appendixno 6036 1.1 mrg \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi 6037 1.1 mrg \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} 6038 1.1 mrg 6039 1.1 mrg % Each @chapter defines these (using marks) as the number+name, number 6040 1.1 mrg % and name of the chapter. Page headings and footings can use 6041 1.1 mrg % these. @section does likewise. 6042 1.1 mrg \def\thischapter{} 6043 1.1 mrg \def\thischapternum{} 6044 1.1 mrg \def\thischaptername{} 6045 1.1 mrg \def\thissection{} 6046 1.1 mrg \def\thissectionnum{} 6047 1.1 mrg \def\thissectionname{} 6048 1.1 mrg 6049 1.1 mrg \newcount\absseclevel % used to calculate proper heading level 6050 1.1 mrg \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count 6051 1.1 mrg 6052 1.1 mrg % @raisesections: treat @section as chapter, @subsection as section, etc. 6053 1.1 mrg \def\raisesections{\global\advance\secbase by -1} 6054 1.1 mrg 6055 1.1 mrg % @lowersections: treat @chapter as section, @section as subsection, etc. 6056 1.1 mrg \def\lowersections{\global\advance\secbase by 1} 6057 1.1 mrg 6058 1.1 mrg % we only have subsub. 6059 1.1 mrg \chardef\maxseclevel = 3 6060 1.1 mrg % 6061 1.1 mrg % A numbered section within an unnumbered changes to unnumbered too. 6062 1.1 mrg % To achieve this, remember the "biggest" unnum. sec. we are currently in: 6063 1.1 mrg \chardef\unnlevel = \maxseclevel 6064 1.1 mrg % 6065 1.1 mrg % Trace whether the current chapter is an appendix or not: 6066 1.1 mrg % \chapheadtype is "N" or "A", unnumbered chapters are ignored. 6067 1.1 mrg \def\chapheadtype{N} 6068 1.1 mrg 6069 1.1 mrg % Choose a heading macro 6070 1.1 mrg % #1 is heading type 6071 1.1 mrg % #2 is heading level 6072 1.1 mrg % #3 is text for heading 6073 1.1 mrg \def\genhead#1#2#3{% 6074 1.1 mrg % Compute the abs. sec. level: 6075 1.1 mrg \absseclevel=#2 6076 1.1 mrg \advance\absseclevel by \secbase 6077 1.1 mrg % Make sure \absseclevel doesn't fall outside the range: 6078 1.1 mrg \ifnum \absseclevel < 0 6079 1.1 mrg \absseclevel = 0 6080 1.1 mrg \else 6081 1.1 mrg \ifnum \absseclevel > 3 6082 1.1 mrg \absseclevel = 3 6083 1.1 mrg \fi 6084 1.1 mrg \fi 6085 1.1 mrg % The heading type: 6086 1.1 mrg \def\headtype{#1}% 6087 1.1 mrg \if \headtype U% 6088 1.1 mrg \ifnum \absseclevel < \unnlevel 6089 1.1 mrg \chardef\unnlevel = \absseclevel 6090 1.1 mrg \fi 6091 1.1 mrg \else 6092 1.1 mrg % Check for appendix sections: 6093 1.1 mrg \ifnum \absseclevel = 0 6094 1.1 mrg \edef\chapheadtype{\headtype}% 6095 1.1 mrg \else 6096 1.1 mrg \if \headtype A\if \chapheadtype N% 6097 1.1 mrg \errmessage{@appendix... within a non-appendix chapter}% 6098 1.1 mrg \fi\fi 6099 1.1 mrg \fi 6100 1.1 mrg % Check for numbered within unnumbered: 6101 1.1 mrg \ifnum \absseclevel > \unnlevel 6102 1.1 mrg \def\headtype{U}% 6103 1.1 mrg \else 6104 1.1 mrg \chardef\unnlevel = 3 6105 1.1 mrg \fi 6106 1.1 mrg \fi 6107 1.1 mrg % Now print the heading: 6108 1.1 mrg \if \headtype U% 6109 1.1 mrg \ifcase\absseclevel 6110 1.1 mrg \unnumberedzzz{#3}% 6111 1.1 mrg \or \unnumberedseczzz{#3}% 6112 1.1 mrg \or \unnumberedsubseczzz{#3}% 6113 1.1 mrg \or \unnumberedsubsubseczzz{#3}% 6114 1.1 mrg \fi 6115 1.1 mrg \else 6116 1.1 mrg \if \headtype A% 6117 1.1 mrg \ifcase\absseclevel 6118 1.1 mrg \appendixzzz{#3}% 6119 1.1 mrg \or \appendixsectionzzz{#3}% 6120 1.1 mrg \or \appendixsubseczzz{#3}% 6121 1.1 mrg \or \appendixsubsubseczzz{#3}% 6122 1.1 mrg \fi 6123 1.1 mrg \else 6124 1.1 mrg \ifcase\absseclevel 6125 1.1 mrg \chapterzzz{#3}% 6126 1.1 mrg \or \seczzz{#3}% 6127 1.1 mrg \or \numberedsubseczzz{#3}% 6128 1.1 mrg \or \numberedsubsubseczzz{#3}% 6129 1.1 mrg \fi 6130 1.1 mrg \fi 6131 1.1 mrg \fi 6132 1.1 mrg \suppressfirstparagraphindent 6133 1.1 mrg } 6134 1.1 mrg 6135 1.1 mrg % an interface: 6136 1.1 mrg \def\numhead{\genhead N} 6137 1.1 mrg \def\apphead{\genhead A} 6138 1.1 mrg \def\unnmhead{\genhead U} 6139 1.1 mrg 6140 1.1 mrg % @chapter, @appendix, @unnumbered. Increment top-level counter, reset 6141 1.1 mrg % all lower-level sectioning counters to zero. 6142 1.1 mrg % 6143 1.1 mrg % Also set \chaplevelprefix, which we prepend to @float sequence numbers 6144 1.1 mrg % (e.g., figures), q.v. By default (before any chapter), that is empty. 6145 1.1 mrg \let\chaplevelprefix = \empty 6146 1.1 mrg % 6147 1.1 mrg \outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz 6148 1.1 mrg \def\chapterzzz#1{% 6149 1.1 mrg % section resetting is \global in case the chapter is in a group, such 6150 1.1 mrg % as an @include file. 6151 1.1 mrg \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 6152 1.1 mrg \global\advance\chapno by 1 6153 1.1 mrg % 6154 1.1 mrg % Used for \float. 6155 1.1 mrg \gdef\chaplevelprefix{\the\chapno.}% 6156 1.1 mrg \resetallfloatnos 6157 1.1 mrg % 6158 1.1 mrg % \putwordChapter can contain complex things in translations. 6159 1.1 mrg \toks0=\expandafter{\putwordChapter}% 6160 1.1 mrg \message{\the\toks0 \space \the\chapno}% 6161 1.1 mrg % 6162 1.1 mrg % Write the actual heading. 6163 1.1 mrg \chapmacro{#1}{Ynumbered}{\the\chapno}% 6164 1.1 mrg % 6165 1.1 mrg % So @section and the like are numbered underneath this chapter. 6166 1.1 mrg \global\let\section = \numberedsec 6167 1.1 mrg \global\let\subsection = \numberedsubsec 6168 1.1 mrg \global\let\subsubsection = \numberedsubsubsec 6169 1.1 mrg } 6170 1.1 mrg 6171 1.1 mrg \outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz 6172 1.1 mrg % 6173 1.1 mrg \def\appendixzzz#1{% 6174 1.1 mrg \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 6175 1.1 mrg \global\advance\appendixno by 1 6176 1.1 mrg \gdef\chaplevelprefix{\appendixletter.}% 6177 1.1 mrg \resetallfloatnos 6178 1.1 mrg % 6179 1.1 mrg % \putwordAppendix can contain complex things in translations. 6180 1.1 mrg \toks0=\expandafter{\putwordAppendix}% 6181 1.1 mrg \message{\the\toks0 \space \appendixletter}% 6182 1.1 mrg % 6183 1.1 mrg \chapmacro{#1}{Yappendix}{\appendixletter}% 6184 1.1 mrg % 6185 1.1 mrg \global\let\section = \appendixsec 6186 1.1 mrg \global\let\subsection = \appendixsubsec 6187 1.1 mrg \global\let\subsubsection = \appendixsubsubsec 6188 1.1 mrg } 6189 1.1 mrg 6190 1.1 mrg % normally unnmhead0 calls unnumberedzzz: 6191 1.1 mrg \outer\parseargdef\unnumbered{\unnmhead0{#1}} 6192 1.1 mrg \def\unnumberedzzz#1{% 6193 1.1 mrg \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 6194 1.1 mrg \global\advance\unnumberedno by 1 6195 1.1 mrg % 6196 1.1 mrg % Since an unnumbered has no number, no prefix for figures. 6197 1.1 mrg \global\let\chaplevelprefix = \empty 6198 1.1 mrg \resetallfloatnos 6199 1.1 mrg % 6200 1.1 mrg % This used to be simply \message{#1}, but TeX fully expands the 6201 1.1 mrg % argument to \message. Therefore, if #1 contained @-commands, TeX 6202 1.1 mrg % expanded them. For example, in `@unnumbered The @cite{Book}', TeX 6203 1.1 mrg % expanded @cite (which turns out to cause errors because \cite is meant 6204 1.1 mrg % to be executed, not expanded). 6205 1.1 mrg % 6206 1.1 mrg % Anyway, we don't want the fully-expanded definition of @cite to appear 6207 1.1 mrg % as a result of the \message, we just want `@cite' itself. We use 6208 1.1 mrg % \the<toks register> to achieve this: TeX expands \the<toks> only once, 6209 1.1 mrg % simply yielding the contents of <toks register>. (We also do this for 6210 1.1 mrg % the toc entries.) 6211 1.1 mrg \toks0 = {#1}% 6212 1.1 mrg \message{(\the\toks0)}% 6213 1.1 mrg % 6214 1.1 mrg \chapmacro{#1}{Ynothing}{\the\unnumberedno}% 6215 1.1 mrg % 6216 1.1 mrg \global\let\section = \unnumberedsec 6217 1.1 mrg \global\let\subsection = \unnumberedsubsec 6218 1.1 mrg \global\let\subsubsection = \unnumberedsubsubsec 6219 1.1 mrg } 6220 1.1 mrg 6221 1.1 mrg % @centerchap is like @unnumbered, but the heading is centered. 6222 1.1 mrg \outer\parseargdef\centerchap{% 6223 1.1 mrg \let\centerparametersmaybe = \centerparameters 6224 1.1 mrg \unnmhead0{#1}% 6225 1.1 mrg \let\centerparametersmaybe = \relax 6226 1.1 mrg } 6227 1.1 mrg 6228 1.1 mrg % @top is like @unnumbered. 6229 1.1 mrg \let\top\unnumbered 6230 1.1 mrg 6231 1.1 mrg % Sections. 6232 1.1 mrg % 6233 1.1 mrg \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz 6234 1.1 mrg \def\seczzz#1{% 6235 1.1 mrg \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 6236 1.1 mrg \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% 6237 1.1 mrg } 6238 1.1 mrg 6239 1.1 mrg % normally calls appendixsectionzzz: 6240 1.1 mrg \outer\parseargdef\appendixsection{\apphead1{#1}} 6241 1.1 mrg \def\appendixsectionzzz#1{% 6242 1.1 mrg \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 6243 1.1 mrg \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% 6244 1.1 mrg } 6245 1.1 mrg \let\appendixsec\appendixsection 6246 1.1 mrg 6247 1.1 mrg % normally calls unnumberedseczzz: 6248 1.1 mrg \outer\parseargdef\unnumberedsec{\unnmhead1{#1}} 6249 1.1 mrg \def\unnumberedseczzz#1{% 6250 1.1 mrg \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 6251 1.1 mrg \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% 6252 1.1 mrg } 6253 1.1 mrg 6254 1.1 mrg % Subsections. 6255 1.1 mrg % 6256 1.1 mrg % normally calls numberedsubseczzz: 6257 1.1 mrg \outer\parseargdef\numberedsubsec{\numhead2{#1}} 6258 1.1 mrg \def\numberedsubseczzz#1{% 6259 1.1 mrg \global\subsubsecno=0 \global\advance\subsecno by 1 6260 1.1 mrg \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}% 6261 1.1 mrg } 6262 1.1 mrg 6263 1.1 mrg % normally calls appendixsubseczzz: 6264 1.1 mrg \outer\parseargdef\appendixsubsec{\apphead2{#1}} 6265 1.1 mrg \def\appendixsubseczzz#1{% 6266 1.1 mrg \global\subsubsecno=0 \global\advance\subsecno by 1 6267 1.1 mrg \sectionheading{#1}{subsec}{Yappendix}% 6268 1.1 mrg {\appendixletter.\the\secno.\the\subsecno}% 6269 1.1 mrg } 6270 1.1 mrg 6271 1.1 mrg % normally calls unnumberedsubseczzz: 6272 1.1 mrg \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} 6273 1.1 mrg \def\unnumberedsubseczzz#1{% 6274 1.1 mrg \global\subsubsecno=0 \global\advance\subsecno by 1 6275 1.1 mrg \sectionheading{#1}{subsec}{Ynothing}% 6276 1.1 mrg {\the\unnumberedno.\the\secno.\the\subsecno}% 6277 1.1 mrg } 6278 1.1 mrg 6279 1.1 mrg % Subsubsections. 6280 1.1 mrg % 6281 1.1 mrg % normally numberedsubsubseczzz: 6282 1.1 mrg \outer\parseargdef\numberedsubsubsec{\numhead3{#1}} 6283 1.1 mrg \def\numberedsubsubseczzz#1{% 6284 1.1 mrg \global\advance\subsubsecno by 1 6285 1.1 mrg \sectionheading{#1}{subsubsec}{Ynumbered}% 6286 1.1 mrg {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% 6287 1.1 mrg } 6288 1.1 mrg 6289 1.1 mrg % normally appendixsubsubseczzz: 6290 1.1 mrg \outer\parseargdef\appendixsubsubsec{\apphead3{#1}} 6291 1.1 mrg \def\appendixsubsubseczzz#1{% 6292 1.1 mrg \global\advance\subsubsecno by 1 6293 1.1 mrg \sectionheading{#1}{subsubsec}{Yappendix}% 6294 1.1 mrg {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}% 6295 1.1 mrg } 6296 1.1 mrg 6297 1.1 mrg % normally unnumberedsubsubseczzz: 6298 1.1 mrg \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} 6299 1.1 mrg \def\unnumberedsubsubseczzz#1{% 6300 1.1 mrg \global\advance\subsubsecno by 1 6301 1.1 mrg \sectionheading{#1}{subsubsec}{Ynothing}% 6302 1.1 mrg {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}% 6303 1.1 mrg } 6304 1.1 mrg 6305 1.1 mrg % These macros control what the section commands do, according 6306 1.1 mrg % to what kind of chapter we are in (ordinary, appendix, or unnumbered). 6307 1.1 mrg % Define them by default for a numbered chapter. 6308 1.1 mrg \let\section = \numberedsec 6309 1.1 mrg \let\subsection = \numberedsubsec 6310 1.1 mrg \let\subsubsection = \numberedsubsubsec 6311 1.1 mrg 6312 1.1 mrg % Define @majorheading, @heading and @subheading 6313 1.1 mrg 6314 1.1 mrg \def\majorheading{% 6315 1.1 mrg {\advance\chapheadingskip by 10pt \chapbreak }% 6316 1.1 mrg \parsearg\chapheadingzzz 6317 1.1 mrg } 6318 1.1 mrg 6319 1.1 mrg \def\chapheading{\chapbreak \parsearg\chapheadingzzz} 6320 1.1 mrg \def\chapheadingzzz#1{% 6321 1.1 mrg \vbox{\chapfonts \raggedtitlesettings #1\par}% 6322 1.1 mrg \nobreak\bigskip \nobreak 6323 1.1 mrg \suppressfirstparagraphindent 6324 1.1 mrg } 6325 1.1 mrg 6326 1.1 mrg % @heading, @subheading, @subsubheading. 6327 1.1 mrg \parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{} 6328 1.1 mrg \suppressfirstparagraphindent} 6329 1.1 mrg \parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{} 6330 1.1 mrg \suppressfirstparagraphindent} 6331 1.1 mrg \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{} 6332 1.1 mrg \suppressfirstparagraphindent} 6333 1.1 mrg 6334 1.1 mrg % These macros generate a chapter, section, etc. heading only 6335 1.1 mrg % (including whitespace, linebreaking, etc. around it), 6336 1.1 mrg % given all the information in convenient, parsed form. 6337 1.1 mrg 6338 1.1 mrg % Args are the skip and penalty (usually negative) 6339 1.1 mrg \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} 6340 1.1 mrg 6341 1.1 mrg % Parameter controlling skip before chapter headings (if needed) 6342 1.1 mrg \newskip\chapheadingskip 6343 1.1 mrg 6344 1.1 mrg % Define plain chapter starts, and page on/off switching for it. 6345 1.1 mrg \def\chapbreak{\dobreak \chapheadingskip {-4000}} 6346 1.1 mrg 6347 1.1 mrg % Start a new page 6348 1.1 mrg \def\chappager{\par\vfill\supereject} 6349 1.1 mrg 6350 1.1 mrg % \chapoddpage - start on an odd page for a new chapter 6351 1.1 mrg % Because \domark is called before \chapoddpage, the filler page will 6352 1.1 mrg % get the headings for the next chapter, which is wrong. But we don't 6353 1.1 mrg % care -- we just disable all headings on the filler page. 6354 1.1 mrg \def\chapoddpage{% 6355 1.1 mrg \chappager 6356 1.1 mrg \ifodd\pageno \else 6357 1.1 mrg \begingroup 6358 1.1 mrg \headingsoff 6359 1.1 mrg \null 6360 1.1 mrg \chappager 6361 1.1 mrg \endgroup 6362 1.1 mrg \fi 6363 1.1 mrg } 6364 1.1 mrg 6365 1.1 mrg \parseargdef\setchapternewpage{\csname CHAPPAG#1\endcsname} 6366 1.1 mrg 6367 1.1 mrg \def\CHAPPAGoff{% 6368 1.1 mrg \global\let\contentsalignmacro = \chappager 6369 1.1.1.2 mrg \global\let\pchapsepmacro=\chapbreak 6370 1.1 mrg \global\def\HEADINGSon{\HEADINGSsinglechapoff}} 6371 1.1 mrg 6372 1.1 mrg \def\CHAPPAGon{% 6373 1.1 mrg \global\let\contentsalignmacro = \chappager 6374 1.1 mrg \global\let\pchapsepmacro=\chappager 6375 1.1 mrg \global\def\HEADINGSon{\HEADINGSsingle}} 6376 1.1 mrg 6377 1.1 mrg \def\CHAPPAGodd{% 6378 1.1 mrg \global\let\contentsalignmacro = \chapoddpage 6379 1.1 mrg \global\let\pchapsepmacro=\chapoddpage 6380 1.1 mrg \global\def\HEADINGSon{\HEADINGSdouble}} 6381 1.1 mrg 6382 1.1 mrg \CHAPPAGon 6383 1.1 mrg 6384 1.1 mrg % \chapmacro - Chapter opening. 6385 1.1 mrg % 6386 1.1 mrg % #1 is the text, #2 is the section type (Ynumbered, Ynothing, 6387 1.1 mrg % Yappendix, Yomitfromtoc), #3 the chapter number. 6388 1.1 mrg % Not used for @heading series. 6389 1.1 mrg % 6390 1.1 mrg % To test against our argument. 6391 1.1 mrg \def\Ynothingkeyword{Ynothing} 6392 1.1 mrg \def\Yappendixkeyword{Yappendix} 6393 1.1 mrg \def\Yomitfromtockeyword{Yomitfromtoc} 6394 1.1 mrg % 6395 1.1 mrg \def\chapmacro#1#2#3{% 6396 1.1 mrg \expandafter\ifx\thisenv\titlepage\else 6397 1.1 mrg \checkenv{}% chapters, etc., should not start inside an environment. 6398 1.1 mrg \fi 6399 1.1 mrg % Insert the first mark before the heading break (see notes for \domark). 6400 1.1 mrg \let\prevchapterdefs=\currentchapterdefs 6401 1.1 mrg \let\prevsectiondefs=\currentsectiondefs 6402 1.1 mrg \gdef\currentsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}% 6403 1.1 mrg \gdef\thissection{}}% 6404 1.1 mrg % 6405 1.1 mrg \def\temptype{#2}% 6406 1.1 mrg \ifx\temptype\Ynothingkeyword 6407 1.1 mrg \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% 6408 1.1 mrg \gdef\thischapter{\thischaptername}}% 6409 1.1 mrg \else\ifx\temptype\Yomitfromtockeyword 6410 1.1 mrg \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% 6411 1.1 mrg \gdef\thischapter{}}% 6412 1.1 mrg \else\ifx\temptype\Yappendixkeyword 6413 1.1 mrg \toks0={#1}% 6414 1.1 mrg \xdef\currentchapterdefs{% 6415 1.1 mrg \gdef\noexpand\thischaptername{\the\toks0}% 6416 1.1 mrg \gdef\noexpand\thischapternum{\appendixletter}% 6417 1.1 mrg % \noexpand\putwordAppendix avoids expanding indigestible 6418 1.1 mrg % commands in some of the translations. 6419 1.1 mrg \gdef\noexpand\thischapter{\noexpand\putwordAppendix{} 6420 1.1 mrg \noexpand\thischapternum: 6421 1.1 mrg \noexpand\thischaptername}% 6422 1.1 mrg }% 6423 1.1 mrg \else 6424 1.1 mrg \toks0={#1}% 6425 1.1 mrg \xdef\currentchapterdefs{% 6426 1.1 mrg \gdef\noexpand\thischaptername{\the\toks0}% 6427 1.1 mrg \gdef\noexpand\thischapternum{\the\chapno}% 6428 1.1 mrg % \noexpand\putwordChapter avoids expanding indigestible 6429 1.1 mrg % commands in some of the translations. 6430 1.1 mrg \gdef\noexpand\thischapter{\noexpand\putwordChapter{} 6431 1.1 mrg \noexpand\thischapternum: 6432 1.1 mrg \noexpand\thischaptername}% 6433 1.1 mrg }% 6434 1.1 mrg \fi\fi\fi 6435 1.1 mrg % 6436 1.1 mrg % Output the mark. Pass it through \safewhatsit, to take care of 6437 1.1 mrg % the preceding space. 6438 1.1 mrg \safewhatsit\domark 6439 1.1 mrg % 6440 1.1 mrg % Insert the chapter heading break. 6441 1.1 mrg \pchapsepmacro 6442 1.1 mrg % 6443 1.1 mrg % Now the second mark, after the heading break. No break points 6444 1.1 mrg % between here and the heading. 6445 1.1 mrg \let\prevchapterdefs=\currentchapterdefs 6446 1.1 mrg \let\prevsectiondefs=\currentsectiondefs 6447 1.1 mrg \domark 6448 1.1 mrg % 6449 1.1 mrg {% 6450 1.1 mrg \chapfonts \rm 6451 1.1 mrg \let\footnote=\errfootnoteheading % give better error message 6452 1.1 mrg % 6453 1.1 mrg % Have to define \currentsection before calling \donoderef, because the 6454 1.1 mrg % xref code eventually uses it. On the other hand, it has to be called 6455 1.1 mrg % after \pchapsepmacro, or the headline will change too soon. 6456 1.1 mrg \gdef\currentsection{#1}% 6457 1.1 mrg % 6458 1.1 mrg % Only insert the separating space if we have a chapter/appendix 6459 1.1 mrg % number, and don't print the unnumbered ``number''. 6460 1.1 mrg \ifx\temptype\Ynothingkeyword 6461 1.1 mrg \setbox0 = \hbox{}% 6462 1.1 mrg \def\toctype{unnchap}% 6463 1.1 mrg \else\ifx\temptype\Yomitfromtockeyword 6464 1.1 mrg \setbox0 = \hbox{}% contents like unnumbered, but no toc entry 6465 1.1 mrg \def\toctype{omit}% 6466 1.1 mrg \else\ifx\temptype\Yappendixkeyword 6467 1.1 mrg \setbox0 = \hbox{\putwordAppendix{} #3\enspace}% 6468 1.1 mrg \def\toctype{app}% 6469 1.1 mrg \else 6470 1.1 mrg \setbox0 = \hbox{#3\enspace}% 6471 1.1 mrg \def\toctype{numchap}% 6472 1.1 mrg \fi\fi\fi 6473 1.1 mrg % 6474 1.1 mrg % Write the toc entry for this chapter. Must come before the 6475 1.1 mrg % \donoderef, because we include the current node name in the toc 6476 1.1 mrg % entry, and \donoderef resets it to empty. 6477 1.1 mrg \writetocentry{\toctype}{#1}{#3}% 6478 1.1 mrg % 6479 1.1 mrg % For pdftex, we have to write out the node definition (aka, make 6480 1.1 mrg % the pdfdest) after any page break, but before the actual text has 6481 1.1 mrg % been typeset. If the destination for the pdf outline is after the 6482 1.1 mrg % text, then jumping from the outline may wind up with the text not 6483 1.1 mrg % being visible, for instance under high magnification. 6484 1.1 mrg \donoderef{#2}% 6485 1.1 mrg % 6486 1.1 mrg % Typeset the actual heading. 6487 1.1 mrg \nobreak % Avoid page breaks at the interline glue. 6488 1.1 mrg \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe 6489 1.1 mrg \unhbox0 #1\par}% 6490 1.1 mrg }% 6491 1.1 mrg \nobreak\bigskip % no page break after a chapter title 6492 1.1 mrg \nobreak 6493 1.1 mrg } 6494 1.1 mrg 6495 1.1 mrg % @centerchap -- centered and unnumbered. 6496 1.1 mrg \let\centerparametersmaybe = \relax 6497 1.1 mrg \def\centerparameters{% 6498 1.1 mrg \advance\rightskip by 3\rightskip 6499 1.1 mrg \leftskip = \rightskip 6500 1.1 mrg \parfillskip = 0pt 6501 1.1 mrg } 6502 1.1 mrg 6503 1.1 mrg 6504 1.1 mrg % Section titles. These macros combine the section number parts and 6505 1.1 mrg % call the generic \sectionheading to do the printing. 6506 1.1 mrg % 6507 1.1 mrg \newskip\secheadingskip 6508 1.1 mrg \def\secheadingbreak{\dobreak \secheadingskip{-1000}} 6509 1.1 mrg 6510 1.1 mrg % Subsection titles. 6511 1.1 mrg \newskip\subsecheadingskip 6512 1.1 mrg \def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}} 6513 1.1 mrg 6514 1.1 mrg % Subsubsection titles. 6515 1.1 mrg \def\subsubsecheadingskip{\subsecheadingskip} 6516 1.1 mrg \def\subsubsecheadingbreak{\subsecheadingbreak} 6517 1.1 mrg 6518 1.1 mrg 6519 1.1 mrg % Print any size, any type, section title. 6520 1.1 mrg % 6521 1.1 mrg % #1 is the text of the title, 6522 1.1 mrg % #2 is the section level (sec/subsec/subsubsec), 6523 1.1 mrg % #3 is the section type (Ynumbered, Ynothing, Yappendix, Yomitfromtoc), 6524 1.1 mrg % #4 is the section number. 6525 1.1 mrg % 6526 1.1 mrg \def\seckeyword{sec} 6527 1.1 mrg % 6528 1.1 mrg \def\sectionheading#1#2#3#4{% 6529 1.1 mrg {% 6530 1.1 mrg \def\sectionlevel{#2}% 6531 1.1 mrg \def\temptype{#3}% 6532 1.1 mrg % 6533 1.1 mrg % It is ok for the @heading series commands to appear inside an 6534 1.1 mrg % environment (it's been historically allowed, though the logic is 6535 1.1 mrg % dubious), but not the others. 6536 1.1 mrg \ifx\temptype\Yomitfromtockeyword\else 6537 1.1 mrg \checkenv{}% non-@*heading should not be in an environment. 6538 1.1 mrg \fi 6539 1.1 mrg \let\footnote=\errfootnoteheading 6540 1.1 mrg % 6541 1.1 mrg % Switch to the right set of fonts. 6542 1.1 mrg \csname #2fonts\endcsname \rm 6543 1.1 mrg % 6544 1.1 mrg % Insert first mark before the heading break (see notes for \domark). 6545 1.1 mrg \let\prevsectiondefs=\currentsectiondefs 6546 1.1 mrg \ifx\temptype\Ynothingkeyword 6547 1.1 mrg \ifx\sectionlevel\seckeyword 6548 1.1 mrg \gdef\currentsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}% 6549 1.1 mrg \gdef\thissection{\thissectionname}}% 6550 1.1 mrg \fi 6551 1.1 mrg \else\ifx\temptype\Yomitfromtockeyword 6552 1.1 mrg % Don't redefine \thissection. 6553 1.1 mrg \else\ifx\temptype\Yappendixkeyword 6554 1.1 mrg \ifx\sectionlevel\seckeyword 6555 1.1 mrg \toks0={#1}% 6556 1.1 mrg \xdef\currentsectiondefs{% 6557 1.1 mrg \gdef\noexpand\thissectionname{\the\toks0}% 6558 1.1 mrg \gdef\noexpand\thissectionnum{#4}% 6559 1.1 mrg % \noexpand\putwordSection avoids expanding indigestible 6560 1.1 mrg % commands in some of the translations. 6561 1.1 mrg \gdef\noexpand\thissection{\noexpand\putwordSection{} 6562 1.1 mrg \noexpand\thissectionnum: 6563 1.1 mrg \noexpand\thissectionname}% 6564 1.1 mrg }% 6565 1.1 mrg \fi 6566 1.1 mrg \else 6567 1.1 mrg \ifx\sectionlevel\seckeyword 6568 1.1 mrg \toks0={#1}% 6569 1.1 mrg \xdef\currentsectiondefs{% 6570 1.1 mrg \gdef\noexpand\thissectionname{\the\toks0}% 6571 1.1 mrg \gdef\noexpand\thissectionnum{#4}% 6572 1.1 mrg % \noexpand\putwordSection avoids expanding indigestible 6573 1.1 mrg % commands in some of the translations. 6574 1.1 mrg \gdef\noexpand\thissection{\noexpand\putwordSection{} 6575 1.1 mrg \noexpand\thissectionnum: 6576 1.1 mrg \noexpand\thissectionname}% 6577 1.1 mrg }% 6578 1.1 mrg \fi 6579 1.1 mrg \fi\fi\fi 6580 1.1 mrg % 6581 1.1 mrg % Go into vertical mode. Usually we'll already be there, but we 6582 1.1 mrg % don't want the following whatsit to end up in a preceding paragraph 6583 1.1 mrg % if the document didn't happen to have a blank line. 6584 1.1 mrg \par 6585 1.1 mrg % 6586 1.1 mrg % Output the mark. Pass it through \safewhatsit, to take care of 6587 1.1 mrg % the preceding space. 6588 1.1 mrg \safewhatsit\domark 6589 1.1 mrg % 6590 1.1 mrg % Insert space above the heading. 6591 1.1 mrg \csname #2headingbreak\endcsname 6592 1.1 mrg % 6593 1.1 mrg % Now the second mark, after the heading break. No break points 6594 1.1 mrg % between here and the heading. 6595 1.1 mrg \global\let\prevsectiondefs=\currentsectiondefs 6596 1.1 mrg \domark 6597 1.1 mrg % 6598 1.1 mrg % Only insert the space after the number if we have a section number. 6599 1.1 mrg \ifx\temptype\Ynothingkeyword 6600 1.1 mrg \setbox0 = \hbox{}% 6601 1.1 mrg \def\toctype{unn}% 6602 1.1 mrg \gdef\currentsection{#1}% 6603 1.1 mrg \else\ifx\temptype\Yomitfromtockeyword 6604 1.1 mrg % for @headings -- no section number, don't include in toc, 6605 1.1 mrg % and don't redefine \currentsection. 6606 1.1 mrg \setbox0 = \hbox{}% 6607 1.1 mrg \def\toctype{omit}% 6608 1.1 mrg \let\sectionlevel=\empty 6609 1.1 mrg \else\ifx\temptype\Yappendixkeyword 6610 1.1 mrg \setbox0 = \hbox{#4\enspace}% 6611 1.1 mrg \def\toctype{app}% 6612 1.1 mrg \gdef\currentsection{#1}% 6613 1.1 mrg \else 6614 1.1 mrg \setbox0 = \hbox{#4\enspace}% 6615 1.1 mrg \def\toctype{num}% 6616 1.1 mrg \gdef\currentsection{#1}% 6617 1.1 mrg \fi\fi\fi 6618 1.1 mrg % 6619 1.1 mrg % Write the toc entry (before \donoderef). See comments in \chapmacro. 6620 1.1 mrg \writetocentry{\toctype\sectionlevel}{#1}{#4}% 6621 1.1 mrg % 6622 1.1 mrg % Write the node reference (= pdf destination for pdftex). 6623 1.1 mrg % Again, see comments in \chapmacro. 6624 1.1 mrg \donoderef{#3}% 6625 1.1 mrg % 6626 1.1 mrg % Interline glue will be inserted when the vbox is completed. 6627 1.1 mrg % That glue will be a valid breakpoint for the page, since it'll be 6628 1.1 mrg % preceded by a whatsit (usually from the \donoderef, or from the 6629 1.1 mrg % \writetocentry if there was no node). We don't want to allow that 6630 1.1 mrg % break, since then the whatsits could end up on page n while the 6631 1.1 mrg % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000. 6632 1.1 mrg \nobreak 6633 1.1 mrg % 6634 1.1 mrg % Output the actual section heading. 6635 1.1 mrg \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright 6636 1.1 mrg \hangindent=\wd0 % zero if no section number 6637 1.1 mrg \unhbox0 #1}% 6638 1.1 mrg }% 6639 1.1 mrg % Add extra space after the heading -- half of whatever came above it. 6640 1.1 mrg % Don't allow stretch, though. 6641 1.1 mrg \kern .5 \csname #2headingskip\endcsname 6642 1.1 mrg % 6643 1.1 mrg % Do not let the kern be a potential breakpoint, as it would be if it 6644 1.1 mrg % was followed by glue. 6645 1.1 mrg \nobreak 6646 1.1 mrg % 6647 1.1 mrg % We'll almost certainly start a paragraph next, so don't let that 6648 1.1 mrg % glue accumulate. (Not a breakpoint because it's preceded by a 6649 1.1 mrg % discardable item.) However, when a paragraph is not started next 6650 1.1 mrg % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out 6651 1.1 mrg % or the negative glue will cause weirdly wrong output, typically 6652 1.1 mrg % obscuring the section heading with something else. 6653 1.1 mrg \vskip-\parskip 6654 1.1 mrg % 6655 1.1 mrg % This is so the last item on the main vertical list is a known 6656 1.1 mrg % \penalty > 10000, so \startdefun, etc., can recognize the situation 6657 1.1 mrg % and do the needful. 6658 1.1 mrg \penalty 10001 6659 1.1 mrg } 6660 1.1 mrg 6661 1.1 mrg 6662 1.1 mrg \message{toc,} 6663 1.1 mrg % Table of contents. 6664 1.1 mrg \newwrite\tocfile 6665 1.1 mrg 6666 1.1 mrg % Write an entry to the toc file, opening it if necessary. 6667 1.1 mrg % Called from @chapter, etc. 6668 1.1 mrg % 6669 1.1 mrg % Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno} 6670 1.1 mrg % We append the current node name (if any) and page number as additional 6671 1.1 mrg % arguments for the \{chap,sec,...}entry macros which will eventually 6672 1.1 mrg % read this. The node name is used in the pdf outlines as the 6673 1.1 mrg % destination to jump to. 6674 1.1 mrg % 6675 1.1 mrg % We open the .toc file for writing here instead of at @setfilename (or 6676 1.1 mrg % any other fixed time) so that @contents can be anywhere in the document. 6677 1.1 mrg % But if #1 is `omit', then we don't do anything. This is used for the 6678 1.1 mrg % table of contents chapter openings themselves. 6679 1.1 mrg % 6680 1.1 mrg \newif\iftocfileopened 6681 1.1 mrg \def\omitkeyword{omit}% 6682 1.1 mrg % 6683 1.1 mrg \def\writetocentry#1#2#3{% 6684 1.1 mrg \edef\writetoctype{#1}% 6685 1.1 mrg \ifx\writetoctype\omitkeyword \else 6686 1.1 mrg \iftocfileopened\else 6687 1.1 mrg \immediate\openout\tocfile = \jobname.toc 6688 1.1 mrg \global\tocfileopenedtrue 6689 1.1 mrg \fi 6690 1.1 mrg % 6691 1.1 mrg \iflinks 6692 1.1 mrg {\atdummies 6693 1.1 mrg \edef\temp{% 6694 1.1 mrg \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}% 6695 1.1 mrg \temp 6696 1.1 mrg }% 6697 1.1 mrg \fi 6698 1.1 mrg \fi 6699 1.1 mrg % 6700 1.1 mrg % Tell \shipout to create a pdf destination on each page, if we're 6701 1.1 mrg % writing pdf. These are used in the table of contents. We can't 6702 1.1 mrg % just write one on every page because the title pages are numbered 6703 1.1 mrg % 1 and 2 (the page numbers aren't printed), and so are the first 6704 1.1 mrg % two pages of the document. Thus, we'd have two destinations named 6705 1.1 mrg % `1', and two named `2'. 6706 1.1 mrg \ifpdforxetex 6707 1.1 mrg \global\pdfmakepagedesttrue 6708 1.1 mrg \fi 6709 1.1 mrg } 6710 1.1 mrg 6711 1.1 mrg 6712 1.1 mrg % These characters do not print properly in the Computer Modern roman 6713 1.1 mrg % fonts, so we must take special care. This is more or less redundant 6714 1.1 mrg % with the Texinfo input format setup at the end of this file. 6715 1.1 mrg % 6716 1.1 mrg \def\activecatcodes{% 6717 1.1 mrg \catcode`\"=\active 6718 1.1 mrg \catcode`\$=\active 6719 1.1 mrg \catcode`\<=\active 6720 1.1 mrg \catcode`\>=\active 6721 1.1 mrg \catcode`\\=\active 6722 1.1 mrg \catcode`\^=\active 6723 1.1 mrg \catcode`\_=\active 6724 1.1 mrg \catcode`\|=\active 6725 1.1 mrg \catcode`\~=\active 6726 1.1 mrg } 6727 1.1 mrg 6728 1.1 mrg 6729 1.1 mrg % Read the toc file, which is essentially Texinfo input. 6730 1.1 mrg \def\readtocfile{% 6731 1.1 mrg \setupdatafile 6732 1.1 mrg \activecatcodes 6733 1.1 mrg \input \tocreadfilename 6734 1.1 mrg } 6735 1.1 mrg 6736 1.1 mrg \newskip\contentsrightmargin \contentsrightmargin=1in 6737 1.1 mrg \newcount\savepageno 6738 1.1 mrg \newcount\lastnegativepageno \lastnegativepageno = -1 6739 1.1 mrg 6740 1.1 mrg % Prepare to read what we've written to \tocfile. 6741 1.1 mrg % 6742 1.1 mrg \def\startcontents#1{% 6743 1.1.1.2 mrg % If @setchapternewpage on, and @headings double, the contents should 6744 1.1 mrg % start on an odd page, unlike chapters. 6745 1.1 mrg \contentsalignmacro 6746 1.1 mrg \immediate\closeout\tocfile 6747 1.1 mrg % 6748 1.1 mrg % Don't need to put `Contents' or `Short Contents' in the headline. 6749 1.1 mrg % It is abundantly clear what they are. 6750 1.1 mrg \chapmacro{#1}{Yomitfromtoc}{}% 6751 1.1 mrg % 6752 1.1 mrg \savepageno = \pageno 6753 1.1 mrg \begingroup % Set up to handle contents files properly. 6754 1.1 mrg \raggedbottom % Worry more about breakpoints than the bottom. 6755 1.1 mrg \entryrightmargin=\contentsrightmargin % Don't use the full line length. 6756 1.1 mrg % 6757 1.1 mrg % Roman numerals for page numbers. 6758 1.1.1.2 mrg \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi 6759 1.1.1.2 mrg \def\thistitle{}% no title in double-sided headings 6760 1.1.1.2 mrg % Record where the Roman numerals started. 6761 1.1 mrg \ifnum\romancount=0 \global\romancount=\pagecount \fi 6762 1.1 mrg } 6763 1.1 mrg 6764 1.1 mrg % redefined for the two-volume lispref. We always output on 6765 1.1 mrg % \jobname.toc even if this is redefined. 6766 1.1 mrg % 6767 1.1 mrg \def\tocreadfilename{\jobname.toc} 6768 1.1 mrg 6769 1.1 mrg % Normal (long) toc. 6770 1.1 mrg % 6771 1.1 mrg \def\contents{% 6772 1.1 mrg \startcontents{\putwordTOC}% 6773 1.1 mrg \openin 1 \tocreadfilename\space 6774 1.1 mrg \ifeof 1 \else 6775 1.1 mrg \readtocfile 6776 1.1 mrg \fi 6777 1.1 mrg \vfill \eject 6778 1.1 mrg \contentsalignmacro % in case @setchapternewpage odd is in effect 6779 1.1 mrg \ifeof 1 \else 6780 1.1 mrg \pdfmakeoutlines 6781 1.1 mrg \fi 6782 1.1 mrg \closein 1 6783 1.1.1.2 mrg \endgroup 6784 1.1 mrg \contentsendroman 6785 1.1 mrg } 6786 1.1 mrg 6787 1.1 mrg % And just the chapters. 6788 1.1 mrg \def\summarycontents{% 6789 1.1 mrg \startcontents{\putwordShortTOC}% 6790 1.1 mrg % 6791 1.1 mrg \let\partentry = \shortpartentry 6792 1.1 mrg \let\numchapentry = \shortchapentry 6793 1.1 mrg \let\appentry = \shortchapentry 6794 1.1 mrg \let\unnchapentry = \shortunnchapentry 6795 1.1 mrg % We want a true roman here for the page numbers. 6796 1.1 mrg \secfonts 6797 1.1 mrg \let\rm=\shortcontrm \let\bf=\shortcontbf 6798 1.1 mrg \let\sl=\shortcontsl \let\tt=\shortconttt 6799 1.1 mrg \rm 6800 1.1 mrg \hyphenpenalty = 10000 6801 1.1 mrg \advance\baselineskip by 1pt % Open it up a little. 6802 1.1 mrg \def\numsecentry##1##2##3##4{} 6803 1.1 mrg \let\appsecentry = \numsecentry 6804 1.1 mrg \let\unnsecentry = \numsecentry 6805 1.1 mrg \let\numsubsecentry = \numsecentry 6806 1.1 mrg \let\appsubsecentry = \numsecentry 6807 1.1 mrg \let\unnsubsecentry = \numsecentry 6808 1.1 mrg \let\numsubsubsecentry = \numsecentry 6809 1.1 mrg \let\appsubsubsecentry = \numsecentry 6810 1.1 mrg \let\unnsubsubsecentry = \numsecentry 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 \closein 1 6816 1.1 mrg \vfill \eject 6817 1.1 mrg \contentsalignmacro % in case @setchapternewpage odd is in effect 6818 1.1.1.2 mrg \endgroup 6819 1.1.1.2 mrg \contentsendroman 6820 1.1.1.2 mrg } 6821 1.1.1.2 mrg \let\shortcontents = \summarycontents 6822 1.1.1.2 mrg 6823 1.1.1.2 mrg % Get ready to use Arabic numerals again 6824 1.1 mrg \def\contentsendroman{% 6825 1.1 mrg \lastnegativepageno = \pageno 6826 1.1.1.2 mrg \global\pageno = \savepageno 6827 1.1.1.2 mrg % 6828 1.1.1.2 mrg % If \romancount > \arabiccount, the contents are at the end of the 6829 1.1.1.2 mrg % document. Otherwise, advance where the Arabic numerals start for 6830 1.1.1.2 mrg % the page numbers. 6831 1.1 mrg \ifnum\romancount>\arabiccount\else\global\arabiccount=\pagecount\fi 6832 1.1 mrg } 6833 1.1 mrg 6834 1.1 mrg % Typeset the label for a chapter or appendix for the short contents. 6835 1.1 mrg % The arg is, e.g., `A' for an appendix, or `3' for a chapter. 6836 1.1 mrg % 6837 1.1 mrg \def\shortchaplabel#1{% 6838 1.1 mrg % This space should be enough, since a single number is .5em, and the 6839 1.1 mrg % widest letter (M) is 1em, at least in the Computer Modern fonts. 6840 1.1 mrg % But use \hss just in case. 6841 1.1 mrg % (This space doesn't include the extra space that gets added after 6842 1.1 mrg % the label; that gets put in by \shortchapentry above.) 6843 1.1 mrg % 6844 1.1 mrg % We'd like to right-justify chapter numbers, but that looks strange 6845 1.1 mrg % with appendix letters. And right-justifying numbers and 6846 1.1 mrg % left-justifying letters looks strange when there is less than 10 6847 1.1 mrg % chapters. Have to read the whole toc once to know how many chapters 6848 1.1 mrg % there are before deciding ... 6849 1.1 mrg \hbox to 1em{#1\hss}% 6850 1.1 mrg } 6851 1.1 mrg 6852 1.1 mrg % These macros generate individual entries in the table of contents. 6853 1.1 mrg % The first argument is the chapter or section name. 6854 1.1 mrg % The last argument is the page number. 6855 1.1 mrg % The arguments in between are the chapter number, section number, ... 6856 1.1 mrg 6857 1.1 mrg % Parts, in the main contents. Replace the part number, which doesn't 6858 1.1 mrg % exist, with an empty box. Let's hope all the numbers have the same width. 6859 1.1 mrg % Also ignore the page number, which is conventionally not printed. 6860 1.1 mrg \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}} 6861 1.1 mrg \def\partentry#1#2#3#4{% 6862 1.1 mrg % Add stretch and a bonus for breaking the page before the part heading. 6863 1.1 mrg % This reduces the chance of the page being broken immediately after the 6864 1.1 mrg % part heading, before a following chapter heading. 6865 1.1 mrg \vskip 0pt plus 5\baselineskip 6866 1.1 mrg \penalty-300 6867 1.1 mrg \vskip 0pt plus -5\baselineskip 6868 1.1 mrg \dochapentry{\numeralbox\labelspace#1}{}% 6869 1.1 mrg } 6870 1.1 mrg % 6871 1.1 mrg % Parts, in the short toc. 6872 1.1 mrg \def\shortpartentry#1#2#3#4{% 6873 1.1 mrg \penalty-300 6874 1.1 mrg \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip 6875 1.1 mrg \shortchapentry{{\bf #1}}{\numeralbox}{}{}% 6876 1.1 mrg } 6877 1.1 mrg 6878 1.1 mrg % Chapters, in the main contents. 6879 1.1 mrg \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} 6880 1.1 mrg 6881 1.1 mrg % Chapters, in the short toc. 6882 1.1 mrg % See comments in \dochapentry re vbox and related settings. 6883 1.1 mrg \def\shortchapentry#1#2#3#4{% 6884 1.1 mrg \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}% 6885 1.1 mrg } 6886 1.1 mrg 6887 1.1 mrg % Appendices, in the main contents. 6888 1.1 mrg % Need the word Appendix, and a fixed-size box. 6889 1.1 mrg % 6890 1.1 mrg \def\appendixbox#1{% 6891 1.1 mrg % We use M since it's probably the widest letter. 6892 1.1 mrg \setbox0 = \hbox{\putwordAppendix{} M}% 6893 1.1 mrg \hbox to \wd0{\putwordAppendix{} #1\hss}} 6894 1.1 mrg % 6895 1.1 mrg \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\hskip.7em#1}{#4}} 6896 1.1 mrg 6897 1.1 mrg % Unnumbered chapters. 6898 1.1 mrg \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} 6899 1.1 mrg \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}} 6900 1.1 mrg 6901 1.1 mrg % Sections. 6902 1.1 mrg \def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} 6903 1.1 mrg \let\appsecentry=\numsecentry 6904 1.1 mrg \def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}} 6905 1.1 mrg 6906 1.1 mrg % Subsections. 6907 1.1 mrg \def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}} 6908 1.1 mrg \let\appsubsecentry=\numsubsecentry 6909 1.1 mrg \def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} 6910 1.1 mrg 6911 1.1 mrg % And subsubsections. 6912 1.1 mrg \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}} 6913 1.1 mrg \let\appsubsubsecentry=\numsubsubsecentry 6914 1.1 mrg \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}} 6915 1.1 mrg 6916 1.1 mrg % This parameter controls the indentation of the various levels. 6917 1.1 mrg % Same as \defaultparindent. 6918 1.1 mrg \newdimen\tocindent \tocindent = 15pt 6919 1.1 mrg 6920 1.1 mrg % Now for the actual typesetting. In all these, #1 is the text and #2 is the 6921 1.1 mrg % page number. 6922 1.1 mrg % 6923 1.1 mrg % If the toc has to be broken over pages, we want it to be at chapters 6924 1.1 mrg % if at all possible; hence the \penalty. 6925 1.1 mrg \def\dochapentry#1#2{% 6926 1.1 mrg \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip 6927 1.1 mrg \begingroup 6928 1.1 mrg % Move the page numbers slightly to the right 6929 1.1 mrg \advance\entryrightmargin by -0.05em 6930 1.1 mrg \chapentryfonts 6931 1.1 mrg \tocentry{#1}{\dopageno\bgroup#2\egroup}% 6932 1.1 mrg \endgroup 6933 1.1 mrg \nobreak\vskip .25\baselineskip plus.1\baselineskip 6934 1.1 mrg } 6935 1.1 mrg 6936 1.1 mrg \def\dosecentry#1#2{\begingroup 6937 1.1 mrg \secentryfonts \leftskip=\tocindent 6938 1.1 mrg \tocentry{#1}{\dopageno\bgroup#2\egroup}% 6939 1.1 mrg \endgroup} 6940 1.1 mrg 6941 1.1 mrg \def\dosubsecentry#1#2{\begingroup 6942 1.1 mrg \subsecentryfonts \leftskip=2\tocindent 6943 1.1 mrg \tocentry{#1}{\dopageno\bgroup#2\egroup}% 6944 1.1 mrg \endgroup} 6945 1.1 mrg 6946 1.1 mrg \def\dosubsubsecentry#1#2{\begingroup 6947 1.1 mrg \subsubsecentryfonts \leftskip=3\tocindent 6948 1.1 mrg \tocentry{#1}{\dopageno\bgroup#2\egroup}% 6949 1.1 mrg \endgroup} 6950 1.1 mrg 6951 1.1 mrg % We use the same \entry macro as for the index entries. 6952 1.1 mrg \let\tocentry = \entry 6953 1.1 mrg 6954 1.1 mrg % Space between chapter (or whatever) number and the title. 6955 1.1 mrg \def\labelspace{\hskip1em \relax} 6956 1.1 mrg 6957 1.1 mrg \def\dopageno#1{{\rm #1}} 6958 1.1 mrg \def\doshortpageno#1{{\rm #1}} 6959 1.1 mrg 6960 1.1 mrg \def\chapentryfonts{\secfonts \rm} 6961 1.1 mrg \def\secentryfonts{\textfonts} 6962 1.1 mrg \def\subsecentryfonts{\textfonts} 6963 1.1 mrg \def\subsubsecentryfonts{\textfonts} 6964 1.1 mrg 6965 1.1 mrg 6966 1.1 mrg \message{environments,} 6967 1.1 mrg % @foo ... @end foo. 6968 1.1 mrg 6969 1.1 mrg % @tex ... @end tex escapes into raw TeX temporarily. 6970 1.1 mrg % One exception: @ is still an escape character, so that @end tex works. 6971 1.1 mrg % But \@ or @@ will get a plain @ character. 6972 1.1 mrg 6973 1.1.1.2 mrg \envdef\tex{% 6974 1.1 mrg \setregularquotes 6975 1.1 mrg \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 6976 1.1 mrg \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 6977 1.1 mrg \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie 6978 1.1 mrg \catcode `\%=14 6979 1.1 mrg \catcode `\+=\other 6980 1.1 mrg \catcode `\"=\other 6981 1.1 mrg \catcode `\|=\other 6982 1.1 mrg \catcode `\<=\other 6983 1.1 mrg \catcode `\>=\other 6984 1.1 mrg \catcode `\`=\other 6985 1.1 mrg \catcode `\'=\other 6986 1.1 mrg % 6987 1.1 mrg % ' is active in math mode (mathcode"8000). So reset it, and all our 6988 1.1 mrg % other math active characters (just in case), to plain's definitions. 6989 1.1 mrg \mathactive 6990 1.1 mrg % 6991 1.1 mrg % Inverse of the list at the beginning of the file. 6992 1.1 mrg \let\b=\ptexb 6993 1.1 mrg \let\bullet=\ptexbullet 6994 1.1 mrg \let\c=\ptexc 6995 1.1 mrg \let\,=\ptexcomma 6996 1.1 mrg \let\.=\ptexdot 6997 1.1 mrg \let\dots=\ptexdots 6998 1.1 mrg \let\equiv=\ptexequiv 6999 1.1 mrg \let\!=\ptexexclam 7000 1.1 mrg \let\i=\ptexi 7001 1.1 mrg \let\indent=\ptexindent 7002 1.1 mrg \let\noindent=\ptexnoindent 7003 1.1 mrg \let\{=\ptexlbrace 7004 1.1 mrg \let\+=\tabalign 7005 1.1 mrg \let\}=\ptexrbrace 7006 1.1 mrg \let\/=\ptexslash 7007 1.1 mrg \let\sp=\ptexsp 7008 1.1 mrg \let\*=\ptexstar 7009 1.1 mrg %\let\sup=\ptexsup % do not redefine, we want @sup to work in math mode 7010 1.1 mrg \let\t=\ptext 7011 1.1 mrg \expandafter \let\csname top\endcsname=\ptextop % we've made it outer 7012 1.1 mrg \let\frenchspacing=\plainfrenchspacing 7013 1.1 mrg % 7014 1.1 mrg \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% 7015 1.1 mrg \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% 7016 1.1 mrg \def\@{@}% 7017 1.1 mrg } 7018 1.1 mrg % There is no need to define \Etex. 7019 1.1 mrg 7020 1.1 mrg % Define @lisp ... @end lisp. 7021 1.1 mrg % @lisp environment forms a group so it can rebind things, 7022 1.1 mrg % including the definition of @end lisp (which normally is erroneous). 7023 1.1 mrg 7024 1.1 mrg % Amount to narrow the margins by for @lisp. 7025 1.1 mrg \newskip\lispnarrowing \lispnarrowing=0.4in 7026 1.1 mrg 7027 1.1 mrg % This is the definition that ^^M gets inside @lisp, @example, and other 7028 1.1 mrg % such environments. \null is better than a space, since it doesn't 7029 1.1 mrg % have any width. 7030 1.1 mrg \def\lisppar{\null\endgraf} 7031 1.1 mrg 7032 1.1 mrg % This space is always present above and below environments. 7033 1.1 mrg \newskip\envskipamount \envskipamount = 0pt 7034 1.1 mrg 7035 1.1 mrg % Make spacing and below environment symmetrical. We use \parskip here 7036 1.1 mrg % to help in doing that, since in @example-like environments \parskip 7037 1.1 mrg % is reset to zero; thus the \afterenvbreak inserts no space -- but the 7038 1.1 mrg % start of the next paragraph will insert \parskip. 7039 1.1 mrg % 7040 1.1 mrg \def\aboveenvbreak{{% 7041 1.1 mrg % =10000 instead of <10000 because of a special case in \itemzzz and 7042 1.1 mrg % \sectionheading, q.v. 7043 1.1 mrg \ifnum \lastpenalty=10000 \else 7044 1.1 mrg \advance\envskipamount by \parskip 7045 1.1 mrg \endgraf 7046 1.1 mrg \ifdim\lastskip<\envskipamount 7047 1.1 mrg \removelastskip 7048 1.1 mrg \ifnum\lastpenalty<10000 7049 1.1 mrg % Penalize breaking before the environment, because preceding text 7050 1.1 mrg % often leads into it. 7051 1.1 mrg \penalty100 7052 1.1 mrg \fi 7053 1.1 mrg \vskip\envskipamount 7054 1.1 mrg \fi 7055 1.1 mrg \fi 7056 1.1 mrg }} 7057 1.1 mrg 7058 1.1 mrg \def\afterenvbreak{{% 7059 1.1 mrg % =10000 instead of <10000 because of a special case in \itemzzz and 7060 1.1 mrg % \sectionheading, q.v. 7061 1.1 mrg \ifnum \lastpenalty=10000 \else 7062 1.1 mrg \advance\envskipamount by \parskip 7063 1.1 mrg \endgraf 7064 1.1 mrg \ifdim\lastskip<\envskipamount 7065 1.1 mrg \removelastskip 7066 1.1 mrg % it's not a good place to break if the last penalty was \nobreak 7067 1.1 mrg % or better ... 7068 1.1 mrg \ifnum\lastpenalty<10000 \penalty-50 \fi 7069 1.1 mrg \vskip\envskipamount 7070 1.1 mrg \fi 7071 1.1 mrg \fi 7072 1.1 mrg }} 7073 1.1 mrg 7074 1.1 mrg % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will 7075 1.1 mrg % also clear it, so that its embedded environments do the narrowing again. 7076 1.1 mrg \let\nonarrowing=\relax 7077 1.1 mrg 7078 1.1 mrg % @cartouche ... @end cartouche: draw rectangle w/rounded corners around 7079 1.1 mrg % environment contents. 7080 1.1 mrg 7081 1.1 mrg % 7082 1.1 mrg \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth 7083 1.1 mrg \def\ctr{{\hskip 6pt\circle\char'010}} 7084 1.1 mrg \def\cbl{{\circle\char'012\hskip -6pt}} 7085 1.1 mrg \def\cbr{{\hskip 6pt\circle\char'011}} 7086 1.1 mrg \def\carttop{\hbox to \cartouter{\hskip\lskip 7087 1.1 mrg \ctl\leaders\hrule height\circthick\hfil\ctr 7088 1.1 mrg \hskip\rskip}} 7089 1.1 mrg \def\cartbot{\hbox to \cartouter{\hskip\lskip 7090 1.1 mrg \cbl\leaders\hrule height\circthick\hfil\cbr 7091 1.1 mrg \hskip\rskip}} 7092 1.1 mrg % 7093 1.1 mrg \newskip\lskip\newskip\rskip 7094 1.1 mrg 7095 1.1 mrg % only require the font if @cartouche is actually used 7096 1.1 mrg \def\cartouchefontdefs{% 7097 1.1 mrg \font\circle=lcircle10\relax 7098 1.1 mrg \circthick=\fontdimen8\circle 7099 1.1 mrg } 7100 1.1 mrg \newdimen\circthick 7101 1.1 mrg \newdimen\cartouter\newdimen\cartinner 7102 1.1 mrg \newskip\normbskip\newskip\normpskip\newskip\normlskip 7103 1.1 mrg 7104 1.1 mrg 7105 1.1 mrg \envdef\cartouche{% 7106 1.1 mrg \cartouchefontdefs 7107 1.1 mrg \ifhmode\par\fi % can't be in the midst of a paragraph. 7108 1.1 mrg \startsavinginserts 7109 1.1 mrg \lskip=\leftskip \rskip=\rightskip 7110 1.1 mrg \leftskip=0pt\rightskip=0pt % we want these *outside*. 7111 1.1 mrg \cartinner=\hsize \advance\cartinner by-\lskip 7112 1.1 mrg \advance\cartinner by-\rskip 7113 1.1 mrg \cartouter=\hsize 7114 1.1 mrg \advance\cartouter by 18.4pt % allow for 3pt kerns on either 7115 1.1 mrg % side, and for 6pt waste from 7116 1.1 mrg % each corner char, and rule thickness 7117 1.1 mrg \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip 7118 1.1 mrg % 7119 1.1 mrg % If this cartouche directly follows a sectioning command, we need the 7120 1.1 mrg % \parskip glue (backspaced over by default) or the cartouche can 7121 1.1 mrg % collide with the section heading. 7122 1.1 mrg \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi 7123 1.1 mrg % 7124 1.1 mrg \setbox\groupbox=\vbox\bgroup 7125 1.1 mrg \baselineskip=0pt\parskip=0pt\lineskip=0pt 7126 1.1 mrg \carttop 7127 1.1 mrg \hbox\bgroup 7128 1.1 mrg \hskip\lskip 7129 1.1 mrg \vrule\kern3pt 7130 1.1 mrg \vbox\bgroup 7131 1.1 mrg \kern3pt 7132 1.1 mrg \hsize=\cartinner 7133 1.1 mrg \baselineskip=\normbskip 7134 1.1 mrg \lineskip=\normlskip 7135 1.1 mrg \parskip=\normpskip 7136 1.1 mrg \vskip -\parskip 7137 1.1 mrg \comment % For explanation, see the end of def\group. 7138 1.1 mrg } 7139 1.1 mrg \def\Ecartouche{% 7140 1.1 mrg \ifhmode\par\fi 7141 1.1 mrg \kern3pt 7142 1.1 mrg \egroup 7143 1.1 mrg \kern3pt\vrule 7144 1.1 mrg \hskip\rskip 7145 1.1 mrg \egroup 7146 1.1 mrg \cartbot 7147 1.1 mrg \egroup 7148 1.1 mrg \addgroupbox 7149 1.1 mrg \checkinserts 7150 1.1 mrg } 7151 1.1 mrg 7152 1.1 mrg 7153 1.1 mrg % This macro is called at the beginning of all the @example variants, 7154 1.1 mrg % inside a group. 7155 1.1 mrg \newdimen\nonfillparindent 7156 1.1 mrg \def\nonfillstart{% 7157 1.1 mrg \aboveenvbreak 7158 1.1 mrg \ifdim\hfuzz < 12pt \hfuzz = 12pt \fi % Don't be fussy 7159 1.1 mrg \sepspaces % Make spaces be word-separators rather than space tokens. 7160 1.1 mrg \let\par = \lisppar % don't ignore blank lines 7161 1.1 mrg \obeylines % each line of input is a line of output 7162 1.1 mrg \parskip = 0pt 7163 1.1 mrg % Turn off paragraph indentation but redefine \indent to emulate 7164 1.1 mrg % the normal \indent. 7165 1.1 mrg \nonfillparindent=\parindent 7166 1.1 mrg \parindent = 0pt 7167 1.1 mrg \let\indent\nonfillindent 7168 1.1 mrg % 7169 1.1 mrg \emergencystretch = 0pt % don't try to avoid overfull boxes 7170 1.1 mrg \ifx\nonarrowing\relax 7171 1.1 mrg \advance \leftskip by \lispnarrowing 7172 1.1 mrg \exdentamount=\lispnarrowing 7173 1.1 mrg \else 7174 1.1 mrg \let\nonarrowing = \relax 7175 1.1 mrg \fi 7176 1.1 mrg \let\exdent=\nofillexdent 7177 1.1 mrg } 7178 1.1 mrg 7179 1.1 mrg \begingroup 7180 1.1 mrg \obeyspaces 7181 1.1 mrg % We want to swallow spaces (but not other tokens) after the fake 7182 1.1 mrg % @indent in our nonfill-environments, where spaces are normally 7183 1.1 mrg % active and set to @tie, resulting in them not being ignored after 7184 1.1 mrg % @indent. 7185 1.1 mrg \gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}% 7186 1.1 mrg \gdef\nonfillindentcheck{% 7187 1.1 mrg \ifx\temp % 7188 1.1 mrg \expandafter\nonfillindentgobble% 7189 1.1 mrg \else% 7190 1.1 mrg \leavevmode\nonfillindentbox% 7191 1.1 mrg \fi% 7192 1.1 mrg }% 7193 1.1 mrg \endgroup 7194 1.1 mrg \def\nonfillindentgobble#1{\nonfillindent} 7195 1.1 mrg \def\nonfillindentbox{\hbox to \nonfillparindent{\hss}} 7196 1.1 mrg 7197 1.1 mrg % If you want all examples etc. small: @set dispenvsize small. 7198 1.1 mrg % If you want even small examples the full size: @set dispenvsize nosmall. 7199 1.1.1.2 mrg % This affects the following displayed environments: 7200 1.1 mrg % @example, @display, @format, @lisp, @verbatim 7201 1.1 mrg % 7202 1.1 mrg \def\smallword{small} 7203 1.1 mrg \def\nosmallword{nosmall} 7204 1.1 mrg \let\SETdispenvsize\relax 7205 1.1 mrg \def\setnormaldispenv{% 7206 1.1 mrg \ifx\SETdispenvsize\smallword 7207 1.1 mrg % end paragraph for sake of leading, in case document has no blank 7208 1.1 mrg % line. This is redundant with what happens in \aboveenvbreak, but 7209 1.1 mrg % we need to do it before changing the fonts, and it's inconvenient 7210 1.1 mrg % to change the fonts afterward. 7211 1.1 mrg \ifnum \lastpenalty=10000 \else \endgraf \fi 7212 1.1 mrg \smallexamplefonts \rm 7213 1.1 mrg \fi 7214 1.1 mrg } 7215 1.1 mrg \def\setsmalldispenv{% 7216 1.1 mrg \ifx\SETdispenvsize\nosmallword 7217 1.1 mrg \else 7218 1.1 mrg \ifnum \lastpenalty=10000 \else \endgraf \fi 7219 1.1 mrg \smallexamplefonts \rm 7220 1.1 mrg \fi 7221 1.1 mrg } 7222 1.1 mrg 7223 1.1 mrg % We often define two environments, @foo and @smallfoo. 7224 1.1 mrg % Let's do it in one command. #1 is the env name, #2 the definition. 7225 1.1 mrg \def\makedispenvdef#1#2{% 7226 1.1 mrg \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}% 7227 1.1 mrg \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}% 7228 1.1 mrg \expandafter\let\csname E#1\endcsname \afterenvbreak 7229 1.1 mrg \expandafter\let\csname Esmall#1\endcsname \afterenvbreak 7230 1.1 mrg } 7231 1.1 mrg 7232 1.1 mrg % Define two environment synonyms (#1 and #2) for an environment. 7233 1.1 mrg \def\maketwodispenvdef#1#2#3{% 7234 1.1 mrg \makedispenvdef{#1}{#3}% 7235 1.1 mrg \makedispenvdef{#2}{#3}% 7236 1.1 mrg } 7237 1.1 mrg % 7238 1.1 mrg % @lisp: indented, narrowed, typewriter font; 7239 1.1 mrg % @example: same as @lisp. 7240 1.1 mrg % 7241 1.1 mrg % @smallexample and @smalllisp: use smaller fonts. 7242 1.1 mrg % Originally contributed by Pavel@xerox. 7243 1.1 mrg % 7244 1.1 mrg \maketwodispenvdef{lisp}{example}{% 7245 1.1.1.2 mrg \nonfillstart 7246 1.1 mrg \tt\setcodequotes 7247 1.1.1.2 mrg \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. 7248 1.1 mrg \parsearg\gobble 7249 1.1 mrg } 7250 1.1 mrg % @display/@smalldisplay: same as @lisp except keep current font. 7251 1.1 mrg % 7252 1.1 mrg \makedispenvdef{display}{% 7253 1.1 mrg \nonfillstart 7254 1.1 mrg \gobble 7255 1.1 mrg } 7256 1.1 mrg 7257 1.1 mrg % @format/@smallformat: same as @display except don't narrow margins. 7258 1.1 mrg % 7259 1.1 mrg \makedispenvdef{format}{% 7260 1.1 mrg \let\nonarrowing = t% 7261 1.1 mrg \nonfillstart 7262 1.1 mrg \gobble 7263 1.1 mrg } 7264 1.1 mrg 7265 1.1 mrg % @flushleft: same as @format, but doesn't obey \SETdispenvsize. 7266 1.1 mrg \envdef\flushleft{% 7267 1.1 mrg \let\nonarrowing = t% 7268 1.1 mrg \nonfillstart 7269 1.1 mrg \gobble 7270 1.1 mrg } 7271 1.1 mrg \let\Eflushleft = \afterenvbreak 7272 1.1 mrg 7273 1.1 mrg % @flushright. 7274 1.1 mrg % 7275 1.1 mrg \envdef\flushright{% 7276 1.1 mrg \let\nonarrowing = t% 7277 1.1 mrg \nonfillstart 7278 1.1 mrg \advance\leftskip by 0pt plus 1fill\relax 7279 1.1 mrg \gobble 7280 1.1 mrg } 7281 1.1 mrg \let\Eflushright = \afterenvbreak 7282 1.1 mrg 7283 1.1 mrg 7284 1.1 mrg % @raggedright does more-or-less normal line breaking but no right 7285 1.1 mrg % justification. From plain.tex. 7286 1.1 mrg \envdef\raggedright{% 7287 1.1 mrg \rightskip0pt plus2.4em \spaceskip.3333em \xspaceskip.5em\relax 7288 1.1 mrg } 7289 1.1 mrg \let\Eraggedright\par 7290 1.1 mrg 7291 1.1 mrg \envdef\raggedleft{% 7292 1.1 mrg \parindent=0pt \leftskip0pt plus2em 7293 1.1 mrg \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt 7294 1.1 mrg \hbadness=10000 % Last line will usually be underfull, so turn off 7295 1.1 mrg % badness reporting. 7296 1.1 mrg } 7297 1.1 mrg \let\Eraggedleft\par 7298 1.1 mrg 7299 1.1 mrg \envdef\raggedcenter{% 7300 1.1 mrg \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em 7301 1.1 mrg \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt 7302 1.1 mrg \hbadness=10000 % Last line will usually be underfull, so turn off 7303 1.1 mrg % badness reporting. 7304 1.1 mrg } 7305 1.1 mrg \let\Eraggedcenter\par 7306 1.1 mrg 7307 1.1 mrg 7308 1.1 mrg % @quotation does normal linebreaking (hence we can't use \nonfillstart) 7309 1.1 mrg % and narrows the margins. We keep \parskip nonzero in general, since 7310 1.1 mrg % we're doing normal filling. So, when using \aboveenvbreak and 7311 1.1 mrg % \afterenvbreak, temporarily make \parskip 0. 7312 1.1 mrg % 7313 1.1 mrg \makedispenvdef{quotation}{\quotationstart} 7314 1.1 mrg % 7315 1.1 mrg \def\quotationstart{% 7316 1.1 mrg \indentedblockstart % same as \indentedblock, but increase right margin too. 7317 1.1 mrg \ifx\nonarrowing\relax 7318 1.1 mrg \advance\rightskip by \lispnarrowing 7319 1.1 mrg \fi 7320 1.1 mrg \parsearg\quotationlabel 7321 1.1 mrg } 7322 1.1 mrg 7323 1.1 mrg % We have retained a nonzero parskip for the environment, since we're 7324 1.1 mrg % doing normal filling. 7325 1.1 mrg % 7326 1.1 mrg \def\Equotation{% 7327 1.1 mrg \par 7328 1.1 mrg \ifx\quotationauthor\thisisundefined\else 7329 1.1 mrg % indent a bit. 7330 1.1 mrg \leftline{\kern 2\leftskip \sl ---\quotationauthor}% 7331 1.1 mrg \fi 7332 1.1 mrg {\parskip=0pt \afterenvbreak}% 7333 1.1 mrg } 7334 1.1 mrg \def\Esmallquotation{\Equotation} 7335 1.1 mrg 7336 1.1 mrg % If we're given an argument, typeset it in bold with a colon after. 7337 1.1 mrg \def\quotationlabel#1{% 7338 1.1 mrg \def\temp{#1}% 7339 1.1 mrg \ifx\temp\empty \else 7340 1.1 mrg {\bf #1: }% 7341 1.1 mrg \fi 7342 1.1 mrg } 7343 1.1 mrg 7344 1.1 mrg % @indentedblock is like @quotation, but indents only on the left and 7345 1.1 mrg % has no optional argument. 7346 1.1 mrg % 7347 1.1 mrg \makedispenvdef{indentedblock}{\indentedblockstart} 7348 1.1 mrg % 7349 1.1 mrg \def\indentedblockstart{% 7350 1.1 mrg {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip 7351 1.1 mrg \parindent=0pt 7352 1.1 mrg % 7353 1.1 mrg % @cartouche defines \nonarrowing to inhibit narrowing at next level down. 7354 1.1 mrg \ifx\nonarrowing\relax 7355 1.1 mrg \advance\leftskip by \lispnarrowing 7356 1.1 mrg \exdentamount = \lispnarrowing 7357 1.1 mrg \else 7358 1.1 mrg \let\nonarrowing = \relax 7359 1.1 mrg \fi 7360 1.1 mrg } 7361 1.1 mrg 7362 1.1 mrg % Keep a nonzero parskip for the environment, since we're doing normal filling. 7363 1.1 mrg % 7364 1.1 mrg \def\Eindentedblock{% 7365 1.1 mrg \par 7366 1.1 mrg {\parskip=0pt \afterenvbreak}% 7367 1.1 mrg } 7368 1.1 mrg \def\Esmallindentedblock{\Eindentedblock} 7369 1.1 mrg 7370 1.1 mrg 7371 1.1 mrg % LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>} 7372 1.1 mrg % If we want to allow any <char> as delimiter, 7373 1.1 mrg % we need the curly braces so that makeinfo sees the @verb command, eg: 7374 1.1 mrg % `@verbx...x' would look like the '@verbx' command. --janneke (a] gnu.org 7375 1.1 mrg % 7376 1.1 mrg % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. 7377 1.1 mrg % 7378 1.1 mrg % [Knuth] p.344; only we need to do the other characters Texinfo sets 7379 1.1 mrg % active too. Otherwise, they get lost as the first character on a 7380 1.1 mrg % verbatim line. 7381 1.1 mrg \def\dospecials{% 7382 1.1 mrg \do\ \do\\\do\{\do\}\do\$\do\&% 7383 1.1 mrg \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~% 7384 1.1 mrg \do\<\do\>\do\|\do\@\do+\do\"% 7385 1.1 mrg % Don't do the quotes -- if we do, @set txicodequoteundirected and 7386 1.1 mrg % @set txicodequotebacktick will not have effect on @verb and 7387 1.1 mrg % @verbatim, and ?` and !` ligatures won't get disabled. 7388 1.1 mrg %\do\`\do\'% 7389 1.1 mrg } 7390 1.1 mrg % 7391 1.1 mrg % [Knuth] p. 380 7392 1.1 mrg \def\uncatcodespecials{% 7393 1.1 mrg \def\do##1{\catcode`##1=\other}\dospecials} 7394 1.1 mrg % 7395 1.1 mrg % Setup for the @verb command. 7396 1.1 mrg % 7397 1.1 mrg % Eight spaces for a tab 7398 1.1 mrg \begingroup 7399 1.1 mrg \catcode`\^^I=\active 7400 1.1 mrg \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }} 7401 1.1 mrg \endgroup 7402 1.1 mrg % 7403 1.1 mrg \def\setupverb{% 7404 1.1 mrg \tt % easiest (and conventionally used) font for verbatim 7405 1.1.1.2 mrg \def\par{\leavevmode\endgraf}% 7406 1.1 mrg \setcodequotes 7407 1.1 mrg \tabeightspaces 7408 1.1 mrg % Respect line breaks, 7409 1.1 mrg % print special symbols as themselves, and 7410 1.1 mrg % make each space count 7411 1.1 mrg % must do in this order: 7412 1.1 mrg \obeylines \uncatcodespecials \sepspaces 7413 1.1 mrg } 7414 1.1 mrg 7415 1.1 mrg % Setup for the @verbatim environment 7416 1.1 mrg % 7417 1.1 mrg % Real tab expansion. 7418 1.1 mrg \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount 7419 1.1 mrg % 7420 1.1.1.2 mrg % We typeset each line of the verbatim in an \hbox, so we can handle 7421 1.1 mrg % tabs. 7422 1.1.1.2 mrg \newbox\verbbox 7423 1.1 mrg \def\starttabbox{\setbox\verbbox=\hbox\bgroup} 7424 1.1 mrg % 7425 1.1 mrg \begingroup 7426 1.1 mrg \catcode`\^^I=\active 7427 1.1 mrg \gdef\tabexpand{% 7428 1.1 mrg \catcode`\^^I=\active 7429 1.1 mrg \def^^I{\leavevmode\egroup 7430 1.1 mrg \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab 7431 1.1 mrg \divide\dimen\verbbox by\tabw 7432 1.1 mrg \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw 7433 1.1.1.2 mrg \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw 7434 1.1.1.2 mrg \wd\verbbox=\dimen\verbbox 7435 1.1 mrg \leavevmode\box\verbbox \starttabbox 7436 1.1 mrg }% 7437 1.1 mrg } 7438 1.1 mrg \endgroup 7439 1.1 mrg 7440 1.1 mrg % start the verbatim environment. 7441 1.1 mrg \def\setupverbatim{% 7442 1.1 mrg \let\nonarrowing = t% 7443 1.1 mrg \nonfillstart 7444 1.1.1.2 mrg \tt % easiest (and conventionally used) font for verbatim 7445 1.1 mrg \def\par{\egroup\leavevmode\box\verbbox\endgraf\starttabbox}% 7446 1.1.1.2 mrg \tabexpand 7447 1.1 mrg \setcodequotes 7448 1.1 mrg % Respect line breaks, 7449 1.1 mrg % print special symbols as themselves, and 7450 1.1 mrg % make each space count. 7451 1.1 mrg % Must do in this order: 7452 1.1 mrg \obeylines \uncatcodespecials \sepspaces 7453 1.1 mrg } 7454 1.1 mrg 7455 1.1 mrg % Do the @verb magic: verbatim text is quoted by unique 7456 1.1 mrg % delimiter characters. Before first delimiter expect a 7457 1.1 mrg % right brace, after last delimiter expect closing brace: 7458 1.1 mrg % 7459 1.1 mrg % \def\doverb'{'<char>#1<char>'}'{#1} 7460 1.1 mrg % 7461 1.1 mrg % [Knuth] p. 382; only eat outer {} 7462 1.1 mrg \begingroup 7463 1.1 mrg \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other 7464 1.1 mrg \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] 7465 1.1 mrg \endgroup 7466 1.1 mrg % 7467 1.1 mrg \def\verb{\begingroup\setupverb\doverb} 7468 1.1 mrg % 7469 1.1 mrg % 7470 1.1 mrg % Do the @verbatim magic: define the macro \doverbatim so that 7471 1.1 mrg % the (first) argument ends when '@end verbatim' is reached, ie: 7472 1.1 mrg % 7473 1.1 mrg % \def\doverbatim#1@end verbatim{#1} 7474 1.1 mrg % 7475 1.1 mrg % For Texinfo it's a lot easier than for LaTeX, 7476 1.1 mrg % because texinfo's \verbatim doesn't stop at '\end{verbatim}': 7477 1.1 mrg % we need not redefine '\', '{' and '}'. 7478 1.1 mrg % 7479 1.1 mrg % Inspired by LaTeX's verbatim command set [latex.ltx] 7480 1.1 mrg % 7481 1.1 mrg \begingroup 7482 1.1 mrg \catcode`\ =\active 7483 1.1 mrg \obeylines % 7484 1.1 mrg % ignore everything up to the first ^^M, that's the newline at the end 7485 1.1 mrg % of the @verbatim input line itself. Otherwise we get an extra blank 7486 1.1.1.2 mrg % line in the output. 7487 1.1.1.2 mrg \xdef\doverbatim#1^^M#2@end verbatim{% 7488 1.1 mrg \starttabbox#2\egroup\noexpand\end\gobble verbatim}% 7489 1.1 mrg % We really want {...\end verbatim} in the body of the macro, but 7490 1.1.1.2 mrg % without the active space; thus we have to use \xdef and \gobble. 7491 1.1.1.2 mrg % The \egroup ends the \verbbox started at the end of the last line in 7492 1.1 mrg % the block. 7493 1.1 mrg \endgroup 7494 1.1 mrg % 7495 1.1.1.2 mrg \envdef\verbatim{% 7496 1.1 mrg \setnormaldispenv\setupverbatim\doverbatim 7497 1.1 mrg } 7498 1.1 mrg \let\Everbatim = \afterenvbreak 7499 1.1 mrg 7500 1.1 mrg 7501 1.1 mrg % @verbatiminclude FILE - insert text of file in verbatim environment. 7502 1.1 mrg % 7503 1.1 mrg \def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude} 7504 1.1 mrg % 7505 1.1 mrg \def\doverbatiminclude#1{% 7506 1.1 mrg {% 7507 1.1 mrg \makevalueexpandable 7508 1.1 mrg \setupverbatim 7509 1.1 mrg {% 7510 1.1 mrg \indexnofonts % Allow `@@' and other weird things in file names. 7511 1.1 mrg \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}% 7512 1.1 mrg \edef\tmp{\noexpand\input #1 } 7513 1.1.1.2 mrg \expandafter 7514 1.1 mrg }\expandafter\starttabbox\tmp\egroup 7515 1.1 mrg \afterenvbreak 7516 1.1 mrg }% 7517 1.1 mrg } 7518 1.1 mrg 7519 1.1 mrg % @copying ... @end copying. 7520 1.1 mrg % Save the text away for @insertcopying later. 7521 1.1 mrg % 7522 1.1 mrg % We save the uninterpreted tokens, rather than creating a box. 7523 1.1 mrg % Saving the text in a box would be much easier, but then all the 7524 1.1 mrg % typesetting commands (@smallbook, font changes, etc.) have to be done 7525 1.1 mrg % beforehand -- and a) we want @copying to be done first in the source 7526 1.1 mrg % file; b) letting users define the frontmatter in as flexible order as 7527 1.1 mrg % possible is desirable. 7528 1.1 mrg % 7529 1.1 mrg \def\copying{\checkenv{}\begingroup\scanargctxt\docopying} 7530 1.1 mrg \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}} 7531 1.1 mrg % 7532 1.1 mrg \def\insertcopying{% 7533 1.1 mrg \begingroup 7534 1.1 mrg \parindent = 0pt % paragraph indentation looks wrong on title page 7535 1.1 mrg \scanexp\copyingtext 7536 1.1 mrg \endgroup 7537 1.1 mrg } 7538 1.1 mrg 7539 1.1 mrg 7540 1.1 mrg \message{defuns,} 7541 1.1 mrg % @defun etc. 7542 1.1 mrg 7543 1.1 mrg \newskip\defbodyindent \defbodyindent=.4in 7544 1.1 mrg \newskip\defargsindent \defargsindent=50pt 7545 1.1 mrg \newskip\deflastargmargin \deflastargmargin=18pt 7546 1.1 mrg \newcount\defunpenalty 7547 1.1 mrg 7548 1.1 mrg % Start the processing of @deffn: 7549 1.1 mrg \def\startdefun{% 7550 1.1 mrg \ifnum\lastpenalty<10000 7551 1.1 mrg \medbreak 7552 1.1 mrg \defunpenalty=10003 % Will keep this @deffn together with the 7553 1.1 mrg % following @def command, see below. 7554 1.1 mrg \else 7555 1.1 mrg % If there are two @def commands in a row, we'll have a \nobreak, 7556 1.1 mrg % which is there to keep the function description together with its 7557 1.1 mrg % header. But if there's nothing but headers, we need to allow a 7558 1.1 mrg % break somewhere. Check specifically for penalty 10002, inserted 7559 1.1 mrg % by \printdefunline, instead of 10000, since the sectioning 7560 1.1 mrg % commands also insert a nobreak penalty, and we don't want to allow 7561 1.1 mrg % a break between a section heading and a defun. 7562 1.1 mrg % 7563 1.1 mrg % As a further refinement, we avoid "club" headers by signalling 7564 1.1 mrg % with penalty of 10003 after the very first @deffn in the 7565 1.1 mrg % sequence (see above), and penalty of 10002 after any following 7566 1.1 mrg % @def command. 7567 1.1 mrg \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi 7568 1.1 mrg % 7569 1.1 mrg % Similarly, after a section heading, do not allow a break. 7570 1.1 mrg % But do insert the glue. 7571 1.1 mrg \medskip % preceded by discardable penalty, so not a breakpoint 7572 1.1 mrg \fi 7573 1.1 mrg % 7574 1.1 mrg \parindent=0in 7575 1.1 mrg \advance\leftskip by \defbodyindent 7576 1.1 mrg \exdentamount=\defbodyindent 7577 1.1 mrg } 7578 1.1 mrg 7579 1.1 mrg \def\dodefunx#1{% 7580 1.1 mrg % First, check whether we are in the right environment: 7581 1.1 mrg \checkenv#1% 7582 1.1 mrg % 7583 1.1 mrg % As above, allow line break if we have multiple x headers in a row. 7584 1.1 mrg % It's not a great place, though. 7585 1.1 mrg \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi 7586 1.1 mrg % 7587 1.1 mrg % And now, it's time to reuse the body of the original defun: 7588 1.1 mrg \expandafter\gobbledefun#1% 7589 1.1 mrg } 7590 1.1 mrg \def\gobbledefun#1\startdefun{} 7591 1.1 mrg 7592 1.1 mrg % \printdefunline \deffnheader{text} 7593 1.1 mrg % 7594 1.1 mrg \def\printdefunline#1#2{% 7595 1.1 mrg \begingroup 7596 1.1 mrg % call \deffnheader: 7597 1.1 mrg #1#2 \endheader 7598 1.1 mrg % common ending: 7599 1.1 mrg \interlinepenalty = 10000 7600 1.1 mrg \advance\rightskip by 0pt plus 1fil\relax 7601 1.1 mrg \endgraf 7602 1.1 mrg \nobreak\vskip -\parskip 7603 1.1 mrg \penalty\defunpenalty % signal to \startdefun and \dodefunx 7604 1.1 mrg % Some of the @defun-type tags do not enable magic parentheses, 7605 1.1 mrg % rendering the following check redundant. But we don't optimize. 7606 1.1 mrg \checkparencounts 7607 1.1 mrg \endgroup 7608 1.1 mrg } 7609 1.1 mrg 7610 1.1 mrg \def\Edefun{\endgraf\medbreak} 7611 1.1 mrg 7612 1.1 mrg % \makedefun{deffn} creates \deffn, \deffnx and \Edeffn; 7613 1.1 mrg % the only thing remaining is to define \deffnheader. 7614 1.1 mrg % 7615 1.1 mrg \def\makedefun#1{% 7616 1.1 mrg \expandafter\let\csname E#1\endcsname = \Edefun 7617 1.1 mrg \edef\temp{\noexpand\domakedefun 7618 1.1 mrg \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}% 7619 1.1 mrg \temp 7620 1.1 mrg } 7621 1.1 mrg 7622 1.1 mrg % \domakedefun \deffn \deffnx \deffnheader { (defn. of \deffnheader) } 7623 1.1 mrg % 7624 1.1 mrg % Define \deffn and \deffnx, without parameters. 7625 1.1 mrg % \deffnheader has to be defined explicitly. 7626 1.1 mrg % 7627 1.1 mrg \def\domakedefun#1#2#3{% 7628 1.1 mrg \envdef#1{% 7629 1.1 mrg \startdefun 7630 1.1 mrg \doingtypefnfalse % distinguish typed functions from all else 7631 1.1 mrg \parseargusing\activeparens{\printdefunline#3}% 7632 1.1 mrg }% 7633 1.1 mrg \def#2{\dodefunx#1}% 7634 1.1 mrg \def#3% 7635 1.1 mrg } 7636 1.1 mrg 7637 1.1 mrg \newif\ifdoingtypefn % doing typed function? 7638 1.1 mrg \newif\ifrettypeownline % typeset return type on its own line? 7639 1.1 mrg 7640 1.1 mrg % @deftypefnnewline on|off says whether the return type of typed functions 7641 1.1 mrg % are printed on their own line. This affects @deftypefn, @deftypefun, 7642 1.1 mrg % @deftypeop, and @deftypemethod. 7643 1.1 mrg % 7644 1.1 mrg \parseargdef\deftypefnnewline{% 7645 1.1 mrg \def\temp{#1}% 7646 1.1 mrg \ifx\temp\onword 7647 1.1 mrg \expandafter\let\csname SETtxideftypefnnl\endcsname 7648 1.1 mrg = \empty 7649 1.1 mrg \else\ifx\temp\offword 7650 1.1 mrg \expandafter\let\csname SETtxideftypefnnl\endcsname 7651 1.1 mrg = \relax 7652 1.1 mrg \else 7653 1.1 mrg \errhelp = \EMsimple 7654 1.1 mrg \errmessage{Unknown @txideftypefnnl value `\temp', 7655 1.1 mrg must be on|off}% 7656 1.1 mrg \fi\fi 7657 1.1 mrg } 7658 1.1 mrg 7659 1.1 mrg % \dosubind {index}{topic}{subtopic} 7660 1.1 mrg % 7661 1.1 mrg % If SUBTOPIC is present, precede it with a space, and call \doind. 7662 1.1 mrg % (At some time during the 20th century, this made a two-level entry in an 7663 1.1 mrg % index such as the operation index. Nobody seemed to notice the change in 7664 1.1 mrg % behaviour though.) 7665 1.1 mrg \def\dosubind#1#2#3{% 7666 1.1 mrg \def\thirdarg{#3}% 7667 1.1 mrg \ifx\thirdarg\empty 7668 1.1 mrg \doind{#1}{#2}% 7669 1.1 mrg \else 7670 1.1 mrg \doind{#1}{#2\space#3}% 7671 1.1 mrg \fi 7672 1.1 mrg } 7673 1.1 mrg 7674 1.1 mrg % Untyped functions: 7675 1.1 mrg 7676 1.1 mrg % @deffn category name args 7677 1.1 mrg \makedefun{deffn}{\deffngeneral{}} 7678 1.1 mrg 7679 1.1 mrg % @deffn category class name args 7680 1.1 mrg \makedefun{defop}#1 {\defopon{#1\ \putwordon}} 7681 1.1 mrg 7682 1.1 mrg % \defopon {category on}class name args 7683 1.1 mrg \def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } 7684 1.1 mrg 7685 1.1 mrg % \deffngeneral {subind}category name args 7686 1.1 mrg % 7687 1.1 mrg \def\deffngeneral#1#2 #3 #4\endheader{% 7688 1.1 mrg \dosubind{fn}{\code{#3}}{#1}% 7689 1.1 mrg \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% 7690 1.1 mrg } 7691 1.1 mrg 7692 1.1 mrg % Typed functions: 7693 1.1 mrg 7694 1.1 mrg % @deftypefn category type name args 7695 1.1 mrg \makedefun{deftypefn}{\deftypefngeneral{}} 7696 1.1 mrg 7697 1.1 mrg % @deftypeop category class type name args 7698 1.1 mrg \makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}} 7699 1.1 mrg 7700 1.1 mrg % \deftypeopon {category on}class type name args 7701 1.1 mrg \def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } 7702 1.1 mrg 7703 1.1 mrg % \deftypefngeneral {subind}category type name args 7704 1.1 mrg % 7705 1.1 mrg \def\deftypefngeneral#1#2 #3 #4 #5\endheader{% 7706 1.1 mrg \dosubind{fn}{\code{#4}}{#1}% 7707 1.1 mrg \doingtypefntrue 7708 1.1 mrg \defname{#2}{#3}{#4}\defunargs{#5\unskip}% 7709 1.1 mrg } 7710 1.1 mrg 7711 1.1 mrg % Typed variables: 7712 1.1 mrg 7713 1.1 mrg % @deftypevr category type var args 7714 1.1 mrg \makedefun{deftypevr}{\deftypecvgeneral{}} 7715 1.1 mrg 7716 1.1 mrg % @deftypecv category class type var args 7717 1.1 mrg \makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}} 7718 1.1 mrg 7719 1.1 mrg % \deftypecvof {category of}class type var args 7720 1.1 mrg \def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} } 7721 1.1 mrg 7722 1.1 mrg % \deftypecvgeneral {subind}category type var args 7723 1.1 mrg % 7724 1.1 mrg \def\deftypecvgeneral#1#2 #3 #4 #5\endheader{% 7725 1.1 mrg \dosubind{vr}{\code{#4}}{#1}% 7726 1.1 mrg \defname{#2}{#3}{#4}\defunargs{#5\unskip}% 7727 1.1 mrg } 7728 1.1 mrg 7729 1.1 mrg % Untyped variables: 7730 1.1 mrg 7731 1.1 mrg % @defvr category var args 7732 1.1 mrg \makedefun{defvr}#1 {\deftypevrheader{#1} {} } 7733 1.1 mrg 7734 1.1 mrg % @defcv category class var args 7735 1.1 mrg \makedefun{defcv}#1 {\defcvof{#1\ \putwordof}} 7736 1.1 mrg 7737 1.1 mrg % \defcvof {category of}class var args 7738 1.1 mrg \def\defcvof#1#2 {\deftypecvof{#1}#2 {} } 7739 1.1 mrg 7740 1.1 mrg % Types: 7741 1.1 mrg 7742 1.1 mrg % @deftp category name args 7743 1.1 mrg \makedefun{deftp}#1 #2 #3\endheader{% 7744 1.1 mrg \doind{tp}{\code{#2}}% 7745 1.1 mrg \defname{#1}{}{#2}\defunargs{#3\unskip}% 7746 1.1 mrg } 7747 1.1 mrg 7748 1.1 mrg % Remaining @defun-like shortcuts: 7749 1.1 mrg \makedefun{defun}{\deffnheader{\putwordDeffunc} } 7750 1.1 mrg \makedefun{defmac}{\deffnheader{\putwordDefmac} } 7751 1.1 mrg \makedefun{defspec}{\deffnheader{\putwordDefspec} } 7752 1.1 mrg \makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} } 7753 1.1 mrg \makedefun{defvar}{\defvrheader{\putwordDefvar} } 7754 1.1 mrg \makedefun{defopt}{\defvrheader{\putwordDefopt} } 7755 1.1 mrg \makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} } 7756 1.1 mrg \makedefun{defmethod}{\defopon\putwordMethodon} 7757 1.1 mrg \makedefun{deftypemethod}{\deftypeopon\putwordMethodon} 7758 1.1 mrg \makedefun{defivar}{\defcvof\putwordInstanceVariableof} 7759 1.1 mrg \makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof} 7760 1.1 mrg 7761 1.1 mrg % \defname, which formats the name of the @def (not the args). 7762 1.1 mrg % #1 is the category, such as "Function". 7763 1.1 mrg % #2 is the return type, if any. 7764 1.1 mrg % #3 is the function name. 7765 1.1 mrg % 7766 1.1 mrg % We are followed by (but not passed) the arguments, if any. 7767 1.1 mrg % 7768 1.1 mrg \def\defname#1#2#3{% 7769 1.1 mrg \par 7770 1.1 mrg % Get the values of \leftskip and \rightskip as they were outside the @def... 7771 1.1 mrg \advance\leftskip by -\defbodyindent 7772 1.1 mrg % 7773 1.1 mrg % Determine if we are typesetting the return type of a typed function 7774 1.1 mrg % on a line by itself. 7775 1.1 mrg \rettypeownlinefalse 7776 1.1 mrg \ifdoingtypefn % doing a typed function specifically? 7777 1.1 mrg % then check user option for putting return type on its own line: 7778 1.1 mrg \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else 7779 1.1 mrg \rettypeownlinetrue 7780 1.1 mrg \fi 7781 1.1 mrg \fi 7782 1.1 mrg % 7783 1.1 mrg % How we'll format the category name. Putting it in brackets helps 7784 1.1 mrg % distinguish it from the body text that may end up on the next line 7785 1.1 mrg % just below it. 7786 1.1 mrg \def\temp{#1}% 7787 1.1 mrg \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} 7788 1.1 mrg % 7789 1.1 mrg % Figure out line sizes for the paragraph shape. We'll always have at 7790 1.1 mrg % least two. 7791 1.1 mrg \tempnum = 2 7792 1.1 mrg % 7793 1.1 mrg % The first line needs space for \box0; but if \rightskip is nonzero, 7794 1.1 mrg % we need only space for the part of \box0 which exceeds it: 7795 1.1 mrg \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip 7796 1.1 mrg % 7797 1.1 mrg % If doing a return type on its own line, we'll have another line. 7798 1.1 mrg \ifrettypeownline 7799 1.1 mrg \advance\tempnum by 1 7800 1.1 mrg \def\maybeshapeline{0in \hsize}% 7801 1.1 mrg \else 7802 1.1 mrg \def\maybeshapeline{}% 7803 1.1 mrg \fi 7804 1.1 mrg % 7805 1.1 mrg % The continuations: 7806 1.1 mrg \dimen2=\hsize \advance\dimen2 by -\defargsindent 7807 1.1 mrg % 7808 1.1 mrg % The final paragraph shape: 7809 1.1 mrg \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2 7810 1.1 mrg % 7811 1.1 mrg % Put the category name at the right margin. 7812 1.1 mrg \noindent 7813 1.1 mrg \hbox to 0pt{% 7814 1.1 mrg \hfil\box0 \kern-\hsize 7815 1.1 mrg % \hsize has to be shortened this way: 7816 1.1 mrg \kern\leftskip 7817 1.1 mrg % Intentionally do not respect \rightskip, since we need the space. 7818 1.1 mrg }% 7819 1.1 mrg % 7820 1.1 mrg % Allow all lines to be underfull without complaint: 7821 1.1 mrg \tolerance=10000 \hbadness=10000 7822 1.1 mrg \exdentamount=\defbodyindent 7823 1.1 mrg {% 7824 1.1 mrg % defun fonts. We use typewriter by default (used to be bold) because: 7825 1.1 mrg % . we're printing identifiers, they should be in tt in principle. 7826 1.1 mrg % . in languages with many accents, such as Czech or French, it's 7827 1.1 mrg % common to leave accents off identifiers. The result looks ok in 7828 1.1 mrg % tt, but exceedingly strange in rm. 7829 1.1 mrg % . we don't want -- and --- to be treated as ligatures. 7830 1.1 mrg % . this still does not fix the ?` and !` ligatures, but so far no 7831 1.1 mrg % one has made identifiers using them :). 7832 1.1 mrg \df \tt 7833 1.1 mrg \def\temp{#2}% text of the return type 7834 1.1 mrg \ifx\temp\empty\else 7835 1.1 mrg \tclose{\temp}% typeset the return type 7836 1.1 mrg \ifrettypeownline 7837 1.1 mrg % put return type on its own line; prohibit line break following: 7838 1.1 mrg \hfil\vadjust{\nobreak}\break 7839 1.1 mrg \else 7840 1.1 mrg \space % type on same line, so just followed by a space 7841 1.1 mrg \fi 7842 1.1 mrg \fi % no return type 7843 1.1 mrg #3% output function name 7844 1.1 mrg }% 7845 1.1 mrg {\rm\enskip}% hskip 0.5 em of \rmfont 7846 1.1 mrg % 7847 1.1 mrg \boldbrax 7848 1.1 mrg % arguments will be output next, if any. 7849 1.1 mrg } 7850 1.1 mrg 7851 1.1 mrg % Print arguments in slanted roman (not ttsl), inconsistently with using 7852 1.1 mrg % tt for the name. This is because literal text is sometimes needed in 7853 1.1 mrg % the argument list (groff manual), and ttsl and tt are not very 7854 1.1 mrg % distinguishable. Prevent hyphenation at `-' chars. 7855 1.1 mrg % 7856 1.1 mrg \def\defunargs#1{% 7857 1.1 mrg % use sl by default (not ttsl), 7858 1.1 mrg % tt for the names. 7859 1.1 mrg \df \sl \hyphenchar\font=0 7860 1.1 mrg % 7861 1.1 mrg % On the other hand, if an argument has two dashes (for instance), we 7862 1.1 mrg % want a way to get ttsl. We used to recommend @var for that, so 7863 1.1 mrg % leave the code in, but it's strange for @var to lead to typewriter. 7864 1.1 mrg % Nowadays we recommend @code, since the difference between a ttsl hyphen 7865 1.1.1.2 mrg % and a tt hyphen is pretty tiny. @code also disables ?` !`. 7866 1.1 mrg \def\var##1{{\setregularquotes\ttslanted{##1}}}% 7867 1.1 mrg #1% 7868 1.1 mrg \sl\hyphenchar\font=45 7869 1.1 mrg } 7870 1.1 mrg 7871 1.1 mrg % We want ()&[] to print specially on the defun line. 7872 1.1 mrg % 7873 1.1 mrg \def\activeparens{% 7874 1.1 mrg \catcode`\(=\active \catcode`\)=\active 7875 1.1 mrg \catcode`\[=\active \catcode`\]=\active 7876 1.1 mrg \catcode`\&=\active 7877 1.1 mrg } 7878 1.1 mrg 7879 1.1 mrg % Make control sequences which act like normal parenthesis chars. 7880 1.1 mrg \let\lparen = ( \let\rparen = ) 7881 1.1 mrg 7882 1.1 mrg % Be sure that we always have a definition for `(', etc. For example, 7883 1.1 mrg % if the fn name has parens in it, \boldbrax will not be in effect yet, 7884 1.1 mrg % so TeX would otherwise complain about undefined control sequence. 7885 1.1 mrg { 7886 1.1 mrg \activeparens 7887 1.1 mrg \global\let(=\lparen \global\let)=\rparen 7888 1.1 mrg \global\let[=\lbrack \global\let]=\rbrack 7889 1.1 mrg \global\let& = \& 7890 1.1 mrg 7891 1.1 mrg \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} 7892 1.1 mrg \gdef\magicamp{\let&=\amprm} 7893 1.1 mrg } 7894 1.1 mrg \let\ampchar\& 7895 1.1 mrg 7896 1.1 mrg \newcount\parencount 7897 1.1 mrg 7898 1.1 mrg % If we encounter &foo, then turn on ()-hacking afterwards 7899 1.1 mrg \newif\ifampseen 7900 1.1 mrg \def\amprm#1 {\ampseentrue{\bf\ }} 7901 1.1 mrg 7902 1.1 mrg \def\parenfont{% 7903 1.1 mrg \ifampseen 7904 1.1 mrg % At the first level, print parens in roman, 7905 1.1 mrg % otherwise use the default font. 7906 1.1 mrg \ifnum \parencount=1 \rm \fi 7907 1.1 mrg \else 7908 1.1 mrg % The \sf parens (in \boldbrax) actually are a little bolder than 7909 1.1 mrg % the contained text. This is especially needed for [ and ] . 7910 1.1 mrg \sf 7911 1.1 mrg \fi 7912 1.1 mrg } 7913 1.1 mrg \def\infirstlevel#1{% 7914 1.1 mrg \ifampseen 7915 1.1 mrg \ifnum\parencount=1 7916 1.1 mrg #1% 7917 1.1 mrg \fi 7918 1.1 mrg \fi 7919 1.1 mrg } 7920 1.1 mrg \def\bfafterword#1 {#1 \bf} 7921 1.1 mrg 7922 1.1 mrg \def\opnr{% 7923 1.1 mrg \global\advance\parencount by 1 7924 1.1 mrg {\parenfont(}% 7925 1.1 mrg \infirstlevel \bfafterword 7926 1.1 mrg } 7927 1.1 mrg \def\clnr{% 7928 1.1 mrg {\parenfont)}% 7929 1.1 mrg \infirstlevel \sl 7930 1.1 mrg \global\advance\parencount by -1 7931 1.1 mrg } 7932 1.1 mrg 7933 1.1 mrg \newcount\brackcount 7934 1.1 mrg \def\lbrb{% 7935 1.1 mrg \global\advance\brackcount by 1 7936 1.1 mrg {\bf[}% 7937 1.1 mrg } 7938 1.1 mrg \def\rbrb{% 7939 1.1 mrg {\bf]}% 7940 1.1 mrg \global\advance\brackcount by -1 7941 1.1 mrg } 7942 1.1 mrg 7943 1.1 mrg \def\checkparencounts{% 7944 1.1 mrg \ifnum\parencount=0 \else \badparencount \fi 7945 1.1 mrg \ifnum\brackcount=0 \else \badbrackcount \fi 7946 1.1 mrg } 7947 1.1 mrg % these should not use \errmessage; the glibc manual, at least, actually 7948 1.1 mrg % has such constructs (when documenting function pointers). 7949 1.1 mrg \def\badparencount{% 7950 1.1 mrg \message{Warning: unbalanced parentheses in @def...}% 7951 1.1 mrg \global\parencount=0 7952 1.1 mrg } 7953 1.1 mrg \def\badbrackcount{% 7954 1.1 mrg \message{Warning: unbalanced square brackets in @def...}% 7955 1.1 mrg \global\brackcount=0 7956 1.1 mrg } 7957 1.1 mrg 7958 1.1 mrg 7959 1.1 mrg \message{macros,} 7960 1.1 mrg % @macro. 7961 1.1 mrg 7962 1.1 mrg % To do this right we need a feature of e-TeX, \scantokens, 7963 1.1 mrg % which we arrange to emulate with a temporary file in ordinary TeX. 7964 1.1 mrg \ifx\eTeXversion\thisisundefined 7965 1.1 mrg \newwrite\macscribble 7966 1.1 mrg \def\scantokens#1{% 7967 1.1 mrg \toks0={#1}% 7968 1.1 mrg \immediate\openout\macscribble=\jobname.tmp 7969 1.1 mrg \immediate\write\macscribble{\the\toks0}% 7970 1.1 mrg \immediate\closeout\macscribble 7971 1.1 mrg \input \jobname.tmp 7972 1.1 mrg } 7973 1.1 mrg \fi 7974 1.1.1.2 mrg 7975 1.1.1.2 mrg \let\E=\expandafter 7976 1.1 mrg 7977 1.1 mrg % Used at the time of macro expansion. 7978 1.1 mrg % Argument is macro body with arguments substituted 7979 1.1 mrg \def\scanmacro#1{% 7980 1.1.1.2 mrg \newlinechar`\^^M 7981 1.1.1.2 mrg % expand the expansion of \eatleadingcr twice to maybe remove a leading 7982 1.1.1.2 mrg % newline (and \else and \fi tokens), then call \eatspaces on the result. 7983 1.1.1.2 mrg \def\xeatspaces##1{% 7984 1.1.1.2 mrg \E\E\E\E\E\E\E\eatspaces\E\E\E\E\E\E\E{\eatleadingcr##1% 7985 1.1.1.2 mrg }}% 7986 1.1 mrg \def\xempty##1{}% 7987 1.1 mrg % 7988 1.1 mrg % Process the macro body under the current catcode regime. 7989 1.1 mrg \scantokens{#1@comment}% 7990 1.1 mrg % 7991 1.1 mrg % The \comment is to remove the \newlinechar added by \scantokens, and 7992 1.1 mrg % can be noticed by \parsearg. Note \c isn't used because this means cedilla 7993 1.1 mrg % in math mode. 7994 1.1 mrg } 7995 1.1 mrg 7996 1.1 mrg % Used for copying and captions 7997 1.1 mrg \def\scanexp#1{% 7998 1.1 mrg \expandafter\scanmacro\expandafter{#1}% 7999 1.1 mrg } 8000 1.1 mrg 8001 1.1 mrg \newcount\paramno % Count of parameters 8002 1.1 mrg \newtoks\macname % Macro name 8003 1.1 mrg \newif\ifrecursive % Is it recursive? 8004 1.1 mrg 8005 1.1 mrg % List of all defined macros in the form 8006 1.1 mrg % \commondummyword\macro1\commondummyword\macro2... 8007 1.1 mrg % Currently is also contains all @aliases; the list can be split 8008 1.1 mrg % if there is a need. 8009 1.1 mrg \def\macrolist{} 8010 1.1 mrg 8011 1.1 mrg % Add the macro to \macrolist 8012 1.1 mrg \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname} 8013 1.1 mrg \def\addtomacrolistxxx#1{% 8014 1.1 mrg \toks0 = \expandafter{\macrolist\commondummyword#1}% 8015 1.1 mrg \xdef\macrolist{\the\toks0}% 8016 1.1 mrg } 8017 1.1 mrg 8018 1.1 mrg % Utility routines. 8019 1.1 mrg % This does \let #1 = #2, with \csnames; that is, 8020 1.1 mrg % \let \csname#1\endcsname = \csname#2\endcsname 8021 1.1 mrg % (except of course we have to play expansion games). 8022 1.1 mrg % 8023 1.1 mrg \def\cslet#1#2{% 8024 1.1 mrg \expandafter\let 8025 1.1 mrg \csname#1\expandafter\endcsname 8026 1.1 mrg \csname#2\endcsname 8027 1.1 mrg } 8028 1.1 mrg 8029 1.1 mrg % Trim leading and trailing spaces off a string. 8030 1.1 mrg % Concepts from aro-bend problem 15 (see CTAN). 8031 1.1 mrg {\catcode`\@=11 8032 1.1 mrg \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} 8033 1.1 mrg \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} 8034 1.1 mrg \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} 8035 1.1 mrg \def\unbrace#1{#1} 8036 1.1 mrg \unbrace{\gdef\trim@@@ #1 } #2@{#1} 8037 1.1 mrg } 8038 1.1.1.2 mrg 8039 1.1.1.2 mrg {\catcode`\^^M=\other% 8040 1.1.1.2 mrg \gdef\eatleadingcr#1{\if\noexpand#1\noexpand^^M\else\E#1\fi}}% 8041 1.1.1.2 mrg % Warning: this won't work for a delimited argument 8042 1.1.1.2 mrg % or for an empty argument 8043 1.1 mrg 8044 1.1 mrg % Trim a single trailing ^^M off a string. 8045 1.1 mrg {\catcode`\^^M=\other \catcode`\Q=3% 8046 1.1 mrg \gdef\eatcr #1{\eatcra #1Q^^MQ}% 8047 1.1 mrg \gdef\eatcra#1^^MQ{\eatcrb#1Q}% 8048 1.1 mrg \gdef\eatcrb#1Q#2Q{#1}% 8049 1.1 mrg } 8050 1.1 mrg 8051 1.1 mrg % Macro bodies are absorbed as an argument in a context where 8052 1.1 mrg % all characters are catcode 10, 11 or 12, except \ which is active 8053 1.1 mrg % (as in normal texinfo). It is necessary to change the definition of \ 8054 1.1 mrg % to recognize macro arguments; this is the job of \mbodybackslash. 8055 1.1 mrg % 8056 1.1 mrg % Non-ASCII encodings make 8-bit characters active, so un-activate 8057 1.1 mrg % them to avoid their expansion. Must do this non-globally, to 8058 1.1 mrg % confine the change to the current group. 8059 1.1 mrg % 8060 1.1 mrg % It's necessary to have hard CRs when the macro is executed. This is 8061 1.1 mrg % done by making ^^M (\endlinechar) catcode 12 when reading the macro 8062 1.1 mrg % body, and then making it the \newlinechar in \scanmacro. 8063 1.1 mrg % 8064 1.1 mrg \def\scanctxt{% used as subroutine 8065 1.1 mrg \catcode`\"=\other 8066 1.1 mrg \catcode`\+=\other 8067 1.1 mrg \catcode`\<=\other 8068 1.1 mrg \catcode`\>=\other 8069 1.1 mrg \catcode`\^=\other 8070 1.1 mrg \catcode`\_=\other 8071 1.1 mrg \catcode`\|=\other 8072 1.1 mrg \catcode`\~=\other 8073 1.1 mrg \passthroughcharstrue 8074 1.1 mrg } 8075 1.1 mrg 8076 1.1 mrg \def\scanargctxt{% used for copying and captions, not macros. 8077 1.1 mrg \scanctxt 8078 1.1 mrg \catcode`\@=\other 8079 1.1 mrg \catcode`\\=\other 8080 1.1 mrg \catcode`\^^M=\other 8081 1.1 mrg } 8082 1.1 mrg 8083 1.1 mrg \def\macrobodyctxt{% used for @macro definitions 8084 1.1 mrg \scanctxt 8085 1.1 mrg \catcode`\ =\other 8086 1.1 mrg \catcode`\@=\other 8087 1.1 mrg \catcode`\{=\other 8088 1.1 mrg \catcode`\}=\other 8089 1.1 mrg \catcode`\^^M=\other 8090 1.1 mrg \usembodybackslash 8091 1.1 mrg } 8092 1.1 mrg 8093 1.1 mrg % Used when scanning braced macro arguments. Note, however, that catcode 8094 1.1 mrg % changes here are ineffectual if the macro invocation was nested inside 8095 1.1 mrg % an argument to another Texinfo command. 8096 1.1 mrg \def\macroargctxt{% 8097 1.1 mrg \scanctxt 8098 1.1 mrg \catcode`\ =\active 8099 1.1 mrg \catcode`\@=\other 8100 1.1 mrg \catcode`\^^M=\other 8101 1.1 mrg \catcode`\\=\active 8102 1.1 mrg } 8103 1.1 mrg 8104 1.1 mrg \def\macrolineargctxt{% used for whole-line arguments without braces 8105 1.1 mrg \scanctxt 8106 1.1 mrg \catcode`\@=\other 8107 1.1 mrg \catcode`\{=\other 8108 1.1 mrg \catcode`\}=\other 8109 1.1 mrg } 8110 1.1 mrg 8111 1.1 mrg % \mbodybackslash is the definition of \ in @macro bodies. 8112 1.1 mrg % It maps \foo\ => \csname macarg.foo\endcsname => #N 8113 1.1 mrg % where N is the macro parameter number. 8114 1.1 mrg % We define \csname macarg.\endcsname to be \realbackslash, so 8115 1.1 mrg % \\ in macro replacement text gets you a backslash. 8116 1.1 mrg % 8117 1.1 mrg {\catcode`@=0 @catcode`@\=@active 8118 1.1 mrg @gdef@usembodybackslash{@let\=@mbodybackslash} 8119 1.1 mrg @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} 8120 1.1 mrg } 8121 1.1 mrg \expandafter\def\csname macarg.\endcsname{\realbackslash} 8122 1.1 mrg 8123 1.1 mrg \def\margbackslash#1{\char`\#1 } 8124 1.1 mrg 8125 1.1 mrg \def\macro{\recursivefalse\parsearg\macroxxx} 8126 1.1 mrg \def\rmacro{\recursivetrue\parsearg\macroxxx} 8127 1.1 mrg 8128 1.1 mrg \def\macroxxx#1{% 8129 1.1 mrg \getargs{#1}% now \macname is the macname and \argl the arglist 8130 1.1 mrg \ifx\argl\empty % no arguments 8131 1.1 mrg \paramno=0\relax 8132 1.1 mrg \else 8133 1.1 mrg \expandafter\parsemargdef \argl;% 8134 1.1 mrg \if\paramno>256\relax 8135 1.1 mrg \ifx\eTeXversion\thisisundefined 8136 1.1 mrg \errhelp = \EMsimple 8137 1.1 mrg \errmessage{You need eTeX to compile a file with macros with more than 256 arguments} 8138 1.1 mrg \fi 8139 1.1 mrg \fi 8140 1.1 mrg \fi 8141 1.1 mrg \if1\csname ismacro.\the\macname\endcsname 8142 1.1 mrg \message{Warning: redefining \the\macname}% 8143 1.1 mrg \else 8144 1.1 mrg \expandafter\ifx\csname \the\macname\endcsname \relax 8145 1.1 mrg \else \errmessage{Macro name \the\macname\space already defined}\fi 8146 1.1 mrg \global\cslet{macsave.\the\macname}{\the\macname}% 8147 1.1 mrg \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% 8148 1.1 mrg \addtomacrolist{\the\macname}% 8149 1.1 mrg \fi 8150 1.1 mrg \begingroup \macrobodyctxt 8151 1.1 mrg \ifrecursive \expandafter\parsermacbody 8152 1.1 mrg \else \expandafter\parsemacbody 8153 1.1 mrg \fi} 8154 1.1 mrg 8155 1.1 mrg \parseargdef\unmacro{% 8156 1.1 mrg \if1\csname ismacro.#1\endcsname 8157 1.1 mrg \global\cslet{#1}{macsave.#1}% 8158 1.1 mrg \global\expandafter\let \csname ismacro.#1\endcsname=0% 8159 1.1 mrg % Remove the macro name from \macrolist: 8160 1.1 mrg \begingroup 8161 1.1 mrg \expandafter\let\csname#1\endcsname \relax 8162 1.1 mrg \let\commondummyword\unmacrodo 8163 1.1 mrg \xdef\macrolist{\macrolist}% 8164 1.1 mrg \endgroup 8165 1.1 mrg \else 8166 1.1 mrg \errmessage{Macro #1 not defined}% 8167 1.1 mrg \fi 8168 1.1 mrg } 8169 1.1 mrg 8170 1.1 mrg % Called by \do from \dounmacro on each macro. The idea is to omit any 8171 1.1 mrg % macro definitions that have been changed to \relax. 8172 1.1 mrg % 8173 1.1 mrg \def\unmacrodo#1{% 8174 1.1 mrg \ifx #1\relax 8175 1.1 mrg % remove this 8176 1.1 mrg \else 8177 1.1 mrg \noexpand\commondummyword \noexpand#1% 8178 1.1 mrg \fi 8179 1.1 mrg } 8180 1.1 mrg 8181 1.1 mrg % \getargs -- Parse the arguments to a @macro line. Set \macname to 8182 1.1 mrg % the name of the macro, and \argl to the braced argument list. 8183 1.1 mrg \def\getargs#1{\getargsxxx#1{}} 8184 1.1 mrg \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} 8185 1.1 mrg \def\getmacname#1 #2\relax{\macname={#1}} 8186 1.1 mrg \def\getmacargs#1{\def\argl{#1}} 8187 1.1 mrg % This made use of the feature that if the last token of a 8188 1.1 mrg % <parameter list> is #, then the preceding argument is delimited by 8189 1.1 mrg % an opening brace, and that opening brace is not consumed. 8190 1.1 mrg 8191 1.1 mrg % Parse the optional {params} list to @macro or @rmacro. 8192 1.1 mrg % Set \paramno to the number of arguments, 8193 1.1 mrg % and \paramlist to a parameter text for the macro (e.g. #1,#2,#3 for a 8194 1.1 mrg % three-param macro.) Define \macarg.BLAH for each BLAH in the params 8195 1.1 mrg % list to some hook where the argument is to be expanded. If there are 8196 1.1 mrg % less than 10 arguments that hook is to be replaced by ##N where N 8197 1.1 mrg % is the position in that list, that is to say the macro arguments are to be 8198 1.1 mrg % defined `a la TeX in the macro body. 8199 1.1 mrg % 8200 1.1 mrg % That gets used by \mbodybackslash (above). 8201 1.1 mrg % 8202 1.1 mrg % If there are 10 or more arguments, a different technique is used: see 8203 1.1 mrg % \parsemmanyargdef. 8204 1.1 mrg % 8205 1.1 mrg \def\parsemargdef#1;{% 8206 1.1 mrg \paramno=0\def\paramlist{}% 8207 1.1 mrg \let\hash\relax 8208 1.1 mrg % \hash is redefined to `#' later to get it into definitions 8209 1.1.1.2 mrg \let\xeatspaces\relax 8210 1.1 mrg \let\xempty\relax 8211 1.1 mrg \parsemargdefxxx#1,;,% 8212 1.1 mrg \ifnum\paramno<10\relax\else 8213 1.1 mrg \paramno0\relax 8214 1.1 mrg \parsemmanyargdef@@#1,;,% 10 or more arguments 8215 1.1 mrg \fi 8216 1.1 mrg } 8217 1.1 mrg \def\parsemargdefxxx#1,{% 8218 1.1 mrg \if#1;\let\next=\relax 8219 1.1 mrg \else \let\next=\parsemargdefxxx 8220 1.1 mrg \advance\paramno by 1 8221 1.1.1.2 mrg \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname 8222 1.1 mrg {\xeatspaces{\hash\the\paramno\noexpand\xempty{}}}% 8223 1.1 mrg \edef\paramlist{\paramlist\hash\the\paramno,}% 8224 1.1.1.2 mrg \fi\next} 8225 1.1.1.2 mrg % the \xempty{} is to give \eatleadingcr an argument in the case of an 8226 1.1 mrg % empty macro argument. 8227 1.1 mrg 8228 1.1 mrg % \parsemacbody, \parsermacbody 8229 1.1 mrg % 8230 1.1 mrg % Read recursive and nonrecursive macro bodies. (They're different since 8231 1.1 mrg % rec and nonrec macros end differently.) 8232 1.1 mrg % 8233 1.1 mrg % We are in \macrobodyctxt, and the \xdef causes backslashshes in the macro 8234 1.1 mrg % body to be transformed. 8235 1.1 mrg % Set \macrobody to the body of the macro, and call \defmacro. 8236 1.1 mrg % 8237 1.1 mrg {\catcode`\ =\other\long\gdef\parsemacbody#1@end macro{% 8238 1.1 mrg \xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}% 8239 1.1 mrg {\catcode`\ =\other\long\gdef\parsermacbody#1@end rmacro{% 8240 1.1 mrg \xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}% 8241 1.1 mrg 8242 1.1 mrg % Make @ a letter, so that we can make private-to-Texinfo macro names. 8243 1.1 mrg \edef\texiatcatcode{\the\catcode`\@} 8244 1.1 mrg \catcode `@=11\relax 8245 1.1 mrg 8246 1.1 mrg %%%%%%%%%%%%%% Code for > 10 arguments only %%%%%%%%%%%%%%%%%% 8247 1.1 mrg 8248 1.1 mrg % If there are 10 or more arguments, a different technique is used, where the 8249 1.1 mrg % hook remains in the body, and when macro is to be expanded the body is 8250 1.1 mrg % processed again to replace the arguments. 8251 1.1 mrg % 8252 1.1 mrg % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the 8253 1.1 mrg % argument N value and then \edef the body (nothing else will expand because of 8254 1.1 mrg % the catcode regime under which the body was input). 8255 1.1 mrg % 8256 1.1 mrg % If you compile with TeX (not eTeX), and you have macros with 10 or more 8257 1.1 mrg % arguments, no macro can have more than 256 arguments (else error). 8258 1.1 mrg % 8259 1.1 mrg % In case that there are 10 or more arguments we parse again the arguments 8260 1.1 mrg % list to set new definitions for the \macarg.BLAH macros corresponding to 8261 1.1 mrg % each BLAH argument. It was anyhow needed to parse already once this list 8262 1.1 mrg % in order to count the arguments, and as macros with at most 9 arguments 8263 1.1 mrg % are by far more frequent than macro with 10 or more arguments, defining 8264 1.1 mrg % twice the \macarg.BLAH macros does not cost too much processing power. 8265 1.1 mrg \def\parsemmanyargdef@@#1,{% 8266 1.1 mrg \if#1;\let\next=\relax 8267 1.1 mrg \else 8268 1.1 mrg \let\next=\parsemmanyargdef@@ 8269 1.1 mrg \edef\tempb{\eatspaces{#1}}% 8270 1.1 mrg \expandafter\def\expandafter\tempa 8271 1.1 mrg \expandafter{\csname macarg.\tempb\endcsname}% 8272 1.1 mrg % Note that we need some extra \noexpand\noexpand, this is because we 8273 1.1 mrg % don't want \the to be expanded in the \parsermacbody as it uses an 8274 1.1 mrg % \xdef . 8275 1.1 mrg \expandafter\edef\tempa 8276 1.1 mrg {\noexpand\noexpand\noexpand\the\toks\the\paramno}% 8277 1.1 mrg \advance\paramno by 1\relax 8278 1.1 mrg \fi\next} 8279 1.1 mrg 8280 1.1 mrg 8281 1.1 mrg \let\endargs@\relax 8282 1.1 mrg \let\nil@\relax 8283 1.1 mrg \def\nilm@{\nil@}% 8284 1.1 mrg \long\def\nillm@{\nil@}% 8285 1.1 mrg 8286 1.1 mrg % This macro is expanded during the Texinfo macro expansion, not during its 8287 1.1 mrg % definition. It gets all the arguments' values and assigns them to macros 8288 1.1 mrg % macarg.ARGNAME 8289 1.1 mrg % 8290 1.1 mrg % #1 is the macro name 8291 1.1 mrg % #2 is the list of argument names 8292 1.1 mrg % #3 is the list of argument values 8293 1.1 mrg \def\getargvals@#1#2#3{% 8294 1.1 mrg \def\macargdeflist@{}% 8295 1.1 mrg \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion. 8296 1.1 mrg \def\paramlist{#2,\nil@}% 8297 1.1 mrg \def\macroname{#1}% 8298 1.1 mrg \begingroup 8299 1.1 mrg \macroargctxt 8300 1.1 mrg \def\argvaluelist{#3,\nil@}% 8301 1.1 mrg \def\@tempa{#3}% 8302 1.1 mrg \ifx\@tempa\empty 8303 1.1 mrg \setemptyargvalues@ 8304 1.1 mrg \else 8305 1.1 mrg \getargvals@@ 8306 1.1 mrg \fi 8307 1.1 mrg } 8308 1.1 mrg \def\getargvals@@{% 8309 1.1 mrg \ifx\paramlist\nilm@ 8310 1.1 mrg % Some sanity check needed here that \argvaluelist is also empty. 8311 1.1 mrg \ifx\argvaluelist\nillm@ 8312 1.1 mrg \else 8313 1.1 mrg \errhelp = \EMsimple 8314 1.1 mrg \errmessage{Too many arguments in macro `\macroname'!}% 8315 1.1 mrg \fi 8316 1.1 mrg \let\next\macargexpandinbody@ 8317 1.1 mrg \else 8318 1.1 mrg \ifx\argvaluelist\nillm@ 8319 1.1 mrg % No more arguments values passed to macro. Set remaining named-arg 8320 1.1 mrg % macros to empty. 8321 1.1 mrg \let\next\setemptyargvalues@ 8322 1.1 mrg \else 8323 1.1 mrg % pop current arg name into \@tempb 8324 1.1 mrg \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}% 8325 1.1 mrg \expandafter\@tempa\expandafter{\paramlist}% 8326 1.1 mrg % pop current argument value into \@tempc 8327 1.1 mrg \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}% 8328 1.1 mrg \expandafter\@tempa\expandafter{\argvaluelist}% 8329 1.1 mrg % Here \@tempb is the current arg name and \@tempc is the current arg value. 8330 1.1 mrg % First place the new argument macro definition into \@tempd 8331 1.1 mrg \expandafter\macname\expandafter{\@tempc}% 8332 1.1 mrg \expandafter\let\csname macarg.\@tempb\endcsname\relax 8333 1.1 mrg \expandafter\def\expandafter\@tempe\expandafter{% 8334 1.1 mrg \csname macarg.\@tempb\endcsname}% 8335 1.1 mrg \edef\@tempd{\long\def\@tempe{\the\macname}}% 8336 1.1 mrg \push@\@tempd\macargdeflist@ 8337 1.1 mrg \let\next\getargvals@@ 8338 1.1 mrg \fi 8339 1.1 mrg \fi 8340 1.1 mrg \next 8341 1.1 mrg } 8342 1.1 mrg 8343 1.1 mrg \def\push@#1#2{% 8344 1.1 mrg \expandafter\expandafter\expandafter\def 8345 1.1 mrg \expandafter\expandafter\expandafter#2% 8346 1.1 mrg \expandafter\expandafter\expandafter{% 8347 1.1 mrg \expandafter#1#2}% 8348 1.1 mrg } 8349 1.1 mrg 8350 1.1 mrg % Replace arguments by their values in the macro body, and place the result 8351 1.1 mrg % in macro \@tempa. 8352 1.1 mrg % 8353 1.1 mrg \def\macvalstoargs@{% 8354 1.1 mrg % To do this we use the property that token registers that are \the'ed 8355 1.1 mrg % within an \edef expand only once. So we are going to place all argument 8356 1.1 mrg % values into respective token registers. 8357 1.1 mrg % 8358 1.1 mrg % First we save the token context, and initialize argument numbering. 8359 1.1 mrg \begingroup 8360 1.1 mrg \paramno0\relax 8361 1.1 mrg % Then, for each argument number #N, we place the corresponding argument 8362 1.1 mrg % value into a new token list register \toks#N 8363 1.1 mrg \expandafter\putargsintokens@\saveparamlist@,;,% 8364 1.1 mrg % Then, we expand the body so that argument are replaced by their 8365 1.1 mrg % values. The trick for values not to be expanded themselves is that they 8366 1.1 mrg % are within tokens and that tokens expand only once in an \edef . 8367 1.1 mrg \edef\@tempc{\csname mac.\macroname .body\endcsname}% 8368 1.1 mrg % Now we restore the token stack pointer to free the token list registers 8369 1.1 mrg % which we have used, but we make sure that expanded body is saved after 8370 1.1 mrg % group. 8371 1.1 mrg \expandafter 8372 1.1 mrg \endgroup 8373 1.1 mrg \expandafter\def\expandafter\@tempa\expandafter{\@tempc}% 8374 1.1 mrg } 8375 1.1 mrg 8376 1.1 mrg % Define the named-macro outside of this group and then close this group. 8377 1.1 mrg % 8378 1.1 mrg \def\macargexpandinbody@{% 8379 1.1 mrg \expandafter 8380 1.1 mrg \endgroup 8381 1.1 mrg \macargdeflist@ 8382 1.1 mrg % First the replace in body the macro arguments by their values, the result 8383 1.1 mrg % is in \@tempa . 8384 1.1 mrg \macvalstoargs@ 8385 1.1 mrg % Then we point at the \norecurse or \gobble (for recursive) macro value 8386 1.1 mrg % with \@tempb . 8387 1.1 mrg \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname 8388 1.1 mrg % Depending on whether it is recursive or not, we need some tailing 8389 1.1 mrg % \egroup . 8390 1.1 mrg \ifx\@tempb\gobble 8391 1.1 mrg \let\@tempc\relax 8392 1.1 mrg \else 8393 1.1 mrg \let\@tempc\egroup 8394 1.1 mrg \fi 8395 1.1 mrg % And now we do the real job: 8396 1.1 mrg \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}% 8397 1.1 mrg \@tempd 8398 1.1 mrg } 8399 1.1 mrg 8400 1.1 mrg \def\putargsintokens@#1,{% 8401 1.1 mrg \if#1;\let\next\relax 8402 1.1 mrg \else 8403 1.1 mrg \let\next\putargsintokens@ 8404 1.1 mrg % First we allocate the new token list register, and give it a temporary 8405 1.1 mrg % alias \@tempb . 8406 1.1 mrg \toksdef\@tempb\the\paramno 8407 1.1 mrg % Then we place the argument value into that token list register. 8408 1.1 mrg \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname 8409 1.1 mrg \expandafter\@tempb\expandafter{\@tempa}% 8410 1.1 mrg \advance\paramno by 1\relax 8411 1.1 mrg \fi 8412 1.1 mrg \next 8413 1.1 mrg } 8414 1.1 mrg 8415 1.1 mrg % Trailing missing arguments are set to empty. 8416 1.1 mrg % 8417 1.1 mrg \def\setemptyargvalues@{% 8418 1.1 mrg \ifx\paramlist\nilm@ 8419 1.1 mrg \let\next\macargexpandinbody@ 8420 1.1 mrg \else 8421 1.1 mrg \expandafter\setemptyargvaluesparser@\paramlist\endargs@ 8422 1.1 mrg \let\next\setemptyargvalues@ 8423 1.1 mrg \fi 8424 1.1 mrg \next 8425 1.1 mrg } 8426 1.1 mrg 8427 1.1 mrg \def\setemptyargvaluesparser@#1,#2\endargs@{% 8428 1.1 mrg \expandafter\def\expandafter\@tempa\expandafter{% 8429 1.1 mrg \expandafter\def\csname macarg.#1\endcsname{}}% 8430 1.1 mrg \push@\@tempa\macargdeflist@ 8431 1.1 mrg \def\paramlist{#2}% 8432 1.1 mrg } 8433 1.1 mrg 8434 1.1 mrg % #1 is the element target macro 8435 1.1 mrg % #2 is the list macro 8436 1.1 mrg % #3,#4\endargs@ is the list value 8437 1.1 mrg \def\pop@#1#2#3,#4\endargs@{% 8438 1.1 mrg \def#1{#3}% 8439 1.1 mrg \def#2{#4}% 8440 1.1 mrg } 8441 1.1 mrg \long\def\longpop@#1#2#3,#4\endargs@{% 8442 1.1 mrg \long\def#1{#3}% 8443 1.1 mrg \long\def#2{#4}% 8444 1.1 mrg } 8445 1.1 mrg 8446 1.1 mrg 8447 1.1 mrg %%%%%%%%%%%%%% End of code for > 10 arguments %%%%%%%%%%%%%%%%%% 8448 1.1 mrg 8449 1.1 mrg 8450 1.1 mrg % This defines a Texinfo @macro or @rmacro, called by \parsemacbody. 8451 1.1 mrg % \macrobody has the body of the macro in it, with placeholders for 8452 1.1 mrg % its parameters, looking like "\xeatspaces{\hash 1}". 8453 1.1 mrg % \paramno is the number of parameters 8454 1.1 mrg % \paramlist is a TeX parameter text, e.g. "#1,#2,#3," 8455 1.1 mrg % There are four cases: macros of zero, one, up to nine, and many arguments. 8456 1.1 mrg % \xdef is used so that macro definitions will survive the file 8457 1.1 mrg % they're defined in: @include reads the file inside a group. 8458 1.1 mrg % 8459 1.1 mrg \def\defmacro{% 8460 1.1 mrg \let\hash=##% convert placeholders to macro parameter chars 8461 1.1 mrg \ifnum\paramno=1 8462 1.1 mrg \def\xeatspaces##1{##1}% 8463 1.1 mrg % This removes the pair of braces around the argument. We don't 8464 1.1 mrg % use \eatspaces, because this can cause ends of lines to be lost 8465 1.1 mrg % when the argument to \eatspaces is read, leading to line-based 8466 1.1 mrg % commands like "@itemize" not being read correctly. 8467 1.1 mrg \else 8468 1.1 mrg \let\xeatspaces\relax % suppress expansion 8469 1.1 mrg \fi 8470 1.1 mrg \ifcase\paramno 8471 1.1 mrg % 0 8472 1.1 mrg \expandafter\xdef\csname\the\macname\endcsname{% 8473 1.1 mrg \bgroup 8474 1.1 mrg \noexpand\spaceisspace 8475 1.1 mrg \noexpand\endlineisspace 8476 1.1 mrg \noexpand\expandafter % skip any whitespace after the macro name. 8477 1.1 mrg \expandafter\noexpand\csname\the\macname @@@\endcsname}% 8478 1.1 mrg \expandafter\xdef\csname\the\macname @@@\endcsname{% 8479 1.1 mrg \egroup 8480 1.1 mrg \noexpand\scanmacro{\macrobody}}% 8481 1.1 mrg \or % 1 8482 1.1 mrg \expandafter\xdef\csname\the\macname\endcsname{% 8483 1.1 mrg \bgroup 8484 1.1 mrg \noexpand\braceorline 8485 1.1 mrg \expandafter\noexpand\csname\the\macname @@@\endcsname}% 8486 1.1 mrg \expandafter\xdef\csname\the\macname @@@\endcsname##1{% 8487 1.1 mrg \egroup 8488 1.1 mrg \noexpand\scanmacro{\macrobody}% 8489 1.1 mrg }% 8490 1.1 mrg \else % at most 9 8491 1.1 mrg \ifnum\paramno<10\relax 8492 1.1 mrg % @MACNAME sets the context for reading the macro argument 8493 1.1 mrg % @MACNAME@@ gets the argument, processes backslashes and appends a 8494 1.1 mrg % comma. 8495 1.1 mrg % @MACNAME@@@ removes braces surrounding the argument list. 8496 1.1 mrg % @MACNAME@@@@ scans the macro body with arguments substituted. 8497 1.1 mrg \expandafter\xdef\csname\the\macname\endcsname{% 8498 1.1 mrg \bgroup 8499 1.1 mrg \noexpand\expandafter % This \expandafter skip any spaces after the 8500 1.1 mrg \noexpand\macroargctxt % macro before we change the catcode of space. 8501 1.1 mrg \noexpand\expandafter 8502 1.1 mrg \expandafter\noexpand\csname\the\macname @@\endcsname}% 8503 1.1 mrg \expandafter\xdef\csname\the\macname @@\endcsname##1{% 8504 1.1 mrg \noexpand\passargtomacro 8505 1.1 mrg \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}% 8506 1.1 mrg \expandafter\xdef\csname\the\macname @@@\endcsname##1{% 8507 1.1 mrg \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}% 8508 1.1 mrg \expandafter\expandafter 8509 1.1 mrg \expandafter\xdef 8510 1.1 mrg \expandafter\expandafter 8511 1.1 mrg \csname\the\macname @@@@\endcsname\paramlist{% 8512 1.1 mrg \egroup\noexpand\scanmacro{\macrobody}}% 8513 1.1 mrg \else % 10 or more: 8514 1.1 mrg \expandafter\xdef\csname\the\macname\endcsname{% 8515 1.1 mrg \noexpand\getargvals@{\the\macname}{\argl}% 8516 1.1 mrg }% 8517 1.1 mrg \global\expandafter\let\csname mac.\the\macname .body\endcsname\macrobody 8518 1.1 mrg \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble 8519 1.1 mrg \fi 8520 1.1 mrg \fi} 8521 1.1 mrg 8522 1.1 mrg \catcode `\@\texiatcatcode\relax % end private-to-Texinfo catcodes 8523 1.1 mrg 8524 1.1 mrg \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} 8525 1.1 mrg 8526 1.1 mrg 8527 1.1 mrg %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8528 1.1 mrg % 8529 1.1 mrg {\catcode`\@=0 \catcode`\\=13 % We need to manipulate \ so use @ as escape 8530 1.1 mrg @catcode`@_=11 % private names 8531 1.1 mrg @catcode`@!=11 % used as argument separator 8532 1.1 mrg 8533 1.1 mrg % \passargtomacro#1#2 - 8534 1.1 mrg % Call #1 with a list of tokens #2, with any doubled backslashes in #2 8535 1.1 mrg % compressed to one. 8536 1.1 mrg % 8537 1.1 mrg % This implementation works by expansion, and not execution (so we cannot use 8538 1.1 mrg % \def or similar). This reduces the risk of this failing in contexts where 8539 1.1 mrg % complete expansion is done with no execution (for example, in writing out to 8540 1.1 mrg % an auxiliary file for an index entry). 8541 1.1 mrg % 8542 1.1 mrg % State is kept in the input stream: the argument passed to 8543 1.1 mrg % @look_ahead, @gobble_and_check_finish and @add_segment is 8544 1.1 mrg % 8545 1.1 mrg % THE_MACRO ARG_RESULT ! {PENDING_BS} NEXT_TOKEN (... rest of input) 8546 1.1 mrg % 8547 1.1 mrg % where: 8548 1.1 mrg % THE_MACRO - name of the macro we want to call 8549 1.1 mrg % ARG_RESULT - argument list we build to pass to that macro 8550 1.1 mrg % PENDING_BS - either a backslash or nothing 8551 1.1 mrg % NEXT_TOKEN - used to look ahead in the input stream to see what's coming next 8552 1.1 mrg 8553 1.1 mrg @gdef@passargtomacro#1#2{% 8554 1.1 mrg @add_segment #1!{}@relax#2\@_finish\% 8555 1.1 mrg } 8556 1.1 mrg @gdef@_finish{@_finishx} @global@let@_finishx@relax 8557 1.1 mrg 8558 1.1 mrg % #1 - THE_MACRO ARG_RESULT 8559 1.1 mrg % #2 - PENDING_BS 8560 1.1 mrg % #3 - NEXT_TOKEN 8561 1.1 mrg % #4 used to look ahead 8562 1.1 mrg % 8563 1.1 mrg % If the next token is not a backslash, process the rest of the argument; 8564 1.1 mrg % otherwise, remove the next token. 8565 1.1 mrg @gdef@look_ahead#1!#2#3#4{% 8566 1.1 mrg @ifx#4\% 8567 1.1 mrg @expandafter@gobble_and_check_finish 8568 1.1 mrg @else 8569 1.1 mrg @expandafter@add_segment 8570 1.1 mrg @fi#1!{#2}#4#4% 8571 1.1 mrg } 8572 1.1 mrg 8573 1.1 mrg % #1 - THE_MACRO ARG_RESULT 8574 1.1 mrg % #2 - PENDING_BS 8575 1.1 mrg % #3 - NEXT_TOKEN 8576 1.1 mrg % #4 should be a backslash, which is gobbled. 8577 1.1 mrg % #5 looks ahead 8578 1.1 mrg % 8579 1.1 mrg % Double backslash found. Add a single backslash, and look ahead. 8580 1.1 mrg @gdef@gobble_and_check_finish#1!#2#3#4#5{% 8581 1.1 mrg @add_segment#1\!{}#5#5% 8582 1.1 mrg } 8583 1.1 mrg 8584 1.1 mrg @gdef@is_fi{@fi} 8585 1.1 mrg 8586 1.1 mrg % #1 - THE_MACRO ARG_RESULT 8587 1.1 mrg % #2 - PENDING_BS 8588 1.1 mrg % #3 - NEXT_TOKEN 8589 1.1 mrg % #4 is input stream until next backslash 8590 1.1 mrg % 8591 1.1 mrg % Input stream is either at the start of the argument, or just after a 8592 1.1 mrg % backslash sequence, either a lone backslash, or a doubled backslash. 8593 1.1 mrg % NEXT_TOKEN contains the first token in the input stream: if it is \finish, 8594 1.1 mrg % finish; otherwise, append to ARG_RESULT the segment of the argument up until 8595 1.1 mrg % the next backslash. PENDING_BACKSLASH contains a backslash to represent 8596 1.1 mrg % a backslash just before the start of the input stream that has not been 8597 1.1 mrg % added to ARG_RESULT. 8598 1.1 mrg @gdef@add_segment#1!#2#3#4\{% 8599 1.1 mrg @ifx#3@_finish 8600 1.1 mrg @call_the_macro#1!% 8601 1.1 mrg @else 8602 1.1 mrg % append the pending backslash to the result, followed by the next segment 8603 1.1 mrg @expandafter@is_fi@look_ahead#1#2#4!{\}@fi 8604 1.1 mrg % this @fi is discarded by @look_ahead. 8605 1.1 mrg % we can't get rid of it with \expandafter because we don't know how 8606 1.1 mrg % long #4 is. 8607 1.1 mrg } 8608 1.1 mrg 8609 1.1 mrg % #1 - THE_MACRO 8610 1.1 mrg % #2 - ARG_RESULT 8611 1.1 mrg % #3 discards the res of the conditional in @add_segment, and @is_fi ends the 8612 1.1 mrg % conditional. 8613 1.1 mrg @gdef@call_the_macro#1#2!#3@fi{@is_fi #1{#2}} 8614 1.1 mrg 8615 1.1 mrg } 8616 1.1 mrg %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8617 1.1 mrg 8618 1.1 mrg % \braceorline MAC is used for a one-argument macro MAC. It checks 8619 1.1 mrg % whether the next non-whitespace character is a {. It sets the context 8620 1.1 mrg % for reading the argument (slightly different in the two cases). Then, 8621 1.1 mrg % to read the argument, in the whole-line case, it then calls the regular 8622 1.1 mrg % \parsearg MAC; in the lbrace case, it calls \passargtomacro MAC. 8623 1.1 mrg % 8624 1.1 mrg \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} 8625 1.1 mrg \def\braceorlinexxx{% 8626 1.1 mrg \ifx\nchar\bgroup 8627 1.1 mrg \macroargctxt 8628 1.1 mrg \expandafter\passargtomacro 8629 1.1 mrg \else 8630 1.1 mrg \macrolineargctxt\expandafter\parsearg 8631 1.1 mrg \fi \macnamexxx} 8632 1.1 mrg 8633 1.1 mrg 8634 1.1 mrg % @alias. 8635 1.1 mrg % We need some trickery to remove the optional spaces around the equal 8636 1.1 mrg % sign. Make them active and then expand them all to nothing. 8637 1.1 mrg % 8638 1.1 mrg \def\alias{\parseargusing\obeyspaces\aliasxxx} 8639 1.1 mrg \def\aliasxxx #1{\aliasyyy#1\relax} 8640 1.1 mrg \def\aliasyyy #1=#2\relax{% 8641 1.1 mrg {% 8642 1.1 mrg \expandafter\let\obeyedspace=\empty 8643 1.1 mrg \addtomacrolist{#1}% 8644 1.1 mrg \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}% 8645 1.1 mrg }% 8646 1.1 mrg \next 8647 1.1 mrg } 8648 1.1 mrg 8649 1.1 mrg 8650 1.1 mrg \message{cross references,} 8651 1.1 mrg 8652 1.1 mrg \newwrite\auxfile 8653 1.1 mrg \newif\ifhavexrefs % True if xref values are known. 8654 1.1 mrg \newif\ifwarnedxrefs % True if we warned once that they aren't known. 8655 1.1 mrg 8656 1.1 mrg % @inforef is relatively simple. 8657 1.1 mrg \def\inforef #1{\inforefzzz #1,,,,**} 8658 1.1 mrg \def\inforefzzz #1,#2,#3,#4**{% 8659 1.1 mrg \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, 8660 1.1 mrg node \samp{\ignorespaces#1{}}} 8661 1.1 mrg 8662 1.1 mrg % @node's only job in TeX is to define \lastnode, which is used in 8663 1.1 mrg % cross-references. The @node line might or might not have commas, and 8664 1.1 mrg % might or might not have spaces before the first comma, like: 8665 1.1 mrg % @node foo , bar , ... 8666 1.1 mrg % We don't want such trailing spaces in the node name. 8667 1.1 mrg % 8668 1.1 mrg \parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse} 8669 1.1 mrg % 8670 1.1 mrg % also remove a trailing comma, in case of something like this: 8671 1.1 mrg % @node Help-Cross, , , Cross-refs 8672 1.1 mrg \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} 8673 1.1 mrg \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}\omittopnode} 8674 1.1 mrg 8675 1.1 mrg % Used so that the @top node doesn't have to be wrapped in an @ifnottex 8676 1.1 mrg % conditional. 8677 1.1 mrg % \doignore goes to more effort to skip nested conditionals but we don't need 8678 1.1 mrg % that here. 8679 1.1 mrg \def\omittopnode{% 8680 1.1 mrg \ifx\lastnode\wordTop 8681 1.1 mrg \expandafter\ignorenode\fi 8682 1.1 mrg } 8683 1.1 mrg \def\wordTop{Top} 8684 1.1 mrg 8685 1.1 mrg % Until the next @node or @bye command, divert output to a box that is not 8686 1.1 mrg % output. 8687 1.1 mrg \def\ignorenode{\setbox\dummybox\vbox\bgroup\def\node{\egroup\node}% 8688 1.1 mrg \ignorenodebye 8689 1.1 mrg } 8690 1.1 mrg 8691 1.1 mrg {\let\bye\relax 8692 1.1 mrg \gdef\ignorenodebye{\let\bye\ignorenodebyedef} 8693 1.1 mrg \gdef\ignorenodebyedef{\egroup(`Top' node ignored)\bye}} 8694 1.1 mrg % The redefinition of \bye here is because it is declared \outer 8695 1.1 mrg 8696 1.1 mrg \let\lastnode=\empty 8697 1.1 mrg 8698 1.1 mrg % Write a cross-reference definition for the current node. #1 is the 8699 1.1 mrg % type (Ynumbered, Yappendix, Ynothing). 8700 1.1 mrg % 8701 1.1 mrg \def\donoderef#1{% 8702 1.1 mrg \ifx\lastnode\empty\else 8703 1.1 mrg \setref{\lastnode}{#1}% 8704 1.1 mrg \global\let\lastnode=\empty 8705 1.1 mrg \fi 8706 1.1 mrg } 8707 1.1 mrg 8708 1.1 mrg % @anchor{NAME} -- define xref target at arbitrary point. 8709 1.1 mrg % 8710 1.1 mrg \newcount\savesfregister 8711 1.1 mrg % 8712 1.1 mrg \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} 8713 1.1 mrg \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} 8714 1.1 mrg \def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} 8715 1.1 mrg 8716 1.1 mrg % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an 8717 1.1 mrg % anchor), which consists of three parts: 8718 1.1 mrg % 1) NAME-title - the current sectioning name taken from \currentsection, 8719 1.1 mrg % or the anchor name. 8720 1.1 mrg % 2) NAME-snt - section number and type, passed as the SNT arg, or 8721 1.1 mrg % empty for anchors. 8722 1.1 mrg % 3) NAME-pg - the page number. 8723 1.1 mrg % 8724 1.1 mrg % This is called from \donoderef, \anchor, and \dofloat. In the case of 8725 1.1 mrg % floats, there is an additional part, which is not written here: 8726 1.1 mrg % 4) NAME-lof - the text as it should appear in a @listoffloats. 8727 1.1 mrg % 8728 1.1 mrg \def\setref#1#2{% 8729 1.1 mrg \pdfmkdest{#1}% 8730 1.1 mrg \iflinks 8731 1.1 mrg {% 8732 1.1 mrg \requireauxfile 8733 1.1 mrg \atdummies % preserve commands, but don't expand them 8734 1.1 mrg % match definition in \xrdef, \refx, \xrefX. 8735 1.1 mrg \def\value##1{##1}% 8736 1.1 mrg \edef\writexrdef##1##2{% 8737 1.1 mrg \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef 8738 1.1 mrg ##1}{##2}}% these are parameters of \writexrdef 8739 1.1 mrg }% 8740 1.1 mrg \toks0 = \expandafter{\currentsection}% 8741 1.1 mrg \immediate \writexrdef{title}{\the\toks0 }% 8742 1.1 mrg \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. 8743 1.1 mrg \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout 8744 1.1 mrg }% 8745 1.1 mrg \fi 8746 1.1 mrg } 8747 1.1 mrg 8748 1.1 mrg % @xrefautosectiontitle on|off says whether @section(ing) names are used 8749 1.1 mrg % automatically in xrefs, if the third arg is not explicitly specified. 8750 1.1 mrg % This was provided as a "secret" @set xref-automatic-section-title 8751 1.1 mrg % variable, now it's official. 8752 1.1 mrg % 8753 1.1 mrg \parseargdef\xrefautomaticsectiontitle{% 8754 1.1 mrg \def\temp{#1}% 8755 1.1 mrg \ifx\temp\onword 8756 1.1 mrg \expandafter\let\csname SETxref-automatic-section-title\endcsname 8757 1.1 mrg = \empty 8758 1.1 mrg \else\ifx\temp\offword 8759 1.1 mrg \expandafter\let\csname SETxref-automatic-section-title\endcsname 8760 1.1 mrg = \relax 8761 1.1 mrg \else 8762 1.1 mrg \errhelp = \EMsimple 8763 1.1 mrg \errmessage{Unknown @xrefautomaticsectiontitle value `\temp', 8764 1.1 mrg must be on|off}% 8765 1.1 mrg \fi\fi 8766 1.1 mrg } 8767 1.1 mrg 8768 1.1 mrg % 8769 1.1 mrg % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is 8770 1.1 mrg % the node name, #2 the name of the Info cross-reference, #3 the printed 8771 1.1 mrg % node name, #4 the name of the Info file, #5 the name of the printed 8772 1.1 mrg % manual. All but the node name can be omitted. 8773 1.1 mrg % 8774 1.1 mrg \def\pxref{\putwordsee{} \xrefXX} 8775 1.1 mrg \def\xref{\putwordSee{} \xrefXX} 8776 1.1 mrg \def\ref{\xrefXX} 8777 1.1 mrg 8778 1.1 mrg \def\xrefXX#1{\def\xrefXXarg{#1}\futurelet\tokenafterxref\xrefXXX} 8779 1.1 mrg \def\xrefXXX{\expandafter\xrefX\expandafter[\xrefXXarg,,,,,,,]} 8780 1.1 mrg % 8781 1.1 mrg \newbox\toprefbox 8782 1.1 mrg \newbox\printedrefnamebox 8783 1.1 mrg \newbox\infofilenamebox 8784 1.1 mrg \newbox\printedmanualbox 8785 1.1 mrg % 8786 1.1 mrg \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup 8787 1.1 mrg \unsepspaces 8788 1.1 mrg % 8789 1.1 mrg % Get args without leading/trailing spaces. 8790 1.1 mrg \def\printedrefname{\ignorespaces #3}% 8791 1.1 mrg \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}% 8792 1.1 mrg % 8793 1.1 mrg \def\infofilename{\ignorespaces #4}% 8794 1.1 mrg \setbox\infofilenamebox = \hbox{\infofilename\unskip}% 8795 1.1 mrg % 8796 1.1 mrg \def\printedmanual{\ignorespaces #5}% 8797 1.1 mrg \setbox\printedmanualbox = \hbox{\printedmanual\unskip}% 8798 1.1 mrg % 8799 1.1 mrg % If the printed reference name (arg #3) was not explicitly given in 8800 1.1 mrg % the @xref, figure out what we want to use. 8801 1.1 mrg \ifdim \wd\printedrefnamebox = 0pt 8802 1.1 mrg % No printed node name was explicitly given. 8803 1.1 mrg \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax 8804 1.1 mrg % Not auto section-title: use node name inside the square brackets. 8805 1.1 mrg \def\printedrefname{\ignorespaces #1}% 8806 1.1 mrg \else 8807 1.1 mrg % Auto section-title: use chapter/section title inside 8808 1.1 mrg % the square brackets if we have it. 8809 1.1 mrg \ifdim \wd\printedmanualbox > 0pt 8810 1.1 mrg % It is in another manual, so we don't have it; use node name. 8811 1.1 mrg \def\printedrefname{\ignorespaces #1}% 8812 1.1 mrg \else 8813 1.1 mrg \ifhavexrefs 8814 1.1.1.2 mrg % We (should) know the real title if we have the xref values. 8815 1.1 mrg \def\printedrefname{\refx{#1-title}}% 8816 1.1 mrg \else 8817 1.1 mrg % Otherwise just copy the Info node name. 8818 1.1 mrg \def\printedrefname{\ignorespaces #1}% 8819 1.1 mrg \fi% 8820 1.1 mrg \fi 8821 1.1 mrg \fi 8822 1.1 mrg \fi 8823 1.1 mrg % 8824 1.1 mrg % Make link in pdf output. 8825 1.1 mrg \ifpdf 8826 1.1 mrg % For pdfTeX and LuaTeX 8827 1.1 mrg {\indexnofonts 8828 1.1 mrg \makevalueexpandable 8829 1.1 mrg \turnoffactive 8830 1.1 mrg % This expands tokens, so do it after making catcode changes, so _ 8831 1.1 mrg % etc. don't get their TeX definitions. This ignores all spaces in 8832 1.1 mrg % #4, including (wrongly) those in the middle of the filename. 8833 1.1 mrg \getfilename{#4}% 8834 1.1 mrg % 8835 1.1 mrg % This (wrongly) does not take account of leading or trailing 8836 1.1 mrg % spaces in #1, which should be ignored. 8837 1.1 mrg \setpdfdestname{#1}% 8838 1.1 mrg % 8839 1.1 mrg \ifx\pdfdestname\empty 8840 1.1 mrg \def\pdfdestname{Top}% no empty targets 8841 1.1 mrg \fi 8842 1.1 mrg % 8843 1.1 mrg \leavevmode 8844 1.1 mrg \startlink attr{/Border [0 0 0]}% 8845 1.1 mrg \ifnum\filenamelength>0 8846 1.1 mrg goto file{\the\filename.pdf} name{\pdfdestname}% 8847 1.1 mrg \else 8848 1.1 mrg goto name{\pdfmkpgn{\pdfdestname}}% 8849 1.1 mrg \fi 8850 1.1 mrg }% 8851 1.1 mrg \setcolor{\linkcolor}% 8852 1.1 mrg \else 8853 1.1 mrg \ifx\XeTeXrevision\thisisundefined 8854 1.1 mrg \else 8855 1.1 mrg % For XeTeX 8856 1.1 mrg {\indexnofonts 8857 1.1 mrg \makevalueexpandable 8858 1.1 mrg \turnoffactive 8859 1.1 mrg % This expands tokens, so do it after making catcode changes, so _ 8860 1.1 mrg % etc. don't get their TeX definitions. This ignores all spaces in 8861 1.1 mrg % #4, including (wrongly) those in the middle of the filename. 8862 1.1 mrg \getfilename{#4}% 8863 1.1 mrg % 8864 1.1 mrg % This (wrongly) does not take account of leading or trailing 8865 1.1 mrg % spaces in #1, which should be ignored. 8866 1.1 mrg \setpdfdestname{#1}% 8867 1.1 mrg % 8868 1.1 mrg \ifx\pdfdestname\empty 8869 1.1 mrg \def\pdfdestname{Top}% no empty targets 8870 1.1 mrg \fi 8871 1.1 mrg % 8872 1.1 mrg \leavevmode 8873 1.1 mrg \ifnum\filenamelength>0 8874 1.1 mrg % With default settings, 8875 1.1 mrg % XeTeX (xdvipdfmx) replaces link destination names with integers. 8876 1.1 mrg % In this case, the replaced destination names of 8877 1.1 mrg % remote PDFs are no longer known. In order to avoid a replacement, 8878 1.1 mrg % you can use xdvipdfmx's command line option `-C 0x0010'. 8879 1.1 mrg % If you use XeTeX 0.99996+ (TeX Live 2016+), 8880 1.1 mrg % this command line option is no longer necessary 8881 1.1 mrg % because we can use the `dvipdfmx:config' special. 8882 1.1 mrg \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A 8883 1.1 mrg << /S /GoToR /F (\the\filename.pdf) /D (\pdfdestname) >> >>}% 8884 1.1 mrg \else 8885 1.1 mrg \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A 8886 1.1 mrg << /S /GoTo /D (\pdfdestname) >> >>}% 8887 1.1 mrg \fi 8888 1.1 mrg }% 8889 1.1 mrg \setcolor{\linkcolor}% 8890 1.1 mrg \fi 8891 1.1 mrg \fi 8892 1.1 mrg {% 8893 1.1 mrg % Have to otherify everything special to allow the \csname to 8894 1.1 mrg % include an _ in the xref name, etc. 8895 1.1 mrg \indexnofonts 8896 1.1 mrg \turnoffactive 8897 1.1 mrg \def\value##1{##1}% 8898 1.1 mrg \expandafter\global\expandafter\let\expandafter\Xthisreftitle 8899 1.1 mrg \csname XR#1-title\endcsname 8900 1.1 mrg }% 8901 1.1 mrg % 8902 1.1 mrg % Float references are printed completely differently: "Figure 1.2" 8903 1.1 mrg % instead of "[somenode], p.3". \iffloat distinguishes them by 8904 1.1 mrg % \Xthisreftitle being set to a magic string. 8905 1.1 mrg \iffloat\Xthisreftitle 8906 1.1 mrg % If the user specified the print name (third arg) to the ref, 8907 1.1 mrg % print it instead of our usual "Figure 1.2". 8908 1.1.1.2 mrg \ifdim\wd\printedrefnamebox = 0pt 8909 1.1 mrg \refx{#1-snt}% 8910 1.1 mrg \else 8911 1.1 mrg \printedrefname 8912 1.1 mrg \fi 8913 1.1 mrg % 8914 1.1 mrg % If the user also gave the printed manual name (fifth arg), append 8915 1.1 mrg % "in MANUALNAME". 8916 1.1 mrg \ifdim \wd\printedmanualbox > 0pt 8917 1.1 mrg \space \putwordin{} \cite{\printedmanual}% 8918 1.1 mrg \fi 8919 1.1 mrg \else 8920 1.1 mrg % node/anchor (non-float) references. 8921 1.1 mrg % 8922 1.1 mrg % If we use \unhbox to print the node names, TeX does not insert 8923 1.1 mrg % empty discretionaries after hyphens, which means that it will not 8924 1.1 mrg % find a line break at a hyphen in a node names. Since some manuals 8925 1.1 mrg % are best written with fairly long node names, containing hyphens, 8926 1.1 mrg % this is a loss. Therefore, we give the text of the node name 8927 1.1 mrg % again, so it is as if TeX is seeing it for the first time. 8928 1.1 mrg % 8929 1.1 mrg \ifdim \wd\printedmanualbox > 0pt 8930 1.1 mrg % Cross-manual reference with a printed manual name. 8931 1.1 mrg % 8932 1.1 mrg \crossmanualxref{\cite{\printedmanual\unskip}}% 8933 1.1 mrg % 8934 1.1 mrg \else\ifdim \wd\infofilenamebox > 0pt 8935 1.1 mrg % Cross-manual reference with only an info filename (arg 4), no 8936 1.1 mrg % printed manual name (arg 5). This is essentially the same as 8937 1.1 mrg % the case above; we output the filename, since we have nothing else. 8938 1.1 mrg % 8939 1.1 mrg \crossmanualxref{\code{\infofilename\unskip}}% 8940 1.1 mrg % 8941 1.1 mrg \else 8942 1.1 mrg % Reference within this manual. 8943 1.1.1.2 mrg % 8944 1.1.1.2 mrg % Only output a following space if the -snt ref is nonempty, as the ref 8945 1.1.1.2 mrg % will be empty for @unnumbered and @anchor. 8946 1.1 mrg \setbox2 = \hbox{\ignorespaces \refx{#1-snt}}% 8947 1.1 mrg \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi 8948 1.1 mrg % 8949 1.1 mrg % output the `[mynode]' via the macro below so it can be overridden. 8950 1.1 mrg \xrefprintnodename\printedrefname 8951 1.1.1.2 mrg % 8952 1.1.1.2 mrg \expandafter\ifx\csname SETtxiomitxrefpg\endcsname\relax 8953 1.1.1.2 mrg % But we always want a comma and a space: 8954 1.1.1.2 mrg ,\space 8955 1.1.1.2 mrg % 8956 1.1.1.2 mrg % output the `page 3'. 8957 1.1.1.2 mrg \turnoffactive \putwordpage\tie\refx{#1-pg}% 8958 1.1.1.2 mrg % Add a , if xref followed by a space 8959 1.1.1.2 mrg \if\space\noexpand\tokenafterxref ,% 8960 1.1.1.2 mrg \else\ifx\ \tokenafterxref ,% @TAB 8961 1.1.1.2 mrg \else\ifx\*\tokenafterxref ,% @* 8962 1.1.1.2 mrg \else\ifx\ \tokenafterxref ,% @SPACE 8963 1.1.1.2 mrg \else\ifx\ 8964 1.1.1.2 mrg \tokenafterxref ,% @NL 8965 1.1.1.2 mrg \else\ifx\tie\tokenafterxref ,% @tie 8966 1.1.1.2 mrg \fi\fi\fi\fi\fi\fi 8967 1.1 mrg \fi 8968 1.1 mrg \fi\fi 8969 1.1 mrg \fi 8970 1.1 mrg \endlink 8971 1.1 mrg \endgroup} 8972 1.1 mrg 8973 1.1 mrg % Output a cross-manual xref to #1. Used just above (twice). 8974 1.1 mrg % 8975 1.1 mrg % Only include the text "Section ``foo'' in" if the foo is neither 8976 1.1 mrg % missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply 8977 1.1 mrg % "see The Foo Manual", the idea being to refer to the whole manual. 8978 1.1 mrg % 8979 1.1 mrg % But, this being TeX, we can't easily compare our node name against the 8980 1.1 mrg % string "Top" while ignoring the possible spaces before and after in 8981 1.1 mrg % the input. By adding the arbitrary 7sp below, we make it much less 8982 1.1 mrg % likely that a real node name would have the same width as "Top" (e.g., 8983 1.1 mrg % in a monospaced font). Hopefully it will never happen in practice. 8984 1.1 mrg % 8985 1.1 mrg % For the same basic reason, we retypeset the "Top" at every 8986 1.1 mrg % reference, since the current font is indeterminate. 8987 1.1 mrg % 8988 1.1 mrg \def\crossmanualxref#1{% 8989 1.1 mrg \setbox\toprefbox = \hbox{Top\kern7sp}% 8990 1.1 mrg \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}% 8991 1.1 mrg \ifdim \wd2 > 7sp % nonempty? 8992 1.1 mrg \ifdim \wd2 = \wd\toprefbox \else % same as Top? 8993 1.1 mrg \putwordSection{} ``\printedrefname'' \putwordin{}\space 8994 1.1 mrg \fi 8995 1.1 mrg \fi 8996 1.1 mrg #1% 8997 1.1 mrg } 8998 1.1 mrg 8999 1.1 mrg % This macro is called from \xrefX for the `[nodename]' part of xref 9000 1.1 mrg % output. It's a separate macro only so it can be changed more easily, 9001 1.1 mrg % since square brackets don't work well in some documents. Particularly 9002 1.1 mrg % one that Bob is working on :). 9003 1.1 mrg % 9004 1.1 mrg \def\xrefprintnodename#1{[#1]} 9005 1.1 mrg 9006 1.1 mrg % Things referred to by \setref. 9007 1.1 mrg % 9008 1.1 mrg \def\Ynothing{} 9009 1.1 mrg \def\Yomitfromtoc{} 9010 1.1 mrg \def\Ynumbered{% 9011 1.1 mrg \ifnum\secno=0 9012 1.1 mrg \putwordChapter@tie \the\chapno 9013 1.1 mrg \else \ifnum\subsecno=0 9014 1.1 mrg \putwordSection@tie \the\chapno.\the\secno 9015 1.1 mrg \else \ifnum\subsubsecno=0 9016 1.1 mrg \putwordSection@tie \the\chapno.\the\secno.\the\subsecno 9017 1.1 mrg \else 9018 1.1 mrg \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno 9019 1.1 mrg \fi\fi\fi 9020 1.1 mrg } 9021 1.1 mrg \def\Yappendix{% 9022 1.1 mrg \ifnum\secno=0 9023 1.1 mrg \putwordAppendix@tie @char\the\appendixno{}% 9024 1.1 mrg \else \ifnum\subsecno=0 9025 1.1 mrg \putwordSection@tie @char\the\appendixno.\the\secno 9026 1.1 mrg \else \ifnum\subsubsecno=0 9027 1.1 mrg \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno 9028 1.1 mrg \else 9029 1.1 mrg \putwordSection@tie 9030 1.1 mrg @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno 9031 1.1 mrg \fi\fi\fi 9032 1.1 mrg } 9033 1.1.1.2 mrg 9034 1.1.1.2 mrg % \refx{NAME} - reference a cross-reference string named NAME. 9035 1.1 mrg \def\refx#1{% 9036 1.1 mrg \requireauxfile 9037 1.1 mrg {% 9038 1.1 mrg \indexnofonts 9039 1.1 mrg \turnoffactive 9040 1.1 mrg \def\value##1{##1}% 9041 1.1 mrg \expandafter\global\expandafter\let\expandafter\thisrefX 9042 1.1 mrg \csname XR#1\endcsname 9043 1.1 mrg }% 9044 1.1 mrg \ifx\thisrefX\relax 9045 1.1 mrg % If not defined, say something at least. 9046 1.1 mrg \angleleft un\-de\-fined\angleright 9047 1.1 mrg \iflinks 9048 1.1 mrg \ifhavexrefs 9049 1.1 mrg {\toks0 = {#1}% avoid expansion of possibly-complex value 9050 1.1 mrg \message{\linenumber Undefined cross reference `\the\toks0'.}}% 9051 1.1 mrg \else 9052 1.1 mrg \ifwarnedxrefs\else 9053 1.1 mrg \global\warnedxrefstrue 9054 1.1 mrg \message{Cross reference values unknown; you must run TeX again.}% 9055 1.1 mrg \fi 9056 1.1 mrg \fi 9057 1.1 mrg \fi 9058 1.1 mrg \else 9059 1.1 mrg % It's defined, so just use it. 9060 1.1 mrg \thisrefX 9061 1.1 mrg \fi 9062 1.1 mrg } 9063 1.1 mrg 9064 1.1 mrg % This is the macro invoked by entries in the aux file. Define a control 9065 1.1 mrg % sequence for a cross-reference target (we prepend XR to the control sequence 9066 1.1 mrg % name to avoid collisions). The value is the page number. If this is a float 9067 1.1 mrg % type, we have more work to do. 9068 1.1 mrg % 9069 1.1 mrg \def\xrdef#1#2{% 9070 1.1 mrg {% Expand the node or anchor name to remove control sequences. 9071 1.1 mrg % \turnoffactive stops 8-bit characters being changed to commands 9072 1.1 mrg % like @'e. \refx does the same to retrieve the value in the definition. 9073 1.1 mrg \indexnofonts 9074 1.1 mrg \turnoffactive 9075 1.1 mrg \def\value##1{##1}% 9076 1.1 mrg \xdef\safexrefname{#1}% 9077 1.1 mrg }% 9078 1.1 mrg % 9079 1.1 mrg \bgroup 9080 1.1 mrg \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% 9081 1.1 mrg \egroup 9082 1.1 mrg % We put the \gdef inside a group to avoid the definitions building up on 9083 1.1 mrg % TeX's save stack, which can cause it to run out of space for aux files with 9084 1.1 mrg % thousands of lines. \gdef doesn't use the save stack, but \csname does 9085 1.1 mrg % when it defines an unknown control sequence as \relax. 9086 1.1 mrg % 9087 1.1 mrg % Was that xref control sequence that we just defined for a float? 9088 1.1 mrg \expandafter\iffloat\csname XR\safexrefname\endcsname 9089 1.1 mrg % it was a float, and we have the (safe) float type in \iffloattype. 9090 1.1 mrg \expandafter\let\expandafter\floatlist 9091 1.1 mrg \csname floatlist\iffloattype\endcsname 9092 1.1 mrg % 9093 1.1 mrg % Is this the first time we've seen this float type? 9094 1.1 mrg \expandafter\ifx\floatlist\relax 9095 1.1 mrg \toks0 = {\do}% yes, so just \do 9096 1.1 mrg \else 9097 1.1 mrg % had it before, so preserve previous elements in list. 9098 1.1 mrg \toks0 = \expandafter{\floatlist\do}% 9099 1.1 mrg \fi 9100 1.1 mrg % 9101 1.1 mrg % Remember this xref in the control sequence \floatlistFLOATTYPE, 9102 1.1 mrg % for later use in \listoffloats. 9103 1.1 mrg \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0 9104 1.1 mrg {\safexrefname}}% 9105 1.1 mrg \fi 9106 1.1 mrg } 9107 1.1 mrg 9108 1.1 mrg % If working on a large document in chapters, it is convenient to 9109 1.1 mrg % be able to disable indexing, cross-referencing, and contents, for test runs. 9110 1.1 mrg % This is done with @novalidate at the beginning of the file. 9111 1.1 mrg % 9112 1.1 mrg \newif\iflinks \linkstrue % by default we want the aux files. 9113 1.1 mrg \let\novalidate = \linksfalse 9114 1.1 mrg 9115 1.1 mrg % Used when writing to the aux file, or when using data from it. 9116 1.1 mrg \def\requireauxfile{% 9117 1.1 mrg \iflinks 9118 1.1 mrg \tryauxfile 9119 1.1 mrg % Open the new aux file. TeX will close it automatically at exit. 9120 1.1 mrg \immediate\openout\auxfile=\jobname.aux 9121 1.1 mrg \fi 9122 1.1 mrg \global\let\requireauxfile=\relax % Only do this once. 9123 1.1 mrg } 9124 1.1 mrg 9125 1.1 mrg % Read the last existing aux file, if any. No error if none exists. 9126 1.1 mrg % 9127 1.1 mrg \def\tryauxfile{% 9128 1.1 mrg \openin 1 \jobname.aux 9129 1.1 mrg \ifeof 1 \else 9130 1.1 mrg \readdatafile{aux}% 9131 1.1 mrg \global\havexrefstrue 9132 1.1 mrg \fi 9133 1.1 mrg \closein 1 9134 1.1 mrg } 9135 1.1 mrg 9136 1.1 mrg \def\setupdatafile{% 9137 1.1 mrg \catcode`\^^@=\other 9138 1.1 mrg \catcode`\^^A=\other 9139 1.1 mrg \catcode`\^^B=\other 9140 1.1 mrg \catcode`\^^C=\other 9141 1.1 mrg \catcode`\^^D=\other 9142 1.1 mrg \catcode`\^^E=\other 9143 1.1 mrg \catcode`\^^F=\other 9144 1.1 mrg \catcode`\^^G=\other 9145 1.1 mrg \catcode`\^^H=\other 9146 1.1 mrg \catcode`\^^K=\other 9147 1.1 mrg \catcode`\^^L=\other 9148 1.1 mrg \catcode`\^^N=\other 9149 1.1 mrg \catcode`\^^P=\other 9150 1.1 mrg \catcode`\^^Q=\other 9151 1.1 mrg \catcode`\^^R=\other 9152 1.1 mrg \catcode`\^^S=\other 9153 1.1 mrg \catcode`\^^T=\other 9154 1.1 mrg \catcode`\^^U=\other 9155 1.1 mrg \catcode`\^^V=\other 9156 1.1 mrg \catcode`\^^W=\other 9157 1.1 mrg \catcode`\^^X=\other 9158 1.1 mrg \catcode`\^^Z=\other 9159 1.1 mrg \catcode`\^^[=\other 9160 1.1 mrg \catcode`\^^\=\other 9161 1.1 mrg \catcode`\^^]=\other 9162 1.1 mrg \catcode`\^^^=\other 9163 1.1 mrg \catcode`\^^_=\other 9164 1.1 mrg \catcode`\^=\other 9165 1.1 mrg % 9166 1.1 mrg % Special characters. Should be turned off anyway, but... 9167 1.1 mrg \catcode`\~=\other 9168 1.1 mrg \catcode`\[=\other 9169 1.1 mrg \catcode`\]=\other 9170 1.1.1.2 mrg \catcode`\"=\other 9171 1.1.1.2 mrg \catcode`\_=\active 9172 1.1.1.2 mrg \catcode`\|=\active 9173 1.1.1.2 mrg \catcode`\<=\active 9174 1.1 mrg \catcode`\>=\active 9175 1.1 mrg \catcode`\$=\other 9176 1.1 mrg \catcode`\#=\other 9177 1.1 mrg \catcode`\&=\other 9178 1.1 mrg \catcode`\%=\other 9179 1.1 mrg \catcode`+=\other % avoid \+ for paranoia even though we've turned it off 9180 1.1 mrg % 9181 1.1 mrg \catcode`\\=\active 9182 1.1 mrg % 9183 1.1 mrg % @ is our escape character in .aux files, and we need braces. 9184 1.1 mrg \catcode`\{=1 9185 1.1 mrg \catcode`\}=2 9186 1.1 mrg \catcode`\@=0 9187 1.1 mrg } 9188 1.1 mrg 9189 1.1 mrg \def\readdatafile#1{% 9190 1.1 mrg \begingroup 9191 1.1 mrg \setupdatafile 9192 1.1 mrg \input\jobname.#1 9193 1.1 mrg \endgroup} 9194 1.1 mrg 9195 1.1 mrg 9196 1.1 mrg \message{insertions,} 9197 1.1 mrg % including footnotes. 9198 1.1 mrg 9199 1.1 mrg \newcount \footnoteno 9200 1.1 mrg 9201 1.1 mrg % The trailing space in the following definition for supereject is 9202 1.1 mrg % vital for proper filling; pages come out unaligned when you do a 9203 1.1 mrg % pagealignmacro call if that space before the closing brace is 9204 1.1 mrg % removed. (Generally, numeric constants should always be followed by a 9205 1.1 mrg % space to prevent strange expansion errors.) 9206 1.1 mrg \def\supereject{\par\penalty -20000\footnoteno =0 } 9207 1.1 mrg 9208 1.1 mrg % @footnotestyle is meaningful for Info output only. 9209 1.1 mrg \let\footnotestyle=\comment 9210 1.1 mrg 9211 1.1 mrg {\catcode `\@=11 9212 1.1 mrg % 9213 1.1 mrg % Auto-number footnotes. Otherwise like plain. 9214 1.1 mrg \gdef\footnote{% 9215 1.1 mrg \global\advance\footnoteno by \@ne 9216 1.1 mrg \edef\thisfootno{$^{\the\footnoteno}$}% 9217 1.1 mrg % 9218 1.1 mrg % In case the footnote comes at the end of a sentence, preserve the 9219 1.1 mrg % extra spacing after we do the footnote number. 9220 1.1 mrg \let\@sf\empty 9221 1.1 mrg \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi 9222 1.1 mrg % 9223 1.1 mrg % Remove inadvertent blank space before typesetting the footnote number. 9224 1.1 mrg \unskip 9225 1.1 mrg \thisfootno\@sf 9226 1.1 mrg \dofootnote 9227 1.1 mrg }% 9228 1.1 mrg 9229 1.1 mrg % Don't bother with the trickery in plain.tex to not require the 9230 1.1 mrg % footnote text as a parameter. Our footnotes don't need to be so general. 9231 1.1 mrg % 9232 1.1 mrg % Oh yes, they do; otherwise, @ifset (and anything else that uses 9233 1.1 mrg % \parseargline) fails inside footnotes because the tokens are fixed when 9234 1.1 mrg % the footnote is read. --karl, 16nov96. 9235 1.1 mrg % 9236 1.1 mrg \gdef\dofootnote{% 9237 1.1 mrg \insert\footins\bgroup 9238 1.1 mrg % 9239 1.1 mrg % Nested footnotes are not supported in TeX, that would take a lot 9240 1.1 mrg % more work. (\startsavinginserts does not suffice.) 9241 1.1 mrg \let\footnote=\errfootnotenest 9242 1.1 mrg % 9243 1.1 mrg % We want to typeset this text as a normal paragraph, even if the 9244 1.1 mrg % footnote reference occurs in (for example) a display environment. 9245 1.1 mrg % So reset some parameters. 9246 1.1 mrg \hsize=\txipagewidth 9247 1.1 mrg \interlinepenalty\interfootnotelinepenalty 9248 1.1 mrg \splittopskip\ht\strutbox % top baseline for broken footnotes 9249 1.1 mrg \splitmaxdepth\dp\strutbox 9250 1.1 mrg \floatingpenalty\@MM 9251 1.1 mrg \leftskip\z@skip 9252 1.1 mrg \rightskip\z@skip 9253 1.1 mrg \spaceskip\z@skip 9254 1.1 mrg \xspaceskip\z@skip 9255 1.1 mrg \parindent\defaultparindent 9256 1.1 mrg % 9257 1.1 mrg \smallfonts \rm 9258 1.1 mrg % 9259 1.1 mrg % Because we use hanging indentation in footnotes, a @noindent appears 9260 1.1 mrg % to exdent this text, so make it be a no-op. makeinfo does not use 9261 1.1 mrg % hanging indentation so @noindent can still be needed within footnote 9262 1.1 mrg % text after an @example or the like (not that this is good style). 9263 1.1 mrg \let\noindent = \relax 9264 1.1 mrg % 9265 1.1 mrg % Hang the footnote text off the number. Use \everypar in case the 9266 1.1 mrg % footnote extends for more than one paragraph. 9267 1.1 mrg \everypar = {\hang}% 9268 1.1 mrg \textindent{\thisfootno}% 9269 1.1 mrg % 9270 1.1 mrg % Don't crash into the line above the footnote text. Since this 9271 1.1 mrg % expands into a box, it must come within the paragraph, lest it 9272 1.1 mrg % provide a place where TeX can split the footnote. 9273 1.1 mrg \footstrut 9274 1.1 mrg % 9275 1.1 mrg % Invoke rest of plain TeX footnote routine. 9276 1.1 mrg \futurelet\next\fo@t 9277 1.1 mrg } 9278 1.1 mrg }%end \catcode `\@=11 9279 1.1 mrg 9280 1.1 mrg \def\errfootnotenest{% 9281 1.1 mrg \errhelp=\EMsimple 9282 1.1 mrg \errmessage{Nested footnotes not supported in texinfo.tex, 9283 1.1 mrg even though they work in makeinfo; sorry} 9284 1.1 mrg } 9285 1.1 mrg 9286 1.1 mrg \def\errfootnoteheading{% 9287 1.1 mrg \errhelp=\EMsimple 9288 1.1 mrg \errmessage{Footnotes in chapters, sections, etc., are not supported} 9289 1.1 mrg } 9290 1.1 mrg 9291 1.1 mrg % In case a @footnote appears in a vbox, save the footnote text and create 9292 1.1 mrg % the real \insert just after the vbox finished. Otherwise, the insertion 9293 1.1 mrg % would be lost. 9294 1.1 mrg % Similarly, if a @footnote appears inside an alignment, save the footnote 9295 1.1 mrg % text to a box and make the \insert when a row of the table is finished. 9296 1.1 mrg % And the same can be done for other insert classes. --kasal, 16nov03. 9297 1.1 mrg % 9298 1.1 mrg % Replace the \insert primitive by a cheating macro. 9299 1.1 mrg % Deeper inside, just make sure that the saved insertions are not spilled 9300 1.1 mrg % out prematurely. 9301 1.1 mrg % 9302 1.1 mrg \def\startsavinginserts{% 9303 1.1 mrg \ifx \insert\ptexinsert 9304 1.1 mrg \let\insert\saveinsert 9305 1.1 mrg \else 9306 1.1 mrg \let\checkinserts\relax 9307 1.1 mrg \fi 9308 1.1 mrg } 9309 1.1 mrg 9310 1.1 mrg % This \insert replacement works for both \insert\footins{foo} and 9311 1.1 mrg % \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}. 9312 1.1 mrg % 9313 1.1 mrg \def\saveinsert#1{% 9314 1.1 mrg \edef\next{\noexpand\savetobox \makeSAVEname#1}% 9315 1.1 mrg \afterassignment\next 9316 1.1 mrg % swallow the left brace 9317 1.1 mrg \let\temp = 9318 1.1 mrg } 9319 1.1 mrg \def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}} 9320 1.1 mrg \def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1} 9321 1.1 mrg 9322 1.1 mrg \def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi} 9323 1.1 mrg 9324 1.1 mrg \def\placesaveins#1{% 9325 1.1 mrg \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname 9326 1.1 mrg {\box#1}% 9327 1.1 mrg } 9328 1.1 mrg 9329 1.1 mrg % eat @SAVE -- beware, all of them have catcode \other: 9330 1.1 mrg { 9331 1.1 mrg \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-) 9332 1.1 mrg \gdef\gobblesave @SAVE{} 9333 1.1 mrg } 9334 1.1 mrg 9335 1.1 mrg % initialization: 9336 1.1 mrg \def\newsaveins #1{% 9337 1.1 mrg \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}% 9338 1.1 mrg \next 9339 1.1 mrg } 9340 1.1 mrg \def\newsaveinsX #1{% 9341 1.1 mrg \csname newbox\endcsname #1% 9342 1.1 mrg \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts 9343 1.1 mrg \checksaveins #1}% 9344 1.1 mrg } 9345 1.1 mrg 9346 1.1 mrg % initialize: 9347 1.1 mrg \let\checkinserts\empty 9348 1.1 mrg \newsaveins\footins 9349 1.1 mrg \newsaveins\margin 9350 1.1 mrg 9351 1.1 mrg 9352 1.1 mrg % @image. We use the macros from epsf.tex to support this. 9353 1.1 mrg % If epsf.tex is not installed and @image is used, we complain. 9354 1.1 mrg % 9355 1.1 mrg % Check for and read epsf.tex up front. If we read it only at @image 9356 1.1 mrg % time, we might be inside a group, and then its definitions would get 9357 1.1 mrg % undone and the next image would fail. 9358 1.1 mrg \openin 1 = epsf.tex 9359 1.1 mrg \ifeof 1 \else 9360 1.1 mrg % Do not bother showing banner with epsf.tex v2.7k (available in 9361 1.1 mrg % doc/epsf.tex and on ctan). 9362 1.1 mrg \def\epsfannounce{\toks0 = }% 9363 1.1 mrg \input epsf.tex 9364 1.1 mrg \fi 9365 1.1 mrg \closein 1 9366 1.1 mrg % 9367 1.1 mrg % We will only complain once about lack of epsf.tex. 9368 1.1 mrg \newif\ifwarnednoepsf 9369 1.1 mrg \newhelp\noepsfhelp{epsf.tex must be installed for images to 9370 1.1 mrg work. It is also included in the Texinfo distribution, or you can get 9371 1.1 mrg it from https://ctan.org/texarchive/macros/texinfo/texinfo/doc/epsf.tex.} 9372 1.1 mrg % 9373 1.1 mrg \def\image#1{% 9374 1.1 mrg \ifx\epsfbox\thisisundefined 9375 1.1 mrg \ifwarnednoepsf \else 9376 1.1 mrg \errhelp = \noepsfhelp 9377 1.1 mrg \errmessage{epsf.tex not found, images will be ignored}% 9378 1.1 mrg \global\warnednoepsftrue 9379 1.1 mrg \fi 9380 1.1 mrg \else 9381 1.1 mrg \imagexxx #1,,,,,\finish 9382 1.1 mrg \fi 9383 1.1 mrg } 9384 1.1 mrg % 9385 1.1 mrg % Arguments to @image: 9386 1.1 mrg % #1 is (mandatory) image filename; we tack on .eps extension. 9387 1.1 mrg % #2 is (optional) width, #3 is (optional) height. 9388 1.1 mrg % #4 is (ignored optional) html alt text. 9389 1.1 mrg % #5 is (ignored optional) extension. 9390 1.1 mrg % #6 is just the usual extra ignored arg for parsing stuff. 9391 1.1 mrg \newif\ifimagevmode 9392 1.1 mrg \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup 9393 1.1 mrg \catcode`\^^M = 5 % in case we're inside an example 9394 1.1.1.2 mrg \normalturnoffactive % allow _ et al. in names 9395 1.1 mrg \makevalueexpandable 9396 1.1 mrg % If the image is by itself, center it. 9397 1.1 mrg \ifvmode 9398 1.1 mrg \imagevmodetrue 9399 1.1 mrg \else \ifx\centersub\centerV 9400 1.1 mrg % for @center @image, we need a vbox so we can have our vertical space 9401 1.1 mrg \imagevmodetrue 9402 1.1 mrg \vbox\bgroup % vbox has better behavior than vtop herev 9403 1.1 mrg \fi\fi 9404 1.1 mrg % 9405 1.1 mrg \ifimagevmode 9406 1.1 mrg \nobreak\medskip 9407 1.1 mrg % Usually we'll have text after the image which will insert 9408 1.1 mrg % \parskip glue, so insert it here too to equalize the space 9409 1.1 mrg % above and below. 9410 1.1 mrg \nobreak\vskip\parskip 9411 1.1 mrg \nobreak 9412 1.1 mrg \fi 9413 1.1 mrg % 9414 1.1 mrg % Leave vertical mode so that indentation from an enclosing 9415 1.1 mrg % environment such as @quotation is respected. 9416 1.1 mrg % However, if we're at the top level, we don't want the 9417 1.1 mrg % normal paragraph indentation. 9418 1.1 mrg % On the other hand, if we are in the case of @center @image, we don't 9419 1.1 mrg % want to start a paragraph, which will create a hsize-width box and 9420 1.1.1.2 mrg % eradicate the centering. 9421 1.1 mrg \ifx\centersub\centerV \else \imageindent \fi 9422 1.1 mrg % 9423 1.1 mrg % Output the image. 9424 1.1 mrg \ifpdf 9425 1.1 mrg % For pdfTeX and LuaTeX <= 0.80 9426 1.1 mrg \dopdfimage{#1}{#2}{#3}% 9427 1.1 mrg \else 9428 1.1 mrg \ifx\XeTeXrevision\thisisundefined 9429 1.1 mrg % For epsf.tex 9430 1.1 mrg % \epsfbox itself resets \epsf?size at each figure. 9431 1.1 mrg \setbox0 = \hbox{\ignorespaces #2}% 9432 1.1 mrg \ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi 9433 1.1 mrg \setbox0 = \hbox{\ignorespaces #3}% 9434 1.1 mrg \ifdim\wd0 > 0pt \epsfysize=#3\relax \fi 9435 1.1 mrg \epsfbox{#1.eps}% 9436 1.1 mrg \else 9437 1.1 mrg % For XeTeX 9438 1.1 mrg \doxeteximage{#1}{#2}{#3}% 9439 1.1 mrg \fi 9440 1.1 mrg \fi 9441 1.1 mrg % 9442 1.1 mrg \ifimagevmode 9443 1.1 mrg \medskip % space after a standalone image 9444 1.1 mrg \fi 9445 1.1 mrg \ifx\centersub\centerV \egroup \fi 9446 1.1 mrg \endgroup} 9447 1.1 mrg 9448 1.1 mrg 9449 1.1 mrg % @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables, 9450 1.1 mrg % etc. We don't actually implement floating yet, we always include the 9451 1.1 mrg % float "here". But it seemed the best name for the future. 9452 1.1 mrg % 9453 1.1 mrg \envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish} 9454 1.1 mrg 9455 1.1 mrg % There may be a space before second and/or third parameter; delete it. 9456 1.1 mrg \def\eatcommaspace#1, {#1,} 9457 1.1 mrg 9458 1.1 mrg % #1 is the optional FLOATTYPE, the text label for this float, typically 9459 1.1 mrg % "Figure", "Table", "Example", etc. Can't contain commas. If omitted, 9460 1.1 mrg % this float will not be numbered and cannot be referred to. 9461 1.1 mrg % 9462 1.1 mrg % #2 is the optional xref label. Also must be present for the float to 9463 1.1 mrg % be referable. 9464 1.1 mrg % 9465 1.1 mrg % #3 is the optional positioning argument; for now, it is ignored. It 9466 1.1 mrg % will somehow specify the positions allowed to float to (here, top, bottom). 9467 1.1 mrg % 9468 1.1 mrg % We keep a separate counter for each FLOATTYPE, which we reset at each 9469 1.1 mrg % chapter-level command. 9470 1.1 mrg \let\resetallfloatnos=\empty 9471 1.1 mrg % 9472 1.1 mrg \def\dofloat#1,#2,#3,#4\finish{% 9473 1.1 mrg \let\thiscaption=\empty 9474 1.1 mrg \let\thisshortcaption=\empty 9475 1.1 mrg % 9476 1.1 mrg % don't lose footnotes inside @float. 9477 1.1 mrg % 9478 1.1 mrg % BEWARE: when the floats start float, we have to issue warning whenever an 9479 1.1 mrg % insert appears inside a float which could possibly float. --kasal, 26may04 9480 1.1 mrg % 9481 1.1 mrg \startsavinginserts 9482 1.1 mrg % 9483 1.1 mrg % We can't be used inside a paragraph. 9484 1.1 mrg \par 9485 1.1 mrg % 9486 1.1 mrg \vtop\bgroup 9487 1.1 mrg \def\floattype{#1}% 9488 1.1 mrg \def\floatlabel{#2}% 9489 1.1 mrg \def\floatloc{#3}% we do nothing with this yet. 9490 1.1 mrg % 9491 1.1 mrg \ifx\floattype\empty 9492 1.1 mrg \let\safefloattype=\empty 9493 1.1 mrg \else 9494 1.1 mrg {% 9495 1.1 mrg % the floattype might have accents or other special characters, 9496 1.1 mrg % but we need to use it in a control sequence name. 9497 1.1 mrg \indexnofonts 9498 1.1 mrg \turnoffactive 9499 1.1 mrg \xdef\safefloattype{\floattype}% 9500 1.1 mrg }% 9501 1.1 mrg \fi 9502 1.1 mrg % 9503 1.1 mrg % If label is given but no type, we handle that as the empty type. 9504 1.1 mrg \ifx\floatlabel\empty \else 9505 1.1 mrg % We want each FLOATTYPE to be numbered separately (Figure 1, 9506 1.1 mrg % Table 1, Figure 2, ...). (And if no label, no number.) 9507 1.1 mrg % 9508 1.1 mrg \expandafter\getfloatno\csname\safefloattype floatno\endcsname 9509 1.1 mrg \global\advance\floatno by 1 9510 1.1 mrg % 9511 1.1 mrg {% 9512 1.1 mrg % This magic value for \currentsection is output by \setref as the 9513 1.1 mrg % XREFLABEL-title value. \xrefX uses it to distinguish float 9514 1.1 mrg % labels (which have a completely different output format) from 9515 1.1 mrg % node and anchor labels. And \xrdef uses it to construct the 9516 1.1 mrg % lists of floats. 9517 1.1 mrg % 9518 1.1 mrg \edef\currentsection{\floatmagic=\safefloattype}% 9519 1.1 mrg \setref{\floatlabel}{Yfloat}% 9520 1.1 mrg }% 9521 1.1 mrg \fi 9522 1.1 mrg % 9523 1.1 mrg % start with \parskip glue, I guess. 9524 1.1 mrg \vskip\parskip 9525 1.1 mrg % 9526 1.1 mrg % Don't suppress indentation if a float happens to start a section. 9527 1.1 mrg \restorefirstparagraphindent 9528 1.1 mrg } 9529 1.1 mrg 9530 1.1 mrg % we have these possibilities: 9531 1.1 mrg % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap 9532 1.1 mrg % @float Foo,lbl & no caption: Foo 1.1 9533 1.1 mrg % @float Foo & @caption{Cap}: Foo: Cap 9534 1.1 mrg % @float Foo & no caption: Foo 9535 1.1 mrg % @float ,lbl & Caption{Cap}: 1.1: Cap 9536 1.1 mrg % @float ,lbl & no caption: 1.1 9537 1.1 mrg % @float & @caption{Cap}: Cap 9538 1.1 mrg % @float & no caption: 9539 1.1 mrg % 9540 1.1 mrg \def\Efloat{% 9541 1.1 mrg \let\floatident = \empty 9542 1.1 mrg % 9543 1.1 mrg % In all cases, if we have a float type, it comes first. 9544 1.1 mrg \ifx\floattype\empty \else \def\floatident{\floattype}\fi 9545 1.1 mrg % 9546 1.1 mrg % If we have an xref label, the number comes next. 9547 1.1 mrg \ifx\floatlabel\empty \else 9548 1.1 mrg \ifx\floattype\empty \else % if also had float type, need tie first. 9549 1.1 mrg \appendtomacro\floatident{\tie}% 9550 1.1 mrg \fi 9551 1.1 mrg % the number. 9552 1.1 mrg \appendtomacro\floatident{\chaplevelprefix\the\floatno}% 9553 1.1 mrg \fi 9554 1.1 mrg % 9555 1.1 mrg % Start the printed caption with what we've constructed in 9556 1.1 mrg % \floatident, but keep it separate; we need \floatident again. 9557 1.1 mrg \let\captionline = \floatident 9558 1.1 mrg % 9559 1.1 mrg \ifx\thiscaption\empty \else 9560 1.1 mrg \ifx\floatident\empty \else 9561 1.1 mrg \appendtomacro\captionline{: }% had ident, so need a colon between 9562 1.1 mrg \fi 9563 1.1 mrg % 9564 1.1 mrg % caption text. 9565 1.1 mrg \appendtomacro\captionline{\scanexp\thiscaption}% 9566 1.1 mrg \fi 9567 1.1 mrg % 9568 1.1 mrg % If we have anything to print, print it, with space before. 9569 1.1 mrg % Eventually this needs to become an \insert. 9570 1.1 mrg \ifx\captionline\empty \else 9571 1.1 mrg \vskip.5\parskip 9572 1.1 mrg \captionline 9573 1.1 mrg % 9574 1.1 mrg % Space below caption. 9575 1.1 mrg \vskip\parskip 9576 1.1 mrg \fi 9577 1.1 mrg % 9578 1.1 mrg % If have an xref label, write the list of floats info. Do this 9579 1.1 mrg % after the caption, to avoid chance of it being a breakpoint. 9580 1.1 mrg \ifx\floatlabel\empty \else 9581 1.1 mrg % Write the text that goes in the lof to the aux file as 9582 1.1 mrg % \floatlabel-lof. Besides \floatident, we include the short 9583 1.1 mrg % caption if specified, else the full caption if specified, else nothing. 9584 1.1 mrg {% 9585 1.1 mrg \requireauxfile 9586 1.1 mrg \atdummies 9587 1.1 mrg % 9588 1.1 mrg \ifx\thisshortcaption\empty 9589 1.1 mrg \def\gtemp{\thiscaption}% 9590 1.1 mrg \else 9591 1.1 mrg \def\gtemp{\thisshortcaption}% 9592 1.1 mrg \fi 9593 1.1 mrg \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident 9594 1.1 mrg \ifx\gtemp\empty \else : \gtemp \fi}}% 9595 1.1 mrg }% 9596 1.1 mrg \fi 9597 1.1 mrg \egroup % end of \vtop 9598 1.1 mrg % 9599 1.1 mrg \checkinserts 9600 1.1 mrg } 9601 1.1 mrg 9602 1.1 mrg % Append the tokens #2 to the definition of macro #1, not expanding either. 9603 1.1 mrg % 9604 1.1 mrg \def\appendtomacro#1#2{% 9605 1.1 mrg \expandafter\def\expandafter#1\expandafter{#1#2}% 9606 1.1 mrg } 9607 1.1 mrg 9608 1.1 mrg % @caption, @shortcaption 9609 1.1 mrg % 9610 1.1 mrg \def\caption{\docaption\thiscaption} 9611 1.1 mrg \def\shortcaption{\docaption\thisshortcaption} 9612 1.1 mrg \def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption} 9613 1.1 mrg \def\defcaption#1#2{\egroup \def#1{#2}} 9614 1.1 mrg 9615 1.1 mrg % The parameter is the control sequence identifying the counter we are 9616 1.1 mrg % going to use. Create it if it doesn't exist and assign it to \floatno. 9617 1.1 mrg \def\getfloatno#1{% 9618 1.1 mrg \ifx#1\relax 9619 1.1 mrg % Haven't seen this figure type before. 9620 1.1 mrg \csname newcount\endcsname #1% 9621 1.1 mrg % 9622 1.1 mrg % Remember to reset this floatno at the next chap. 9623 1.1 mrg \expandafter\gdef\expandafter\resetallfloatnos 9624 1.1 mrg \expandafter{\resetallfloatnos #1=0 }% 9625 1.1 mrg \fi 9626 1.1 mrg \let\floatno#1% 9627 1.1 mrg } 9628 1.1 mrg 9629 1.1 mrg % \setref calls this to get the XREFLABEL-snt value. We want an @xref 9630 1.1 mrg % to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we 9631 1.1 mrg % first read the @float command. 9632 1.1 mrg % 9633 1.1 mrg \def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}% 9634 1.1 mrg 9635 1.1 mrg % Magic string used for the XREFLABEL-title value, so \xrefX can 9636 1.1 mrg % distinguish floats from other xref types. 9637 1.1 mrg \def\floatmagic{!!float!!} 9638 1.1 mrg 9639 1.1 mrg % #1 is the control sequence we are passed; we expand into a conditional 9640 1.1 mrg % which is true if #1 represents a float ref. That is, the magic 9641 1.1 mrg % \currentsection value which we \setref above. 9642 1.1 mrg % 9643 1.1 mrg \def\iffloat#1{\expandafter\doiffloat#1==\finish} 9644 1.1 mrg % 9645 1.1 mrg % #1 is (maybe) the \floatmagic string. If so, #2 will be the 9646 1.1 mrg % (safe) float type for this float. We set \iffloattype to #2. 9647 1.1 mrg % 9648 1.1 mrg \def\doiffloat#1=#2=#3\finish{% 9649 1.1 mrg \def\temp{#1}% 9650 1.1 mrg \def\iffloattype{#2}% 9651 1.1 mrg \ifx\temp\floatmagic 9652 1.1 mrg } 9653 1.1 mrg 9654 1.1 mrg % @listoffloats FLOATTYPE - print a list of floats like a table of contents. 9655 1.1 mrg % 9656 1.1 mrg \parseargdef\listoffloats{% 9657 1.1 mrg \def\floattype{#1}% floattype 9658 1.1 mrg {% 9659 1.1 mrg % the floattype might have accents or other special characters, 9660 1.1 mrg % but we need to use it in a control sequence name. 9661 1.1 mrg \indexnofonts 9662 1.1 mrg \turnoffactive 9663 1.1 mrg \xdef\safefloattype{\floattype}% 9664 1.1 mrg }% 9665 1.1 mrg % 9666 1.1 mrg % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE. 9667 1.1 mrg \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax 9668 1.1 mrg \ifhavexrefs 9669 1.1 mrg % if the user said @listoffloats foo but never @float foo. 9670 1.1 mrg \message{\linenumber No `\safefloattype' floats to list.}% 9671 1.1 mrg \fi 9672 1.1 mrg \else 9673 1.1 mrg \begingroup 9674 1.1 mrg \leftskip=\tocindent % indent these entries like a toc 9675 1.1 mrg \let\do=\listoffloatsdo 9676 1.1 mrg \csname floatlist\safefloattype\endcsname 9677 1.1 mrg \endgroup 9678 1.1 mrg \fi 9679 1.1 mrg } 9680 1.1 mrg 9681 1.1 mrg % This is called on each entry in a list of floats. We're passed the 9682 1.1 mrg % xref label, in the form LABEL-title, which is how we save it in the 9683 1.1 mrg % aux file. We strip off the -title and look up \XRLABEL-lof, which 9684 1.1 mrg % has the text we're supposed to typeset here. 9685 1.1 mrg % 9686 1.1 mrg % Figures without xref labels will not be included in the list (since 9687 1.1 mrg % they won't appear in the aux file). 9688 1.1 mrg % 9689 1.1 mrg \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish} 9690 1.1 mrg \def\listoffloatsdoentry#1-title\finish{{% 9691 1.1 mrg % Can't fully expand XR#1-lof because it can contain anything. Just 9692 1.1 mrg % pass the control sequence. On the other hand, XR#1-pg is just the 9693 1.1 mrg % page number, and we want to fully expand that so we can get a link 9694 1.1 mrg % in pdf output. 9695 1.1 mrg \toksA = \expandafter{\csname XR#1-lof\endcsname}% 9696 1.1 mrg % 9697 1.1 mrg % use the same \entry macro we use to generate the TOC and index. 9698 1.1 mrg \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}% 9699 1.1 mrg \writeentry 9700 1.1 mrg }} 9701 1.1 mrg 9702 1.1 mrg 9703 1.1 mrg \message{localization,} 9704 1.1 mrg 9705 1.1 mrg % For single-language documents, @documentlanguage is usually given very 9706 1.1 mrg % early, just after @documentencoding. Single argument is the language 9707 1.1 mrg % (de) or locale (de_DE) abbreviation. 9708 1.1 mrg % 9709 1.1 mrg { 9710 1.1 mrg \catcode`\_ = \active 9711 1.1 mrg \globaldefs=1 9712 1.1 mrg \parseargdef\documentlanguage{% 9713 1.1 mrg \tex % read txi-??.tex file in plain TeX. 9714 1.1 mrg % Read the file by the name they passed if it exists. 9715 1.1 mrg \let_ = \normalunderscore % normal _ character for filename test 9716 1.1 mrg \openin 1 txi-#1.tex 9717 1.1 mrg \ifeof 1 9718 1.1 mrg \documentlanguagetrywithoutunderscore #1_\finish 9719 1.1 mrg \else 9720 1.1 mrg \globaldefs = 1 % everything in the txi-LL files needs to persist 9721 1.1 mrg \input txi-#1.tex 9722 1.1 mrg \fi 9723 1.1 mrg \closein 1 9724 1.1 mrg \endgroup % end raw TeX 9725 1.1 mrg } 9726 1.1 mrg % 9727 1.1 mrg % If they passed de_DE, and txi-de_DE.tex doesn't exist, 9728 1.1 mrg % try txi-de.tex. 9729 1.1 mrg % 9730 1.1 mrg \gdef\documentlanguagetrywithoutunderscore#1_#2\finish{% 9731 1.1 mrg \openin 1 txi-#1.tex 9732 1.1 mrg \ifeof 1 9733 1.1 mrg \errhelp = \nolanghelp 9734 1.1 mrg \errmessage{Cannot read language file txi-#1.tex}% 9735 1.1 mrg \else 9736 1.1 mrg \globaldefs = 1 % everything in the txi-LL files needs to persist 9737 1.1 mrg \input txi-#1.tex 9738 1.1 mrg \fi 9739 1.1 mrg \closein 1 9740 1.1 mrg } 9741 1.1 mrg }% end of special _ catcode 9742 1.1 mrg % 9743 1.1 mrg \newhelp\nolanghelp{The given language definition file cannot be found or 9744 1.1 mrg is empty. Maybe you need to install it? Putting it in the current 9745 1.1 mrg directory should work if nowhere else does.} 9746 1.1 mrg 9747 1.1 mrg % This macro is called from txi-??.tex files; the first argument is the 9748 1.1 mrg % \language name to set (without the "\lang@" prefix), the second and 9749 1.1 mrg % third args are \{left,right}hyphenmin. 9750 1.1 mrg % 9751 1.1 mrg % The language names to pass are determined when the format is built. 9752 1.1 mrg % See the etex.log file created at that time, e.g., 9753 1.1 mrg % /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log. 9754 1.1 mrg % 9755 1.1 mrg % With TeX Live 2008, etex now includes hyphenation patterns for all 9756 1.1 mrg % available languages. This means we can support hyphenation in 9757 1.1 mrg % Texinfo, at least to some extent. (This still doesn't solve the 9758 1.1 mrg % accented characters problem.) 9759 1.1 mrg % 9760 1.1 mrg \catcode`@=11 9761 1.1 mrg \def\txisetlanguage#1#2#3{% 9762 1.1 mrg % do not set the language if the name is undefined in the current TeX. 9763 1.1 mrg \expandafter\ifx\csname lang@#1\endcsname \relax 9764 1.1 mrg \message{no patterns for #1}% 9765 1.1 mrg \else 9766 1.1 mrg \global\language = \csname lang@#1\endcsname 9767 1.1 mrg \fi 9768 1.1 mrg % but there is no harm in adjusting the hyphenmin values regardless. 9769 1.1 mrg \global\lefthyphenmin = #2\relax 9770 1.1 mrg \global\righthyphenmin = #3\relax 9771 1.1 mrg } 9772 1.1 mrg 9773 1.1 mrg % XeTeX and LuaTeX can handle Unicode natively. 9774 1.1 mrg % Their default I/O uses UTF-8 sequences instead of a byte-wise operation. 9775 1.1 mrg % Other TeX engines' I/O (pdfTeX, etc.) is byte-wise. 9776 1.1 mrg % 9777 1.1 mrg \newif\iftxinativeunicodecapable 9778 1.1 mrg \newif\iftxiusebytewiseio 9779 1.1 mrg 9780 1.1 mrg \ifx\XeTeXrevision\thisisundefined 9781 1.1 mrg \ifx\luatexversion\thisisundefined 9782 1.1 mrg \txinativeunicodecapablefalse 9783 1.1 mrg \txiusebytewiseiotrue 9784 1.1 mrg \else 9785 1.1 mrg \txinativeunicodecapabletrue 9786 1.1 mrg \txiusebytewiseiofalse 9787 1.1 mrg \fi 9788 1.1 mrg \else 9789 1.1 mrg \txinativeunicodecapabletrue 9790 1.1 mrg \txiusebytewiseiofalse 9791 1.1 mrg \fi 9792 1.1 mrg 9793 1.1 mrg % Set I/O by bytes instead of UTF-8 sequence for XeTeX and LuaTex 9794 1.1 mrg % for non-UTF-8 (byte-wise) encodings. 9795 1.1 mrg % 9796 1.1 mrg \def\setbytewiseio{% 9797 1.1 mrg \ifx\XeTeXrevision\thisisundefined 9798 1.1 mrg \else 9799 1.1 mrg \XeTeXdefaultencoding "bytes" % For subsequent files to be read 9800 1.1 mrg \XeTeXinputencoding "bytes" % For document root file 9801 1.1 mrg % Unfortunately, there seems to be no corresponding XeTeX command for 9802 1.1 mrg % output encoding. This is a problem for auxiliary index and TOC files. 9803 1.1 mrg % The only solution would be perhaps to write out @U{...} sequences in 9804 1.1 mrg % place of non-ASCII characters. 9805 1.1 mrg \fi 9806 1.1 mrg 9807 1.1 mrg \ifx\luatexversion\thisisundefined 9808 1.1 mrg \else 9809 1.1 mrg \directlua{ 9810 1.1 mrg local utf8_char, byte, gsub = unicode.utf8.char, string.byte, string.gsub 9811 1.1 mrg local function convert_char (char) 9812 1.1 mrg return utf8_char(byte(char)) 9813 1.1 mrg end 9814 1.1 mrg 9815 1.1 mrg local function convert_line (line) 9816 1.1 mrg return gsub(line, ".", convert_char) 9817 1.1 mrg end 9818 1.1 mrg 9819 1.1 mrg callback.register("process_input_buffer", convert_line) 9820 1.1 mrg 9821 1.1 mrg local function convert_line_out (line) 9822 1.1 mrg local line_out = "" 9823 1.1 mrg for c in string.utfvalues(line) do 9824 1.1 mrg line_out = line_out .. string.char(c) 9825 1.1 mrg end 9826 1.1 mrg return line_out 9827 1.1 mrg end 9828 1.1 mrg 9829 1.1 mrg callback.register("process_output_buffer", convert_line_out) 9830 1.1 mrg } 9831 1.1 mrg \fi 9832 1.1 mrg 9833 1.1 mrg \txiusebytewiseiotrue 9834 1.1 mrg } 9835 1.1 mrg 9836 1.1 mrg 9837 1.1 mrg % Helpers for encodings. 9838 1.1 mrg % Set the catcode of characters 128 through 255 to the specified number. 9839 1.1 mrg % 9840 1.1 mrg \def\setnonasciicharscatcode#1{% 9841 1.1 mrg \count255=128 9842 1.1 mrg \loop\ifnum\count255<256 9843 1.1 mrg \global\catcode\count255=#1\relax 9844 1.1 mrg \advance\count255 by 1 9845 1.1 mrg \repeat 9846 1.1 mrg } 9847 1.1 mrg 9848 1.1 mrg \def\setnonasciicharscatcodenonglobal#1{% 9849 1.1 mrg \count255=128 9850 1.1 mrg \loop\ifnum\count255<256 9851 1.1 mrg \catcode\count255=#1\relax 9852 1.1 mrg \advance\count255 by 1 9853 1.1 mrg \repeat 9854 1.1 mrg } 9855 1.1 mrg 9856 1.1 mrg % @documentencoding sets the definition of non-ASCII characters 9857 1.1 mrg % according to the specified encoding. 9858 1.1 mrg % 9859 1.1 mrg \def\documentencoding{\parseargusing\filenamecatcodes\documentencodingzzz} 9860 1.1 mrg \def\documentencodingzzz#1{% 9861 1.1 mrg % 9862 1.1 mrg % Encoding being declared for the document. 9863 1.1 mrg \def\declaredencoding{\csname #1.enc\endcsname}% 9864 1.1 mrg % 9865 1.1 mrg % Supported encodings: names converted to tokens in order to be able 9866 1.1 mrg % to compare them with \ifx. 9867 1.1 mrg \def\ascii{\csname US-ASCII.enc\endcsname}% 9868 1.1 mrg \def\latnine{\csname ISO-8859-15.enc\endcsname}% 9869 1.1 mrg \def\latone{\csname ISO-8859-1.enc\endcsname}% 9870 1.1 mrg \def\lattwo{\csname ISO-8859-2.enc\endcsname}% 9871 1.1 mrg \def\utfeight{\csname UTF-8.enc\endcsname}% 9872 1.1 mrg % 9873 1.1 mrg \ifx \declaredencoding \ascii 9874 1.1 mrg \asciichardefs 9875 1.1 mrg % 9876 1.1 mrg \else \ifx \declaredencoding \lattwo 9877 1.1 mrg \iftxinativeunicodecapable 9878 1.1 mrg \setbytewiseio 9879 1.1 mrg \fi 9880 1.1 mrg \setnonasciicharscatcode\active 9881 1.1 mrg \lattwochardefs 9882 1.1 mrg % 9883 1.1 mrg \else \ifx \declaredencoding \latone 9884 1.1 mrg \iftxinativeunicodecapable 9885 1.1 mrg \setbytewiseio 9886 1.1 mrg \fi 9887 1.1 mrg \setnonasciicharscatcode\active 9888 1.1 mrg \latonechardefs 9889 1.1 mrg % 9890 1.1 mrg \else \ifx \declaredencoding \latnine 9891 1.1 mrg \iftxinativeunicodecapable 9892 1.1 mrg \setbytewiseio 9893 1.1 mrg \fi 9894 1.1 mrg \setnonasciicharscatcode\active 9895 1.1 mrg \latninechardefs 9896 1.1 mrg % 9897 1.1 mrg \else \ifx \declaredencoding \utfeight 9898 1.1 mrg \iftxinativeunicodecapable 9899 1.1 mrg % For native Unicode handling (XeTeX and LuaTeX) 9900 1.1 mrg \nativeunicodechardefs 9901 1.1 mrg \else 9902 1.1 mrg % For treating UTF-8 as byte sequences (TeX, eTeX and pdfTeX) 9903 1.1 mrg \setnonasciicharscatcode\active 9904 1.1 mrg % since we already invoked \utfeightchardefs at the top level 9905 1.1 mrg % (below), do not re-invoke it, otherwise our check for duplicated 9906 1.1 mrg % definitions gets triggered. Making non-ascii chars active is 9907 1.1 mrg % sufficient. 9908 1.1 mrg \fi 9909 1.1 mrg % 9910 1.1 mrg \else 9911 1.1 mrg \message{Ignoring unknown document encoding: #1.}% 9912 1.1 mrg % 9913 1.1 mrg \fi % utfeight 9914 1.1 mrg \fi % latnine 9915 1.1 mrg \fi % latone 9916 1.1 mrg \fi % lattwo 9917 1.1 mrg \fi % ascii 9918 1.1 mrg % 9919 1.1 mrg \ifx\XeTeXrevision\thisisundefined 9920 1.1 mrg \else 9921 1.1 mrg \ifx \declaredencoding \utfeight 9922 1.1 mrg \else 9923 1.1 mrg \ifx \declaredencoding \ascii 9924 1.1 mrg \else 9925 1.1 mrg \message{Warning: XeTeX with non-UTF-8 encodings cannot handle % 9926 1.1 mrg non-ASCII characters in auxiliary files.}% 9927 1.1 mrg \fi 9928 1.1 mrg \fi 9929 1.1 mrg \fi 9930 1.1 mrg } 9931 1.1 mrg 9932 1.1 mrg % emacs-page 9933 1.1 mrg % A message to be logged when using a character that isn't available 9934 1.1 mrg % the default font encoding (OT1). 9935 1.1 mrg % 9936 1.1 mrg \def\missingcharmsg#1{\message{Character missing, sorry: #1.}} 9937 1.1 mrg 9938 1.1 mrg % Take account of \c (plain) vs. \, (Texinfo) difference. 9939 1.1 mrg \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi} 9940 1.1 mrg 9941 1.1 mrg % First, make active non-ASCII characters in order for them to be 9942 1.1 mrg % correctly categorized when TeX reads the replacement text of 9943 1.1 mrg % macros containing the character definitions. 9944 1.1 mrg \setnonasciicharscatcode\active 9945 1.1 mrg % 9946 1.1 mrg 9947 1.1 mrg \def\gdefchar#1#2{% 9948 1.1 mrg \gdef#1{% 9949 1.1 mrg \ifpassthroughchars 9950 1.1 mrg \string#1% 9951 1.1 mrg \else 9952 1.1 mrg #2% 9953 1.1 mrg \fi 9954 1.1 mrg }} 9955 1.1 mrg 9956 1.1 mrg % Latin1 (ISO-8859-1) character definitions. 9957 1.1 mrg \def\latonechardefs{% 9958 1.1 mrg \gdefchar^^a0{\tie} 9959 1.1 mrg \gdefchar^^a1{\exclamdown} 9960 1.1 mrg \gdefchar^^a2{{\tcfont \char162}} % cent 9961 1.1 mrg \gdefchar^^a3{\pounds{}} 9962 1.1 mrg \gdefchar^^a4{{\tcfont \char164}} % currency 9963 1.1 mrg \gdefchar^^a5{{\tcfont \char165}} % yen 9964 1.1 mrg \gdefchar^^a6{{\tcfont \char166}} % broken bar 9965 1.1 mrg \gdefchar^^a7{\S} 9966 1.1 mrg \gdefchar^^a8{\"{}} 9967 1.1 mrg \gdefchar^^a9{\copyright{}} 9968 1.1 mrg \gdefchar^^aa{\ordf} 9969 1.1 mrg \gdefchar^^ab{\guillemetleft{}} 9970 1.1 mrg \gdefchar^^ac{\ensuremath\lnot} 9971 1.1 mrg \gdefchar^^ad{\-} 9972 1.1 mrg \gdefchar^^ae{\registeredsymbol{}} 9973 1.1 mrg \gdefchar^^af{\={}} 9974 1.1 mrg % 9975 1.1 mrg \gdefchar^^b0{\textdegree} 9976 1.1 mrg \gdefchar^^b1{$\pm$} 9977 1.1 mrg \gdefchar^^b2{$^2$} 9978 1.1 mrg \gdefchar^^b3{$^3$} 9979 1.1 mrg \gdefchar^^b4{\'{}} 9980 1.1 mrg \gdefchar^^b5{$\mu$} 9981 1.1 mrg \gdefchar^^b6{\P} 9982 1.1 mrg \gdefchar^^b7{\ensuremath\cdot} 9983 1.1 mrg \gdefchar^^b8{\cedilla\ } 9984 1.1 mrg \gdefchar^^b9{$^1$} 9985 1.1 mrg \gdefchar^^ba{\ordm} 9986 1.1 mrg \gdefchar^^bb{\guillemetright{}} 9987 1.1 mrg \gdefchar^^bc{$1\over4$} 9988 1.1 mrg \gdefchar^^bd{$1\over2$} 9989 1.1 mrg \gdefchar^^be{$3\over4$} 9990 1.1 mrg \gdefchar^^bf{\questiondown} 9991 1.1 mrg % 9992 1.1 mrg \gdefchar^^c0{\`A} 9993 1.1 mrg \gdefchar^^c1{\'A} 9994 1.1 mrg \gdefchar^^c2{\^A} 9995 1.1 mrg \gdefchar^^c3{\~A} 9996 1.1 mrg \gdefchar^^c4{\"A} 9997 1.1 mrg \gdefchar^^c5{\ringaccent A} 9998 1.1 mrg \gdefchar^^c6{\AE} 9999 1.1 mrg \gdefchar^^c7{\cedilla C} 10000 1.1 mrg \gdefchar^^c8{\`E} 10001 1.1 mrg \gdefchar^^c9{\'E} 10002 1.1 mrg \gdefchar^^ca{\^E} 10003 1.1 mrg \gdefchar^^cb{\"E} 10004 1.1 mrg \gdefchar^^cc{\`I} 10005 1.1 mrg \gdefchar^^cd{\'I} 10006 1.1 mrg \gdefchar^^ce{\^I} 10007 1.1 mrg \gdefchar^^cf{\"I} 10008 1.1 mrg % 10009 1.1 mrg \gdefchar^^d0{\DH} 10010 1.1 mrg \gdefchar^^d1{\~N} 10011 1.1 mrg \gdefchar^^d2{\`O} 10012 1.1 mrg \gdefchar^^d3{\'O} 10013 1.1 mrg \gdefchar^^d4{\^O} 10014 1.1 mrg \gdefchar^^d5{\~O} 10015 1.1 mrg \gdefchar^^d6{\"O} 10016 1.1 mrg \gdefchar^^d7{$\times$} 10017 1.1 mrg \gdefchar^^d8{\O} 10018 1.1 mrg \gdefchar^^d9{\`U} 10019 1.1 mrg \gdefchar^^da{\'U} 10020 1.1 mrg \gdefchar^^db{\^U} 10021 1.1 mrg \gdefchar^^dc{\"U} 10022 1.1 mrg \gdefchar^^dd{\'Y} 10023 1.1 mrg \gdefchar^^de{\TH} 10024 1.1 mrg \gdefchar^^df{\ss} 10025 1.1 mrg % 10026 1.1 mrg \gdefchar^^e0{\`a} 10027 1.1 mrg \gdefchar^^e1{\'a} 10028 1.1 mrg \gdefchar^^e2{\^a} 10029 1.1 mrg \gdefchar^^e3{\~a} 10030 1.1 mrg \gdefchar^^e4{\"a} 10031 1.1 mrg \gdefchar^^e5{\ringaccent a} 10032 1.1 mrg \gdefchar^^e6{\ae} 10033 1.1 mrg \gdefchar^^e7{\cedilla c} 10034 1.1 mrg \gdefchar^^e8{\`e} 10035 1.1 mrg \gdefchar^^e9{\'e} 10036 1.1 mrg \gdefchar^^ea{\^e} 10037 1.1 mrg \gdefchar^^eb{\"e} 10038 1.1 mrg \gdefchar^^ec{\`{\dotless i}} 10039 1.1 mrg \gdefchar^^ed{\'{\dotless i}} 10040 1.1 mrg \gdefchar^^ee{\^{\dotless i}} 10041 1.1 mrg \gdefchar^^ef{\"{\dotless i}} 10042 1.1 mrg % 10043 1.1 mrg \gdefchar^^f0{\dh} 10044 1.1 mrg \gdefchar^^f1{\~n} 10045 1.1 mrg \gdefchar^^f2{\`o} 10046 1.1 mrg \gdefchar^^f3{\'o} 10047 1.1 mrg \gdefchar^^f4{\^o} 10048 1.1 mrg \gdefchar^^f5{\~o} 10049 1.1 mrg \gdefchar^^f6{\"o} 10050 1.1 mrg \gdefchar^^f7{$\div$} 10051 1.1 mrg \gdefchar^^f8{\o} 10052 1.1 mrg \gdefchar^^f9{\`u} 10053 1.1 mrg \gdefchar^^fa{\'u} 10054 1.1 mrg \gdefchar^^fb{\^u} 10055 1.1 mrg \gdefchar^^fc{\"u} 10056 1.1 mrg \gdefchar^^fd{\'y} 10057 1.1 mrg \gdefchar^^fe{\th} 10058 1.1 mrg \gdefchar^^ff{\"y} 10059 1.1 mrg } 10060 1.1 mrg 10061 1.1 mrg % Latin9 (ISO-8859-15) encoding character definitions. 10062 1.1 mrg \def\latninechardefs{% 10063 1.1 mrg % Encoding is almost identical to Latin1. 10064 1.1 mrg \latonechardefs 10065 1.1 mrg % 10066 1.1 mrg \gdefchar^^a4{\euro{}} 10067 1.1 mrg \gdefchar^^a6{\v S} 10068 1.1 mrg \gdefchar^^a8{\v s} 10069 1.1 mrg \gdefchar^^b4{\v Z} 10070 1.1 mrg \gdefchar^^b8{\v z} 10071 1.1 mrg \gdefchar^^bc{\OE} 10072 1.1 mrg \gdefchar^^bd{\oe} 10073 1.1 mrg \gdefchar^^be{\"Y} 10074 1.1 mrg } 10075 1.1 mrg 10076 1.1 mrg % Latin2 (ISO-8859-2) character definitions. 10077 1.1 mrg \def\lattwochardefs{% 10078 1.1 mrg \gdefchar^^a0{\tie} 10079 1.1 mrg \gdefchar^^a1{\ogonek{A}} 10080 1.1 mrg \gdefchar^^a2{\u{}} 10081 1.1 mrg \gdefchar^^a3{\L} 10082 1.1 mrg \gdefchar^^a4{\missingcharmsg{CURRENCY SIGN}} 10083 1.1 mrg \gdefchar^^a5{\v L} 10084 1.1 mrg \gdefchar^^a6{\'S} 10085 1.1 mrg \gdefchar^^a7{\S} 10086 1.1 mrg \gdefchar^^a8{\"{}} 10087 1.1 mrg \gdefchar^^a9{\v S} 10088 1.1 mrg \gdefchar^^aa{\cedilla S} 10089 1.1 mrg \gdefchar^^ab{\v T} 10090 1.1 mrg \gdefchar^^ac{\'Z} 10091 1.1 mrg \gdefchar^^ad{\-} 10092 1.1 mrg \gdefchar^^ae{\v Z} 10093 1.1 mrg \gdefchar^^af{\dotaccent Z} 10094 1.1 mrg % 10095 1.1 mrg \gdefchar^^b0{\textdegree{}} 10096 1.1 mrg \gdefchar^^b1{\ogonek{a}} 10097 1.1 mrg \gdefchar^^b2{\ogonek{ }} 10098 1.1 mrg \gdefchar^^b3{\l} 10099 1.1 mrg \gdefchar^^b4{\'{}} 10100 1.1 mrg \gdefchar^^b5{\v l} 10101 1.1 mrg \gdefchar^^b6{\'s} 10102 1.1 mrg \gdefchar^^b7{\v{}} 10103 1.1 mrg \gdefchar^^b8{\cedilla\ } 10104 1.1 mrg \gdefchar^^b9{\v s} 10105 1.1 mrg \gdefchar^^ba{\cedilla s} 10106 1.1 mrg \gdefchar^^bb{\v t} 10107 1.1 mrg \gdefchar^^bc{\'z} 10108 1.1 mrg \gdefchar^^bd{\H{}} 10109 1.1 mrg \gdefchar^^be{\v z} 10110 1.1 mrg \gdefchar^^bf{\dotaccent z} 10111 1.1 mrg % 10112 1.1 mrg \gdefchar^^c0{\'R} 10113 1.1 mrg \gdefchar^^c1{\'A} 10114 1.1 mrg \gdefchar^^c2{\^A} 10115 1.1 mrg \gdefchar^^c3{\u A} 10116 1.1 mrg \gdefchar^^c4{\"A} 10117 1.1 mrg \gdefchar^^c5{\'L} 10118 1.1 mrg \gdefchar^^c6{\'C} 10119 1.1 mrg \gdefchar^^c7{\cedilla C} 10120 1.1 mrg \gdefchar^^c8{\v C} 10121 1.1 mrg \gdefchar^^c9{\'E} 10122 1.1 mrg \gdefchar^^ca{\ogonek{E}} 10123 1.1 mrg \gdefchar^^cb{\"E} 10124 1.1 mrg \gdefchar^^cc{\v E} 10125 1.1 mrg \gdefchar^^cd{\'I} 10126 1.1 mrg \gdefchar^^ce{\^I} 10127 1.1 mrg \gdefchar^^cf{\v D} 10128 1.1 mrg % 10129 1.1 mrg \gdefchar^^d0{\DH} 10130 1.1 mrg \gdefchar^^d1{\'N} 10131 1.1 mrg \gdefchar^^d2{\v N} 10132 1.1 mrg \gdefchar^^d3{\'O} 10133 1.1 mrg \gdefchar^^d4{\^O} 10134 1.1 mrg \gdefchar^^d5{\H O} 10135 1.1 mrg \gdefchar^^d6{\"O} 10136 1.1 mrg \gdefchar^^d7{$\times$} 10137 1.1 mrg \gdefchar^^d8{\v R} 10138 1.1 mrg \gdefchar^^d9{\ringaccent U} 10139 1.1 mrg \gdefchar^^da{\'U} 10140 1.1 mrg \gdefchar^^db{\H U} 10141 1.1 mrg \gdefchar^^dc{\"U} 10142 1.1 mrg \gdefchar^^dd{\'Y} 10143 1.1 mrg \gdefchar^^de{\cedilla T} 10144 1.1 mrg \gdefchar^^df{\ss} 10145 1.1 mrg % 10146 1.1 mrg \gdefchar^^e0{\'r} 10147 1.1 mrg \gdefchar^^e1{\'a} 10148 1.1 mrg \gdefchar^^e2{\^a} 10149 1.1 mrg \gdefchar^^e3{\u a} 10150 1.1 mrg \gdefchar^^e4{\"a} 10151 1.1 mrg \gdefchar^^e5{\'l} 10152 1.1 mrg \gdefchar^^e6{\'c} 10153 1.1 mrg \gdefchar^^e7{\cedilla c} 10154 1.1 mrg \gdefchar^^e8{\v c} 10155 1.1 mrg \gdefchar^^e9{\'e} 10156 1.1 mrg \gdefchar^^ea{\ogonek{e}} 10157 1.1 mrg \gdefchar^^eb{\"e} 10158 1.1 mrg \gdefchar^^ec{\v e} 10159 1.1 mrg \gdefchar^^ed{\'{\dotless{i}}} 10160 1.1 mrg \gdefchar^^ee{\^{\dotless{i}}} 10161 1.1 mrg \gdefchar^^ef{\v d} 10162 1.1 mrg % 10163 1.1 mrg \gdefchar^^f0{\dh} 10164 1.1 mrg \gdefchar^^f1{\'n} 10165 1.1 mrg \gdefchar^^f2{\v n} 10166 1.1 mrg \gdefchar^^f3{\'o} 10167 1.1 mrg \gdefchar^^f4{\^o} 10168 1.1 mrg \gdefchar^^f5{\H o} 10169 1.1 mrg \gdefchar^^f6{\"o} 10170 1.1 mrg \gdefchar^^f7{$\div$} 10171 1.1 mrg \gdefchar^^f8{\v r} 10172 1.1 mrg \gdefchar^^f9{\ringaccent u} 10173 1.1 mrg \gdefchar^^fa{\'u} 10174 1.1 mrg \gdefchar^^fb{\H u} 10175 1.1 mrg \gdefchar^^fc{\"u} 10176 1.1 mrg \gdefchar^^fd{\'y} 10177 1.1 mrg \gdefchar^^fe{\cedilla t} 10178 1.1 mrg \gdefchar^^ff{\dotaccent{}} 10179 1.1 mrg } 10180 1.1 mrg 10181 1.1 mrg % UTF-8 character definitions. 10182 1.1 mrg % 10183 1.1 mrg % This code to support UTF-8 is based on LaTeX's utf8.def, with some 10184 1.1 mrg % changes for Texinfo conventions. It is included here under the GPL by 10185 1.1 mrg % permission from Frank Mittelbach and the LaTeX team. 10186 1.1 mrg % 10187 1.1 mrg \newcount\countUTFx 10188 1.1 mrg \newcount\countUTFy 10189 1.1 mrg \newcount\countUTFz 10190 1.1 mrg 10191 1.1 mrg \gdef\UTFviiiTwoOctets#1#2{\expandafter 10192 1.1 mrg \UTFviiiDefined\csname u8:#1\string #2\endcsname} 10193 1.1 mrg % 10194 1.1 mrg \gdef\UTFviiiThreeOctets#1#2#3{\expandafter 10195 1.1 mrg \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname} 10196 1.1 mrg % 10197 1.1 mrg \gdef\UTFviiiFourOctets#1#2#3#4{\expandafter 10198 1.1 mrg \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname} 10199 1.1 mrg 10200 1.1 mrg \gdef\UTFviiiDefined#1{% 10201 1.1 mrg \ifx #1\relax 10202 1.1 mrg \message{\linenumber Unicode char \string #1 not defined for Texinfo}% 10203 1.1 mrg \else 10204 1.1 mrg \expandafter #1% 10205 1.1 mrg \fi 10206 1.1 mrg } 10207 1.1 mrg 10208 1.1 mrg % Give non-ASCII bytes the active definitions for processing UTF-8 sequences 10209 1.1 mrg \begingroup 10210 1.1 mrg \catcode`\~13 10211 1.1 mrg \catcode`\$12 10212 1.1 mrg \catcode`\"12 10213 1.1 mrg 10214 1.1 mrg % Loop from \countUTFx to \countUTFy, performing \UTFviiiTmp 10215 1.1 mrg % substituting ~ and $ with a character token of that value. 10216 1.1 mrg \def\UTFviiiLoop{% 10217 1.1 mrg \global\catcode\countUTFx\active 10218 1.1 mrg \uccode`\~\countUTFx 10219 1.1 mrg \uccode`\$\countUTFx 10220 1.1 mrg \uppercase\expandafter{\UTFviiiTmp}% 10221 1.1 mrg \advance\countUTFx by 1 10222 1.1 mrg \ifnum\countUTFx < \countUTFy 10223 1.1 mrg \expandafter\UTFviiiLoop 10224 1.1 mrg \fi} 10225 1.1 mrg 10226 1.1 mrg % For bytes other than the first in a UTF-8 sequence. Not expected to 10227 1.1 mrg % be expanded except when writing to auxiliary files. 10228 1.1 mrg \countUTFx = "80 10229 1.1 mrg \countUTFy = "C2 10230 1.1 mrg \def\UTFviiiTmp{% 10231 1.1 mrg \gdef~{% 10232 1.1 mrg \ifpassthroughchars $\fi}}% 10233 1.1 mrg \UTFviiiLoop 10234 1.1 mrg 10235 1.1 mrg \countUTFx = "C2 10236 1.1 mrg \countUTFy = "E0 10237 1.1 mrg \def\UTFviiiTmp{% 10238 1.1 mrg \gdef~{% 10239 1.1 mrg \ifpassthroughchars $% 10240 1.1 mrg \else\expandafter\UTFviiiTwoOctets\expandafter$\fi}}% 10241 1.1 mrg \UTFviiiLoop 10242 1.1 mrg 10243 1.1 mrg \countUTFx = "E0 10244 1.1 mrg \countUTFy = "F0 10245 1.1 mrg \def\UTFviiiTmp{% 10246 1.1 mrg \gdef~{% 10247 1.1 mrg \ifpassthroughchars $% 10248 1.1 mrg \else\expandafter\UTFviiiThreeOctets\expandafter$\fi}}% 10249 1.1 mrg \UTFviiiLoop 10250 1.1 mrg 10251 1.1 mrg \countUTFx = "F0 10252 1.1 mrg \countUTFy = "F4 10253 1.1 mrg \def\UTFviiiTmp{% 10254 1.1 mrg \gdef~{% 10255 1.1 mrg \ifpassthroughchars $% 10256 1.1 mrg \else\expandafter\UTFviiiFourOctets\expandafter$\fi 10257 1.1 mrg }}% 10258 1.1 mrg \UTFviiiLoop 10259 1.1 mrg \endgroup 10260 1.1 mrg 10261 1.1 mrg \def\globallet{\global\let} % save some \expandafter's below 10262 1.1 mrg 10263 1.1 mrg % @U{xxxx} to produce U+xxxx, if we support it. 10264 1.1 mrg \def\U#1{% 10265 1.1 mrg \expandafter\ifx\csname uni:#1\endcsname \relax 10266 1.1 mrg \iftxinativeunicodecapable 10267 1.1 mrg % All Unicode characters can be used if native Unicode handling is 10268 1.1 mrg % active. However, if the font does not have the glyph, 10269 1.1 mrg % letters are missing. 10270 1.1 mrg \begingroup 10271 1.1 mrg \uccode`\.="#1\relax 10272 1.1 mrg \uppercase{.} 10273 1.1 mrg \endgroup 10274 1.1 mrg \else 10275 1.1 mrg \errhelp = \EMsimple 10276 1.1 mrg \errmessage{Unicode character U+#1 not supported, sorry}% 10277 1.1 mrg \fi 10278 1.1 mrg \else 10279 1.1 mrg \csname uni:#1\endcsname 10280 1.1 mrg \fi 10281 1.1 mrg } 10282 1.1 mrg 10283 1.1 mrg % These macros are used here to construct the name of a control 10284 1.1 mrg % sequence to be defined. 10285 1.1 mrg \def\UTFviiiTwoOctetsName#1#2{% 10286 1.1 mrg \csname u8:#1\string #2\endcsname}% 10287 1.1 mrg \def\UTFviiiThreeOctetsName#1#2#3{% 10288 1.1 mrg \csname u8:#1\string #2\string #3\endcsname}% 10289 1.1 mrg \def\UTFviiiFourOctetsName#1#2#3#4{% 10290 1.1 mrg \csname u8:#1\string #2\string #3\string #4\endcsname}% 10291 1.1 mrg 10292 1.1 mrg % For UTF-8 byte sequences (TeX, e-TeX and pdfTeX), 10293 1.1 mrg % provide a definition macro to replace a Unicode character; 10294 1.1 mrg % this gets used by the @U command 10295 1.1 mrg % 10296 1.1 mrg \begingroup 10297 1.1 mrg \catcode`\"=12 10298 1.1 mrg \catcode`\<=12 10299 1.1 mrg \catcode`\.=12 10300 1.1 mrg \catcode`\,=12 10301 1.1 mrg \catcode`\;=12 10302 1.1 mrg \catcode`\!=12 10303 1.1 mrg \catcode`\~=13 10304 1.1 mrg \gdef\DeclareUnicodeCharacterUTFviii#1#2{% 10305 1.1 mrg \countUTFz = "#1\relax 10306 1.1 mrg \begingroup 10307 1.1 mrg \parseXMLCharref 10308 1.1 mrg 10309 1.1 mrg % Give \u8:... its definition. The sequence of seven \expandafter's 10310 1.1 mrg % expands after the \gdef three times, e.g. 10311 1.1 mrg % 10312 1.1 mrg % 1. \UTFviiTwoOctetsName B1 B2 10313 1.1 mrg % 2. \csname u8:B1 \string B2 \endcsname 10314 1.1 mrg % 3. \u8: B1 B2 (a single control sequence token) 10315 1.1 mrg % 10316 1.1 mrg \expandafter\expandafter 10317 1.1 mrg \expandafter\expandafter 10318 1.1 mrg \expandafter\expandafter 10319 1.1 mrg \expandafter\gdef \UTFviiiTmp{#2}% 10320 1.1 mrg % 10321 1.1 mrg \expandafter\ifx\csname uni:#1\endcsname \relax \else 10322 1.1 mrg \message{Internal error, already defined: #1}% 10323 1.1 mrg \fi 10324 1.1 mrg % 10325 1.1 mrg % define an additional control sequence for this code point. 10326 1.1 mrg \expandafter\globallet\csname uni:#1\endcsname \UTFviiiTmp 10327 1.1 mrg \endgroup} 10328 1.1 mrg % 10329 1.1 mrg % Given the value in \countUTFz as a Unicode code point, set \UTFviiiTmp 10330 1.1 mrg % to the corresponding UTF-8 sequence. 10331 1.1 mrg \gdef\parseXMLCharref{% 10332 1.1 mrg \ifnum\countUTFz < "A0\relax 10333 1.1 mrg \errhelp = \EMsimple 10334 1.1 mrg \errmessage{Cannot define Unicode char value < 00A0}% 10335 1.1 mrg \else\ifnum\countUTFz < "800\relax 10336 1.1 mrg \parseUTFviiiA,% 10337 1.1 mrg \parseUTFviiiB C\UTFviiiTwoOctetsName.,% 10338 1.1 mrg \else\ifnum\countUTFz < "10000\relax 10339 1.1 mrg \parseUTFviiiA;% 10340 1.1 mrg \parseUTFviiiA,% 10341 1.1 mrg \parseUTFviiiB E\UTFviiiThreeOctetsName.{,;}% 10342 1.1 mrg \else 10343 1.1 mrg \parseUTFviiiA;% 10344 1.1 mrg \parseUTFviiiA,% 10345 1.1 mrg \parseUTFviiiA!% 10346 1.1 mrg \parseUTFviiiB F\UTFviiiFourOctetsName.{!,;}% 10347 1.1 mrg \fi\fi\fi 10348 1.1 mrg } 10349 1.1 mrg 10350 1.1 mrg % Extract a byte from the end of the UTF-8 representation of \countUTFx. 10351 1.1 mrg % It must be a non-initial byte in the sequence. 10352 1.1 mrg % Change \uccode of #1 for it to be used in \parseUTFviiiB as one 10353 1.1 mrg % of the bytes. 10354 1.1 mrg \gdef\parseUTFviiiA#1{% 10355 1.1 mrg \countUTFx = \countUTFz 10356 1.1 mrg \divide\countUTFz by 64 10357 1.1 mrg \countUTFy = \countUTFz % Save to be the future value of \countUTFz. 10358 1.1 mrg \multiply\countUTFz by 64 10359 1.1 mrg 10360 1.1 mrg % \countUTFz is now \countUTFx with the last 5 bits cleared. Subtract 10361 1.1 mrg % in order to get the last five bits. 10362 1.1 mrg \advance\countUTFx by -\countUTFz 10363 1.1 mrg 10364 1.1 mrg % Convert this to the byte in the UTF-8 sequence. 10365 1.1 mrg \advance\countUTFx by 128 10366 1.1 mrg \uccode `#1\countUTFx 10367 1.1 mrg \countUTFz = \countUTFy} 10368 1.1 mrg 10369 1.1 mrg % Used to put a UTF-8 byte sequence into \UTFviiiTmp 10370 1.1 mrg % #1 is the increment for \countUTFz to yield a the first byte of the UTF-8 10371 1.1 mrg % sequence. 10372 1.1 mrg % #2 is one of the \UTFviii*OctetsName macros. 10373 1.1 mrg % #3 is always a full stop (.) 10374 1.1 mrg % #4 is a template for the other bytes in the sequence. The values for these 10375 1.1 mrg % bytes is substituted in here with \uppercase using the \uccode's. 10376 1.1 mrg \gdef\parseUTFviiiB#1#2#3#4{% 10377 1.1 mrg \advance\countUTFz by "#10\relax 10378 1.1 mrg \uccode `#3\countUTFz 10379 1.1 mrg \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} 10380 1.1 mrg \endgroup 10381 1.1 mrg 10382 1.1 mrg % For native Unicode handling (XeTeX and LuaTeX), 10383 1.1 mrg % provide a definition macro that sets a catcode to `other' non-globally 10384 1.1 mrg % 10385 1.1 mrg \def\DeclareUnicodeCharacterNativeOther#1#2{% 10386 1.1 mrg \catcode"#1=\other 10387 1.1 mrg } 10388 1.1 mrg 10389 1.1 mrg % https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_M 10390 1.1 mrg % U+0000..U+007F = https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block) 10391 1.1 mrg % U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block) 10392 1.1 mrg % U+0100..U+017F = https://en.wikipedia.org/wiki/Latin_Extended-A 10393 1.1 mrg % U+0180..U+024F = https://en.wikipedia.org/wiki/Latin_Extended-B 10394 1.1 mrg % 10395 1.1 mrg % Many of our renditions are less than wonderful, and all the missing 10396 1.1 mrg % characters are available somewhere. Loading the necessary fonts 10397 1.1 mrg % awaits user request. We can't truly support Unicode without 10398 1.1 mrg % reimplementing everything that's been done in LaTeX for many years, 10399 1.1 mrg % plus probably using luatex or xetex, and who knows what else. 10400 1.1 mrg % We won't be doing that here in this simple file. But we can try to at 10401 1.1 mrg % least make most of the characters not bomb out. 10402 1.1 mrg % 10403 1.1 mrg \def\unicodechardefs{% 10404 1.1 mrg \DeclareUnicodeCharacter{00A0}{\tie}% 10405 1.1 mrg \DeclareUnicodeCharacter{00A1}{\exclamdown}% 10406 1.1 mrg \DeclareUnicodeCharacter{00A2}{{\tcfont \char162}}% 0242=cent 10407 1.1 mrg \DeclareUnicodeCharacter{00A3}{\pounds{}}% 10408 1.1 mrg \DeclareUnicodeCharacter{00A4}{{\tcfont \char164}}% 0244=currency 10409 1.1 mrg \DeclareUnicodeCharacter{00A5}{{\tcfont \char165}}% 0245=yen 10410 1.1 mrg \DeclareUnicodeCharacter{00A6}{{\tcfont \char166}}% 0246=brokenbar 10411 1.1 mrg \DeclareUnicodeCharacter{00A7}{\S}% 10412 1.1 mrg \DeclareUnicodeCharacter{00A8}{\"{ }}% 10413 1.1 mrg \DeclareUnicodeCharacter{00A9}{\copyright{}}% 10414 1.1 mrg \DeclareUnicodeCharacter{00AA}{\ordf}% 10415 1.1 mrg \DeclareUnicodeCharacter{00AB}{\guillemetleft{}}% 10416 1.1 mrg \DeclareUnicodeCharacter{00AC}{\ensuremath\lnot}% 10417 1.1 mrg \DeclareUnicodeCharacter{00AD}{\-}% 10418 1.1 mrg \DeclareUnicodeCharacter{00AE}{\registeredsymbol{}}% 10419 1.1 mrg \DeclareUnicodeCharacter{00AF}{\={ }}% 10420 1.1 mrg % 10421 1.1 mrg \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}% 10422 1.1 mrg \DeclareUnicodeCharacter{00B1}{\ensuremath\pm}% 10423 1.1 mrg \DeclareUnicodeCharacter{00B2}{$^2$}% 10424 1.1 mrg \DeclareUnicodeCharacter{00B3}{$^3$}% 10425 1.1 mrg \DeclareUnicodeCharacter{00B4}{\'{ }}% 10426 1.1 mrg \DeclareUnicodeCharacter{00B5}{$\mu$}% 10427 1.1 mrg \DeclareUnicodeCharacter{00B6}{\P}% 10428 1.1 mrg \DeclareUnicodeCharacter{00B7}{\ensuremath\cdot}% 10429 1.1 mrg \DeclareUnicodeCharacter{00B8}{\cedilla{ }}% 10430 1.1 mrg \DeclareUnicodeCharacter{00B9}{$^1$}% 10431 1.1 mrg \DeclareUnicodeCharacter{00BA}{\ordm}% 10432 1.1 mrg \DeclareUnicodeCharacter{00BB}{\guillemetright{}}% 10433 1.1 mrg \DeclareUnicodeCharacter{00BC}{$1\over4$}% 10434 1.1 mrg \DeclareUnicodeCharacter{00BD}{$1\over2$}% 10435 1.1 mrg \DeclareUnicodeCharacter{00BE}{$3\over4$}% 10436 1.1 mrg \DeclareUnicodeCharacter{00BF}{\questiondown}% 10437 1.1 mrg % 10438 1.1 mrg \DeclareUnicodeCharacter{00C0}{\`A}% 10439 1.1 mrg \DeclareUnicodeCharacter{00C1}{\'A}% 10440 1.1 mrg \DeclareUnicodeCharacter{00C2}{\^A}% 10441 1.1 mrg \DeclareUnicodeCharacter{00C3}{\~A}% 10442 1.1 mrg \DeclareUnicodeCharacter{00C4}{\"A}% 10443 1.1 mrg \DeclareUnicodeCharacter{00C5}{\AA}% 10444 1.1 mrg \DeclareUnicodeCharacter{00C6}{\AE}% 10445 1.1 mrg \DeclareUnicodeCharacter{00C7}{\cedilla{C}}% 10446 1.1 mrg \DeclareUnicodeCharacter{00C8}{\`E}% 10447 1.1 mrg \DeclareUnicodeCharacter{00C9}{\'E}% 10448 1.1 mrg \DeclareUnicodeCharacter{00CA}{\^E}% 10449 1.1 mrg \DeclareUnicodeCharacter{00CB}{\"E}% 10450 1.1 mrg \DeclareUnicodeCharacter{00CC}{\`I}% 10451 1.1 mrg \DeclareUnicodeCharacter{00CD}{\'I}% 10452 1.1 mrg \DeclareUnicodeCharacter{00CE}{\^I}% 10453 1.1 mrg \DeclareUnicodeCharacter{00CF}{\"I}% 10454 1.1 mrg % 10455 1.1 mrg \DeclareUnicodeCharacter{00D0}{\DH}% 10456 1.1 mrg \DeclareUnicodeCharacter{00D1}{\~N}% 10457 1.1 mrg \DeclareUnicodeCharacter{00D2}{\`O}% 10458 1.1 mrg \DeclareUnicodeCharacter{00D3}{\'O}% 10459 1.1 mrg \DeclareUnicodeCharacter{00D4}{\^O}% 10460 1.1 mrg \DeclareUnicodeCharacter{00D5}{\~O}% 10461 1.1 mrg \DeclareUnicodeCharacter{00D6}{\"O}% 10462 1.1 mrg \DeclareUnicodeCharacter{00D7}{\ensuremath\times}% 10463 1.1 mrg \DeclareUnicodeCharacter{00D8}{\O}% 10464 1.1 mrg \DeclareUnicodeCharacter{00D9}{\`U}% 10465 1.1 mrg \DeclareUnicodeCharacter{00DA}{\'U}% 10466 1.1 mrg \DeclareUnicodeCharacter{00DB}{\^U}% 10467 1.1 mrg \DeclareUnicodeCharacter{00DC}{\"U}% 10468 1.1 mrg \DeclareUnicodeCharacter{00DD}{\'Y}% 10469 1.1 mrg \DeclareUnicodeCharacter{00DE}{\TH}% 10470 1.1 mrg \DeclareUnicodeCharacter{00DF}{\ss}% 10471 1.1 mrg % 10472 1.1 mrg \DeclareUnicodeCharacter{00E0}{\`a}% 10473 1.1 mrg \DeclareUnicodeCharacter{00E1}{\'a}% 10474 1.1 mrg \DeclareUnicodeCharacter{00E2}{\^a}% 10475 1.1 mrg \DeclareUnicodeCharacter{00E3}{\~a}% 10476 1.1 mrg \DeclareUnicodeCharacter{00E4}{\"a}% 10477 1.1 mrg \DeclareUnicodeCharacter{00E5}{\aa}% 10478 1.1 mrg \DeclareUnicodeCharacter{00E6}{\ae}% 10479 1.1 mrg \DeclareUnicodeCharacter{00E7}{\cedilla{c}}% 10480 1.1 mrg \DeclareUnicodeCharacter{00E8}{\`e}% 10481 1.1 mrg \DeclareUnicodeCharacter{00E9}{\'e}% 10482 1.1 mrg \DeclareUnicodeCharacter{00EA}{\^e}% 10483 1.1 mrg \DeclareUnicodeCharacter{00EB}{\"e}% 10484 1.1 mrg \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}% 10485 1.1 mrg \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}% 10486 1.1 mrg \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}% 10487 1.1 mrg \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}% 10488 1.1 mrg % 10489 1.1 mrg \DeclareUnicodeCharacter{00F0}{\dh}% 10490 1.1 mrg \DeclareUnicodeCharacter{00F1}{\~n}% 10491 1.1 mrg \DeclareUnicodeCharacter{00F2}{\`o}% 10492 1.1 mrg \DeclareUnicodeCharacter{00F3}{\'o}% 10493 1.1 mrg \DeclareUnicodeCharacter{00F4}{\^o}% 10494 1.1 mrg \DeclareUnicodeCharacter{00F5}{\~o}% 10495 1.1 mrg \DeclareUnicodeCharacter{00F6}{\"o}% 10496 1.1 mrg \DeclareUnicodeCharacter{00F7}{\ensuremath\div}% 10497 1.1 mrg \DeclareUnicodeCharacter{00F8}{\o}% 10498 1.1 mrg \DeclareUnicodeCharacter{00F9}{\`u}% 10499 1.1 mrg \DeclareUnicodeCharacter{00FA}{\'u}% 10500 1.1 mrg \DeclareUnicodeCharacter{00FB}{\^u}% 10501 1.1 mrg \DeclareUnicodeCharacter{00FC}{\"u}% 10502 1.1 mrg \DeclareUnicodeCharacter{00FD}{\'y}% 10503 1.1 mrg \DeclareUnicodeCharacter{00FE}{\th}% 10504 1.1 mrg \DeclareUnicodeCharacter{00FF}{\"y}% 10505 1.1 mrg % 10506 1.1 mrg \DeclareUnicodeCharacter{0100}{\=A}% 10507 1.1 mrg \DeclareUnicodeCharacter{0101}{\=a}% 10508 1.1 mrg \DeclareUnicodeCharacter{0102}{\u{A}}% 10509 1.1 mrg \DeclareUnicodeCharacter{0103}{\u{a}}% 10510 1.1 mrg \DeclareUnicodeCharacter{0104}{\ogonek{A}}% 10511 1.1 mrg \DeclareUnicodeCharacter{0105}{\ogonek{a}}% 10512 1.1 mrg \DeclareUnicodeCharacter{0106}{\'C}% 10513 1.1 mrg \DeclareUnicodeCharacter{0107}{\'c}% 10514 1.1 mrg \DeclareUnicodeCharacter{0108}{\^C}% 10515 1.1 mrg \DeclareUnicodeCharacter{0109}{\^c}% 10516 1.1 mrg \DeclareUnicodeCharacter{010A}{\dotaccent{C}}% 10517 1.1 mrg \DeclareUnicodeCharacter{010B}{\dotaccent{c}}% 10518 1.1 mrg \DeclareUnicodeCharacter{010C}{\v{C}}% 10519 1.1 mrg \DeclareUnicodeCharacter{010D}{\v{c}}% 10520 1.1 mrg \DeclareUnicodeCharacter{010E}{\v{D}}% 10521 1.1 mrg \DeclareUnicodeCharacter{010F}{d'}% 10522 1.1 mrg % 10523 1.1 mrg \DeclareUnicodeCharacter{0110}{\DH}% 10524 1.1 mrg \DeclareUnicodeCharacter{0111}{\dh}% 10525 1.1 mrg \DeclareUnicodeCharacter{0112}{\=E}% 10526 1.1 mrg \DeclareUnicodeCharacter{0113}{\=e}% 10527 1.1 mrg \DeclareUnicodeCharacter{0114}{\u{E}}% 10528 1.1 mrg \DeclareUnicodeCharacter{0115}{\u{e}}% 10529 1.1 mrg \DeclareUnicodeCharacter{0116}{\dotaccent{E}}% 10530 1.1 mrg \DeclareUnicodeCharacter{0117}{\dotaccent{e}}% 10531 1.1 mrg \DeclareUnicodeCharacter{0118}{\ogonek{E}}% 10532 1.1 mrg \DeclareUnicodeCharacter{0119}{\ogonek{e}}% 10533 1.1 mrg \DeclareUnicodeCharacter{011A}{\v{E}}% 10534 1.1 mrg \DeclareUnicodeCharacter{011B}{\v{e}}% 10535 1.1 mrg \DeclareUnicodeCharacter{011C}{\^G}% 10536 1.1 mrg \DeclareUnicodeCharacter{011D}{\^g}% 10537 1.1 mrg \DeclareUnicodeCharacter{011E}{\u{G}}% 10538 1.1 mrg \DeclareUnicodeCharacter{011F}{\u{g}}% 10539 1.1 mrg % 10540 1.1 mrg \DeclareUnicodeCharacter{0120}{\dotaccent{G}}% 10541 1.1 mrg \DeclareUnicodeCharacter{0121}{\dotaccent{g}}% 10542 1.1 mrg \DeclareUnicodeCharacter{0122}{\cedilla{G}}% 10543 1.1 mrg \DeclareUnicodeCharacter{0123}{\cedilla{g}}% 10544 1.1 mrg \DeclareUnicodeCharacter{0124}{\^H}% 10545 1.1 mrg \DeclareUnicodeCharacter{0125}{\^h}% 10546 1.1 mrg \DeclareUnicodeCharacter{0126}{\missingcharmsg{H WITH STROKE}}% 10547 1.1 mrg \DeclareUnicodeCharacter{0127}{\missingcharmsg{h WITH STROKE}}% 10548 1.1 mrg \DeclareUnicodeCharacter{0128}{\~I}% 10549 1.1 mrg \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}% 10550 1.1 mrg \DeclareUnicodeCharacter{012A}{\=I}% 10551 1.1 mrg \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}% 10552 1.1 mrg \DeclareUnicodeCharacter{012C}{\u{I}}% 10553 1.1 mrg \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}% 10554 1.1 mrg \DeclareUnicodeCharacter{012E}{\ogonek{I}}% 10555 1.1 mrg \DeclareUnicodeCharacter{012F}{\ogonek{i}}% 10556 1.1 mrg % 10557 1.1 mrg \DeclareUnicodeCharacter{0130}{\dotaccent{I}}% 10558 1.1 mrg \DeclareUnicodeCharacter{0131}{\dotless{i}}% 10559 1.1 mrg \DeclareUnicodeCharacter{0132}{IJ}% 10560 1.1 mrg \DeclareUnicodeCharacter{0133}{ij}% 10561 1.1 mrg \DeclareUnicodeCharacter{0134}{\^J}% 10562 1.1 mrg \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}% 10563 1.1 mrg \DeclareUnicodeCharacter{0136}{\cedilla{K}}% 10564 1.1 mrg \DeclareUnicodeCharacter{0137}{\cedilla{k}}% 10565 1.1 mrg \DeclareUnicodeCharacter{0138}{\ensuremath\kappa}% 10566 1.1 mrg \DeclareUnicodeCharacter{0139}{\'L}% 10567 1.1 mrg \DeclareUnicodeCharacter{013A}{\'l}% 10568 1.1 mrg \DeclareUnicodeCharacter{013B}{\cedilla{L}}% 10569 1.1 mrg \DeclareUnicodeCharacter{013C}{\cedilla{l}}% 10570 1.1 mrg \DeclareUnicodeCharacter{013D}{L'}% should kern 10571 1.1 mrg \DeclareUnicodeCharacter{013E}{l'}% should kern 10572 1.1 mrg \DeclareUnicodeCharacter{013F}{L\U{00B7}}% 10573 1.1 mrg % 10574 1.1 mrg \DeclareUnicodeCharacter{0140}{l\U{00B7}}% 10575 1.1 mrg \DeclareUnicodeCharacter{0141}{\L}% 10576 1.1 mrg \DeclareUnicodeCharacter{0142}{\l}% 10577 1.1 mrg \DeclareUnicodeCharacter{0143}{\'N}% 10578 1.1 mrg \DeclareUnicodeCharacter{0144}{\'n}% 10579 1.1 mrg \DeclareUnicodeCharacter{0145}{\cedilla{N}}% 10580 1.1 mrg \DeclareUnicodeCharacter{0146}{\cedilla{n}}% 10581 1.1 mrg \DeclareUnicodeCharacter{0147}{\v{N}}% 10582 1.1 mrg \DeclareUnicodeCharacter{0148}{\v{n}}% 10583 1.1 mrg \DeclareUnicodeCharacter{0149}{'n}% 10584 1.1 mrg \DeclareUnicodeCharacter{014A}{\missingcharmsg{ENG}}% 10585 1.1 mrg \DeclareUnicodeCharacter{014B}{\missingcharmsg{eng}}% 10586 1.1 mrg \DeclareUnicodeCharacter{014C}{\=O}% 10587 1.1 mrg \DeclareUnicodeCharacter{014D}{\=o}% 10588 1.1 mrg \DeclareUnicodeCharacter{014E}{\u{O}}% 10589 1.1 mrg \DeclareUnicodeCharacter{014F}{\u{o}}% 10590 1.1 mrg % 10591 1.1 mrg \DeclareUnicodeCharacter{0150}{\H{O}}% 10592 1.1 mrg \DeclareUnicodeCharacter{0151}{\H{o}}% 10593 1.1 mrg \DeclareUnicodeCharacter{0152}{\OE}% 10594 1.1 mrg \DeclareUnicodeCharacter{0153}{\oe}% 10595 1.1 mrg \DeclareUnicodeCharacter{0154}{\'R}% 10596 1.1 mrg \DeclareUnicodeCharacter{0155}{\'r}% 10597 1.1 mrg \DeclareUnicodeCharacter{0156}{\cedilla{R}}% 10598 1.1 mrg \DeclareUnicodeCharacter{0157}{\cedilla{r}}% 10599 1.1 mrg \DeclareUnicodeCharacter{0158}{\v{R}}% 10600 1.1 mrg \DeclareUnicodeCharacter{0159}{\v{r}}% 10601 1.1 mrg \DeclareUnicodeCharacter{015A}{\'S}% 10602 1.1 mrg \DeclareUnicodeCharacter{015B}{\'s}% 10603 1.1 mrg \DeclareUnicodeCharacter{015C}{\^S}% 10604 1.1 mrg \DeclareUnicodeCharacter{015D}{\^s}% 10605 1.1 mrg \DeclareUnicodeCharacter{015E}{\cedilla{S}}% 10606 1.1 mrg \DeclareUnicodeCharacter{015F}{\cedilla{s}}% 10607 1.1 mrg % 10608 1.1 mrg \DeclareUnicodeCharacter{0160}{\v{S}}% 10609 1.1 mrg \DeclareUnicodeCharacter{0161}{\v{s}}% 10610 1.1 mrg \DeclareUnicodeCharacter{0162}{\cedilla{T}}% 10611 1.1 mrg \DeclareUnicodeCharacter{0163}{\cedilla{t}}% 10612 1.1 mrg \DeclareUnicodeCharacter{0164}{\v{T}}% 10613 1.1 mrg \DeclareUnicodeCharacter{0165}{\v{t}}% 10614 1.1 mrg \DeclareUnicodeCharacter{0166}{\missingcharmsg{H WITH STROKE}}% 10615 1.1 mrg \DeclareUnicodeCharacter{0167}{\missingcharmsg{h WITH STROKE}}% 10616 1.1 mrg \DeclareUnicodeCharacter{0168}{\~U}% 10617 1.1 mrg \DeclareUnicodeCharacter{0169}{\~u}% 10618 1.1 mrg \DeclareUnicodeCharacter{016A}{\=U}% 10619 1.1 mrg \DeclareUnicodeCharacter{016B}{\=u}% 10620 1.1 mrg \DeclareUnicodeCharacter{016C}{\u{U}}% 10621 1.1 mrg \DeclareUnicodeCharacter{016D}{\u{u}}% 10622 1.1 mrg \DeclareUnicodeCharacter{016E}{\ringaccent{U}}% 10623 1.1 mrg \DeclareUnicodeCharacter{016F}{\ringaccent{u}}% 10624 1.1 mrg % 10625 1.1 mrg \DeclareUnicodeCharacter{0170}{\H{U}}% 10626 1.1 mrg \DeclareUnicodeCharacter{0171}{\H{u}}% 10627 1.1 mrg \DeclareUnicodeCharacter{0172}{\ogonek{U}}% 10628 1.1 mrg \DeclareUnicodeCharacter{0173}{\ogonek{u}}% 10629 1.1 mrg \DeclareUnicodeCharacter{0174}{\^W}% 10630 1.1 mrg \DeclareUnicodeCharacter{0175}{\^w}% 10631 1.1 mrg \DeclareUnicodeCharacter{0176}{\^Y}% 10632 1.1 mrg \DeclareUnicodeCharacter{0177}{\^y}% 10633 1.1 mrg \DeclareUnicodeCharacter{0178}{\"Y}% 10634 1.1 mrg \DeclareUnicodeCharacter{0179}{\'Z}% 10635 1.1 mrg \DeclareUnicodeCharacter{017A}{\'z}% 10636 1.1 mrg \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}% 10637 1.1 mrg \DeclareUnicodeCharacter{017C}{\dotaccent{z}}% 10638 1.1 mrg \DeclareUnicodeCharacter{017D}{\v{Z}}% 10639 1.1 mrg \DeclareUnicodeCharacter{017E}{\v{z}}% 10640 1.1 mrg \DeclareUnicodeCharacter{017F}{\missingcharmsg{LONG S}}% 10641 1.1 mrg % 10642 1.1 mrg \DeclareUnicodeCharacter{01C4}{D\v{Z}}% 10643 1.1 mrg \DeclareUnicodeCharacter{01C5}{D\v{z}}% 10644 1.1 mrg \DeclareUnicodeCharacter{01C6}{d\v{z}}% 10645 1.1 mrg \DeclareUnicodeCharacter{01C7}{LJ}% 10646 1.1 mrg \DeclareUnicodeCharacter{01C8}{Lj}% 10647 1.1 mrg \DeclareUnicodeCharacter{01C9}{lj}% 10648 1.1 mrg \DeclareUnicodeCharacter{01CA}{NJ}% 10649 1.1 mrg \DeclareUnicodeCharacter{01CB}{Nj}% 10650 1.1 mrg \DeclareUnicodeCharacter{01CC}{nj}% 10651 1.1 mrg \DeclareUnicodeCharacter{01CD}{\v{A}}% 10652 1.1 mrg \DeclareUnicodeCharacter{01CE}{\v{a}}% 10653 1.1 mrg \DeclareUnicodeCharacter{01CF}{\v{I}}% 10654 1.1 mrg % 10655 1.1 mrg \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}% 10656 1.1 mrg \DeclareUnicodeCharacter{01D1}{\v{O}}% 10657 1.1 mrg \DeclareUnicodeCharacter{01D2}{\v{o}}% 10658 1.1 mrg \DeclareUnicodeCharacter{01D3}{\v{U}}% 10659 1.1 mrg \DeclareUnicodeCharacter{01D4}{\v{u}}% 10660 1.1 mrg % 10661 1.1 mrg \DeclareUnicodeCharacter{01E2}{\={\AE}}% 10662 1.1 mrg \DeclareUnicodeCharacter{01E3}{\={\ae}}% 10663 1.1 mrg \DeclareUnicodeCharacter{01E6}{\v{G}}% 10664 1.1 mrg \DeclareUnicodeCharacter{01E7}{\v{g}}% 10665 1.1 mrg \DeclareUnicodeCharacter{01E8}{\v{K}}% 10666 1.1 mrg \DeclareUnicodeCharacter{01E9}{\v{k}}% 10667 1.1 mrg % 10668 1.1 mrg \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}% 10669 1.1 mrg \DeclareUnicodeCharacter{01F1}{DZ}% 10670 1.1 mrg \DeclareUnicodeCharacter{01F2}{Dz}% 10671 1.1 mrg \DeclareUnicodeCharacter{01F3}{dz}% 10672 1.1 mrg \DeclareUnicodeCharacter{01F4}{\'G}% 10673 1.1 mrg \DeclareUnicodeCharacter{01F5}{\'g}% 10674 1.1 mrg \DeclareUnicodeCharacter{01F8}{\`N}% 10675 1.1 mrg \DeclareUnicodeCharacter{01F9}{\`n}% 10676 1.1 mrg \DeclareUnicodeCharacter{01FC}{\'{\AE}}% 10677 1.1 mrg \DeclareUnicodeCharacter{01FD}{\'{\ae}}% 10678 1.1 mrg \DeclareUnicodeCharacter{01FE}{\'{\O}}% 10679 1.1 mrg \DeclareUnicodeCharacter{01FF}{\'{\o}}% 10680 1.1 mrg % 10681 1.1 mrg \DeclareUnicodeCharacter{021E}{\v{H}}% 10682 1.1 mrg \DeclareUnicodeCharacter{021F}{\v{h}}% 10683 1.1 mrg % 10684 1.1 mrg \DeclareUnicodeCharacter{0226}{\dotaccent{A}}% 10685 1.1 mrg \DeclareUnicodeCharacter{0227}{\dotaccent{a}}% 10686 1.1 mrg \DeclareUnicodeCharacter{0228}{\cedilla{E}}% 10687 1.1 mrg \DeclareUnicodeCharacter{0229}{\cedilla{e}}% 10688 1.1 mrg \DeclareUnicodeCharacter{022E}{\dotaccent{O}}% 10689 1.1 mrg \DeclareUnicodeCharacter{022F}{\dotaccent{o}}% 10690 1.1 mrg % 10691 1.1 mrg \DeclareUnicodeCharacter{0232}{\=Y}% 10692 1.1 mrg \DeclareUnicodeCharacter{0233}{\=y}% 10693 1.1 mrg \DeclareUnicodeCharacter{0237}{\dotless{j}}% 10694 1.1.1.2 mrg % 10695 1.1.1.2 mrg \DeclareUnicodeCharacter{02BC}{'}% 10696 1.1 mrg % 10697 1.1 mrg \DeclareUnicodeCharacter{02DB}{\ogonek{ }}% 10698 1.1 mrg % 10699 1.1 mrg % Greek letters upper case 10700 1.1 mrg \DeclareUnicodeCharacter{0391}{{\it A}}% 10701 1.1 mrg \DeclareUnicodeCharacter{0392}{{\it B}}% 10702 1.1 mrg \DeclareUnicodeCharacter{0393}{\ensuremath{\mit\Gamma}}% 10703 1.1 mrg \DeclareUnicodeCharacter{0394}{\ensuremath{\mit\Delta}}% 10704 1.1 mrg \DeclareUnicodeCharacter{0395}{{\it E}}% 10705 1.1 mrg \DeclareUnicodeCharacter{0396}{{\it Z}}% 10706 1.1 mrg \DeclareUnicodeCharacter{0397}{{\it H}}% 10707 1.1 mrg \DeclareUnicodeCharacter{0398}{\ensuremath{\mit\Theta}}% 10708 1.1 mrg \DeclareUnicodeCharacter{0399}{{\it I}}% 10709 1.1 mrg \DeclareUnicodeCharacter{039A}{{\it K}}% 10710 1.1 mrg \DeclareUnicodeCharacter{039B}{\ensuremath{\mit\Lambda}}% 10711 1.1 mrg \DeclareUnicodeCharacter{039C}{{\it M}}% 10712 1.1 mrg \DeclareUnicodeCharacter{039D}{{\it N}}% 10713 1.1 mrg \DeclareUnicodeCharacter{039E}{\ensuremath{\mit\Xi}}% 10714 1.1 mrg \DeclareUnicodeCharacter{039F}{{\it O}}% 10715 1.1 mrg \DeclareUnicodeCharacter{03A0}{\ensuremath{\mit\Pi}}% 10716 1.1 mrg \DeclareUnicodeCharacter{03A1}{{\it P}}% 10717 1.1 mrg %\DeclareUnicodeCharacter{03A2}{} % none - corresponds to final sigma 10718 1.1 mrg \DeclareUnicodeCharacter{03A3}{\ensuremath{\mit\Sigma}}% 10719 1.1 mrg \DeclareUnicodeCharacter{03A4}{{\it T}}% 10720 1.1 mrg \DeclareUnicodeCharacter{03A5}{\ensuremath{\mit\Upsilon}}% 10721 1.1 mrg \DeclareUnicodeCharacter{03A6}{\ensuremath{\mit\Phi}}% 10722 1.1 mrg \DeclareUnicodeCharacter{03A7}{{\it X}}% 10723 1.1 mrg \DeclareUnicodeCharacter{03A8}{\ensuremath{\mit\Psi}}% 10724 1.1 mrg \DeclareUnicodeCharacter{03A9}{\ensuremath{\mit\Omega}}% 10725 1.1 mrg % 10726 1.1 mrg % Vowels with accents 10727 1.1 mrg \DeclareUnicodeCharacter{0390}{\ensuremath{\ddot{\acute\iota}}}% 10728 1.1 mrg \DeclareUnicodeCharacter{03AC}{\ensuremath{\acute\alpha}}% 10729 1.1 mrg \DeclareUnicodeCharacter{03AD}{\ensuremath{\acute\epsilon}}% 10730 1.1 mrg \DeclareUnicodeCharacter{03AE}{\ensuremath{\acute\eta}}% 10731 1.1 mrg \DeclareUnicodeCharacter{03AF}{\ensuremath{\acute\iota}}% 10732 1.1 mrg \DeclareUnicodeCharacter{03B0}{\ensuremath{\acute{\ddot\upsilon}}}% 10733 1.1 mrg % 10734 1.1 mrg % Standalone accent 10735 1.1 mrg \DeclareUnicodeCharacter{0384}{\ensuremath{\acute{\ }}}% 10736 1.1 mrg % 10737 1.1 mrg % Greek letters lower case 10738 1.1 mrg \DeclareUnicodeCharacter{03B1}{\ensuremath\alpha}% 10739 1.1 mrg \DeclareUnicodeCharacter{03B2}{\ensuremath\beta}% 10740 1.1 mrg \DeclareUnicodeCharacter{03B3}{\ensuremath\gamma}% 10741 1.1 mrg \DeclareUnicodeCharacter{03B4}{\ensuremath\delta}% 10742 1.1 mrg \DeclareUnicodeCharacter{03B5}{\ensuremath\epsilon}% 10743 1.1 mrg \DeclareUnicodeCharacter{03B6}{\ensuremath\zeta}% 10744 1.1 mrg \DeclareUnicodeCharacter{03B7}{\ensuremath\eta}% 10745 1.1 mrg \DeclareUnicodeCharacter{03B8}{\ensuremath\theta}% 10746 1.1 mrg \DeclareUnicodeCharacter{03B9}{\ensuremath\iota}% 10747 1.1 mrg \DeclareUnicodeCharacter{03BA}{\ensuremath\kappa}% 10748 1.1 mrg \DeclareUnicodeCharacter{03BB}{\ensuremath\lambda}% 10749 1.1 mrg \DeclareUnicodeCharacter{03BC}{\ensuremath\mu}% 10750 1.1 mrg \DeclareUnicodeCharacter{03BD}{\ensuremath\nu}% 10751 1.1 mrg \DeclareUnicodeCharacter{03BE}{\ensuremath\xi}% 10752 1.1 mrg \DeclareUnicodeCharacter{03BF}{{\it o}}% omicron 10753 1.1 mrg \DeclareUnicodeCharacter{03C0}{\ensuremath\pi}% 10754 1.1 mrg \DeclareUnicodeCharacter{03C1}{\ensuremath\rho}% 10755 1.1 mrg \DeclareUnicodeCharacter{03C2}{\ensuremath\varsigma}% 10756 1.1 mrg \DeclareUnicodeCharacter{03C3}{\ensuremath\sigma}% 10757 1.1 mrg \DeclareUnicodeCharacter{03C4}{\ensuremath\tau}% 10758 1.1 mrg \DeclareUnicodeCharacter{03C5}{\ensuremath\upsilon}% 10759 1.1 mrg \DeclareUnicodeCharacter{03C6}{\ensuremath\phi}% 10760 1.1 mrg \DeclareUnicodeCharacter{03C7}{\ensuremath\chi}% 10761 1.1 mrg \DeclareUnicodeCharacter{03C8}{\ensuremath\psi}% 10762 1.1 mrg \DeclareUnicodeCharacter{03C9}{\ensuremath\omega}% 10763 1.1 mrg % 10764 1.1 mrg % More Greek vowels with accents 10765 1.1 mrg \DeclareUnicodeCharacter{03CA}{\ensuremath{\ddot\iota}}% 10766 1.1 mrg \DeclareUnicodeCharacter{03CB}{\ensuremath{\ddot\upsilon}}% 10767 1.1 mrg \DeclareUnicodeCharacter{03CC}{\ensuremath{\acute o}}% 10768 1.1 mrg \DeclareUnicodeCharacter{03CD}{\ensuremath{\acute\upsilon}}% 10769 1.1 mrg \DeclareUnicodeCharacter{03CE}{\ensuremath{\acute\omega}}% 10770 1.1 mrg % 10771 1.1 mrg % Variant Greek letters 10772 1.1 mrg \DeclareUnicodeCharacter{03D1}{\ensuremath\vartheta}% 10773 1.1 mrg \DeclareUnicodeCharacter{03D6}{\ensuremath\varpi}% 10774 1.1 mrg \DeclareUnicodeCharacter{03F1}{\ensuremath\varrho}% 10775 1.1 mrg % 10776 1.1 mrg \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}% 10777 1.1 mrg \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}% 10778 1.1 mrg \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}% 10779 1.1 mrg \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}% 10780 1.1 mrg \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}% 10781 1.1 mrg \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}% 10782 1.1 mrg \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}% 10783 1.1 mrg \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}% 10784 1.1 mrg \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}% 10785 1.1 mrg \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}% 10786 1.1 mrg \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}% 10787 1.1 mrg \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}% 10788 1.1 mrg % 10789 1.1 mrg \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}% 10790 1.1 mrg \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}% 10791 1.1 mrg % 10792 1.1 mrg \DeclareUnicodeCharacter{1E20}{\=G}% 10793 1.1 mrg \DeclareUnicodeCharacter{1E21}{\=g}% 10794 1.1 mrg \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}% 10795 1.1 mrg \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}% 10796 1.1 mrg \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}% 10797 1.1 mrg \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}% 10798 1.1 mrg \DeclareUnicodeCharacter{1E26}{\"H}% 10799 1.1 mrg \DeclareUnicodeCharacter{1E27}{\"h}% 10800 1.1 mrg % 10801 1.1 mrg \DeclareUnicodeCharacter{1E30}{\'K}% 10802 1.1 mrg \DeclareUnicodeCharacter{1E31}{\'k}% 10803 1.1 mrg \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}% 10804 1.1 mrg \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}% 10805 1.1 mrg \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}% 10806 1.1 mrg \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}% 10807 1.1 mrg \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}% 10808 1.1 mrg \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}% 10809 1.1 mrg \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}% 10810 1.1 mrg \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}% 10811 1.1 mrg \DeclareUnicodeCharacter{1E3E}{\'M}% 10812 1.1 mrg \DeclareUnicodeCharacter{1E3F}{\'m}% 10813 1.1 mrg % 10814 1.1 mrg \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}% 10815 1.1 mrg \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}% 10816 1.1 mrg \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}% 10817 1.1 mrg \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}% 10818 1.1 mrg \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}% 10819 1.1 mrg \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}% 10820 1.1 mrg \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}% 10821 1.1 mrg \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}% 10822 1.1 mrg \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}% 10823 1.1 mrg \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}% 10824 1.1 mrg % 10825 1.1 mrg \DeclareUnicodeCharacter{1E54}{\'P}% 10826 1.1 mrg \DeclareUnicodeCharacter{1E55}{\'p}% 10827 1.1 mrg \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}% 10828 1.1 mrg \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}% 10829 1.1 mrg \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}% 10830 1.1 mrg \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}% 10831 1.1 mrg \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}% 10832 1.1 mrg \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}% 10833 1.1 mrg \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}% 10834 1.1 mrg \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}% 10835 1.1 mrg % 10836 1.1 mrg \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}% 10837 1.1 mrg \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}% 10838 1.1 mrg \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}% 10839 1.1 mrg \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}% 10840 1.1 mrg \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}% 10841 1.1 mrg \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}% 10842 1.1 mrg \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}% 10843 1.1 mrg \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}% 10844 1.1 mrg \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}% 10845 1.1 mrg \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}% 10846 1.1 mrg % 10847 1.1 mrg \DeclareUnicodeCharacter{1E7C}{\~V}% 10848 1.1 mrg \DeclareUnicodeCharacter{1E7D}{\~v}% 10849 1.1 mrg \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}% 10850 1.1 mrg \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}% 10851 1.1 mrg % 10852 1.1 mrg \DeclareUnicodeCharacter{1E80}{\`W}% 10853 1.1 mrg \DeclareUnicodeCharacter{1E81}{\`w}% 10854 1.1 mrg \DeclareUnicodeCharacter{1E82}{\'W}% 10855 1.1 mrg \DeclareUnicodeCharacter{1E83}{\'w}% 10856 1.1 mrg \DeclareUnicodeCharacter{1E84}{\"W}% 10857 1.1 mrg \DeclareUnicodeCharacter{1E85}{\"w}% 10858 1.1 mrg \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}% 10859 1.1 mrg \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}% 10860 1.1 mrg \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}% 10861 1.1 mrg \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}% 10862 1.1 mrg \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}% 10863 1.1 mrg \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}% 10864 1.1 mrg \DeclareUnicodeCharacter{1E8C}{\"X}% 10865 1.1 mrg \DeclareUnicodeCharacter{1E8D}{\"x}% 10866 1.1 mrg \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}% 10867 1.1 mrg \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}% 10868 1.1 mrg % 10869 1.1 mrg \DeclareUnicodeCharacter{1E90}{\^Z}% 10870 1.1 mrg \DeclareUnicodeCharacter{1E91}{\^z}% 10871 1.1 mrg \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}% 10872 1.1 mrg \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}% 10873 1.1 mrg \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}% 10874 1.1 mrg \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}% 10875 1.1 mrg \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}% 10876 1.1 mrg \DeclareUnicodeCharacter{1E97}{\"t}% 10877 1.1 mrg \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}% 10878 1.1 mrg \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}% 10879 1.1 mrg % 10880 1.1 mrg \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}% 10881 1.1 mrg \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}% 10882 1.1 mrg % 10883 1.1 mrg \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}% 10884 1.1 mrg \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}% 10885 1.1 mrg \DeclareUnicodeCharacter{1EBC}{\~E}% 10886 1.1 mrg \DeclareUnicodeCharacter{1EBD}{\~e}% 10887 1.1 mrg % 10888 1.1 mrg \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}% 10889 1.1 mrg \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}% 10890 1.1 mrg \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}% 10891 1.1 mrg \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}% 10892 1.1 mrg % 10893 1.1 mrg \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}% 10894 1.1 mrg \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}% 10895 1.1 mrg % 10896 1.1 mrg \DeclareUnicodeCharacter{1EF2}{\`Y}% 10897 1.1 mrg \DeclareUnicodeCharacter{1EF3}{\`y}% 10898 1.1 mrg \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}% 10899 1.1 mrg % 10900 1.1 mrg \DeclareUnicodeCharacter{1EF8}{\~Y}% 10901 1.1 mrg \DeclareUnicodeCharacter{1EF9}{\~y}% 10902 1.1 mrg % 10903 1.1 mrg % Punctuation 10904 1.1 mrg \DeclareUnicodeCharacter{2013}{--}% 10905 1.1 mrg \DeclareUnicodeCharacter{2014}{---}% 10906 1.1 mrg \DeclareUnicodeCharacter{2018}{\quoteleft{}}% 10907 1.1 mrg \DeclareUnicodeCharacter{2019}{\quoteright{}}% 10908 1.1 mrg \DeclareUnicodeCharacter{201A}{\quotesinglbase{}}% 10909 1.1 mrg \DeclareUnicodeCharacter{201C}{\quotedblleft{}}% 10910 1.1 mrg \DeclareUnicodeCharacter{201D}{\quotedblright{}}% 10911 1.1 mrg \DeclareUnicodeCharacter{201E}{\quotedblbase{}}% 10912 1.1 mrg \DeclareUnicodeCharacter{2020}{\ensuremath\dagger}% 10913 1.1 mrg \DeclareUnicodeCharacter{2021}{\ensuremath\ddagger}% 10914 1.1 mrg \DeclareUnicodeCharacter{2022}{\bullet{}}% 10915 1.1 mrg \DeclareUnicodeCharacter{202F}{\thinspace}% 10916 1.1 mrg \DeclareUnicodeCharacter{2026}{\dots{}}% 10917 1.1 mrg \DeclareUnicodeCharacter{2039}{\guilsinglleft{}}% 10918 1.1 mrg \DeclareUnicodeCharacter{203A}{\guilsinglright{}}% 10919 1.1 mrg % 10920 1.1 mrg \DeclareUnicodeCharacter{20AC}{\euro{}}% 10921 1.1 mrg % 10922 1.1 mrg \DeclareUnicodeCharacter{2192}{\expansion{}}% 10923 1.1 mrg \DeclareUnicodeCharacter{21D2}{\result{}}% 10924 1.1 mrg % 10925 1.1 mrg % Mathematical symbols 10926 1.1 mrg \DeclareUnicodeCharacter{2200}{\ensuremath\forall}% 10927 1.1 mrg \DeclareUnicodeCharacter{2203}{\ensuremath\exists}% 10928 1.1 mrg \DeclareUnicodeCharacter{2208}{\ensuremath\in}% 10929 1.1 mrg \DeclareUnicodeCharacter{2212}{\minus{}}% 10930 1.1 mrg \DeclareUnicodeCharacter{2217}{\ast}% 10931 1.1 mrg \DeclareUnicodeCharacter{221E}{\ensuremath\infty}% 10932 1.1 mrg \DeclareUnicodeCharacter{2225}{\ensuremath\parallel}% 10933 1.1 mrg \DeclareUnicodeCharacter{2227}{\ensuremath\wedge}% 10934 1.1 mrg \DeclareUnicodeCharacter{2229}{\ensuremath\cap}% 10935 1.1 mrg \DeclareUnicodeCharacter{2261}{\equiv{}}% 10936 1.1 mrg \DeclareUnicodeCharacter{2264}{\ensuremath\leq}% 10937 1.1 mrg \DeclareUnicodeCharacter{2265}{\ensuremath\geq}% 10938 1.1 mrg \DeclareUnicodeCharacter{2282}{\ensuremath\subset}% 10939 1.1 mrg \DeclareUnicodeCharacter{2287}{\ensuremath\supseteq}% 10940 1.1 mrg % 10941 1.1 mrg \DeclareUnicodeCharacter{2016}{\ensuremath\Vert}% 10942 1.1 mrg \DeclareUnicodeCharacter{2032}{\ensuremath\prime}% 10943 1.1 mrg \DeclareUnicodeCharacter{210F}{\ensuremath\hbar}% 10944 1.1 mrg \DeclareUnicodeCharacter{2111}{\ensuremath\Im}% 10945 1.1 mrg \DeclareUnicodeCharacter{2113}{\ensuremath\ell}% 10946 1.1 mrg \DeclareUnicodeCharacter{2118}{\ensuremath\wp}% 10947 1.1 mrg \DeclareUnicodeCharacter{211C}{\ensuremath\Re}% 10948 1.1 mrg \DeclareUnicodeCharacter{2135}{\ensuremath\aleph}% 10949 1.1 mrg \DeclareUnicodeCharacter{2190}{\ensuremath\leftarrow}% 10950 1.1 mrg \DeclareUnicodeCharacter{2191}{\ensuremath\uparrow}% 10951 1.1 mrg \DeclareUnicodeCharacter{2193}{\ensuremath\downarrow}% 10952 1.1 mrg \DeclareUnicodeCharacter{2194}{\ensuremath\leftrightarrow}% 10953 1.1 mrg \DeclareUnicodeCharacter{2195}{\ensuremath\updownarrow}% 10954 1.1 mrg \DeclareUnicodeCharacter{2196}{\ensuremath\nwarrow}% 10955 1.1 mrg \DeclareUnicodeCharacter{2197}{\ensuremath\nearrow}% 10956 1.1 mrg \DeclareUnicodeCharacter{2198}{\ensuremath\searrow}% 10957 1.1 mrg \DeclareUnicodeCharacter{2199}{\ensuremath\swarrow}% 10958 1.1 mrg \DeclareUnicodeCharacter{21A6}{\ensuremath\mapsto}% 10959 1.1 mrg \DeclareUnicodeCharacter{21A9}{\ensuremath\hookleftarrow}% 10960 1.1 mrg \DeclareUnicodeCharacter{21AA}{\ensuremath\hookrightarrow}% 10961 1.1 mrg \DeclareUnicodeCharacter{21BC}{\ensuremath\leftharpoonup}% 10962 1.1 mrg \DeclareUnicodeCharacter{21BD}{\ensuremath\leftharpoondown}% 10963 1.1 mrg \DeclareUnicodeCharacter{21C0}{\ensuremath\rightharpoonup}% 10964 1.1 mrg \DeclareUnicodeCharacter{21C1}{\ensuremath\rightharpoondown}% 10965 1.1 mrg \DeclareUnicodeCharacter{21CC}{\ensuremath\rightleftharpoons}% 10966 1.1 mrg \DeclareUnicodeCharacter{21D0}{\ensuremath\Leftarrow}% 10967 1.1 mrg \DeclareUnicodeCharacter{21D1}{\ensuremath\Uparrow}% 10968 1.1 mrg \DeclareUnicodeCharacter{21D3}{\ensuremath\Downarrow}% 10969 1.1 mrg \DeclareUnicodeCharacter{21D4}{\ensuremath\Leftrightarrow}% 10970 1.1 mrg \DeclareUnicodeCharacter{21D5}{\ensuremath\Updownarrow}% 10971 1.1 mrg \DeclareUnicodeCharacter{2202}{\ensuremath\partial}% 10972 1.1 mrg \DeclareUnicodeCharacter{2205}{\ensuremath\emptyset}% 10973 1.1 mrg \DeclareUnicodeCharacter{2207}{\ensuremath\nabla}% 10974 1.1 mrg \DeclareUnicodeCharacter{2209}{\ensuremath\notin}% 10975 1.1 mrg \DeclareUnicodeCharacter{220B}{\ensuremath\owns}% 10976 1.1 mrg \DeclareUnicodeCharacter{220F}{\ensuremath\prod}% 10977 1.1 mrg \DeclareUnicodeCharacter{2210}{\ensuremath\coprod}% 10978 1.1 mrg \DeclareUnicodeCharacter{2211}{\ensuremath\sum}% 10979 1.1 mrg \DeclareUnicodeCharacter{2213}{\ensuremath\mp}% 10980 1.1 mrg \DeclareUnicodeCharacter{2218}{\ensuremath\circ}% 10981 1.1 mrg \DeclareUnicodeCharacter{221A}{\ensuremath\surd}% 10982 1.1 mrg \DeclareUnicodeCharacter{221D}{\ensuremath\propto}% 10983 1.1 mrg \DeclareUnicodeCharacter{2220}{\ensuremath\angle}% 10984 1.1 mrg \DeclareUnicodeCharacter{2223}{\ensuremath\mid}% 10985 1.1 mrg \DeclareUnicodeCharacter{2228}{\ensuremath\vee}% 10986 1.1 mrg \DeclareUnicodeCharacter{222A}{\ensuremath\cup}% 10987 1.1 mrg \DeclareUnicodeCharacter{222B}{\ensuremath\smallint}% 10988 1.1 mrg \DeclareUnicodeCharacter{222E}{\ensuremath\oint}% 10989 1.1 mrg \DeclareUnicodeCharacter{223C}{\ensuremath\sim}% 10990 1.1 mrg \DeclareUnicodeCharacter{2240}{\ensuremath\wr}% 10991 1.1 mrg \DeclareUnicodeCharacter{2243}{\ensuremath\simeq}% 10992 1.1 mrg \DeclareUnicodeCharacter{2245}{\ensuremath\cong}% 10993 1.1 mrg \DeclareUnicodeCharacter{2248}{\ensuremath\approx}% 10994 1.1 mrg \DeclareUnicodeCharacter{224D}{\ensuremath\asymp}% 10995 1.1 mrg \DeclareUnicodeCharacter{2250}{\ensuremath\doteq}% 10996 1.1 mrg \DeclareUnicodeCharacter{2260}{\ensuremath\neq}% 10997 1.1 mrg \DeclareUnicodeCharacter{226A}{\ensuremath\ll}% 10998 1.1 mrg \DeclareUnicodeCharacter{226B}{\ensuremath\gg}% 10999 1.1 mrg \DeclareUnicodeCharacter{227A}{\ensuremath\prec}% 11000 1.1 mrg \DeclareUnicodeCharacter{227B}{\ensuremath\succ}% 11001 1.1 mrg \DeclareUnicodeCharacter{2283}{\ensuremath\supset}% 11002 1.1 mrg \DeclareUnicodeCharacter{2286}{\ensuremath\subseteq}% 11003 1.1 mrg \DeclareUnicodeCharacter{228E}{\ensuremath\uplus}% 11004 1.1 mrg \DeclareUnicodeCharacter{2291}{\ensuremath\sqsubseteq}% 11005 1.1 mrg \DeclareUnicodeCharacter{2292}{\ensuremath\sqsupseteq}% 11006 1.1 mrg \DeclareUnicodeCharacter{2293}{\ensuremath\sqcap}% 11007 1.1 mrg \DeclareUnicodeCharacter{2294}{\ensuremath\sqcup}% 11008 1.1 mrg \DeclareUnicodeCharacter{2295}{\ensuremath\oplus}% 11009 1.1 mrg \DeclareUnicodeCharacter{2296}{\ensuremath\ominus}% 11010 1.1 mrg \DeclareUnicodeCharacter{2297}{\ensuremath\otimes}% 11011 1.1 mrg \DeclareUnicodeCharacter{2298}{\ensuremath\oslash}% 11012 1.1 mrg \DeclareUnicodeCharacter{2299}{\ensuremath\odot}% 11013 1.1 mrg \DeclareUnicodeCharacter{22A2}{\ensuremath\vdash}% 11014 1.1 mrg \DeclareUnicodeCharacter{22A3}{\ensuremath\dashv}% 11015 1.1 mrg \DeclareUnicodeCharacter{22A4}{\ensuremath\ptextop}% 11016 1.1 mrg \DeclareUnicodeCharacter{22A5}{\ensuremath\bot}% 11017 1.1 mrg \DeclareUnicodeCharacter{22A8}{\ensuremath\models}% 11018 1.1 mrg \DeclareUnicodeCharacter{22C0}{\ensuremath\bigwedge}% 11019 1.1 mrg \DeclareUnicodeCharacter{22C1}{\ensuremath\bigvee}% 11020 1.1 mrg \DeclareUnicodeCharacter{22C2}{\ensuremath\bigcap}% 11021 1.1 mrg \DeclareUnicodeCharacter{22C3}{\ensuremath\bigcup}% 11022 1.1 mrg \DeclareUnicodeCharacter{22C4}{\ensuremath\diamond}% 11023 1.1 mrg \DeclareUnicodeCharacter{22C5}{\ensuremath\cdot}% 11024 1.1 mrg \DeclareUnicodeCharacter{22C6}{\ensuremath\star}% 11025 1.1 mrg \DeclareUnicodeCharacter{22C8}{\ensuremath\bowtie}% 11026 1.1 mrg \DeclareUnicodeCharacter{2308}{\ensuremath\lceil}% 11027 1.1 mrg \DeclareUnicodeCharacter{2309}{\ensuremath\rceil}% 11028 1.1 mrg \DeclareUnicodeCharacter{230A}{\ensuremath\lfloor}% 11029 1.1 mrg \DeclareUnicodeCharacter{230B}{\ensuremath\rfloor}% 11030 1.1 mrg \DeclareUnicodeCharacter{2322}{\ensuremath\frown}% 11031 1.1 mrg \DeclareUnicodeCharacter{2323}{\ensuremath\smile}% 11032 1.1 mrg % 11033 1.1 mrg \DeclareUnicodeCharacter{25B3}{\ensuremath\triangle}% 11034 1.1 mrg \DeclareUnicodeCharacter{25B7}{\ensuremath\triangleright}% 11035 1.1 mrg \DeclareUnicodeCharacter{25BD}{\ensuremath\bigtriangledown}% 11036 1.1 mrg \DeclareUnicodeCharacter{25C1}{\ensuremath\triangleleft}% 11037 1.1 mrg \DeclareUnicodeCharacter{25C7}{\ensuremath\diamond}% 11038 1.1 mrg \DeclareUnicodeCharacter{2660}{\ensuremath\spadesuit}% 11039 1.1 mrg \DeclareUnicodeCharacter{2661}{\ensuremath\heartsuit}% 11040 1.1 mrg \DeclareUnicodeCharacter{2662}{\ensuremath\diamondsuit}% 11041 1.1 mrg \DeclareUnicodeCharacter{2663}{\ensuremath\clubsuit}% 11042 1.1 mrg \DeclareUnicodeCharacter{266D}{\ensuremath\flat}% 11043 1.1 mrg \DeclareUnicodeCharacter{266E}{\ensuremath\natural}% 11044 1.1 mrg \DeclareUnicodeCharacter{266F}{\ensuremath\sharp}% 11045 1.1 mrg \DeclareUnicodeCharacter{26AA}{\ensuremath\bigcirc}% 11046 1.1 mrg \DeclareUnicodeCharacter{27B9}{\ensuremath\rangle}% 11047 1.1 mrg \DeclareUnicodeCharacter{27C2}{\ensuremath\perp}% 11048 1.1 mrg \DeclareUnicodeCharacter{27E8}{\ensuremath\langle}% 11049 1.1 mrg \DeclareUnicodeCharacter{27F5}{\ensuremath\longleftarrow}% 11050 1.1 mrg \DeclareUnicodeCharacter{27F6}{\ensuremath\longrightarrow}% 11051 1.1 mrg \DeclareUnicodeCharacter{27F7}{\ensuremath\longleftrightarrow}% 11052 1.1 mrg \DeclareUnicodeCharacter{27FC}{\ensuremath\longmapsto}% 11053 1.1 mrg \DeclareUnicodeCharacter{29F5}{\ensuremath\setminus}% 11054 1.1 mrg \DeclareUnicodeCharacter{2A00}{\ensuremath\bigodot}% 11055 1.1 mrg \DeclareUnicodeCharacter{2A01}{\ensuremath\bigoplus}% 11056 1.1 mrg \DeclareUnicodeCharacter{2A02}{\ensuremath\bigotimes}% 11057 1.1 mrg \DeclareUnicodeCharacter{2A04}{\ensuremath\biguplus}% 11058 1.1 mrg \DeclareUnicodeCharacter{2A06}{\ensuremath\bigsqcup}% 11059 1.1 mrg \DeclareUnicodeCharacter{2A3F}{\ensuremath\amalg}% 11060 1.1 mrg \DeclareUnicodeCharacter{2AAF}{\ensuremath\preceq}% 11061 1.1 mrg \DeclareUnicodeCharacter{2AB0}{\ensuremath\succeq}% 11062 1.1 mrg % 11063 1.1 mrg \global\mathchardef\checkmark="1370% actually the square root sign 11064 1.1 mrg \DeclareUnicodeCharacter{2713}{\ensuremath\checkmark}% 11065 1.1 mrg }% end of \unicodechardefs 11066 1.1 mrg 11067 1.1 mrg % UTF-8 byte sequence (pdfTeX) definitions (replacing and @U command) 11068 1.1 mrg % It makes the setting that replace UTF-8 byte sequence. 11069 1.1 mrg \def\utfeightchardefs{% 11070 1.1 mrg \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterUTFviii 11071 1.1 mrg \unicodechardefs 11072 1.1 mrg } 11073 1.1 mrg 11074 1.1 mrg % Whether the active definitions of non-ASCII characters expand to 11075 1.1 mrg % non-active tokens with the same character code. This is used to 11076 1.1 mrg % write characters literally, instead of using active definitions for 11077 1.1 mrg % printing the correct glyphs. 11078 1.1 mrg \newif\ifpassthroughchars 11079 1.1 mrg \passthroughcharsfalse 11080 1.1 mrg 11081 1.1 mrg % For native Unicode handling (XeTeX and LuaTeX), 11082 1.1 mrg % provide a definition macro to replace/pass-through a Unicode character 11083 1.1 mrg % 11084 1.1 mrg \def\DeclareUnicodeCharacterNative#1#2{% 11085 1.1 mrg \catcode"#1=\active 11086 1.1 mrg \def\dodeclareunicodecharacternative##1##2##3{% 11087 1.1 mrg \begingroup 11088 1.1 mrg \uccode`\~="##2\relax 11089 1.1 mrg \uppercase{\gdef~}{% 11090 1.1 mrg \ifpassthroughchars 11091 1.1 mrg ##1% 11092 1.1 mrg \else 11093 1.1 mrg ##3% 11094 1.1 mrg \fi 11095 1.1 mrg } 11096 1.1 mrg \endgroup 11097 1.1 mrg } 11098 1.1 mrg \begingroup 11099 1.1 mrg \uccode`\.="#1\relax 11100 1.1 mrg \uppercase{\def\UTFNativeTmp{.}}% 11101 1.1 mrg \expandafter\dodeclareunicodecharacternative\UTFNativeTmp{#1}{#2}% 11102 1.1 mrg \endgroup 11103 1.1 mrg } 11104 1.1 mrg 11105 1.1 mrg % Native Unicode handling (XeTeX and LuaTeX) character replacing definition. 11106 1.1 mrg % It activates the setting that replaces Unicode characters. 11107 1.1 mrg \def\nativeunicodechardefs{% 11108 1.1 mrg \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNative 11109 1.1 mrg \unicodechardefs 11110 1.1 mrg } 11111 1.1 mrg 11112 1.1 mrg % For native Unicode handling (XeTeX and LuaTeX), 11113 1.1 mrg % make the character token expand 11114 1.1 mrg % to the sequences given in \unicodechardefs for printing. 11115 1.1 mrg \def\DeclareUnicodeCharacterNativeAtU#1#2{% 11116 1.1 mrg \def\UTFAtUTmp{#2} 11117 1.1 mrg \expandafter\globallet\csname uni:#1\endcsname \UTFAtUTmp 11118 1.1 mrg } 11119 1.1 mrg 11120 1.1 mrg % @U command definitions for native Unicode handling (XeTeX and LuaTeX). 11121 1.1 mrg \def\nativeunicodechardefsatu{% 11122 1.1 mrg \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNativeAtU 11123 1.1 mrg \unicodechardefs 11124 1.1 mrg } 11125 1.1 mrg 11126 1.1 mrg % US-ASCII character definitions. 11127 1.1 mrg \def\asciichardefs{% nothing need be done 11128 1.1 mrg \relax 11129 1.1 mrg } 11130 1.1 mrg 11131 1.1 mrg % Define all Unicode characters we know about. This makes UTF-8 the default 11132 1.1 mrg % input encoding and allows @U to work. 11133 1.1 mrg \iftxinativeunicodecapable 11134 1.1 mrg \nativeunicodechardefsatu 11135 1.1 mrg \else 11136 1.1 mrg \utfeightchardefs 11137 1.1 mrg \fi 11138 1.1 mrg 11139 1.1 mrg \message{formatting,} 11140 1.1 mrg 11141 1.1 mrg \newdimen\defaultparindent \defaultparindent = 15pt 11142 1.1 mrg 11143 1.1 mrg \chapheadingskip = 15pt plus 4pt minus 2pt 11144 1.1 mrg \secheadingskip = 12pt plus 3pt minus 2pt 11145 1.1 mrg \subsecheadingskip = 9pt plus 2pt minus 2pt 11146 1.1 mrg 11147 1.1 mrg % Prevent underfull vbox error messages. 11148 1.1 mrg \vbadness = 10000 11149 1.1 mrg 11150 1.1 mrg % Don't be very finicky about underfull hboxes, either. 11151 1.1 mrg \hbadness = 6666 11152 1.1 mrg 11153 1.1 mrg % Following George Bush, get rid of widows and orphans. 11154 1.1 mrg \widowpenalty=10000 11155 1.1 mrg \clubpenalty=10000 11156 1.1 mrg 11157 1.1 mrg % Use TeX 3.0's \emergencystretch to help line breaking, but if we're 11158 1.1 mrg % using an old version of TeX, don't do anything. We want the amount of 11159 1.1 mrg % stretch added to depend on the line length, hence the dependence on 11160 1.1 mrg % \hsize. We call this whenever the paper size is set. 11161 1.1 mrg % 11162 1.1 mrg \def\setemergencystretch{% 11163 1.1 mrg \ifx\emergencystretch\thisisundefined 11164 1.1 mrg % Allow us to assign to \emergencystretch anyway. 11165 1.1 mrg \def\emergencystretch{\dimen0}% 11166 1.1 mrg \else 11167 1.1 mrg \emergencystretch = .15\hsize 11168 1.1 mrg \fi 11169 1.1 mrg } 11170 1.1 mrg 11171 1.1 mrg % Parameters in order: 1) textheight; 2) textwidth; 11172 1.1 mrg % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip; 11173 1.1 mrg % 7) physical page height; 8) physical page width. 11174 1.1 mrg % 11175 1.1 mrg % We also call \setleading{\textleading}, so the caller should define 11176 1.1 mrg % \textleading. The caller should also set \parskip. 11177 1.1 mrg % 11178 1.1 mrg \def\internalpagesizes#1#2#3#4#5#6#7#8{% 11179 1.1 mrg \voffset = #3\relax 11180 1.1 mrg \topskip = #6\relax 11181 1.1 mrg \splittopskip = \topskip 11182 1.1 mrg % 11183 1.1 mrg \vsize = #1\relax 11184 1.1 mrg \advance\vsize by \topskip 11185 1.1 mrg \outervsize = \vsize 11186 1.1 mrg \advance\outervsize by 2\topandbottommargin 11187 1.1 mrg \txipageheight = \vsize 11188 1.1 mrg % 11189 1.1 mrg \hsize = #2\relax 11190 1.1 mrg \outerhsize = \hsize 11191 1.1 mrg \advance\outerhsize by 0.5in 11192 1.1 mrg \txipagewidth = \hsize 11193 1.1 mrg % 11194 1.1 mrg \normaloffset = #4\relax 11195 1.1 mrg \bindingoffset = #5\relax 11196 1.1 mrg % 11197 1.1 mrg \ifpdf 11198 1.1 mrg \pdfpageheight #7\relax 11199 1.1 mrg \pdfpagewidth #8\relax 11200 1.1 mrg % if we don't reset these, they will remain at "1 true in" of 11201 1.1 mrg % whatever layout pdftex was dumped with. 11202 1.1 mrg \pdfhorigin = 1 true in 11203 1.1 mrg \pdfvorigin = 1 true in 11204 1.1 mrg \else 11205 1.1 mrg \ifx\XeTeXrevision\thisisundefined 11206 1.1 mrg \special{papersize=#8,#7}% 11207 1.1 mrg \else 11208 1.1 mrg \pdfpageheight #7\relax 11209 1.1 mrg \pdfpagewidth #8\relax 11210 1.1 mrg % XeTeX does not have \pdfhorigin and \pdfvorigin. 11211 1.1 mrg \fi 11212 1.1 mrg \fi 11213 1.1 mrg % 11214 1.1 mrg \setleading{\textleading} 11215 1.1 mrg % 11216 1.1 mrg \parindent = \defaultparindent 11217 1.1 mrg \setemergencystretch 11218 1.1 mrg } 11219 1.1 mrg 11220 1.1 mrg % @letterpaper (the default). 11221 1.1 mrg \def\letterpaper{{\globaldefs = 1 11222 1.1 mrg \parskip = 3pt plus 2pt minus 1pt 11223 1.1 mrg \textleading = 13.2pt 11224 1.1 mrg % 11225 1.1 mrg % If page is nothing but text, make it come out even. 11226 1.1 mrg \internalpagesizes{607.2pt}{6in}% that's 46 lines 11227 1.1 mrg {\voffset}{.25in}% 11228 1.1 mrg {\bindingoffset}{36pt}% 11229 1.1 mrg {11in}{8.5in}% 11230 1.1 mrg }} 11231 1.1 mrg 11232 1.1 mrg % Use @smallbook to reset parameters for 7x9.25 trim size. 11233 1.1 mrg \def\smallbook{{\globaldefs = 1 11234 1.1 mrg \parskip = 2pt plus 1pt 11235 1.1 mrg \textleading = 12pt 11236 1.1 mrg % 11237 1.1 mrg \internalpagesizes{7.5in}{5in}% 11238 1.1 mrg {-.2in}{0in}% 11239 1.1 mrg {\bindingoffset}{16pt}% 11240 1.1 mrg {9.25in}{7in}% 11241 1.1 mrg % 11242 1.1 mrg \lispnarrowing = 0.3in 11243 1.1 mrg \tolerance = 700 11244 1.1 mrg \contentsrightmargin = 0pt 11245 1.1 mrg \defbodyindent = .5cm 11246 1.1 mrg }} 11247 1.1 mrg 11248 1.1 mrg % Use @smallerbook to reset parameters for 6x9 trim size. 11249 1.1 mrg % (Just testing, parameters still in flux.) 11250 1.1 mrg \def\smallerbook{{\globaldefs = 1 11251 1.1 mrg \parskip = 1.5pt plus 1pt 11252 1.1 mrg \textleading = 12pt 11253 1.1 mrg % 11254 1.1 mrg \internalpagesizes{7.4in}{4.8in}% 11255 1.1 mrg {-.2in}{-.4in}% 11256 1.1 mrg {0pt}{14pt}% 11257 1.1 mrg {9in}{6in}% 11258 1.1 mrg % 11259 1.1 mrg \lispnarrowing = 0.25in 11260 1.1 mrg \tolerance = 700 11261 1.1 mrg \contentsrightmargin = 0pt 11262 1.1 mrg \defbodyindent = .4cm 11263 1.1 mrg }} 11264 1.1 mrg 11265 1.1 mrg % Use @afourpaper to print on European A4 paper. 11266 1.1 mrg \def\afourpaper{{\globaldefs = 1 11267 1.1 mrg \parskip = 3pt plus 2pt minus 1pt 11268 1.1 mrg \textleading = 13.2pt 11269 1.1 mrg % 11270 1.1 mrg % Double-side printing via postscript on Laserjet 4050 11271 1.1 mrg % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm. 11272 1.1 mrg % To change the settings for a different printer or situation, adjust 11273 1.1 mrg % \normaloffset until the front-side and back-side texts align. Then 11274 1.1 mrg % do the same for \bindingoffset. You can set these for testing in 11275 1.1 mrg % your texinfo source file like this: 11276 1.1 mrg % @tex 11277 1.1 mrg % \global\normaloffset = -6mm 11278 1.1 mrg % \global\bindingoffset = 10mm 11279 1.1 mrg % @end tex 11280 1.1 mrg \internalpagesizes{673.2pt}{160mm}% that's 51 lines 11281 1.1 mrg {\voffset}{\hoffset}% 11282 1.1 mrg {\bindingoffset}{44pt}% 11283 1.1 mrg {297mm}{210mm}% 11284 1.1 mrg % 11285 1.1 mrg \tolerance = 700 11286 1.1 mrg \contentsrightmargin = 0pt 11287 1.1 mrg \defbodyindent = 5mm 11288 1.1 mrg }} 11289 1.1 mrg 11290 1.1 mrg % Use @afivepaper to print on European A5 paper. 11291 1.1 mrg % From romildo (a] urano.iceb.ufop.br, 2 July 2000. 11292 1.1 mrg % He also recommends making @example and @lisp be small. 11293 1.1 mrg \def\afivepaper{{\globaldefs = 1 11294 1.1 mrg \parskip = 2pt plus 1pt minus 0.1pt 11295 1.1 mrg \textleading = 12.5pt 11296 1.1 mrg % 11297 1.1 mrg \internalpagesizes{160mm}{120mm}% 11298 1.1 mrg {\voffset}{\hoffset}% 11299 1.1 mrg {\bindingoffset}{8pt}% 11300 1.1 mrg {210mm}{148mm}% 11301 1.1 mrg % 11302 1.1 mrg \lispnarrowing = 0.2in 11303 1.1 mrg \tolerance = 800 11304 1.1 mrg \contentsrightmargin = 0pt 11305 1.1 mrg \defbodyindent = 2mm 11306 1.1 mrg \tableindent = 12mm 11307 1.1 mrg }} 11308 1.1 mrg 11309 1.1 mrg % A specific text layout, 24x15cm overall, intended for A4 paper. 11310 1.1 mrg \def\afourlatex{{\globaldefs = 1 11311 1.1 mrg \afourpaper 11312 1.1 mrg \internalpagesizes{237mm}{150mm}% 11313 1.1 mrg {\voffset}{4.6mm}% 11314 1.1 mrg {\bindingoffset}{7mm}% 11315 1.1 mrg {297mm}{210mm}% 11316 1.1 mrg % 11317 1.1 mrg % Must explicitly reset to 0 because we call \afourpaper. 11318 1.1 mrg \globaldefs = 0 11319 1.1 mrg }} 11320 1.1 mrg 11321 1.1 mrg % Use @afourwide to print on A4 paper in landscape format. 11322 1.1 mrg \def\afourwide{{\globaldefs = 1 11323 1.1 mrg \afourpaper 11324 1.1 mrg \internalpagesizes{241mm}{165mm}% 11325 1.1 mrg {\voffset}{-2.95mm}% 11326 1.1 mrg {\bindingoffset}{7mm}% 11327 1.1 mrg {297mm}{210mm}% 11328 1.1 mrg \globaldefs = 0 11329 1.1 mrg }} 11330 1.1.1.2 mrg 11331 1.1.1.2 mrg \def\bsixpaper{{\globaldefs = 1 11332 1.1.1.2 mrg \afourpaper 11333 1.1.1.2 mrg \internalpagesizes{140mm}{100mm}% 11334 1.1.1.2 mrg {-6.35mm}{-12.7mm}% 11335 1.1.1.2 mrg {\bindingoffset}{14pt}% 11336 1.1.1.2 mrg {176mm}{125mm}% 11337 1.1.1.2 mrg \let\SETdispenvsize=\smallword 11338 1.1.1.2 mrg \lispnarrowing = 0.2in 11339 1.1.1.2 mrg \globaldefs = 0 11340 1.1.1.2 mrg }} 11341 1.1.1.2 mrg 11342 1.1 mrg 11343 1.1 mrg % @pagesizes TEXTHEIGHT[,TEXTWIDTH] 11344 1.1 mrg % Perhaps we should allow setting the margins, \topskip, \parskip, 11345 1.1 mrg % and/or leading, also. Or perhaps we should compute them somehow. 11346 1.1 mrg % 11347 1.1 mrg \parseargdef\pagesizes{\pagesizesyyy #1,,\finish} 11348 1.1 mrg \def\pagesizesyyy#1,#2,#3\finish{{% 11349 1.1 mrg \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi 11350 1.1 mrg \globaldefs = 1 11351 1.1 mrg % 11352 1.1 mrg \parskip = 3pt plus 2pt minus 1pt 11353 1.1 mrg \setleading{\textleading}% 11354 1.1 mrg % 11355 1.1.1.2 mrg \dimen0 = #1\relax 11356 1.1.1.2 mrg \advance\dimen0 by 2.5in % default 1in margin above heading line 11357 1.1.1.2 mrg % and 1.5in to include heading, footing and 11358 1.1 mrg % bottom margin 11359 1.1 mrg % 11360 1.1.1.2 mrg \dimen2 = \hsize 11361 1.1 mrg \advance\dimen2 by 2in % default to 1 inch margin on each side 11362 1.1 mrg % 11363 1.1 mrg \internalpagesizes{#1}{\hsize}% 11364 1.1 mrg {\voffset}{\normaloffset}% 11365 1.1 mrg {\bindingoffset}{44pt}% 11366 1.1 mrg {\dimen0}{\dimen2}% 11367 1.1 mrg }} 11368 1.1 mrg 11369 1.1 mrg % Set default to letter. 11370 1.1 mrg % 11371 1.1 mrg \letterpaper 11372 1.1 mrg 11373 1.1 mrg % Default value of \hfuzz, for suppressing warnings about overfull hboxes. 11374 1.1 mrg \hfuzz = 1pt 11375 1.1 mrg 11376 1.1 mrg 11377 1.1 mrg \message{and turning on texinfo input format.} 11378 1.1 mrg 11379 1.1 mrg \def^^L{\par} % remove \outer, so ^L can appear in an @comment 11380 1.1 mrg 11381 1.1 mrg % DEL is a comment character, in case @c does not suffice. 11382 1.1 mrg \catcode`\^^? = 14 11383 1.1 mrg 11384 1.1 mrg % Define macros to output various characters with catcode for normal text. 11385 1.1 mrg \catcode`\"=\other \def\normaldoublequote{"} 11386 1.1 mrg \catcode`\$=\other \def\normaldollar{$}%$ font-lock fix 11387 1.1 mrg \catcode`\+=\other \def\normalplus{+} 11388 1.1 mrg \catcode`\<=\other \def\normalless{<} 11389 1.1 mrg \catcode`\>=\other \def\normalgreater{>} 11390 1.1 mrg \catcode`\^=\other \def\normalcaret{^} 11391 1.1 mrg \catcode`\_=\other \def\normalunderscore{_} 11392 1.1 mrg \catcode`\|=\other \def\normalverticalbar{|} 11393 1.1 mrg \catcode`\~=\other \def\normaltilde{~} 11394 1.1 mrg 11395 1.1 mrg % This macro is used to make a character print one way in \tt 11396 1.1 mrg % (where it can probably be output as-is), and another way in other fonts, 11397 1.1 mrg % where something hairier probably needs to be done. 11398 1.1 mrg % 11399 1.1 mrg % #1 is what to print if we are indeed using \tt; #2 is what to print 11400 1.1 mrg % otherwise. Since all the Computer Modern typewriter fonts have zero 11401 1.1 mrg % interword stretch (and shrink), and it is reasonable to expect all 11402 1.1 mrg % typewriter fonts to have this, we can check that font parameter. 11403 1.1 mrg % 11404 1.1 mrg \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} 11405 1.1 mrg 11406 1.1 mrg % Same as above, but check for italic font. Actually this also catches 11407 1.1 mrg % non-italic slanted fonts since it is impossible to distinguish them from 11408 1.1 mrg % italic fonts. But since this is only used by $ and it uses \sl anyway 11409 1.1 mrg % this is not a problem. 11410 1.1 mrg \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} 11411 1.1 mrg 11412 1.1 mrg % Set catcodes for Texinfo file 11413 1.1 mrg 11414 1.1 mrg % Active characters for printing the wanted glyph. 11415 1.1 mrg % Most of these we simply print from the \tt font, but for some, we can 11416 1.1 mrg % use math or other variants that look better in normal text. 11417 1.1 mrg % 11418 1.1 mrg \catcode`\"=\active 11419 1.1 mrg \def\activedoublequote{{\tt\char34}} 11420 1.1 mrg \let"=\activedoublequote 11421 1.1 mrg \catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde 11422 1.1 mrg \chardef\hatchar=`\^ 11423 1.1 mrg \catcode`\^=\active \def\activehat{{\tt \hatchar}} \let^ = \activehat 11424 1.1 mrg 11425 1.1 mrg \catcode`\_=\active 11426 1.1 mrg \def_{\ifusingtt\normalunderscore\_} 11427 1.1 mrg \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } 11428 1.1 mrg \let\realunder=_ 11429 1.1 mrg 11430 1.1 mrg \catcode`\|=\active \def|{{\tt\char124}} 11431 1.1 mrg 11432 1.1 mrg \chardef \less=`\< 11433 1.1 mrg \catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless 11434 1.1 mrg \chardef \gtr=`\> 11435 1.1 mrg \catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr 11436 1.1 mrg \catcode`\+=\active \def+{{\tt \char 43}} 11437 1.1 mrg \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix 11438 1.1 mrg \catcode`\-=\active \let-=\normaldash 11439 1.1 mrg 11440 1.1 mrg 11441 1.1 mrg % used for headline/footline in the output routine, in case the page 11442 1.1 mrg % breaks in the middle of an @tex block. 11443 1.1 mrg \def\texinfochars{% 11444 1.1 mrg \let< = \activeless 11445 1.1 mrg \let> = \activegtr 11446 1.1 mrg \let~ = \activetilde 11447 1.1.1.2 mrg \let^ = \activehat 11448 1.1 mrg \setregularquotes 11449 1.1 mrg \let\b = \strong 11450 1.1 mrg \let\i = \smartitalic 11451 1.1 mrg % in principle, all other definitions in \tex have to be undone too. 11452 1.1 mrg } 11453 1.1 mrg 11454 1.1 mrg % Used sometimes to turn off (effectively) the active characters even after 11455 1.1 mrg % parsing them. 11456 1.1 mrg \def\turnoffactive{% 11457 1.1 mrg \normalturnoffactive 11458 1.1 mrg \otherbackslash 11459 1.1 mrg } 11460 1.1 mrg 11461 1.1 mrg \catcode`\@=0 11462 1.1 mrg 11463 1.1 mrg % \backslashcurfont outputs one backslash character in current font, 11464 1.1 mrg % as in \char`\\. 11465 1.1 mrg \global\chardef\backslashcurfont=`\\ 11466 1.1 mrg 11467 1.1 mrg % \realbackslash is an actual character `\' with catcode other. 11468 1.1 mrg {\catcode`\\=\other @gdef@realbackslash{\}} 11469 1.1 mrg 11470 1.1 mrg % In Texinfo, backslash is an active character; it prints the backslash 11471 1.1 mrg % in fixed width font. 11472 1.1 mrg \catcode`\\=\active % @ for escape char from now on. 11473 1.1 mrg 11474 1.1 mrg % Print a typewriter backslash. For math mode, we can't simply use 11475 1.1 mrg % \backslashcurfont: the story here is that in math mode, the \char 11476 1.1 mrg % of \backslashcurfont ends up printing the roman \ from the math symbol 11477 1.1 mrg % font (because \char in math mode uses the \mathcode, and plain.tex 11478 1.1 mrg % sets \mathcode`\\="026E). Hence we use an explicit \mathchar, 11479 1.1 mrg % which is the decimal equivalent of "715c (class 7, e.g., use \fam; 11480 1.1 mrg % ignored family value; char position "5C). We can't use " for the 11481 1.1 mrg % usual hex value because it has already been made active. 11482 1.1 mrg 11483 1.1 mrg @def@ttbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} 11484 1.1 mrg @let@backslashchar = @ttbackslash % @backslashchar{} is for user documents. 11485 1.1 mrg 11486 1.1 mrg % \otherbackslash defines an active \ to be a literal `\' character with 11487 1.1 mrg % catcode other. 11488 1.1 mrg @gdef@otherbackslash{@let\=@realbackslash} 11489 1.1 mrg 11490 1.1 mrg % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of 11491 1.1 mrg % the literal character `\'. 11492 1.1 mrg % 11493 1.1 mrg {@catcode`- = @active 11494 1.1 mrg @gdef@normalturnoffactive{% 11495 1.1 mrg @passthroughcharstrue 11496 1.1 mrg @let-=@normaldash 11497 1.1 mrg @let"=@normaldoublequote 11498 1.1 mrg @let$=@normaldollar %$ font-lock fix 11499 1.1 mrg @let+=@normalplus 11500 1.1 mrg @let<=@normalless 11501 1.1 mrg @let>=@normalgreater 11502 1.1 mrg @let^=@normalcaret 11503 1.1 mrg @let_=@normalunderscore 11504 1.1 mrg @let|=@normalverticalbar 11505 1.1 mrg @let~=@normaltilde 11506 1.1.1.2 mrg @let\=@ttbackslash 11507 1.1 mrg @setregularquotes 11508 1.1 mrg @unsepspaces 11509 1.1 mrg } 11510 1.1 mrg } 11511 1.1 mrg 11512 1.1 mrg % If a .fmt file is being used, characters that might appear in a file 11513 1.1 mrg % name cannot be active until we have parsed the command line. 11514 1.1 mrg % So turn them off again, and have @fixbackslash turn them back on. 11515 1.1 mrg @catcode`+=@other @catcode`@_=@other 11516 1.1 mrg 11517 1.1 mrg % \enablebackslashhack - allow file to begin `\input texinfo' 11518 1.1 mrg % 11519 1.1 mrg % If a .fmt file is being used, we don't want the `\input texinfo' to show up. 11520 1.1 mrg % That is what \eatinput is for; after that, the `\' should revert to printing 11521 1.1 mrg % a backslash. 11522 1.1 mrg % If the file did not have a `\input texinfo', then it is turned off after 11523 1.1 mrg % the first line; otherwise the first `\' in the file would cause an error. 11524 1.1 mrg % This is used on the very last line of this file, texinfo.tex. 11525 1.1 mrg % We also use @c to call @fixbackslash, in case ends of lines are hidden. 11526 1.1 mrg { 11527 1.1 mrg @catcode`@^=7 11528 1.1 mrg @catcode`@^^M=13@gdef@enablebackslashhack{% 11529 1.1 mrg @global@let\ = @eatinput% 11530 1.1 mrg @catcode`@^^M=13% 11531 1.1 mrg @def@c{@fixbackslash@c}% 11532 1.1 mrg % Definition for the newline at the end of this file. 11533 1.1 mrg @def ^^M{@let^^M@secondlinenl}% 11534 1.1 mrg % Definition for a newline in the main Texinfo file. 11535 1.1 mrg @gdef @secondlinenl{@fixbackslash}% 11536 1.1 mrg % In case the first line has a whole-line command on it 11537 1.1 mrg @let@originalparsearg@parsearg 11538 1.1 mrg @def@parsearg{@fixbackslash@originalparsearg} 11539 1.1 mrg }} 11540 1.1 mrg 11541 1.1 mrg {@catcode`@^=7 @catcode`@^^M=13% 11542 1.1 mrg @gdef@eatinput input texinfo#1^^M{@fixbackslash}} 11543 1.1 mrg 11544 1.1 mrg % Emergency active definition of newline, in case an active newline token 11545 1.1 mrg % appears by mistake. 11546 1.1 mrg {@catcode`@^=7 @catcode13=13% 11547 1.1 mrg @gdef@enableemergencynewline{% 11548 1.1 mrg @gdef^^M{% 11549 1.1 mrg @par% 11550 1.1 mrg %<warning: active newline>@par% 11551 1.1 mrg }}} 11552 1.1 mrg 11553 1.1 mrg 11554 1.1 mrg @gdef@fixbackslash{% 11555 1.1 mrg @ifx\@eatinput @let\ = @ttbackslash @fi 11556 1.1 mrg @catcode13=5 % regular end of line 11557 1.1 mrg @enableemergencynewline 11558 1.1 mrg @let@c=@comment 11559 1.1 mrg @let@parsearg@originalparsearg 11560 1.1 mrg % Also turn back on active characters that might appear in the input 11561 1.1 mrg % file name, in case not using a pre-dumped format. 11562 1.1 mrg @catcode`+=@active 11563 1.1 mrg @catcode`@_=@active 11564 1.1 mrg % 11565 1.1 mrg % If texinfo.cnf is present on the system, read it. 11566 1.1 mrg % Useful for site-wide @afourpaper, etc. This macro, @fixbackslash, gets 11567 1.1 mrg % called at the beginning of every Texinfo file. Not opening texinfo.cnf 11568 1.1 mrg % directly in this file, texinfo.tex, makes it possible to make a format 11569 1.1 mrg % file for Texinfo. 11570 1.1 mrg % 11571 1.1 mrg @openin 1 texinfo.cnf 11572 1.1 mrg @ifeof 1 @else @input texinfo.cnf @fi 11573 1.1 mrg @closein 1 11574 1.1 mrg } 11575 1.1 mrg 11576 1.1 mrg 11577 1.1 mrg % Say @foo, not \foo, in error messages. 11578 1.1 mrg @escapechar = `@@ 11579 1.1 mrg 11580 1.1 mrg % These (along with & and #) are made active for url-breaking, so need 11581 1.1 mrg % active definitions as the normal characters. 11582 1.1 mrg @def@normaldot{.} 11583 1.1 mrg @def@normalquest{?} 11584 1.1 mrg @def@normalslash{/} 11585 1.1 mrg 11586 1.1 mrg % These look ok in all fonts, so just make them not special. 11587 1.1 mrg % @hashchar{} gets its own user-level command, because of #line. 11588 1.1 mrg @catcode`@& = @other @def@normalamp{&} 11589 1.1 mrg @catcode`@# = @other @def@normalhash{#} 11590 1.1 mrg @catcode`@% = @other @def@normalpercent{%} 11591 1.1 mrg 11592 1.1 mrg @let @hashchar = @normalhash 11593 1.1 mrg 11594 1.1 mrg @c Finally, make ` and ' active, so that txicodequoteundirected and 11595 1.1 mrg @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we 11596 1.1 mrg @c don't make ` and ' active, @code will not get them as active chars. 11597 1.1 mrg @c Do this last of all since we use ` in the previous @catcode assignments. 11598 1.1 mrg @catcode`@'=@active 11599 1.1.1.2 mrg @catcode`@`=@active 11600 1.1 mrg @setregularquotes 11601 1.1 mrg 11602 1.1 mrg @c Local variables: 11603 1.1 mrg @c eval: (add-hook 'before-save-hook 'time-stamp) 11604 1.1 mrg @c page-delimiter: "^\\\\message\\|emacs-page" 11605 1.1 mrg @c time-stamp-start: "def\\\\texinfoversion{" 11606 1.1 mrg @c time-stamp-format: "%:y-%02m-%02d.%02H" 11607 1.1 mrg @c time-stamp-end: "}" 11608 1.1 mrg @c End: 11609 1.1 mrg 11610 1.1 mrg @c vim:sw=2: 11611 1.1 mrg 11612 1.1.1.2 mrg @enablebackslashhack 11613 11614