~ubuntu-branches/ubuntu/vivid/libconfig/vivid

« back to all changes in this revision

Viewing changes to aux-build/texinfo.tex

  • Committer: Package Import Robot
  • Author(s): Jonathan McCrohan
  • Date: 2013-10-12 16:41:14 UTC
  • mfrom: (3.2.5 sid)
  • Revision ID: package-import@ubuntu.com-20131012164114-aps48fwa26gs4fjt
Tags: 1.4.9-1
* New upstream release
* Update S-V to 3.9.4
  - No changes necessary
* Ensure that libconfig++-dbg depends on libconfig9 (= ${binary:Version})
  in addition to libconfig++9 (= ${binary:Version})
  - Fixes dbg-package-missing-depends lintian warning

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
% texinfo.tex -- TeX macros to handle Texinfo files.
2
 
%
 
2
3
3
% Load plain if necessary, i.e., if running under initex.
4
4
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
5
5
%
6
 
\def\texinfoversion{2004-11-25.16}
7
 
%
8
 
% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
9
 
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
10
 
% Foundation, Inc.
11
 
%
12
 
% This texinfo.tex file is free software; you can redistribute it and/or
 
6
\def\texinfoversion{2009-08-14.15}
 
7
%
 
8
% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
 
9
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
 
10
% 2007, 2008, 2009 Free Software Foundation, Inc.
 
11
%
 
12
% This texinfo.tex file is free software: you can redistribute it and/or
13
13
% modify it under the terms of the GNU General Public License as
14
 
% published by the Free Software Foundation; either version 2, or (at
15
 
% your option) any later version.
 
14
% published by the Free Software Foundation, either version 3 of the
 
15
% License, or (at your option) any later version.
16
16
%
17
17
% This texinfo.tex file is distributed in the hope that it will be
18
18
% useful, but WITHOUT ANY WARRANTY; without even the implied warranty
20
20
% General Public License for more details.
21
21
%
22
22
% You should have received a copy of the GNU General Public License
23
 
% along with this texinfo.tex file; see the file COPYING.  If not, write
24
 
% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25
 
% Boston, MA 02111-1307, USA.
 
23
% along with this program.  If not, see <http://www.gnu.org/licenses/>.
26
24
%
27
25
% As a special exception, when this file is read by TeX when processing
28
26
% a Texinfo source document, you may use the result without
67
65
\everyjob{\message{[Texinfo version \texinfoversion]}%
68
66
  \catcode`+=\active \catcode`\_=\active}
69
67
 
70
 
\message{Basics,}
 
68
 
71
69
\chardef\other=12
72
70
 
73
71
% We never want plain's \outer definition of \+ in Texinfo.
99
97
\let\ptexslash=\/
100
98
\let\ptexstar=\*
101
99
\let\ptext=\t
 
100
\let\ptextop=\top
 
101
{\catcode`\'=\active
 
102
\global\let\ptexquoteright'}% Math-mode def from plain.tex.
 
103
\let\ptexraggedright=\raggedright
102
104
 
103
105
% If this character appears in an error message or help string, it
104
106
% starts a new line in the output.
153
155
\ifx\putwordDefopt\undefined    \gdef\putwordDefopt{User Option}\fi
154
156
\ifx\putwordDeffunc\undefined   \gdef\putwordDeffunc{Function}\fi
155
157
 
156
 
% In some macros, we cannot use the `\? notation---the left quote is
157
 
% in some cases the escape char.
 
158
% Since the category of space is not known, we have to be careful.
 
159
\chardef\spacecat = 10
 
160
\def\spaceisspace{\catcode`\ =\spacecat}
 
161
 
 
162
% sometimes characters are active, so we need control sequences.
158
163
\chardef\colonChar = `\:
159
164
\chardef\commaChar = `\,
 
165
\chardef\dashChar  = `\-
160
166
\chardef\dotChar   = `\.
161
167
\chardef\exclamChar= `\!
 
168
\chardef\lquoteChar= `\`
162
169
\chardef\questChar = `\?
 
170
\chardef\rquoteChar= `\'
163
171
\chardef\semiChar  = `\;
164
172
\chardef\underChar = `\_
165
173
 
166
 
\chardef\spaceChar = `\ %
167
 
\chardef\spacecat = 10
168
 
\def\spaceisspace{\catcode\spaceChar=\spacecat}
169
 
 
170
174
% Ignore a token.
171
175
%
172
176
\def\gobble#1{}
277
281
\newdimen\cornerthick \cornerthick=.3pt
278
282
\newdimen\topandbottommargin \topandbottommargin=.75in
279
283
 
 
284
% Output a mark which sets \thischapter, \thissection and \thiscolor.
 
285
% We dump everything together because we only have one kind of mark.
 
286
% This works because we only use \botmark / \topmark, not \firstmark.
 
287
%
 
288
% A mark contains a subexpression of the \ifcase ... \fi construct.
 
289
% \get*marks macros below extract the needed part using \ifcase.
 
290
%
 
291
% Another complication is to let the user choose whether \thischapter
 
292
% (\thissection) refers to the chapter (section) in effect at the top
 
293
% of a page, or that at the bottom of a page.  The solution is
 
294
% described on page 260 of The TeXbook.  It involves outputting two
 
295
% marks for the sectioning macros, one before the section break, and
 
296
% one after.  I won't pretend I can describe this better than DEK...
 
297
\def\domark{%
 
298
  \toks0=\expandafter{\lastchapterdefs}%
 
299
  \toks2=\expandafter{\lastsectiondefs}%
 
300
  \toks4=\expandafter{\prevchapterdefs}%
 
301
  \toks6=\expandafter{\prevsectiondefs}%
 
302
  \toks8=\expandafter{\lastcolordefs}%
 
303
  \mark{%
 
304
                   \the\toks0 \the\toks2
 
305
      \noexpand\or \the\toks4 \the\toks6
 
306
    \noexpand\else \the\toks8
 
307
  }%
 
308
}
 
309
% \topmark doesn't work for the very first chapter (after the title
 
310
% page or the contents), so we use \firstmark there -- this gets us
 
311
% the mark with the chapter defs, unless the user sneaks in, e.g.,
 
312
% @setcolor (or @url, or @link, etc.) between @contents and the very
 
313
% first @chapter.
 
314
\def\gettopheadingmarks{%
 
315
  \ifcase0\topmark\fi
 
316
  \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
 
317
}
 
318
\def\getbottomheadingmarks{\ifcase1\botmark\fi}
 
319
\def\getcolormarks{\ifcase2\topmark\fi}
 
320
 
 
321
% Avoid "undefined control sequence" errors.
 
322
\def\lastchapterdefs{}
 
323
\def\lastsectiondefs{}
 
324
\def\prevchapterdefs{}
 
325
\def\prevsectiondefs{}
 
326
\def\lastcolordefs{}
 
327
 
280
328
% Main output routine.
281
329
\chardef\PAGE = 255
282
330
\output = {\onepageout{\pagecontents\PAGE}}
294
342
  %
295
343
  % Do this outside of the \shipout so @code etc. will be expanded in
296
344
  % the headline as they should be, not taken literally (outputting ''code).
 
345
  \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
297
346
  \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
 
347
  \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
298
348
  \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
299
349
  %
300
350
  {%
302
352
    % take effect in \write's, yet the group defined by the \vbox ends
303
353
    % before the \shipout runs.
304
354
    %
305
 
    \escapechar = `\\     % use backslash in output files.
306
355
    \indexdummies         % don't expand commands in the output.
307
356
    \normalturnoffactive  % \ in index entries must not stay \, e.g., if
308
 
                   % the page break happens to be in the middle of an example.
 
357
               % the page break happens to be in the middle of an example.
 
358
               % We don't want .vr (or whatever) entries like this:
 
359
               % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}}
 
360
               % "\acronym" won't work when it's read back in;
 
361
               % it needs to be
 
362
               % {\code {{\tt \backslashcurfont }acronym}
309
363
    \shipout\vbox{%
310
364
      % Do this early so pdf references go to the beginning of the page.
311
365
      \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
333
387
      \pagebody{#1}%
334
388
      \ifdim\ht\footlinebox > 0pt
335
389
        % Only leave this space if the footline is nonempty.
336
 
        % (We lessened \vsize for it in \oddfootingxxx.)
 
390
        % (We lessened \vsize for it in \oddfootingyyy.)
337
391
        % The \baselineskip=24pt in plain's \makefootline has no effect.
338
 
        \vskip 2\baselineskip
 
392
        \vskip 24pt
339
393
        \unvbox\footlinebox
340
394
      \fi
341
395
      %
356
410
      \egroup % \vbox from first cropmarks clause
357
411
      \fi
358
412
    }% end of \shipout\vbox
359
 
  }% end of group with \normalturnoffactive
 
413
  }% end of group with \indexdummies
360
414
  \advancepageno
361
415
  \ifnum\outputpenalty>-20000 \else\dosupereject\fi
362
416
}
369
423
% marginal hacks, juha@viisa.uucp (Juha Takala)
370
424
\ifvoid\margin\else % marginal info is present
371
425
  \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
372
 
\dimen@=\dp#1 \unvbox#1
 
426
\dimen@=\dp#1\relax \unvbox#1\relax
373
427
\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
374
428
\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
375
429
}
391
445
%
392
446
\def\parsearg{\parseargusing{}}
393
447
\def\parseargusing#1#2{%
394
 
  \def\next{#2}%
 
448
  \def\argtorun{#2}%
395
449
  \begingroup
396
450
    \obeylines
397
451
    \spaceisspace
410
464
\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
411
465
\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
412
466
 
413
 
% Each occurence of `\^^M' or `<space>\^^M' is replaced by a single space.
 
467
% Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
414
468
%
415
469
% \argremovec might leave us with trailing space, e.g.,
416
470
%    @end itemize  @c foo
422
476
\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
423
477
  \def\temp{#3}%
424
478
  \ifx\temp\empty
425
 
    % We cannot use \next here, as it holds the macro to run;
426
 
    % thus we reuse \temp.
 
479
    % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
427
480
    \let\temp\finishparsearg
428
481
  \else
429
482
    \let\temp\argcheckspaces
435
488
% If a _delimited_ argument is enclosed in braces, they get stripped; so
436
489
% to get _exactly_ the rest of the line, we had to prevent such situation.
437
490
% We prepended an \empty token at the very beginning and we expand it now,
438
 
% just before passing the control to \next.
439
 
% (Similarily, we have to think about #3 of \argcheckspacesY above: it is
 
491
% just before passing the control to \argtorun.
 
492
% (Similarly, we have to think about #3 of \argcheckspacesY above: it is
440
493
% either the null string, or it ends with \^^M---thus there is no danger
441
494
% that a pair of braces would be stripped.
442
495
%
443
496
% But first, we have to remove the trailing space token.
444
497
%
445
 
\def\finishparsearg#1 \ArgTerm{\expandafter\next\expandafter{#1}}
 
498
\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
446
499
 
447
500
% \parseargdef\foo{...}
448
501
%       is roughly equivalent to
493
546
% used to check whether the current environment is the one expected.
494
547
%
495
548
% Non-false conditionals (@iftex, @ifset) don't fit into this, so they
496
 
% are not treated as enviroments; they don't open a group.  (The
 
549
% are not treated as environments; they don't open a group.  (The
497
550
% implementation of @end takes care not to call \endgroup in this
498
551
% special case.)
499
552
 
500
553
 
501
 
% At runtime, environments start with this:
 
554
% At run-time, environments start with this:
502
555
\def\startenvironment#1{\begingroup\def\thisenv{#1}}
503
556
% initialize
504
557
\let\thisenv\empty
516
569
  \fi
517
570
}
518
571
 
519
 
% Evironment mismatch, #1 expected:
 
572
% Environment mismatch, #1 expected:
520
573
\def\badenverr{%
521
574
  \errhelp = \EMsimple
522
575
  \errmessage{This command can appear only \inenvironment\temp,
566
619
\let\}=\myrbrace
567
620
\begingroup
568
621
  % Definitions to produce \{ and \} commands for indices,
569
 
  % and @{ and @} for the aux file.
 
622
  % and @{ and @} for the aux/toc files.
570
623
  \catcode`\{ = \other \catcode`\} = \other
571
624
  \catcode`\[ = 1 \catcode`\] = 2
572
625
  \catcode`\! = 0 \catcode`\\ = \other
600
653
\def\jmacro{j}
601
654
\def\dotless#1{%
602
655
  \def\temp{#1}%
603
 
  \ifx\temp\imacro \ptexi
604
 
  \else\ifx\temp\jmacro \j
 
656
  \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
 
657
  \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
605
658
  \else \errmessage{@dotless can be used only with i or j}%
606
659
  \fi\fi
607
660
}
647
700
\let\/=\allowbreak
648
701
 
649
702
% @. is an end-of-sentence period.
650
 
\def\.{.\spacefactor=3000 }
 
703
\def\.{.\spacefactor=\endofsentencespacefactor\space}
651
704
 
652
705
% @! is an end-of-sentence bang.
653
 
\def\!{!\spacefactor=3000 }
 
706
\def\!{!\spacefactor=\endofsentencespacefactor\space}
654
707
 
655
708
% @? is an end-of-sentence query.
656
 
\def\?{?\spacefactor=3000 }
 
709
\def\?{?\spacefactor=\endofsentencespacefactor\space}
 
710
 
 
711
% @frenchspacing on|off  says whether to put extra space after punctuation.
 
712
%
 
713
\def\onword{on}
 
714
\def\offword{off}
 
715
%
 
716
\parseargdef\frenchspacing{%
 
717
  \def\temp{#1}%
 
718
  \ifx\temp\onword \plainfrenchspacing
 
719
  \else\ifx\temp\offword \plainnonfrenchspacing
 
720
  \else
 
721
    \errhelp = \EMsimple
 
722
    \errmessage{Unknown @frenchspacing option `\temp', must be on/off}%
 
723
  \fi\fi
 
724
}
657
725
 
658
726
% @w prevents a word break.  Without the \leavevmode, @w at the
659
727
% beginning of a paragraph, when TeX is still in vertical mode, would
852
920
  \temp
853
921
}
854
922
 
855
 
% @include file    insert text of that file as input.
 
923
% @include FILE -- \input text of FILE.
856
924
%
857
925
\def\include{\parseargusing\filenamecatcodes\includezzz}
858
926
\def\includezzz#1{%
859
927
  \pushthisfilestack
860
928
  \def\thisfile{#1}%
861
929
  {%
862
 
    \makevalueexpandable
863
 
    \def\temp{\input #1 }%
 
930
    \makevalueexpandable  % we want to expand any @value in FILE.
 
931
    \turnoffactive        % and allow special characters in the expansion
 
932
    \indexnofonts         % Allow `@@' and other weird things in file names.
 
933
    \edef\temp{\noexpand\input #1 }%
 
934
    %
 
935
    % This trickery is to read FILE outside of a group, in case it makes
 
936
    % definitions, etc.
864
937
    \expandafter
865
938
  }\temp
866
939
  \popthisfilestack
875
948
  \catcode`>=\other
876
949
  \catcode`+=\other
877
950
  \catcode`-=\other
 
951
  \catcode`\`=\other
 
952
  \catcode`\'=\other
878
953
}
879
954
 
880
955
\def\pushthisfilestack{%
1031
1106
% _ active, and distinguish by seeing if the current family is \slfam,
1032
1107
% which is what @var uses.
1033
1108
{
1034
 
  \catcode\underChar = \active
 
1109
  \catcode`\_ = \active
1035
1110
  \gdef\mathunderscore{%
1036
 
    \catcode\underChar=\active
 
1111
    \catcode`\_=\active
1037
1112
    \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
1038
1113
  }
1039
1114
}
1050
1125
  \mathunderscore
1051
1126
  \let\\ = \mathbackslash
1052
1127
  \mathactive
 
1128
  % make the texinfo accent commands work in math mode
 
1129
  \let\"=\ddot
 
1130
  \let\'=\acute
 
1131
  \let\==\bar
 
1132
  \let\^=\hat
 
1133
  \let\`=\grave
 
1134
  \let\u=\breve
 
1135
  \let\v=\check
 
1136
  \let\~=\tilde
 
1137
  \let\dotaccent=\dot
1053
1138
  $\finishmath
1054
1139
}
1055
1140
\def\finishmath#1{#1$\endgroup}  % Close the group opened by \tex.
1063
1148
  \catcode`< = \active
1064
1149
  \catcode`> = \active
1065
1150
  \catcode`+ = \active
 
1151
  \catcode`' = \active
1066
1152
  \gdef\mathactive{%
1067
1153
    \let^ = \ptexhat
1068
1154
    \let< = \ptexless
1069
1155
    \let> = \ptexgtr
1070
1156
    \let+ = \ptexplus
 
1157
    \let' = \ptexquoteright
1071
1158
  }
1072
1159
}
1073
1160
 
1074
 
% @bullet and @minus need the same treatment as @math, just above.
 
1161
% Some math mode symbols.
1075
1162
\def\bullet{$\ptexbullet$}
1076
 
\def\minus{$-$}
 
1163
\def\geq{\ifmmode \ge\else $\ge$\fi}
 
1164
\def\leq{\ifmmode \le\else $\le$\fi}
 
1165
\def\minus{\ifmmode -\else $-$\fi}
1077
1166
 
1078
1167
% @dots{} outputs an ellipsis using the current font.
1079
 
% We do .5em per period so that it has the same spacing in a typewriter
1080
 
% font as three actual period characters.
 
1168
% We do .5em per period so that it has the same spacing in the cm
 
1169
% typewriter fonts as three actual period characters; on the other hand,
 
1170
% in other typewriter fonts three periods are wider than 1.5em.  So do
 
1171
% whichever is larger.
1081
1172
%
1082
1173
\def\dots{%
1083
1174
  \leavevmode
1084
 
  \hbox to 1.5em{%
1085
 
    \hskip 0pt plus 0.25fil
1086
 
    .\hfil.\hfil.%
1087
 
    \hskip 0pt plus 0.5fil
 
1175
  \setbox0=\hbox{...}% get width of three periods
 
1176
  \ifdim\wd0 > 1.5em
 
1177
    \dimen0 = \wd0
 
1178
  \else
 
1179
    \dimen0 = 1.5em
 
1180
  \fi
 
1181
  \hbox to \dimen0{%
 
1182
    \hskip 0pt plus.25fil
 
1183
    .\hskip 0pt plus1fil
 
1184
    .\hskip 0pt plus1fil
 
1185
    .\hskip 0pt plus.5fil
1088
1186
  }%
1089
1187
}
1090
1188
 
1092
1190
%
1093
1191
\def\enddots{%
1094
1192
  \dots
1095
 
  \spacefactor=3000
 
1193
  \spacefactor=\endofsentencespacefactor
1096
1194
}
1097
1195
 
1098
1196
% @comma{} is so commas can be inserted into text without messing up
1176
1274
    \fi
1177
1275
  \fi
1178
1276
\fi
1179
 
%
 
1277
 
 
1278
% PDF uses PostScript string constants for the names of xref targets,
 
1279
% for display in the outlines, and in other places.  Thus, we have to
 
1280
% double any backslashes.  Otherwise, a name like "\node" will be
 
1281
% interpreted as a newline (\n), followed by o, d, e.  Not good.
 
1282
% http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html
 
1283
% (and related messages, the final outcome is that it is up to the TeX
 
1284
% user to double the backslashes and otherwise make the string valid, so
 
1285
% that's what we do).
 
1286
 
 
1287
% double active backslashes.
 
1288
%
 
1289
{\catcode`\@=0 \catcode`\\=\active
 
1290
 @gdef@activebackslashdouble{%
 
1291
   @catcode`@\=@active
 
1292
   @let\=@doublebackslash}
 
1293
}
 
1294
 
 
1295
% To handle parens, we must adopt a different approach, since parens are
 
1296
% not active characters.  hyperref.dtx (which has the same problem as
 
1297
% us) handles it with this amazing macro to replace tokens, with minor
 
1298
% changes for Texinfo.  It is included here under the GPL by permission
 
1299
% from the author, Heiko Oberdiek.
 
1300
%
 
1301
% #1 is the tokens to replace.
 
1302
% #2 is the replacement.
 
1303
% #3 is the control sequence with the string.
 
1304
%
 
1305
\def\HyPsdSubst#1#2#3{%
 
1306
  \def\HyPsdReplace##1#1##2\END{%
 
1307
    ##1%
 
1308
    \ifx\\##2\\%
 
1309
    \else
 
1310
      #2%
 
1311
      \HyReturnAfterFi{%
 
1312
        \HyPsdReplace##2\END
 
1313
      }%
 
1314
    \fi
 
1315
  }%
 
1316
  \xdef#3{\expandafter\HyPsdReplace#3#1\END}%
 
1317
}
 
1318
\long\def\HyReturnAfterFi#1\fi{\fi#1}
 
1319
 
 
1320
% #1 is a control sequence in which to do the replacements.
 
1321
\def\backslashparens#1{%
 
1322
  \xdef#1{#1}% redefine it as its expansion; the definition is simply
 
1323
             % \lastnode when called from \setref -> \pdfmkdest.
 
1324
  \HyPsdSubst{(}{\realbackslash(}{#1}%
 
1325
  \HyPsdSubst{)}{\realbackslash)}{#1}%
 
1326
}
 
1327
 
 
1328
\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
 
1329
with PDF output, and none of those formats could be found.  (.eps cannot
 
1330
be supported due to the design of the PDF format; use regular TeX (DVI
 
1331
output) for that.)}
 
1332
 
1180
1333
\ifpdf
1181
 
  \input pdfcolor
1182
 
  \pdfcatalog{/PageMode /UseOutlines}%
 
1334
  %
 
1335
  % Color manipulation macros based on pdfcolor.tex,
 
1336
  % except using rgb instead of cmyk; the latter is said to render as a
 
1337
  % very dark gray on-screen and a very dark halftone in print, instead
 
1338
  % of actual black.
 
1339
  \def\rgbDarkRed{0.50 0.09 0.12}
 
1340
  \def\rgbBlack{0 0 0}
 
1341
  %
 
1342
  % k sets the color for filling (usual text, etc.);
 
1343
  % K sets the color for stroking (thin rules, e.g., normal _'s).
 
1344
  \def\pdfsetcolor#1{\pdfliteral{#1 rg  #1 RG}}
 
1345
  %
 
1346
  % Set color, and create a mark which defines \thiscolor accordingly,
 
1347
  % so that \makeheadline knows which color to restore.
 
1348
  \def\setcolor#1{%
 
1349
    \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
 
1350
    \domark
 
1351
    \pdfsetcolor{#1}%
 
1352
  }
 
1353
  %
 
1354
  \def\maincolor{\rgbBlack}
 
1355
  \pdfsetcolor{\maincolor}
 
1356
  \edef\thiscolor{\maincolor}
 
1357
  \def\lastcolordefs{}
 
1358
  %
 
1359
  \def\makefootline{%
 
1360
    \baselineskip24pt
 
1361
    \line{\pdfsetcolor{\maincolor}\the\footline}%
 
1362
  }
 
1363
  %
 
1364
  \def\makeheadline{%
 
1365
    \vbox to 0pt{%
 
1366
      \vskip-22.5pt
 
1367
      \line{%
 
1368
        \vbox to8.5pt{}%
 
1369
        % Extract \thiscolor definition from the marks.
 
1370
        \getcolormarks
 
1371
        % Typeset the headline with \maincolor, then restore the color.
 
1372
        \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
 
1373
      }%
 
1374
      \vss
 
1375
    }%
 
1376
    \nointerlineskip
 
1377
  }
 
1378
  %
 
1379
  %
 
1380
  \pdfcatalog{/PageMode /UseOutlines}
 
1381
  %
 
1382
  % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
1183
1383
  \def\dopdfimage#1#2#3{%
1184
 
    \def\imagewidth{#2}%
1185
 
    \def\imageheight{#3}%
1186
 
    % without \immediate, pdftex seg faults when the same image is
 
1384
    \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
 
1385
    \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
 
1386
    %
 
1387
    % pdftex (and the PDF format) support .png, .jpg, .pdf (among
 
1388
    % others).  Let's try in that order.
 
1389
    \let\pdfimgext=\empty
 
1390
    \begingroup
 
1391
      \openin 1 #1.png \ifeof 1
 
1392
        \openin 1 #1.jpg \ifeof 1
 
1393
          \openin 1 #1.jpeg \ifeof 1
 
1394
            \openin 1 #1.JPG \ifeof 1
 
1395
              \openin 1 #1.pdf \ifeof 1
 
1396
                \openin 1 #1.PDF \ifeof 1
 
1397
                  \errhelp = \nopdfimagehelp
 
1398
                  \errmessage{Could not find image file #1 for pdf}%
 
1399
                \else \gdef\pdfimgext{PDF}%
 
1400
                \fi
 
1401
              \else \gdef\pdfimgext{pdf}%
 
1402
              \fi
 
1403
            \else \gdef\pdfimgext{JPG}%
 
1404
            \fi
 
1405
          \else \gdef\pdfimgext{jpeg}%
 
1406
          \fi
 
1407
        \else \gdef\pdfimgext{jpg}%
 
1408
        \fi
 
1409
      \else \gdef\pdfimgext{png}%
 
1410
      \fi
 
1411
      \closein 1
 
1412
    \endgroup
 
1413
    %
 
1414
    % without \immediate, ancient pdftex seg faults when the same image is
1187
1415
    % included twice.  (Version 3.14159-pre-1.0-unofficial-20010704.)
1188
1416
    \ifnum\pdftexversion < 14
1189
1417
      \immediate\pdfimage
1190
1418
    \else
1191
1419
      \immediate\pdfximage
1192
1420
    \fi
1193
 
      \ifx\empty\imagewidth\else width \imagewidth \fi
1194
 
      \ifx\empty\imageheight\else height \imageheight \fi
 
1421
      \ifdim \wd0 >0pt width \imagewidth \fi
 
1422
      \ifdim \wd2 >0pt height \imageheight \fi
1195
1423
      \ifnum\pdftexversion<13
1196
 
         #1.pdf%
 
1424
         #1.\pdfimgext
1197
1425
       \else
1198
 
         {#1.pdf}%
 
1426
         {#1.\pdfimgext}%
1199
1427
       \fi
1200
1428
    \ifnum\pdftexversion < 14 \else
1201
1429
      \pdfrefximage \pdflastximage
1202
1430
    \fi}
 
1431
  %
1203
1432
  \def\pdfmkdest#1{{%
1204
 
    % We have to set dummies so commands such as @code in a section title
1205
 
    % aren't expanded.
1206
 
    \atdummies
1207
 
    \normalturnoffactive
1208
 
    \pdfdest name{#1} xyz%
 
1433
    % We have to set dummies so commands such as @code, and characters
 
1434
    % such as \, aren't expanded when present in a section title.
 
1435
    \indexnofonts
 
1436
    \turnoffactive
 
1437
    \activebackslashdouble
 
1438
    \makevalueexpandable
 
1439
    \def\pdfdestname{#1}%
 
1440
    \backslashparens\pdfdestname
 
1441
    \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
1209
1442
  }}
 
1443
  %
 
1444
  % used to mark target names; must be expandable.
1210
1445
  \def\pdfmkpgn#1{#1}
1211
 
  \let\linkcolor = \Blue  % was Cyan, but that seems light?
1212
 
  \def\endlink{\Black\pdfendlink}
 
1446
  %
 
1447
  % by default, use a color that is dark enough to print on paper as
 
1448
  % nearly black, but still distinguishable for online viewing.
 
1449
  \def\urlcolor{\rgbDarkRed}
 
1450
  \def\linkcolor{\rgbDarkRed}
 
1451
  \def\endlink{\setcolor{\maincolor}\pdfendlink}
 
1452
  %
1213
1453
  % Adding outlines to PDF; macros for calculating structure of outlines
1214
1454
  % come from Petr Olsak
1215
1455
  \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
1218
1458
    \advance\tempnum by 1
1219
1459
    \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
1220
1460
  %
1221
 
  % #1 is the section text.  #2 is the pdf expression for the number
1222
 
  % of subentries (or empty, for subsubsections).  #3 is the node
1223
 
  % text, which might be empty if this toc entry had no
1224
 
  % corresponding node.  #4 is the page number.
 
1461
  % #1 is the section text, which is what will be displayed in the
 
1462
  % outline by the pdf viewer.  #2 is the pdf expression for the number
 
1463
  % of subentries (or empty, for subsubsections).  #3 is the node text,
 
1464
  % which might be empty if this toc entry had no corresponding node.
 
1465
  % #4 is the page number
1225
1466
  %
1226
1467
  \def\dopdfoutline#1#2#3#4{%
1227
1468
    % Generate a link to the node text if that exists; else, use the
1228
1469
    % page number.  We could generate a destination for the section
1229
1470
    % text in the case where a section has no node, but it doesn't
1230
 
    % seem worthwhile, since most documents are normally structured.
 
1471
    % seem worth the trouble, since most documents are normally structured.
1231
1472
    \def\pdfoutlinedest{#3}%
1232
 
    \ifx\pdfoutlinedest\empty \def\pdfoutlinedest{#4}\fi
1233
 
    %
1234
 
    \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{#1}%
 
1473
    \ifx\pdfoutlinedest\empty
 
1474
      \def\pdfoutlinedest{#4}%
 
1475
    \else
 
1476
      % Doubled backslashes in the name.
 
1477
      {\activebackslashdouble \xdef\pdfoutlinedest{#3}%
 
1478
       \backslashparens\pdfoutlinedest}%
 
1479
    \fi
 
1480
    %
 
1481
    % Also double the backslashes in the display string.
 
1482
    {\activebackslashdouble \xdef\pdfoutlinetext{#1}%
 
1483
     \backslashparens\pdfoutlinetext}%
 
1484
    %
 
1485
    \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
1235
1486
  }
1236
1487
  %
1237
1488
  \def\pdfmakeoutlines{%
1272
1523
      \def\unnsecentry{\numsecentry}%
1273
1524
      \def\unnsubsecentry{\numsubsecentry}%
1274
1525
      \def\unnsubsubsecentry{\numsubsubsecentry}%
1275
 
      \input \jobname.toc
 
1526
      \readdatafile{toc}%
1276
1527
      %
1277
1528
      % Read toc second time, this time actually producing the outlines.
1278
1529
      % The `-' means take the \expnumber as the absolute number of
1298
1549
      % their "best" equivalent, based on the @documentencoding.  Right
1299
1550
      % now, I guess we'll just let the pdf reader have its way.
1300
1551
      \indexnofonts
1301
 
      \turnoffactive
1302
 
      \input \jobname.toc
 
1552
      \setupdatafile
 
1553
      \catcode`\\=\active \otherbackslash
 
1554
      \input \tocreadfilename
1303
1555
    \endgroup
1304
1556
  }
1305
1557
  %
1306
 
  \def\makelinks #1,{%
1307
 
    \def\params{#1}\def\E{END}%
1308
 
    \ifx\params\E
1309
 
      \let\nextmakelinks=\relax
1310
 
    \else
1311
 
      \let\nextmakelinks=\makelinks
1312
 
      \ifnum\lnkcount>0,\fi
1313
 
      \picknum{#1}%
1314
 
      \startlink attr{/Border [0 0 0]}
1315
 
        goto name{\pdfmkpgn{\the\pgn}}%
1316
 
      \linkcolor #1%
1317
 
      \advance\lnkcount by 1%
1318
 
      \endlink
1319
 
    \fi
1320
 
    \nextmakelinks
1321
 
  }
1322
 
  \def\picknum#1{\expandafter\pn#1}
1323
 
  \def\pn#1{%
1324
 
    \def\p{#1}%
1325
 
    \ifx\p\lbrace
1326
 
      \let\nextpn=\ppn
1327
 
    \else
1328
 
      \let\nextpn=\ppnn
1329
 
      \def\first{#1}
1330
 
    \fi
1331
 
    \nextpn
1332
 
  }
1333
 
  \def\ppn#1{\pgn=#1\gobble}
1334
 
  \def\ppnn{\pgn=\first}
1335
 
  \def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,}
1336
1558
  \def\skipspaces#1{\def\PP{#1}\def\D{|}%
1337
1559
    \ifx\PP\D\let\nextsp\relax
1338
1560
    \else\let\nextsp\skipspaces
1347
1569
  \else
1348
1570
    \let \startlink \pdfstartlink
1349
1571
  \fi
 
1572
  % make a live url in pdf output.
1350
1573
  \def\pdfurl#1{%
1351
1574
    \begingroup
1352
 
      \normalturnoffactive\def\@{@}%
 
1575
      % it seems we really need yet another set of dummies; have not
 
1576
      % tried to figure out what each command should do in the context
 
1577
      % of @url.  for now, just make @/ a no-op, that's the only one
 
1578
      % people have actually reported a problem with.
 
1579
      %
 
1580
      \normalturnoffactive
 
1581
      \def\@{@}%
 
1582
      \let\/=\empty
1353
1583
      \makevalueexpandable
1354
 
      \leavevmode\Red
 
1584
      % do we want to go so far as to use \indexnofonts instead of just
 
1585
      % special-casing \var here?
 
1586
      \def\var##1{##1}%
 
1587
      %
 
1588
      \leavevmode\setcolor{\urlcolor}%
1355
1589
      \startlink attr{/Border [0 0 0]}%
1356
1590
        user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
1357
1591
    \endgroup}
1378
1612
    {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
1379
1613
  \def\pdflink#1{%
1380
1614
    \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
1381
 
    \linkcolor #1\endlink}
 
1615
    \setcolor{\linkcolor}#1\endlink}
1382
1616
  \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
1383
1617
\else
 
1618
  % non-pdf mode
1384
1619
  \let\pdfmkdest = \gobble
1385
1620
  \let\pdfurl = \gobble
1386
1621
  \let\endlink = \relax
1387
 
  \let\linkcolor = \relax
 
1622
  \let\setcolor = \gobble
 
1623
  \let\pdfsetcolor = \gobble
1388
1624
  \let\pdfmakeoutlines = \relax
1389
1625
\fi  % \ifx\pdfoutput
1390
1626
 
1410
1646
\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
1411
1647
\def\tt{\fam=\ttfam \setfontstyle{tt}}
1412
1648
 
 
1649
% Unfortunately, we have to override this for titles and the like, since
 
1650
% in those cases "rm" is bold.  Sigh.
 
1651
\def\rmisbold{\rm\def\curfontstyle{bf}}
 
1652
 
1413
1653
% Texinfo sort of supports the sans serif font style, which plain TeX does not.
1414
1654
% So we set up a \sf.
1415
1655
\newfam\sffam
1419
1659
% We don't need math for this font style.
1420
1660
\def\ttsl{\setfontstyle{ttsl}}
1421
1661
 
 
1662
 
1422
1663
% Default leading.
1423
1664
\newdimen\textleading  \textleading = 13.2pt
1424
1665
 
1430
1671
\def\strutheightpercent{.70833}
1431
1672
\def\strutdepthpercent {.29167}
1432
1673
%
 
1674
% can get a sort of poor man's double spacing by redefining this.
 
1675
\def\baselinefactor{1}
 
1676
%
1433
1677
\def\setleading#1{%
1434
 
  \normalbaselineskip = #1\relax
 
1678
  \dimen0 = #1\relax
 
1679
  \normalbaselineskip = \baselinefactor\dimen0
1435
1680
  \normallineskip = \lineskipfactor\normalbaselineskip
1436
1681
  \normalbaselines
1437
1682
  \setbox\strutbox =\hbox{%
1440
1685
  }%
1441
1686
}
1442
1687
 
 
1688
% PDF CMaps.  See also LaTeX's t1.cmap.
 
1689
%
 
1690
% do nothing with this by default.
 
1691
\expandafter\let\csname cmapOT1\endcsname\gobble
 
1692
\expandafter\let\csname cmapOT1IT\endcsname\gobble
 
1693
\expandafter\let\csname cmapOT1TT\endcsname\gobble
 
1694
 
 
1695
% if we are producing pdf, and we have \pdffontattr, then define cmaps.
 
1696
% (\pdffontattr was introduced many years ago, but people still run
 
1697
% older pdftex's; it's easy to conditionalize, so we do.)
 
1698
\ifpdf \ifx\pdffontattr\undefined \else
 
1699
  \begingroup
 
1700
    \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
 
1701
    \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
 
1702
%%DocumentNeededResources: ProcSet (CIDInit)
 
1703
%%IncludeResource: ProcSet (CIDInit)
 
1704
%%BeginResource: CMap (TeX-OT1-0)
 
1705
%%Title: (TeX-OT1-0 TeX OT1 0)
 
1706
%%Version: 1.000
 
1707
%%EndComments
 
1708
/CIDInit /ProcSet findresource begin
 
1709
12 dict begin
 
1710
begincmap
 
1711
/CIDSystemInfo
 
1712
<< /Registry (TeX)
 
1713
/Ordering (OT1)
 
1714
/Supplement 0
 
1715
>> def
 
1716
/CMapName /TeX-OT1-0 def
 
1717
/CMapType 2 def
 
1718
1 begincodespacerange
 
1719
<00> <7F>
 
1720
endcodespacerange
 
1721
8 beginbfrange
 
1722
<00> <01> <0393>
 
1723
<09> <0A> <03A8>
 
1724
<23> <26> <0023>
 
1725
<28> <3B> <0028>
 
1726
<3F> <5B> <003F>
 
1727
<5D> <5E> <005D>
 
1728
<61> <7A> <0061>
 
1729
<7B> <7C> <2013>
 
1730
endbfrange
 
1731
40 beginbfchar
 
1732
<02> <0398>
 
1733
<03> <039B>
 
1734
<04> <039E>
 
1735
<05> <03A0>
 
1736
<06> <03A3>
 
1737
<07> <03D2>
 
1738
<08> <03A6>
 
1739
<0B> <00660066>
 
1740
<0C> <00660069>
 
1741
<0D> <0066006C>
 
1742
<0E> <006600660069>
 
1743
<0F> <00660066006C>
 
1744
<10> <0131>
 
1745
<11> <0237>
 
1746
<12> <0060>
 
1747
<13> <00B4>
 
1748
<14> <02C7>
 
1749
<15> <02D8>
 
1750
<16> <00AF>
 
1751
<17> <02DA>
 
1752
<18> <00B8>
 
1753
<19> <00DF>
 
1754
<1A> <00E6>
 
1755
<1B> <0153>
 
1756
<1C> <00F8>
 
1757
<1D> <00C6>
 
1758
<1E> <0152>
 
1759
<1F> <00D8>
 
1760
<21> <0021>
 
1761
<22> <201D>
 
1762
<27> <2019>
 
1763
<3C> <00A1>
 
1764
<3D> <003D>
 
1765
<3E> <00BF>
 
1766
<5C> <201C>
 
1767
<5F> <02D9>
 
1768
<60> <2018>
 
1769
<7D> <02DD>
 
1770
<7E> <007E>
 
1771
<7F> <00A8>
 
1772
endbfchar
 
1773
endcmap
 
1774
CMapName currentdict /CMap defineresource pop
 
1775
end
 
1776
end
 
1777
%%EndResource
 
1778
%%EOF
 
1779
    }\endgroup
 
1780
  \expandafter\edef\csname cmapOT1\endcsname#1{%
 
1781
    \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
 
1782
  }%
 
1783
%
 
1784
% \cmapOT1IT
 
1785
  \begingroup
 
1786
    \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
 
1787
    \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
 
1788
%%DocumentNeededResources: ProcSet (CIDInit)
 
1789
%%IncludeResource: ProcSet (CIDInit)
 
1790
%%BeginResource: CMap (TeX-OT1IT-0)
 
1791
%%Title: (TeX-OT1IT-0 TeX OT1IT 0)
 
1792
%%Version: 1.000
 
1793
%%EndComments
 
1794
/CIDInit /ProcSet findresource begin
 
1795
12 dict begin
 
1796
begincmap
 
1797
/CIDSystemInfo
 
1798
<< /Registry (TeX)
 
1799
/Ordering (OT1IT)
 
1800
/Supplement 0
 
1801
>> def
 
1802
/CMapName /TeX-OT1IT-0 def
 
1803
/CMapType 2 def
 
1804
1 begincodespacerange
 
1805
<00> <7F>
 
1806
endcodespacerange
 
1807
8 beginbfrange
 
1808
<00> <01> <0393>
 
1809
<09> <0A> <03A8>
 
1810
<25> <26> <0025>
 
1811
<28> <3B> <0028>
 
1812
<3F> <5B> <003F>
 
1813
<5D> <5E> <005D>
 
1814
<61> <7A> <0061>
 
1815
<7B> <7C> <2013>
 
1816
endbfrange
 
1817
42 beginbfchar
 
1818
<02> <0398>
 
1819
<03> <039B>
 
1820
<04> <039E>
 
1821
<05> <03A0>
 
1822
<06> <03A3>
 
1823
<07> <03D2>
 
1824
<08> <03A6>
 
1825
<0B> <00660066>
 
1826
<0C> <00660069>
 
1827
<0D> <0066006C>
 
1828
<0E> <006600660069>
 
1829
<0F> <00660066006C>
 
1830
<10> <0131>
 
1831
<11> <0237>
 
1832
<12> <0060>
 
1833
<13> <00B4>
 
1834
<14> <02C7>
 
1835
<15> <02D8>
 
1836
<16> <00AF>
 
1837
<17> <02DA>
 
1838
<18> <00B8>
 
1839
<19> <00DF>
 
1840
<1A> <00E6>
 
1841
<1B> <0153>
 
1842
<1C> <00F8>
 
1843
<1D> <00C6>
 
1844
<1E> <0152>
 
1845
<1F> <00D8>
 
1846
<21> <0021>
 
1847
<22> <201D>
 
1848
<23> <0023>
 
1849
<24> <00A3>
 
1850
<27> <2019>
 
1851
<3C> <00A1>
 
1852
<3D> <003D>
 
1853
<3E> <00BF>
 
1854
<5C> <201C>
 
1855
<5F> <02D9>
 
1856
<60> <2018>
 
1857
<7D> <02DD>
 
1858
<7E> <007E>
 
1859
<7F> <00A8>
 
1860
endbfchar
 
1861
endcmap
 
1862
CMapName currentdict /CMap defineresource pop
 
1863
end
 
1864
end
 
1865
%%EndResource
 
1866
%%EOF
 
1867
    }\endgroup
 
1868
  \expandafter\edef\csname cmapOT1IT\endcsname#1{%
 
1869
    \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
 
1870
  }%
 
1871
%
 
1872
% \cmapOT1TT
 
1873
  \begingroup
 
1874
    \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
 
1875
    \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
 
1876
%%DocumentNeededResources: ProcSet (CIDInit)
 
1877
%%IncludeResource: ProcSet (CIDInit)
 
1878
%%BeginResource: CMap (TeX-OT1TT-0)
 
1879
%%Title: (TeX-OT1TT-0 TeX OT1TT 0)
 
1880
%%Version: 1.000
 
1881
%%EndComments
 
1882
/CIDInit /ProcSet findresource begin
 
1883
12 dict begin
 
1884
begincmap
 
1885
/CIDSystemInfo
 
1886
<< /Registry (TeX)
 
1887
/Ordering (OT1TT)
 
1888
/Supplement 0
 
1889
>> def
 
1890
/CMapName /TeX-OT1TT-0 def
 
1891
/CMapType 2 def
 
1892
1 begincodespacerange
 
1893
<00> <7F>
 
1894
endcodespacerange
 
1895
5 beginbfrange
 
1896
<00> <01> <0393>
 
1897
<09> <0A> <03A8>
 
1898
<21> <26> <0021>
 
1899
<28> <5F> <0028>
 
1900
<61> <7E> <0061>
 
1901
endbfrange
 
1902
32 beginbfchar
 
1903
<02> <0398>
 
1904
<03> <039B>
 
1905
<04> <039E>
 
1906
<05> <03A0>
 
1907
<06> <03A3>
 
1908
<07> <03D2>
 
1909
<08> <03A6>
 
1910
<0B> <2191>
 
1911
<0C> <2193>
 
1912
<0D> <0027>
 
1913
<0E> <00A1>
 
1914
<0F> <00BF>
 
1915
<10> <0131>
 
1916
<11> <0237>
 
1917
<12> <0060>
 
1918
<13> <00B4>
 
1919
<14> <02C7>
 
1920
<15> <02D8>
 
1921
<16> <00AF>
 
1922
<17> <02DA>
 
1923
<18> <00B8>
 
1924
<19> <00DF>
 
1925
<1A> <00E6>
 
1926
<1B> <0153>
 
1927
<1C> <00F8>
 
1928
<1D> <00C6>
 
1929
<1E> <0152>
 
1930
<1F> <00D8>
 
1931
<20> <2423>
 
1932
<27> <2019>
 
1933
<60> <2018>
 
1934
<7F> <00A8>
 
1935
endbfchar
 
1936
endcmap
 
1937
CMapName currentdict /CMap defineresource pop
 
1938
end
 
1939
end
 
1940
%%EndResource
 
1941
%%EOF
 
1942
    }\endgroup
 
1943
  \expandafter\edef\csname cmapOT1TT\endcsname#1{%
 
1944
    \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
 
1945
  }%
 
1946
\fi\fi
 
1947
 
 
1948
 
1443
1949
% Set the font macro #1 to the font named #2, adding on the
1444
1950
% specified font prefix (normally `cm').
1445
 
% #3 is the font's design size, #4 is a scale factor
1446
 
\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}
 
1951
% #3 is the font's design size, #4 is a scale factor, #5 is the CMap
 
1952
% encoding (currently only OT1, OT1IT and OT1TT are allowed, pass
 
1953
% empty to omit).
 
1954
\def\setfont#1#2#3#4#5{%
 
1955
  \font#1=\fontprefix#2#3 scaled #4
 
1956
  \csname cmap#5\endcsname#1%
 
1957
}
 
1958
% This is what gets called when #5 of \setfont is empty.
 
1959
\let\cmap\gobble
 
1960
% emacs-page end of cmaps
1447
1961
 
1448
1962
% Use cm as the default font prefix.
1449
1963
% To specify the font prefix, you must define \fontprefix
1468
1982
\def\scshape{csc}
1469
1983
\def\scbshape{csc}
1470
1984
 
 
1985
% Definitions for a main text size of 11pt.  This is the default in
 
1986
% Texinfo.
 
1987
%
 
1988
\def\definetextfontsizexi{%
1471
1989
% Text fonts (11.2pt, magstep1).
1472
1990
\def\textnominalsize{11pt}
1473
1991
\edef\mainmagstep{\magstephalf}
1474
 
\setfont\textrm\rmshape{10}{\mainmagstep}
1475
 
\setfont\texttt\ttshape{10}{\mainmagstep}
1476
 
\setfont\textbf\bfshape{10}{\mainmagstep}
1477
 
\setfont\textit\itshape{10}{\mainmagstep}
1478
 
\setfont\textsl\slshape{10}{\mainmagstep}
1479
 
\setfont\textsf\sfshape{10}{\mainmagstep}
1480
 
\setfont\textsc\scshape{10}{\mainmagstep}
1481
 
\setfont\textttsl\ttslshape{10}{\mainmagstep}
 
1992
\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
 
1993
\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
 
1994
\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
 
1995
\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
 
1996
\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
 
1997
\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
 
1998
\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
 
1999
\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
1482
2000
\font\texti=cmmi10 scaled \mainmagstep
1483
2001
\font\textsy=cmsy10 scaled \mainmagstep
 
2002
\def\textecsize{1095}
1484
2003
 
1485
2004
% A few fonts for @defun names and args.
1486
 
\setfont\defbf\bfshape{10}{\magstep1}
1487
 
\setfont\deftt\ttshape{10}{\magstep1}
1488
 
\setfont\defttsl\ttslshape{10}{\magstep1}
 
2005
\setfont\defbf\bfshape{10}{\magstep1}{OT1}
 
2006
\setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
 
2007
\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
1489
2008
\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
1490
2009
 
1491
2010
% Fonts for indices, footnotes, small examples (9pt).
1492
2011
\def\smallnominalsize{9pt}
1493
 
\setfont\smallrm\rmshape{9}{1000}
1494
 
\setfont\smalltt\ttshape{9}{1000}
1495
 
\setfont\smallbf\bfshape{10}{900}
1496
 
\setfont\smallit\itshape{9}{1000}
1497
 
\setfont\smallsl\slshape{9}{1000}
1498
 
\setfont\smallsf\sfshape{9}{1000}
1499
 
\setfont\smallsc\scshape{10}{900}
1500
 
\setfont\smallttsl\ttslshape{10}{900}
 
2012
\setfont\smallrm\rmshape{9}{1000}{OT1}
 
2013
\setfont\smalltt\ttshape{9}{1000}{OT1TT}
 
2014
\setfont\smallbf\bfshape{10}{900}{OT1}
 
2015
\setfont\smallit\itshape{9}{1000}{OT1IT}
 
2016
\setfont\smallsl\slshape{9}{1000}{OT1}
 
2017
\setfont\smallsf\sfshape{9}{1000}{OT1}
 
2018
\setfont\smallsc\scshape{10}{900}{OT1}
 
2019
\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
1501
2020
\font\smalli=cmmi9
1502
2021
\font\smallsy=cmsy9
 
2022
\def\smallecsize{0900}
1503
2023
 
1504
2024
% Fonts for small examples (8pt).
1505
2025
\def\smallernominalsize{8pt}
1506
 
\setfont\smallerrm\rmshape{8}{1000}
1507
 
\setfont\smallertt\ttshape{8}{1000}
1508
 
\setfont\smallerbf\bfshape{10}{800}
1509
 
\setfont\smallerit\itshape{8}{1000}
1510
 
\setfont\smallersl\slshape{8}{1000}
1511
 
\setfont\smallersf\sfshape{8}{1000}
1512
 
\setfont\smallersc\scshape{10}{800}
1513
 
\setfont\smallerttsl\ttslshape{10}{800}
 
2026
\setfont\smallerrm\rmshape{8}{1000}{OT1}
 
2027
\setfont\smallertt\ttshape{8}{1000}{OT1TT}
 
2028
\setfont\smallerbf\bfshape{10}{800}{OT1}
 
2029
\setfont\smallerit\itshape{8}{1000}{OT1IT}
 
2030
\setfont\smallersl\slshape{8}{1000}{OT1}
 
2031
\setfont\smallersf\sfshape{8}{1000}{OT1}
 
2032
\setfont\smallersc\scshape{10}{800}{OT1}
 
2033
\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
1514
2034
\font\smalleri=cmmi8
1515
2035
\font\smallersy=cmsy8
 
2036
\def\smallerecsize{0800}
1516
2037
 
1517
2038
% Fonts for title page (20.4pt):
1518
2039
\def\titlenominalsize{20pt}
1519
 
\setfont\titlerm\rmbshape{12}{\magstep3}
1520
 
\setfont\titleit\itbshape{10}{\magstep4}
1521
 
\setfont\titlesl\slbshape{10}{\magstep4}
1522
 
\setfont\titlett\ttbshape{12}{\magstep3}
1523
 
\setfont\titlettsl\ttslshape{10}{\magstep4}
1524
 
\setfont\titlesf\sfbshape{17}{\magstep1}
 
2040
\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
 
2041
\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
 
2042
\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
 
2043
\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
 
2044
\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
 
2045
\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
1525
2046
\let\titlebf=\titlerm
1526
 
\setfont\titlesc\scbshape{10}{\magstep4}
 
2047
\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
1527
2048
\font\titlei=cmmi12 scaled \magstep3
1528
2049
\font\titlesy=cmsy10 scaled \magstep4
1529
 
\def\authorrm{\secrm}
1530
 
\def\authortt{\sectt}
 
2050
\def\titleecsize{2074}
1531
2051
 
1532
2052
% Chapter (and unnumbered) fonts (17.28pt).
1533
2053
\def\chapnominalsize{17pt}
1534
 
\setfont\chaprm\rmbshape{12}{\magstep2}
1535
 
\setfont\chapit\itbshape{10}{\magstep3}
1536
 
\setfont\chapsl\slbshape{10}{\magstep3}
1537
 
\setfont\chaptt\ttbshape{12}{\magstep2}
1538
 
\setfont\chapttsl\ttslshape{10}{\magstep3}
1539
 
\setfont\chapsf\sfbshape{17}{1000}
 
2054
\setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
 
2055
\setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
 
2056
\setfont\chapsl\slbshape{10}{\magstep3}{OT1}
 
2057
\setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
 
2058
\setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
 
2059
\setfont\chapsf\sfbshape{17}{1000}{OT1}
1540
2060
\let\chapbf=\chaprm
1541
 
\setfont\chapsc\scbshape{10}{\magstep3}
 
2061
\setfont\chapsc\scbshape{10}{\magstep3}{OT1}
1542
2062
\font\chapi=cmmi12 scaled \magstep2
1543
2063
\font\chapsy=cmsy10 scaled \magstep3
 
2064
\def\chapecsize{1728}
1544
2065
 
1545
2066
% Section fonts (14.4pt).
1546
2067
\def\secnominalsize{14pt}
1547
 
\setfont\secrm\rmbshape{12}{\magstep1}
1548
 
\setfont\secit\itbshape{10}{\magstep2}
1549
 
\setfont\secsl\slbshape{10}{\magstep2}
1550
 
\setfont\sectt\ttbshape{12}{\magstep1}
1551
 
\setfont\secttsl\ttslshape{10}{\magstep2}
1552
 
\setfont\secsf\sfbshape{12}{\magstep1}
 
2068
\setfont\secrm\rmbshape{12}{\magstep1}{OT1}
 
2069
\setfont\secit\itbshape{10}{\magstep2}{OT1IT}
 
2070
\setfont\secsl\slbshape{10}{\magstep2}{OT1}
 
2071
\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
 
2072
\setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
 
2073
\setfont\secsf\sfbshape{12}{\magstep1}{OT1}
1553
2074
\let\secbf\secrm
1554
 
\setfont\secsc\scbshape{10}{\magstep2}
 
2075
\setfont\secsc\scbshape{10}{\magstep2}{OT1}
1555
2076
\font\seci=cmmi12 scaled \magstep1
1556
2077
\font\secsy=cmsy10 scaled \magstep2
 
2078
\def\sececsize{1440}
1557
2079
 
1558
2080
% Subsection fonts (13.15pt).
1559
2081
\def\ssecnominalsize{13pt}
1560
 
\setfont\ssecrm\rmbshape{12}{\magstephalf}
1561
 
\setfont\ssecit\itbshape{10}{1315}
1562
 
\setfont\ssecsl\slbshape{10}{1315}
1563
 
\setfont\ssectt\ttbshape{12}{\magstephalf}
1564
 
\setfont\ssecttsl\ttslshape{10}{1315}
1565
 
\setfont\ssecsf\sfbshape{12}{\magstephalf}
 
2082
\setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
 
2083
\setfont\ssecit\itbshape{10}{1315}{OT1IT}
 
2084
\setfont\ssecsl\slbshape{10}{1315}{OT1}
 
2085
\setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
 
2086
\setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
 
2087
\setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
1566
2088
\let\ssecbf\ssecrm
1567
 
\setfont\ssecsc\scbshape{10}{1315}
 
2089
\setfont\ssecsc\scbshape{10}{1315}{OT1}
1568
2090
\font\sseci=cmmi12 scaled \magstephalf
1569
2091
\font\ssecsy=cmsy10 scaled 1315
 
2092
\def\ssececsize{1200}
1570
2093
 
1571
2094
% Reduced fonts for @acro in text (10pt).
1572
2095
\def\reducednominalsize{10pt}
1573
 
\setfont\reducedrm\rmshape{10}{1000}
1574
 
\setfont\reducedtt\ttshape{10}{1000}
1575
 
\setfont\reducedbf\bfshape{10}{1000}
1576
 
\setfont\reducedit\itshape{10}{1000}
1577
 
\setfont\reducedsl\slshape{10}{1000}
1578
 
\setfont\reducedsf\sfshape{10}{1000}
1579
 
\setfont\reducedsc\scshape{10}{1000}
1580
 
\setfont\reducedttsl\ttslshape{10}{1000}
 
2096
\setfont\reducedrm\rmshape{10}{1000}{OT1}
 
2097
\setfont\reducedtt\ttshape{10}{1000}{OT1TT}
 
2098
\setfont\reducedbf\bfshape{10}{1000}{OT1}
 
2099
\setfont\reducedit\itshape{10}{1000}{OT1IT}
 
2100
\setfont\reducedsl\slshape{10}{1000}{OT1}
 
2101
\setfont\reducedsf\sfshape{10}{1000}{OT1}
 
2102
\setfont\reducedsc\scshape{10}{1000}{OT1}
 
2103
\setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
1581
2104
\font\reducedi=cmmi10
1582
2105
\font\reducedsy=cmsy10
 
2106
\def\reducedecsize{1000}
 
2107
 
 
2108
% reset the current fonts
 
2109
\textfonts
 
2110
\rm
 
2111
} % end of 11pt text font size definitions
 
2112
 
 
2113
 
 
2114
% Definitions to make the main text be 10pt Computer Modern, with
 
2115
% section, chapter, etc., sizes following suit.  This is for the GNU
 
2116
% Press printing of the Emacs 22 manual.  Maybe other manuals in the
 
2117
% future.  Used with @smallbook, which sets the leading to 12pt.
 
2118
%
 
2119
\def\definetextfontsizex{%
 
2120
% Text fonts (10pt).
 
2121
\def\textnominalsize{10pt}
 
2122
\edef\mainmagstep{1000}
 
2123
\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
 
2124
\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
 
2125
\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
 
2126
\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
 
2127
\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
 
2128
\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
 
2129
\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
 
2130
\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
 
2131
\font\texti=cmmi10 scaled \mainmagstep
 
2132
\font\textsy=cmsy10 scaled \mainmagstep
 
2133
\def\textecsize{1000}
 
2134
 
 
2135
% A few fonts for @defun names and args.
 
2136
\setfont\defbf\bfshape{10}{\magstephalf}{OT1}
 
2137
\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
 
2138
\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
 
2139
\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
 
2140
 
 
2141
% Fonts for indices, footnotes, small examples (9pt).
 
2142
\def\smallnominalsize{9pt}
 
2143
\setfont\smallrm\rmshape{9}{1000}{OT1}
 
2144
\setfont\smalltt\ttshape{9}{1000}{OT1TT}
 
2145
\setfont\smallbf\bfshape{10}{900}{OT1}
 
2146
\setfont\smallit\itshape{9}{1000}{OT1IT}
 
2147
\setfont\smallsl\slshape{9}{1000}{OT1}
 
2148
\setfont\smallsf\sfshape{9}{1000}{OT1}
 
2149
\setfont\smallsc\scshape{10}{900}{OT1}
 
2150
\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
 
2151
\font\smalli=cmmi9
 
2152
\font\smallsy=cmsy9
 
2153
\def\smallecsize{0900}
 
2154
 
 
2155
% Fonts for small examples (8pt).
 
2156
\def\smallernominalsize{8pt}
 
2157
\setfont\smallerrm\rmshape{8}{1000}{OT1}
 
2158
\setfont\smallertt\ttshape{8}{1000}{OT1TT}
 
2159
\setfont\smallerbf\bfshape{10}{800}{OT1}
 
2160
\setfont\smallerit\itshape{8}{1000}{OT1IT}
 
2161
\setfont\smallersl\slshape{8}{1000}{OT1}
 
2162
\setfont\smallersf\sfshape{8}{1000}{OT1}
 
2163
\setfont\smallersc\scshape{10}{800}{OT1}
 
2164
\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
 
2165
\font\smalleri=cmmi8
 
2166
\font\smallersy=cmsy8
 
2167
\def\smallerecsize{0800}
 
2168
 
 
2169
% Fonts for title page (20.4pt):
 
2170
\def\titlenominalsize{20pt}
 
2171
\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
 
2172
\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
 
2173
\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
 
2174
\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
 
2175
\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
 
2176
\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
 
2177
\let\titlebf=\titlerm
 
2178
\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
 
2179
\font\titlei=cmmi12 scaled \magstep3
 
2180
\font\titlesy=cmsy10 scaled \magstep4
 
2181
\def\titleecsize{2074}
 
2182
 
 
2183
% Chapter fonts (14.4pt).
 
2184
\def\chapnominalsize{14pt}
 
2185
\setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
 
2186
\setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
 
2187
\setfont\chapsl\slbshape{10}{\magstep2}{OT1}
 
2188
\setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
 
2189
\setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
 
2190
\setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
 
2191
\let\chapbf\chaprm
 
2192
\setfont\chapsc\scbshape{10}{\magstep2}{OT1}
 
2193
\font\chapi=cmmi12 scaled \magstep1
 
2194
\font\chapsy=cmsy10 scaled \magstep2
 
2195
\def\chapecsize{1440}
 
2196
 
 
2197
% Section fonts (12pt).
 
2198
\def\secnominalsize{12pt}
 
2199
\setfont\secrm\rmbshape{12}{1000}{OT1}
 
2200
\setfont\secit\itbshape{10}{\magstep1}{OT1IT}
 
2201
\setfont\secsl\slbshape{10}{\magstep1}{OT1}
 
2202
\setfont\sectt\ttbshape{12}{1000}{OT1TT}
 
2203
\setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
 
2204
\setfont\secsf\sfbshape{12}{1000}{OT1}
 
2205
\let\secbf\secrm
 
2206
\setfont\secsc\scbshape{10}{\magstep1}{OT1}
 
2207
\font\seci=cmmi12
 
2208
\font\secsy=cmsy10 scaled \magstep1
 
2209
\def\sececsize{1200}
 
2210
 
 
2211
% Subsection fonts (10pt).
 
2212
\def\ssecnominalsize{10pt}
 
2213
\setfont\ssecrm\rmbshape{10}{1000}{OT1}
 
2214
\setfont\ssecit\itbshape{10}{1000}{OT1IT}
 
2215
\setfont\ssecsl\slbshape{10}{1000}{OT1}
 
2216
\setfont\ssectt\ttbshape{10}{1000}{OT1TT}
 
2217
\setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
 
2218
\setfont\ssecsf\sfbshape{10}{1000}{OT1}
 
2219
\let\ssecbf\ssecrm
 
2220
\setfont\ssecsc\scbshape{10}{1000}{OT1}
 
2221
\font\sseci=cmmi10
 
2222
\font\ssecsy=cmsy10
 
2223
\def\ssececsize{1000}
 
2224
 
 
2225
% Reduced fonts for @acro in text (9pt).
 
2226
\def\reducednominalsize{9pt}
 
2227
\setfont\reducedrm\rmshape{9}{1000}{OT1}
 
2228
\setfont\reducedtt\ttshape{9}{1000}{OT1TT}
 
2229
\setfont\reducedbf\bfshape{10}{900}{OT1}
 
2230
\setfont\reducedit\itshape{9}{1000}{OT1IT}
 
2231
\setfont\reducedsl\slshape{9}{1000}{OT1}
 
2232
\setfont\reducedsf\sfshape{9}{1000}{OT1}
 
2233
\setfont\reducedsc\scshape{10}{900}{OT1}
 
2234
\setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
 
2235
\font\reducedi=cmmi9
 
2236
\font\reducedsy=cmsy9
 
2237
\def\reducedecsize{0900}
 
2238
 
 
2239
% reduce space between paragraphs
 
2240
\divide\parskip by 2
 
2241
 
 
2242
% reset the current fonts
 
2243
\textfonts
 
2244
\rm
 
2245
} % end of 10pt text font size definitions
 
2246
 
 
2247
 
 
2248
% We provide the user-level command
 
2249
%   @fonttextsize 10
 
2250
% (or 11) to redefine the text font size.  pt is assumed.
 
2251
%
 
2252
\def\xword{10}
 
2253
\def\xiword{11}
 
2254
%
 
2255
\parseargdef\fonttextsize{%
 
2256
  \def\textsizearg{#1}%
 
2257
  \wlog{doing @fonttextsize \textsizearg}%
 
2258
  %
 
2259
  % Set \globaldefs so that documents can use this inside @tex, since
 
2260
  % makeinfo 4.8 does not support it, but we need it nonetheless.
 
2261
  %
 
2262
 \begingroup \globaldefs=1
 
2263
  \ifx\textsizearg\xword \definetextfontsizex
 
2264
  \else \ifx\textsizearg\xiword \definetextfontsizexi
 
2265
  \else
 
2266
    \errhelp=\EMsimple
 
2267
    \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
 
2268
  \fi\fi
 
2269
 \endgroup
 
2270
}
 
2271
 
1583
2272
 
1584
2273
% In order for the font changes to affect most math symbols and letters,
1585
2274
% we have to define the \textfont of the standard families.  Since
1620
2309
  \def\curfontsize{title}%
1621
2310
  \def\lsize{chap}\def\lllsize{subsec}%
1622
2311
  \resetmathfonts \setleading{25pt}}
1623
 
\def\titlefont#1{{\titlefonts\rm #1}}
 
2312
\def\titlefont#1{{\titlefonts\rmisbold #1}}
1624
2313
\def\chapfonts{%
1625
2314
  \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
1626
2315
  \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
1671
2360
  \def\lsize{smaller}\def\lllsize{smaller}%
1672
2361
  \resetmathfonts \setleading{9.5pt}}
1673
2362
 
 
2363
% Fonts for short table of contents.
 
2364
\setfont\shortcontrm\rmshape{12}{1000}{OT1}
 
2365
\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1}  % no cmb12
 
2366
\setfont\shortcontsl\slshape{12}{1000}{OT1}
 
2367
\setfont\shortconttt\ttshape{12}{1000}{OT1TT}
 
2368
 
 
2369
% Define these just so they can be easily changed for other fonts.
 
2370
\def\angleleft{$\langle$}
 
2371
\def\angleright{$\rangle$}
 
2372
 
1674
2373
% Set the fonts to use with the @small... environments.
1675
2374
\let\smallexamplefonts = \smallfonts
1676
2375
 
1684
2383
%
1685
2384
% By the way, for comparison, here's what fits with @example (10pt):
1686
2385
%   8.5x11=71  smallbook=60  a4=75  a5=58
1687
 
%
1688
 
% I wish the USA used A4 paper.
1689
2386
% --karl, 24jan03.
1690
2387
 
1691
 
 
1692
2388
% Set up the default fonts, so we can use them for creating boxes.
1693
2389
%
1694
 
\textfonts \rm
1695
 
 
1696
 
% Define these so they can be easily changed for other fonts.
1697
 
\def\angleleft{$\langle$}
1698
 
\def\angleright{$\rangle$}
 
2390
\definetextfontsizexi
 
2391
 
 
2392
 
 
2393
\message{markup,}
 
2394
 
 
2395
% Check if we are currently using a typewriter font.  Since all the
 
2396
% Computer Modern typewriter fonts have zero interword stretch (and
 
2397
% shrink), and it is reasonable to expect all typewriter fonts to have
 
2398
% this property, we can check that font parameter.
 
2399
%
 
2400
\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
 
2401
 
 
2402
% Markup style infrastructure.  \defmarkupstylesetup\INITMACRO will
 
2403
% define and register \INITMACRO to be called on markup style changes.
 
2404
% \INITMACRO can check \currentmarkupstyle for the innermost
 
2405
% style and the set of \ifmarkupSTYLE switches for all styles
 
2406
% currently in effect.
 
2407
\newif\ifmarkupvar
 
2408
\newif\ifmarkupsamp
 
2409
\newif\ifmarkupkey
 
2410
%\newif\ifmarkupfile % @file == @samp.
 
2411
%\newif\ifmarkupoption % @option == @samp.
 
2412
\newif\ifmarkupcode
 
2413
\newif\ifmarkupkbd
 
2414
%\newif\ifmarkupenv % @env == @code.
 
2415
%\newif\ifmarkupcommand % @command == @code.
 
2416
\newif\ifmarkuptex % @tex (and part of @math, for now).
 
2417
\newif\ifmarkupexample
 
2418
\newif\ifmarkupverb
 
2419
\newif\ifmarkupverbatim
 
2420
 
 
2421
\let\currentmarkupstyle\empty
 
2422
 
 
2423
\def\setupmarkupstyle#1{%
 
2424
  \csname markup#1true\endcsname
 
2425
  \def\currentmarkupstyle{#1}%
 
2426
  \markupstylesetup
 
2427
}
 
2428
 
 
2429
\let\markupstylesetup\empty
 
2430
 
 
2431
\def\defmarkupstylesetup#1{%
 
2432
  \expandafter\def\expandafter\markupstylesetup
 
2433
    \expandafter{\markupstylesetup #1}%
 
2434
  \def#1%
 
2435
}
 
2436
 
 
2437
% Markup style setup for left and right quotes.
 
2438
\defmarkupstylesetup\markupsetuplq{%
 
2439
  \expandafter\let\expandafter \temp \csname markupsetuplq\currentmarkupstyle\endcsname
 
2440
  \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
 
2441
}
 
2442
 
 
2443
\defmarkupstylesetup\markupsetuprq{%
 
2444
  \expandafter\let\expandafter \temp \csname markupsetuprq\currentmarkupstyle\endcsname
 
2445
  \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
 
2446
}
 
2447
 
 
2448
{
 
2449
\catcode`\'=\active
 
2450
\catcode`\`=\active
 
2451
 
 
2452
\gdef\markupsetuplqdefault{\let`\lq}
 
2453
\gdef\markupsetuprqdefault{\let'\rq}
 
2454
 
 
2455
\gdef\markupsetcodequoteleft{\let`\codequoteleft}
 
2456
\gdef\markupsetcodequoteright{\let'\codequoteright}
 
2457
 
 
2458
\gdef\markupsetnoligaturesquoteleft{\let`\noligaturesquoteleft}
 
2459
}
 
2460
 
 
2461
\let\markupsetuplqcode \markupsetcodequoteleft
 
2462
\let\markupsetuprqcode \markupsetcodequoteright
 
2463
\let\markupsetuplqexample \markupsetcodequoteleft
 
2464
\let\markupsetuprqexample \markupsetcodequoteright
 
2465
\let\markupsetuplqverb \markupsetcodequoteleft
 
2466
\let\markupsetuprqverb \markupsetcodequoteright
 
2467
\let\markupsetuplqverbatim \markupsetcodequoteleft
 
2468
\let\markupsetuprqverbatim \markupsetcodequoteright
 
2469
 
 
2470
\let\markupsetuplqsamp \markupsetnoligaturesquoteleft
 
2471
\let\markupsetuplqkbd \markupsetnoligaturesquoteleft
 
2472
 
 
2473
% Allow an option to not replace quotes with a regular directed right
 
2474
% quote/apostrophe (char 0x27), but instead use the undirected quote
 
2475
% from cmtt (char 0x0d).  The undirected quote is ugly, so don't make it
 
2476
% the default, but it works for pasting with more pdf viewers (at least
 
2477
% evince), the lilypond developers report.  xpdf does work with the
 
2478
% regular 0x27.
 
2479
%
 
2480
\def\codequoteright{%
 
2481
  \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
 
2482
    \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
 
2483
      '%
 
2484
    \else \char'15 \fi
 
2485
  \else \char'15 \fi
 
2486
}
 
2487
%
 
2488
% and a similar option for the left quote char vs. a grave accent.
 
2489
% Modern fonts display ASCII 0x60 as a grave accent, so some people like
 
2490
% the code environments to do likewise.
 
2491
%
 
2492
\def\codequoteleft{%
 
2493
  \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
 
2494
    \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
 
2495
      % [Knuth] pp. 380,381,391
 
2496
      % \relax disables Spanish ligatures ?` and !` of \tt font.
 
2497
      \relax`%
 
2498
    \else \char'22 \fi
 
2499
  \else \char'22 \fi
 
2500
}
 
2501
 
 
2502
% [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
 
2503
\def\noligaturesquoteleft{\relax\lq}
1699
2504
 
1700
2505
% Count depth in font-changes, for error checks
1701
2506
\newcount\fontdepth \fontdepth=0
1702
2507
 
1703
 
% Fonts for short table of contents.
1704
 
\setfont\shortcontrm\rmshape{12}{1000}
1705
 
\setfont\shortcontbf\bfshape{10}{\magstep1}  % no cmb12
1706
 
\setfont\shortcontsl\slshape{12}{1000}
1707
 
\setfont\shortconttt\ttshape{12}{1000}
1708
 
 
1709
2508
%% Add scribe-like font environments, plus @l for inline lisp (usually sans
1710
2509
%% serif) and @ii for TeX italic
1711
2510
 
1720
2519
% @var is set to this for defun arguments.
1721
2520
\def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx}
1722
2521
 
1723
 
% like \smartslanted except unconditionally use \sl.  We never want
 
2522
% @cite is like \smartslanted except unconditionally use \sl.  We never want
1724
2523
% ttsl for book titles, do we?
1725
2524
\def\cite#1{{\sl #1}\futurelet\next\smartitalicx}
1726
2525
 
1727
2526
\let\i=\smartitalic
1728
2527
\let\slanted=\smartslanted
1729
 
\let\var=\smartslanted
 
2528
\def\var#1{{\setupmarkupstyle{var}\smartslanted{#1}}}
1730
2529
\let\dfn=\smartslanted
1731
2530
\let\emph=\smartitalic
1732
2531
 
1733
 
% @b, explicit bold.
 
2532
% Explicit font changes: @r, @sc, undocumented @ii.
 
2533
\def\r#1{{\rm #1}}              % roman font
 
2534
\def\sc#1{{\smallcaps#1}}       % smallcaps font
 
2535
\def\ii#1{{\it #1}}             % italic font
 
2536
 
 
2537
% @b, explicit bold.  Also @strong.
1734
2538
\def\b#1{{\bf #1}}
1735
2539
\let\strong=\b
1736
2540
 
1749
2553
% sometimes \x has an active definition that messes things up.
1750
2554
%
1751
2555
\catcode`@=11
1752
 
  \def\frenchspacing{%
 
2556
  \def\plainfrenchspacing{%
1753
2557
    \sfcode\dotChar  =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
1754
2558
    \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
 
2559
    \def\endofsentencespacefactor{1000}% for @. and friends
 
2560
  }
 
2561
  \def\plainnonfrenchspacing{%
 
2562
    \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
 
2563
    \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
 
2564
    \def\endofsentencespacefactor{3000}% for @. and friends
1755
2565
  }
1756
2566
\catcode`@=\other
 
2567
\def\endofsentencespacefactor{3000}% default
1757
2568
 
 
2569
% @t, explicit typewriter.
1758
2570
\def\t#1{%
1759
 
  {\tt \rawbackslash \frenchspacing #1}%
 
2571
  {\tt \rawbackslash \plainfrenchspacing #1}%
1760
2572
  \null
1761
2573
}
1762
 
\def\samp#1{`\tclose{#1}'\null}
1763
 
\setfont\keyrm\rmshape{8}{1000}
1764
 
\font\keysy=cmsy9
1765
 
\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
1766
 
  \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
1767
 
    \vbox{\hrule\kern-0.4pt
1768
 
     \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
1769
 
    \kern-0.4pt\hrule}%
1770
 
  \kern-.06em\raise0.4pt\hbox{\angleright}}}}
1771
 
% The old definition, with no lozenge:
1772
 
%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
 
2574
 
 
2575
% @samp.
 
2576
\def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
 
2577
 
 
2578
% definition of @key that produces a lozenge.  Doesn't adjust to text size.
 
2579
%\setfont\keyrm\rmshape{8}{1000}{OT1}
 
2580
%\font\keysy=cmsy9
 
2581
%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
 
2582
%  \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
 
2583
%    \vbox{\hrule\kern-0.4pt
 
2584
%     \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
 
2585
%    \kern-0.4pt\hrule}%
 
2586
%  \kern-.06em\raise0.4pt\hbox{\angleright}}}}
 
2587
 
 
2588
% definition of @key with no lozenge.  If the current font is already
 
2589
% monospace, don't change it; that way, we respect @kbdinputstyle.  But
 
2590
% if it isn't monospace, then use \tt.
 
2591
%
 
2592
\def\key#1{{\setupmarkupstyle{key}%
 
2593
  \nohyphenation
 
2594
  \ifmonospace\else\tt\fi
 
2595
  #1}\null}
 
2596
 
 
2597
% ctrl is no longer a Texinfo command.
1773
2598
\def\ctrl #1{{\tt \rawbackslash \hat}#1}
1774
2599
 
1775
2600
% @file, @option are the same as @samp.
1793
2618
    \nohyphenation
1794
2619
    %
1795
2620
    \rawbackslash
1796
 
    \frenchspacing
 
2621
    \plainfrenchspacing
1797
2622
    #1%
1798
2623
  }%
1799
2624
  \null
1809
2634
% and arrange explicitly to hyphenate at a dash.
1810
2635
%  -- rms.
1811
2636
{
1812
 
  \catcode`\-=\active
1813
 
  \catcode`\_=\active
 
2637
  \catcode`\-=\active \catcode`\_=\active
 
2638
  \catcode`\'=\active \catcode`\`=\active
 
2639
  \global\let'=\rq \global\let`=\lq  % default definitions
1814
2640
  %
1815
2641
  \global\def\code{\begingroup
1816
 
    \catcode`\-=\active \let-\codedash
1817
 
    \catcode`\_=\active \let_\codeunder
 
2642
    \setupmarkupstyle{code}%
 
2643
    % The following should really be moved into \setupmarkupstyle handlers.
 
2644
    \catcode\dashChar=\active  \catcode\underChar=\active
 
2645
    \ifallowcodebreaks
 
2646
     \let-\codedash
 
2647
     \let_\codeunder
 
2648
    \else
 
2649
     \let-\realdash
 
2650
     \let_\realunder
 
2651
    \fi
1818
2652
    \codex
1819
2653
  }
1820
2654
}
1834
2668
}
1835
2669
\def\codex #1{\tclose{#1}\endgroup}
1836
2670
 
 
2671
% An additional complication: the above will allow breaks after, e.g.,
 
2672
% each of the four underscores in __typeof__.  This is undesirable in
 
2673
% some manuals, especially if they don't have long identifiers in
 
2674
% general.  @allowcodebreaks provides a way to control this.
 
2675
%
 
2676
\newif\ifallowcodebreaks  \allowcodebreakstrue
 
2677
 
 
2678
\def\keywordtrue{true}
 
2679
\def\keywordfalse{false}
 
2680
 
 
2681
\parseargdef\allowcodebreaks{%
 
2682
  \def\txiarg{#1}%
 
2683
  \ifx\txiarg\keywordtrue
 
2684
    \allowcodebreakstrue
 
2685
  \else\ifx\txiarg\keywordfalse
 
2686
    \allowcodebreaksfalse
 
2687
  \else
 
2688
    \errhelp = \EMsimple
 
2689
    \errmessage{Unknown @allowcodebreaks option `\txiarg'}%
 
2690
  \fi\fi
 
2691
}
 
2692
 
1837
2693
% @kbd is like @code, except that if the argument is just one @key command,
1838
2694
% then @kbd has no effect.
 
2695
\def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}}
1839
2696
 
1840
2697
% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
1841
2698
%   `example' (@kbd uses ttsl only inside of @example and friends),
1842
2699
%   or `code' (@kbd uses normal tty font always).
1843
2700
\parseargdef\kbdinputstyle{%
1844
 
  \def\arg{#1}%
1845
 
  \ifx\arg\worddistinct
 
2701
  \def\txiarg{#1}%
 
2702
  \ifx\txiarg\worddistinct
1846
2703
    \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
1847
 
  \else\ifx\arg\wordexample
 
2704
  \else\ifx\txiarg\wordexample
1848
2705
    \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
1849
 
  \else\ifx\arg\wordcode
 
2706
  \else\ifx\txiarg\wordcode
1850
2707
    \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
1851
2708
  \else
1852
2709
    \errhelp = \EMsimple
1853
 
    \errmessage{Unknown @kbdinputstyle option `\arg'}%
 
2710
    \errmessage{Unknown @kbdinputstyle option `\txiarg'}%
1854
2711
  \fi\fi\fi
1855
2712
}
1856
2713
\def\worddistinct{distinct}
1857
2714
\def\wordexample{example}
1858
2715
\def\wordcode{code}
1859
2716
 
1860
 
% Default is `distinct.'
 
2717
% Default is `distinct'.
1861
2718
\kbdinputstyle distinct
1862
2719
 
1863
2720
\def\xkey{\key}
1864
2721
\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
1865
2722
\ifx\one\xkey\ifx\threex\three \key{#2}%
1866
 
\else{\tclose{\kbdfont\look}}\fi
1867
 
\else{\tclose{\kbdfont\look}}\fi}
 
2723
\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
 
2724
\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi}
1868
2725
 
1869
2726
% For @indicateurl, @env, @command quotes seem unnecessary, so use \code.
1870
2727
\let\indicateurl=\code
1871
2728
\let\env=\code
1872
2729
\let\command=\code
1873
2730
 
 
2731
% @clicksequence{File @click{} Open ...}
 
2732
\def\clicksequence#1{\begingroup #1\endgroup}
 
2733
 
 
2734
% @clickstyle @arrow   (by default)
 
2735
\parseargdef\clickstyle{\def\click{#1}}
 
2736
\def\click{\arrow}
 
2737
 
1874
2738
% @uref (abbreviation for `urlref') takes an optional (comma-separated)
1875
2739
% second argument specifying the text to display and an optional third
1876
2740
% arg as text to display instead of (rather than in addition to) the url
1920
2784
  \let\email=\uref
1921
2785
\fi
1922
2786
 
1923
 
% Check if we are currently using a typewriter font.  Since all the
1924
 
% Computer Modern typewriter fonts have zero interword stretch (and
1925
 
% shrink), and it is reasonable to expect all typewriter fonts to have
1926
 
% this property, we can check that font parameter.
1927
 
%
1928
 
\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
1929
 
 
1930
2787
% Typeset a dimension, e.g., `in' or `pt'.  The only reason for the
1931
2788
% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
1932
2789
%
1933
2790
\def\dmn#1{\thinspace #1}
1934
2791
 
1935
 
\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
1936
 
 
1937
2792
% @l was never documented to mean ``switch to the Lisp font'',
1938
2793
% and it is not used as such in any manual I can find.  We need it for
1939
2794
% Polish suppressed-l.  --karl, 22sep96.
1940
2795
%\def\l#1{{\li #1}\null}
1941
2796
 
1942
 
% Explicit font changes: @r, @sc, undocumented @ii.
1943
 
\def\r#1{{\rm #1}}              % roman font
1944
 
\def\sc#1{{\smallcaps#1}}       % smallcaps font
1945
 
\def\ii#1{{\it #1}}             % italic font
1946
 
 
1947
2797
% @acronym for "FBI", "NATO", and the like.
1948
2798
% We print this one point size smaller, since it's intended for
1949
2799
% all-uppercase.
1950
 
 
2800
%
1951
2801
\def\acronym#1{\doacronym #1,,\finish}
1952
2802
\def\doacronym#1,#2,#3\finish{%
1953
2803
  {\selectfonts\lsize #1}%
1959
2809
 
1960
2810
% @abbr for "Comput. J." and the like.
1961
2811
% No font change, but don't do end-of-sentence spacing.
1962
 
 
2812
%
1963
2813
\def\abbr#1{\doabbr #1,,\finish}
1964
2814
\def\doabbr#1,#2,#3\finish{%
1965
 
  {\frenchspacing #1}%
 
2815
  {\plainfrenchspacing #1}%
1966
2816
  \def\temp{#2}%
1967
2817
  \ifx\temp\empty \else
1968
2818
    \space ({\unsepspaces \ignorespaces \temp \unskip})%
1969
2819
  \fi
1970
2820
}
1971
2821
 
 
2822
 
 
2823
\message{glyphs,}
 
2824
 
 
2825
% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
 
2826
%
 
2827
% Since these characters are used in examples, they should be an even number of
 
2828
% \tt widths. Each \tt character is 1en, so two makes it 1em.
 
2829
%
 
2830
\def\point{$\star$}
 
2831
\def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
 
2832
\def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
 
2833
\def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
 
2834
\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
 
2835
\def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
 
2836
 
 
2837
% The @error{} command.
 
2838
% Adapted from the TeXbook's \boxit.
 
2839
%
 
2840
\newbox\errorbox
 
2841
%
 
2842
{\tentt \global\dimen0 = 3em}% Width of the box.
 
2843
\dimen2 = .55pt % Thickness of rules
 
2844
% The text. (`r' is open on the right, `e' somewhat less so on the left.)
 
2845
\setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt}
 
2846
%
 
2847
\setbox\errorbox=\hbox to \dimen0{\hfil
 
2848
   \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
 
2849
   \advance\hsize by -2\dimen2 % Rules.
 
2850
   \vbox{%
 
2851
      \hrule height\dimen2
 
2852
      \hbox{\vrule width\dimen2 \kern3pt          % Space to left of text.
 
2853
         \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
 
2854
         \kern3pt\vrule width\dimen2}% Space to right.
 
2855
      \hrule height\dimen2}
 
2856
    \hfil}
 
2857
%
 
2858
\def\error{\leavevmode\lower.7ex\copy\errorbox}
 
2859
 
1972
2860
% @pounds{} is a sterling sign, which Knuth put in the CM italic font.
1973
2861
%
1974
2862
\def\pounds{{\it\$}}
1978
2866
% Theiling, which support regular, slanted, bold and bold slanted (and
1979
2867
% "outlined" (blackboard board, sort of) versions, which we don't need).
1980
2868
% It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
1981
 
 
2869
%
1982
2870
% Although only regular is the truly official Euro symbol, we ignore
1983
2871
% that.  The Euro is designed to be slightly taller than the regular
1984
2872
% font height.
1985
 
 
2873
%
1986
2874
% feymr - regular
1987
2875
% feymo - slanted
1988
2876
% feybr - bold
1989
2877
% feybo - bold slanted
1990
 
 
2878
%
1991
2879
% There is no good (free) typewriter version, to my knowledge.
1992
2880
% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
1993
2881
% Hmm.
1994
 
 
2882
%
1995
2883
% Also doesn't work in math.  Do we need to do math with euro symbols?
1996
2884
% Hope not.
1997
 
1998
 
 
2885
%
 
2886
%
1999
2887
\def\euro{{\eurofont e}}
2000
2888
\def\eurofont{%
2001
2889
  % We set the font at each command, rather than predefining it in
2002
2890
  % \textfonts and the other font-switching commands, so that
2003
 
  % installations which never need the symbold don't have to have the
 
2891
  % installations which never need the symbol don't have to have the
2004
2892
  % font installed.
2005
 
  % 
 
2893
  %
2006
2894
  % There is only one designed size (nominal 10pt), so we always scale
2007
2895
  % that to the current nominal size.
2008
 
  % 
 
2896
  %
2009
2897
  % By the way, simply using "at 1em" works for cmr10 and the like, but
2010
2898
  % does not work for cmbx10 and other extended/shrunken fonts.
2011
 
  % 
 
2899
  %
2012
2900
  \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
2013
2901
  %
2014
 
  \ifx\curfontstyle\bfstylename 
 
2902
  \ifx\curfontstyle\bfstylename
2015
2903
    % bold:
2016
2904
    \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
2017
 
  \else 
 
2905
  \else
2018
2906
    % regular:
2019
2907
    \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
2020
2908
  \fi
2021
2909
  \thiseurofont
2022
2910
}
2023
2911
 
 
2912
% Glyphs from the EC fonts.  We don't use \let for the aliases, because
 
2913
% sometimes we redefine the original macro, and the alias should reflect
 
2914
% the redefinition.
 
2915
%
 
2916
% Use LaTeX names for the Icelandic letters.
 
2917
\def\DH{{\ecfont \char"D0}} % Eth
 
2918
\def\dh{{\ecfont \char"F0}} % eth
 
2919
\def\TH{{\ecfont \char"DE}} % Thorn
 
2920
\def\th{{\ecfont \char"FE}} % thorn
 
2921
%
 
2922
\def\guillemetleft{{\ecfont \char"13}}
 
2923
\def\guillemotleft{\guillemetleft}
 
2924
\def\guillemetright{{\ecfont \char"14}}
 
2925
\def\guillemotright{\guillemetright}
 
2926
\def\guilsinglleft{{\ecfont \char"0E}}
 
2927
\def\guilsinglright{{\ecfont \char"0F}}
 
2928
\def\quotedblbase{{\ecfont \char"12}}
 
2929
\def\quotesinglbase{{\ecfont \char"0D}}
 
2930
%
 
2931
% This positioning is not perfect (see the ogonek LaTeX package), but
 
2932
% we have the precomposed glyphs for the most common cases.  We put the
 
2933
% tests to use those glyphs in the single \ogonek macro so we have fewer
 
2934
% dummy definitions to worry about for index entries, etc.
 
2935
%
 
2936
% ogonek is also used with other letters in Lithuanian (IOU), but using
 
2937
% the precomposed glyphs for those is not so easy since they aren't in
 
2938
% the same EC font.
 
2939
\def\ogonek#1{{%
 
2940
  \def\temp{#1}%
 
2941
  \ifx\temp\macrocharA\Aogonek
 
2942
  \else\ifx\temp\macrochara\aogonek
 
2943
  \else\ifx\temp\macrocharE\Eogonek
 
2944
  \else\ifx\temp\macrochare\eogonek
 
2945
  \else
 
2946
    \ecfont \setbox0=\hbox{#1}%
 
2947
    \ifdim\ht0=1ex\accent"0C #1%
 
2948
    \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
 
2949
    \fi
 
2950
  \fi\fi\fi\fi
 
2951
  }%
 
2952
}
 
2953
\def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
 
2954
\def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
 
2955
\def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
 
2956
\def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
 
2957
%
 
2958
% Use the ec* fonts (cm-super in outline format) for non-CM glyphs.
 
2959
\def\ecfont{%
 
2960
  % We can't distinguish serif/sans and italic/slanted, but this
 
2961
  % is used for crude hacks anyway (like adding French and German
 
2962
  % quotes to documents typeset with CM, where we lose kerning), so
 
2963
  % hopefully nobody will notice/care.
 
2964
  \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
 
2965
  \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
 
2966
  \ifx\curfontstyle\bfstylename
 
2967
    % bold:
 
2968
    \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
 
2969
  \else
 
2970
    % regular:
 
2971
    \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
 
2972
  \fi
 
2973
  \thisecfont
 
2974
}
 
2975
 
2024
2976
% @registeredsymbol - R in a circle.  The font for the R should really
2025
2977
% be smaller yet, but lllsize is the best we can do for now.
2026
2978
% Adapted from the plain.tex definition of \copyright.
2031
2983
    }$%
2032
2984
}
2033
2985
 
 
2986
% @textdegree - the normal degrees sign.
 
2987
%
 
2988
\def\textdegree{$^\circ$}
 
2989
 
2034
2990
% Laurent Siebenmann reports \Orb undefined with:
2035
2991
%  Textures 1.7.7 (preloaded format=plain 93.10.14)  (68K)  16 APR 2004 02:38
2036
2992
% so we'll define it if necessary.
2037
 
 
2993
%
2038
2994
\ifx\Orb\undefined
2039
2995
\def\Orb{\mathhexbox20D}
2040
2996
\fi
2041
2997
 
 
2998
% Quotes.
 
2999
\chardef\quotedblleft="5C
 
3000
\chardef\quotedblright=`\"
 
3001
\chardef\quoteleft=`\`
 
3002
\chardef\quoteright=`\'
 
3003
 
2042
3004
 
2043
3005
\message{page headings,}
2044
3006
 
2123
3085
\let\subtitlerm=\tenrm
2124
3086
\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
2125
3087
 
2126
 
\def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines
2127
 
                \let\tt=\authortt}
2128
 
 
2129
3088
\parseargdef\title{%
2130
3089
  \checkenv\titlepage
2131
 
  \leftline{\titlefonts\rm #1}
 
3090
  \leftline{\titlefonts\rmisbold #1}
2132
3091
  % print a rule at the page bottom also.
2133
3092
  \finishedtitlepagefalse
2134
3093
  \vskip4pt \hrule height 4pt width \hsize \vskip4pt
2149
3108
  \else
2150
3109
    \checkenv\titlepage
2151
3110
    \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
2152
 
    {\authorfont \leftline{#1}}%
 
3111
    {\secfonts\rmisbold \leftline{#1}}%
2153
3112
  \fi
2154
3113
}
2155
3114
 
2202
3161
  %
2203
3162
  % Leave some space for the footline.  Hopefully ok to assume
2204
3163
  % @evenfooting will not be used by itself.
2205
 
  \global\advance\pageheight by -\baselineskip
2206
 
  \global\advance\vsize by -\baselineskip
 
3164
  \global\advance\pageheight by -12pt
 
3165
  \global\advance\vsize by -12pt
2207
3166
}
2208
3167
 
2209
3168
\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
2210
3169
 
 
3170
% @evenheadingmarks top     \thischapter <- chapter at the top of a page
 
3171
% @evenheadingmarks bottom  \thischapter <- chapter at the bottom of a page
 
3172
%
 
3173
% The same set of arguments for:
 
3174
%
 
3175
% @oddheadingmarks
 
3176
% @evenfootingmarks
 
3177
% @oddfootingmarks
 
3178
% @everyheadingmarks
 
3179
% @everyfootingmarks
 
3180
 
 
3181
\def\evenheadingmarks{\headingmarks{even}{heading}}
 
3182
\def\oddheadingmarks{\headingmarks{odd}{heading}}
 
3183
\def\evenfootingmarks{\headingmarks{even}{footing}}
 
3184
\def\oddfootingmarks{\headingmarks{odd}{footing}}
 
3185
\def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1}
 
3186
                          \headingmarks{odd}{heading}{#1} }
 
3187
\def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1}
 
3188
                          \headingmarks{odd}{footing}{#1} }
 
3189
% #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
 
3190
\def\headingmarks#1#2#3 {%
 
3191
  \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
 
3192
  \global\expandafter\let\csname get#1#2marks\endcsname \temp
 
3193
}
 
3194
 
 
3195
\everyheadingmarks bottom
 
3196
\everyfootingmarks bottom
2211
3197
 
2212
3198
% @headings double      turns headings on for double-sided printing.
2213
3199
% @headings single      turns headings on for single-sided printing.
2350
3336
    % cause the example and the item to crash together.  So we use this
2351
3337
    % bizarre value of 10001 as a signal to \aboveenvbreak to insert
2352
3338
    % \parskip glue after all.  Section titles are handled this way also.
2353
 
    % 
 
3339
    %
2354
3340
    \penalty 10001
2355
3341
    \endgroup
2356
3342
    \itemxneedsnegativevskipfalse
2444
3430
  \parindent=0pt
2445
3431
  \parskip=\smallskipamount
2446
3432
  \ifdim\parskip=0pt \parskip=2pt \fi
 
3433
  %
 
3434
  % Try typesetting the item mark that if the document erroneously says
 
3435
  % something like @itemize @samp (intending @table), there's an error
 
3436
  % right away at the @itemize.  It's not the best error message in the
 
3437
  % world, but it's better than leaving it to the @item.  This means if
 
3438
  % the user wants an empty mark, they have to say @w{} not just @w.
2447
3439
  \def\itemcontents{#1}%
 
3440
  \setbox0 = \hbox{\itemcontents}%
 
3441
  %
2448
3442
  % @itemize with no arg is equivalent to @itemize @bullet.
2449
3443
  \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
 
3444
  %
2450
3445
  \let\item=\itemizeitem
2451
3446
}
2452
3447
 
2467
3462
   \ifnum\lastpenalty<10000 \parskip=0in \fi
2468
3463
   \noindent
2469
3464
   \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
 
3465
   %
2470
3466
   \vadjust{\penalty 1200}}% not good to break after first line of item.
2471
3467
  \flushcr
2472
3468
}
2688
3684
%
2689
3685
% @headitem starts a heading row, which we typeset in bold.
2690
3686
% Assignments have to be global since we are inside the implicit group
2691
 
% of an alignment entry.  Note that \everycr resets \everytab.
2692
 
\def\headitem{\checkenv\multitable \crcr \global\everytab={\bf}\the\everytab}%
 
3687
% of an alignment entry.  \everycr resets \everytab so we don't have to
 
3688
% undo it ourselves.
 
3689
\def\headitemfont{\b}% for people to use in the template row; not changeable
 
3690
\def\headitem{%
 
3691
  \checkenv\multitable
 
3692
  \crcr
 
3693
  \global\everytab={\bf}% can't use \headitemfont since the parsing differs
 
3694
  \the\everytab % for the first item
 
3695
}%
2693
3696
%
2694
3697
% A \tab used to include \hskip1sp.  But then the space in a template
2695
3698
% line is not enough.  That is bad.  So let's go back to just `&' until
2696
 
% we encounter the problem it was intended to solve again.
 
3699
% we again encounter the problem the 1sp was intended to solve.
2697
3700
%                                       --karl, nathan@acm.org, 20apr99.
2698
3701
\def\tab{\checkenv\multitable &\the\everytab}%
2699
3702
 
2862
3865
 
2863
3866
\def\doignore#1{\begingroup
2864
3867
  % Scan in ``verbatim'' mode:
 
3868
  \obeylines
2865
3869
  \catcode`\@ = \other
2866
3870
  \catcode`\{ = \other
2867
3871
  \catcode`\} = \other
2882
3886
  \gdef\dodoignore#1{%
2883
3887
    % #1 contains the command name as a string, e.g., `ifinfo'.
2884
3888
    %
2885
 
    % Define a command to find the next `@end #1', which must be on a line
2886
 
    % by itself.
2887
 
    \long\def\doignoretext##1^^M@end #1{\doignoretextyyy##1^^M@#1\_STOP_}%
 
3889
    % Define a command to find the next `@end #1'.
 
3890
    \long\def\doignoretext##1^^M@end #1{%
 
3891
      \doignoretextyyy##1^^M@#1\_STOP_}%
 
3892
    %
2888
3893
    % And this command to find another #1 command, at the beginning of a
2889
3894
    % line.  (Otherwise, we would consider a line `@c @ifset', for
2890
3895
    % example, to count as an @ifset for nesting.)
2891
3896
    \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
2892
3897
    %
2893
3898
    % And now expand that command.
2894
 
    \obeylines %
2895
3899
    \doignoretext ^^M%
2896
3900
  }%
2897
3901
}
2921
3925
}
2922
3926
 
2923
3927
% Finish off ignored text.
2924
 
\def\enddoignore{\endgroup\ignorespaces}
 
3928
{ \obeylines%
 
3929
  % Ignore anything after the last `@end #1'; this matters in verbatim
 
3930
  % environments, where otherwise the newline after an ignored conditional
 
3931
  % would result in a blank line in the output.
 
3932
  \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
 
3933
}
2925
3934
 
2926
3935
 
2927
3936
% @set VAR sets the variable VAR to an empty value.
3086
4095
\def\dosynindex#1#2#3{%
3087
4096
  % Only do \closeout if we haven't already done it, else we'll end up
3088
4097
  % closing the target index.
3089
 
  \expandafter \ifx\csname donesynindex#2\endcsname \undefined
 
4098
  \expandafter \ifx\csname donesynindex#2\endcsname \relax
3090
4099
    % The \closeout helps reduce unnecessary open files; the limit on the
3091
4100
    % Acorn RISC OS is a mere 16 files.
3092
4101
    \expandafter\closeout\csname#2indfile\endcsname
3093
 
    \expandafter\let\csname\donesynindex#2\endcsname = 1
 
4102
    \expandafter\let\csname donesynindex#2\endcsname = 1
3094
4103
  \fi
3095
4104
  % redefine \fooindfile:
3096
4105
  \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
3121
4130
% we have to laboriously prevent expansion for those that we don't.
3122
4131
%
3123
4132
\def\indexdummies{%
 
4133
  \escapechar = `\\     % use backslash in output files.
3124
4134
  \def\@{@}% change to @@ when we switch to @ as escape char in index files.
3125
4135
  \def\ {\realbackslash\space }%
 
4136
  %
3126
4137
  % Need these in case \tex is in effect and \{ is a \delimiter again.
3127
4138
  % But can't use \lbracecmd and \rbracecmd because texindex assumes
3128
4139
  % braces and backslashes are used only as delimiters.
3129
4140
  \let\{ = \mylbrace
3130
4141
  \let\} = \myrbrace
3131
4142
  %
3132
 
  % \definedummyword defines \#1 as \realbackslash #1\space, thus
3133
 
  % effectively preventing its expansion.  This is used only for control
3134
 
  % words, not control letters, because the \space would be incorrect
3135
 
  % for control characters, but is needed to separate the control word
 
4143
  % I don't entirely understand this, but when an index entry is
 
4144
  % generated from a macro call, the \endinput which \scanmacro inserts
 
4145
  % causes processing to be prematurely terminated.  This is,
 
4146
  % apparently, because \indexsorttmp is fully expanded, and \endinput
 
4147
  % is an expandable command.  The redefinition below makes \endinput
 
4148
  % disappear altogether for that purpose -- although logging shows that
 
4149
  % processing continues to some further point.  On the other hand, it
 
4150
  % seems \endinput does not hurt in the printed index arg, since that
 
4151
  % is still getting written without apparent harm.
 
4152
  %
 
4153
  % Sample source (mac-idx3.tex, reported by Graham Percival to
 
4154
  % help-texinfo, 22may06):
 
4155
  % @macro funindex {WORD}
 
4156
  % @findex xyz
 
4157
  % @end macro
 
4158
  % ...
 
4159
  % @funindex commtest
 
4160
  %
 
4161
  % The above is not enough to reproduce the bug, but it gives the flavor.
 
4162
  %
 
4163
  % Sample whatsit resulting:
 
4164
  % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}}
 
4165
  %
 
4166
  % So:
 
4167
  \let\endinput = \empty
 
4168
  %
 
4169
  % Do the redefinitions.
 
4170
  \commondummies
 
4171
}
 
4172
 
 
4173
% For the aux and toc files, @ is the escape character.  So we want to
 
4174
% redefine everything using @ as the escape character (instead of
 
4175
% \realbackslash, still used for index files).  When everything uses @,
 
4176
% this will be simpler.
 
4177
%
 
4178
\def\atdummies{%
 
4179
  \def\@{@@}%
 
4180
  \def\ {@ }%
 
4181
  \let\{ = \lbraceatcmd
 
4182
  \let\} = \rbraceatcmd
 
4183
  %
 
4184
  % Do the redefinitions.
 
4185
  \commondummies
 
4186
  \otherbackslash
 
4187
}
 
4188
 
 
4189
% Called from \indexdummies and \atdummies.
 
4190
%
 
4191
\def\commondummies{%
 
4192
  %
 
4193
  % \definedummyword defines \#1 as \string\#1\space, thus effectively
 
4194
  % preventing its expansion.  This is used only for control% words,
 
4195
  % not control letters, because the \space would be incorrect for
 
4196
  % control characters, but is needed to separate the control word
3136
4197
  % from whatever follows.
3137
4198
  %
3138
4199
  % For control letters, we have \definedummyletter, which omits the
3142
4203
  % those that do not.  If it is followed by {arg} in the input, then
3143
4204
  % that will dutifully get written to the index (or wherever).
3144
4205
  %
3145
 
  \def\definedummyword##1{%
3146
 
    \expandafter\def\csname ##1\endcsname{\realbackslash ##1\space}%
3147
 
  }%
3148
 
  \def\definedummyletter##1{%
3149
 
    \expandafter\def\csname ##1\endcsname{\realbackslash ##1}%
3150
 
  }%
3151
 
  \let\definedummyaccent\definedummyletter
3152
 
  %
3153
 
  % Do the redefinitions.
3154
 
  \commondummies
3155
 
}
3156
 
 
3157
 
% For the aux file, @ is the escape character.  So we want to redefine
3158
 
% everything using @ instead of \realbackslash.  When everything uses
3159
 
% @, this will be simpler.
3160
 
%
3161
 
\def\atdummies{%
3162
 
  \def\@{@@}%
3163
 
  \def\ {@ }%
3164
 
  \let\{ = \lbraceatcmd
3165
 
  \let\} = \rbraceatcmd
3166
 
  %
3167
 
  % (See comments in \indexdummies.)
3168
 
  \def\definedummyword##1{%
3169
 
    \expandafter\def\csname ##1\endcsname{@##1\space}%
3170
 
  }%
3171
 
  \def\definedummyletter##1{%
3172
 
    \expandafter\def\csname ##1\endcsname{@##1}%
3173
 
  }%
3174
 
  \let\definedummyaccent\definedummyletter
3175
 
  %
3176
 
  % Do the redefinitions.
3177
 
  \commondummies
3178
 
}
3179
 
 
3180
 
% Called from \indexdummies and \atdummies.  \definedummyword and
3181
 
% \definedummyletter must be defined first.
3182
 
%
3183
 
\def\commondummies{%
3184
 
  %
3185
 
  \normalturnoffactive
 
4206
  \def\definedummyword  ##1{\def##1{\string##1\space}}%
 
4207
  \def\definedummyletter##1{\def##1{\string##1}}%
 
4208
  \let\definedummyaccent\definedummyletter
3186
4209
  %
3187
4210
  \commondummiesnofonts
3188
4211
  %
3189
 
  \definedummyletter{_}%
 
4212
  \definedummyletter\_%
3190
4213
  %
3191
4214
  % Non-English letters.
3192
 
  \definedummyword{AA}%
3193
 
  \definedummyword{AE}%
3194
 
  \definedummyword{L}%
3195
 
  \definedummyword{OE}%
3196
 
  \definedummyword{O}%
3197
 
  \definedummyword{aa}%
3198
 
  \definedummyword{ae}%
3199
 
  \definedummyword{l}%
3200
 
  \definedummyword{oe}%
3201
 
  \definedummyword{o}%
3202
 
  \definedummyword{ss}%
3203
 
  \definedummyword{exclamdown}%
3204
 
  \definedummyword{questiondown}%
3205
 
  \definedummyword{ordf}%
3206
 
  \definedummyword{ordm}%
 
4215
  \definedummyword\AA
 
4216
  \definedummyword\AE
 
4217
  \definedummyword\DH
 
4218
  \definedummyword\L
 
4219
  \definedummyword\O
 
4220
  \definedummyword\OE
 
4221
  \definedummyword\TH
 
4222
  \definedummyword\aa
 
4223
  \definedummyword\ae
 
4224
  \definedummyword\dh
 
4225
  \definedummyword\exclamdown
 
4226
  \definedummyword\l
 
4227
  \definedummyword\o
 
4228
  \definedummyword\oe
 
4229
  \definedummyword\ordf
 
4230
  \definedummyword\ordm
 
4231
  \definedummyword\questiondown
 
4232
  \definedummyword\ss
 
4233
  \definedummyword\th
3207
4234
  %
3208
4235
  % Although these internal commands shouldn't show up, sometimes they do.
3209
 
  \definedummyword{bf}%
3210
 
  \definedummyword{gtr}%
3211
 
  \definedummyword{hat}%
3212
 
  \definedummyword{less}%
3213
 
  \definedummyword{sf}%
3214
 
  \definedummyword{sl}%
3215
 
  \definedummyword{tclose}%
3216
 
  \definedummyword{tt}%
 
4236
  \definedummyword\bf
 
4237
  \definedummyword\gtr
 
4238
  \definedummyword\hat
 
4239
  \definedummyword\less
 
4240
  \definedummyword\sf
 
4241
  \definedummyword\sl
 
4242
  \definedummyword\tclose
 
4243
  \definedummyword\tt
3217
4244
  %
3218
 
  \definedummyword{LaTeX}%
3219
 
  \definedummyword{TeX}%
 
4245
  \definedummyword\LaTeX
 
4246
  \definedummyword\TeX
3220
4247
  %
3221
4248
  % Assorted special characters.
3222
 
  \definedummyword{bullet}%
3223
 
  \definedummyword{comma}%
3224
 
  \definedummyword{copyright}%
3225
 
  \definedummyword{registeredsymbol}%
3226
 
  \definedummyword{dots}%
3227
 
  \definedummyword{enddots}%
3228
 
  \definedummyword{equiv}%
3229
 
  \definedummyword{error}%
3230
 
  \definedummyword{euro}%
3231
 
  \definedummyword{expansion}%
3232
 
  \definedummyword{minus}%
3233
 
  \definedummyword{pounds}%
3234
 
  \definedummyword{point}%
3235
 
  \definedummyword{print}%
3236
 
  \definedummyword{result}%
 
4249
  \definedummyword\bullet
 
4250
  \definedummyword\comma
 
4251
  \definedummyword\copyright
 
4252
  \definedummyword\registeredsymbol
 
4253
  \definedummyword\dots
 
4254
  \definedummyword\enddots
 
4255
  \definedummyword\equiv
 
4256
  \definedummyword\error
 
4257
  \definedummyword\euro
 
4258
  \definedummyword\guillemetleft
 
4259
  \definedummyword\guillemetright
 
4260
  \definedummyword\guilsinglleft
 
4261
  \definedummyword\guilsinglright
 
4262
  \definedummyword\expansion
 
4263
  \definedummyword\minus
 
4264
  \definedummyword\ogonek
 
4265
  \definedummyword\pounds
 
4266
  \definedummyword\point
 
4267
  \definedummyword\print
 
4268
  \definedummyword\quotedblbase
 
4269
  \definedummyword\quotedblleft
 
4270
  \definedummyword\quotedblright
 
4271
  \definedummyword\quoteleft
 
4272
  \definedummyword\quoteright
 
4273
  \definedummyword\quotesinglbase
 
4274
  \definedummyword\result
 
4275
  \definedummyword\textdegree
 
4276
  %
 
4277
  % We want to disable all macros so that they are not expanded by \write.
 
4278
  \macrolist
 
4279
  %
 
4280
  \normalturnoffactive
3237
4281
  %
3238
4282
  % Handle some cases of @value -- where it does not contain any
3239
4283
  % (non-fully-expandable) commands.
3240
4284
  \makevalueexpandable
3241
 
  %
3242
 
  % Normal spaces, not active ones.
3243
 
  \unsepspaces
3244
 
  %
3245
 
  % No macro expansion.
3246
 
  \turnoffmacros
3247
4285
}
3248
4286
 
3249
4287
% \commondummiesnofonts: common to \commondummies and \indexnofonts.
3250
4288
%
3251
 
% Better have this without active chars.
3252
 
{
3253
 
  \catcode`\~=\other
3254
 
  \gdef\commondummiesnofonts{%
3255
 
    % Control letters and accents.
3256
 
    \definedummyletter{!}%
3257
 
    \definedummyaccent{"}%
3258
 
    \definedummyaccent{'}%
3259
 
    \definedummyletter{*}%
3260
 
    \definedummyaccent{,}%
3261
 
    \definedummyletter{.}%
3262
 
    \definedummyletter{/}%
3263
 
    \definedummyletter{:}%
3264
 
    \definedummyaccent{=}%
3265
 
    \definedummyletter{?}%
3266
 
    \definedummyaccent{^}%
3267
 
    \definedummyaccent{`}%
3268
 
    \definedummyaccent{~}%
3269
 
    \definedummyword{u}%
3270
 
    \definedummyword{v}%
3271
 
    \definedummyword{H}%
3272
 
    \definedummyword{dotaccent}%
3273
 
    \definedummyword{ringaccent}%
3274
 
    \definedummyword{tieaccent}%
3275
 
    \definedummyword{ubaraccent}%
3276
 
    \definedummyword{udotaccent}%
3277
 
    \definedummyword{dotless}%
3278
 
    %
3279
 
    % Texinfo font commands.
3280
 
    \definedummyword{b}%
3281
 
    \definedummyword{i}%
3282
 
    \definedummyword{r}%
3283
 
    \definedummyword{sc}%
3284
 
    \definedummyword{t}%
3285
 
    %
3286
 
    % Commands that take arguments.
3287
 
    \definedummyword{acronym}%
3288
 
    \definedummyword{cite}%
3289
 
    \definedummyword{code}%
3290
 
    \definedummyword{command}%
3291
 
    \definedummyword{dfn}%
3292
 
    \definedummyword{emph}%
3293
 
    \definedummyword{env}%
3294
 
    \definedummyword{file}%
3295
 
    \definedummyword{kbd}%
3296
 
    \definedummyword{key}%
3297
 
    \definedummyword{math}%
3298
 
    \definedummyword{option}%
3299
 
    \definedummyword{samp}%
3300
 
    \definedummyword{strong}%
3301
 
    \definedummyword{tie}%
3302
 
    \definedummyword{uref}%
3303
 
    \definedummyword{url}%
3304
 
    \definedummyword{var}%
3305
 
    \definedummyword{verb}%
3306
 
    \definedummyword{w}%
3307
 
  }
 
4289
\def\commondummiesnofonts{%
 
4290
  % Control letters and accents.
 
4291
  \definedummyletter\!%
 
4292
  \definedummyaccent\"%
 
4293
  \definedummyaccent\'%
 
4294
  \definedummyletter\*%
 
4295
  \definedummyaccent\,%
 
4296
  \definedummyletter\.%
 
4297
  \definedummyletter\/%
 
4298
  \definedummyletter\:%
 
4299
  \definedummyaccent\=%
 
4300
  \definedummyletter\?%
 
4301
  \definedummyaccent\^%
 
4302
  \definedummyaccent\`%
 
4303
  \definedummyaccent\~%
 
4304
  \definedummyword\u
 
4305
  \definedummyword\v
 
4306
  \definedummyword\H
 
4307
  \definedummyword\dotaccent
 
4308
  \definedummyword\ogonek
 
4309
  \definedummyword\ringaccent
 
4310
  \definedummyword\tieaccent
 
4311
  \definedummyword\ubaraccent
 
4312
  \definedummyword\udotaccent
 
4313
  \definedummyword\dotless
 
4314
  %
 
4315
  % Texinfo font commands.
 
4316
  \definedummyword\b
 
4317
  \definedummyword\i
 
4318
  \definedummyword\r
 
4319
  \definedummyword\sc
 
4320
  \definedummyword\t
 
4321
  %
 
4322
  % Commands that take arguments.
 
4323
  \definedummyword\acronym
 
4324
  \definedummyword\cite
 
4325
  \definedummyword\code
 
4326
  \definedummyword\command
 
4327
  \definedummyword\dfn
 
4328
  \definedummyword\email
 
4329
  \definedummyword\emph
 
4330
  \definedummyword\env
 
4331
  \definedummyword\file
 
4332
  \definedummyword\kbd
 
4333
  \definedummyword\key
 
4334
  \definedummyword\math
 
4335
  \definedummyword\option
 
4336
  \definedummyword\pxref
 
4337
  \definedummyword\ref
 
4338
  \definedummyword\samp
 
4339
  \definedummyword\strong
 
4340
  \definedummyword\tie
 
4341
  \definedummyword\uref
 
4342
  \definedummyword\url
 
4343
  \definedummyword\var
 
4344
  \definedummyword\verb
 
4345
  \definedummyword\w
 
4346
  \definedummyword\xref
3308
4347
}
3309
4348
 
3310
4349
% \indexnofonts is used when outputting the strings to sort the index
3314
4353
%
3315
4354
\def\indexnofonts{%
3316
4355
  % Accent commands should become @asis.
3317
 
  \def\definedummyaccent##1{%
3318
 
    \expandafter\let\csname ##1\endcsname\asis
3319
 
  }%
 
4356
  \def\definedummyaccent##1{\let##1\asis}%
3320
4357
  % We can just ignore other control letters.
3321
 
  \def\definedummyletter##1{%
3322
 
    \expandafter\def\csname ##1\endcsname{}%
3323
 
  }%
 
4358
  \def\definedummyletter##1{\let##1\empty}%
3324
4359
  % Hopefully, all control words can become @asis.
3325
4360
  \let\definedummyword\definedummyaccent
3326
4361
  %
3339
4374
  % Non-English letters.
3340
4375
  \def\AA{AA}%
3341
4376
  \def\AE{AE}%
 
4377
  \def\DH{DZZ}%
3342
4378
  \def\L{L}%
3343
4379
  \def\OE{OE}%
3344
4380
  \def\O{O}%
 
4381
  \def\TH{ZZZ}%
3345
4382
  \def\aa{aa}%
3346
4383
  \def\ae{ae}%
 
4384
  \def\dh{dzz}%
 
4385
  \def\exclamdown{!}%
3347
4386
  \def\l{l}%
3348
4387
  \def\oe{oe}%
 
4388
  \def\ordf{a}%
 
4389
  \def\ordm{o}%
3349
4390
  \def\o{o}%
 
4391
  \def\questiondown{?}%
3350
4392
  \def\ss{ss}%
3351
 
  \def\exclamdown{!}%
3352
 
  \def\questiondown{?}%
3353
 
  \def\ordf{a}%
3354
 
  \def\ordm{o}%
 
4393
  \def\th{zzz}%
3355
4394
  %
3356
4395
  \def\LaTeX{LaTeX}%
3357
4396
  \def\TeX{TeX}%
3361
4400
  \def\bullet{bullet}%
3362
4401
  \def\comma{,}%
3363
4402
  \def\copyright{copyright}%
3364
 
  \def\registeredsymbol{R}%
3365
4403
  \def\dots{...}%
3366
4404
  \def\enddots{...}%
3367
4405
  \def\equiv{==}%
3368
4406
  \def\error{error}%
3369
4407
  \def\euro{euro}%
3370
4408
  \def\expansion{==>}%
 
4409
  \def\guillemetleft{<<}%
 
4410
  \def\guillemetright{>>}%
 
4411
  \def\guilsinglleft{<}%
 
4412
  \def\guilsinglright{>}%
3371
4413
  \def\minus{-}%
 
4414
  \def\point{.}%
3372
4415
  \def\pounds{pounds}%
3373
 
  \def\point{.}%
3374
4416
  \def\print{-|}%
 
4417
  \def\quotedblbase{"}%
 
4418
  \def\quotedblleft{"}%
 
4419
  \def\quotedblright{"}%
 
4420
  \def\quoteleft{`}%
 
4421
  \def\quoteright{'}%
 
4422
  \def\quotesinglbase{,}%
 
4423
  \def\registeredsymbol{R}%
3375
4424
  \def\result{=>}%
3376
 
  %
3377
 
  % Don't write macro names.
3378
 
  \emptyusermacros
 
4425
  \def\textdegree{o}%
 
4426
  %
 
4427
  % We need to get rid of all macros, leaving only the arguments (if present).
 
4428
  % Of course this is not nearly correct, but it is the best we can do for now.
 
4429
  % makeinfo does not expand macros in the argument to @deffn, which ends up
 
4430
  % writing an index entry, and texindex isn't prepared for an index sort entry
 
4431
  % that starts with \.
 
4432
  %
 
4433
  % Since macro invocations are followed by braces, we can just redefine them
 
4434
  % to take a single TeX argument.  The case of a macro invocation that
 
4435
  % goes to end-of-line is not handled.
 
4436
  %
 
4437
  \macrolist
3379
4438
}
3380
4439
 
3381
4440
\let\indexbackslash=0  %overridden during \printindex.
3403
4462
    %
3404
4463
    \edef\writeto{\csname#1indfile\endcsname}%
3405
4464
    %
3406
 
    \ifvmode
3407
 
      \dosubindsanitize
3408
 
    \else
3409
 
      \dosubindwrite
3410
 
    \fi
 
4465
    \safewhatsit\dosubindwrite
3411
4466
  }%
3412
4467
  \fi
3413
4468
}
3422
4477
  %
3423
4478
  % Remember, we are within a group.
3424
4479
  \indexdummies % Must do this here, since \bf, etc expand at this stage
3425
 
  \escapechar=`\\
3426
4480
  \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now
3427
4481
      % so it will be output as is; and it will print as backslash.
3428
4482
  %
3445
4499
  \temp
3446
4500
}
3447
4501
 
3448
 
% Take care of unwanted page breaks:
 
4502
% Take care of unwanted page breaks/skips around a whatsit:
3449
4503
%
3450
4504
% If a skip is the last thing on the list now, preserve it
3451
4505
% by backing up by \lastskip, doing the \write, then inserting
3452
4506
% the skip again.  Otherwise, the whatsit generated by the
3453
 
% \write will make \lastskip zero.  The result is that sequences
3454
 
% like this:
 
4507
% \write or \pdfdest will make \lastskip zero.  The result is that
 
4508
% sequences like this:
3455
4509
% @end defun
3456
4510
% @tindex whatever
3457
4511
% @defun ...
3475
4529
%
3476
4530
\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
3477
4531
%
 
4532
\newskip\whatsitskip
 
4533
\newcount\whatsitpenalty
 
4534
%
3478
4535
% ..., ready, GO:
3479
4536
%
3480
 
\def\dosubindsanitize{%
 
4537
\def\safewhatsit#1{%
 
4538
\ifhmode
 
4539
  #1%
 
4540
\else
3481
4541
  % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
3482
 
  \skip0 = \lastskip
 
4542
  \whatsitskip = \lastskip
3483
4543
  \edef\lastskipmacro{\the\lastskip}%
3484
 
  \count255 = \lastpenalty
 
4544
  \whatsitpenalty = \lastpenalty
3485
4545
  %
3486
4546
  % If \lastskip is nonzero, that means the last item was a
3487
4547
  % skip.  And since a skip is discardable, that means this
3488
 
  % -\skip0 glue we're inserting is preceded by a
 
4548
  % -\whatsitskip glue we're inserting is preceded by a
3489
4549
  % non-discardable item, therefore it is not a potential
3490
4550
  % breakpoint, therefore no \nobreak needed.
3491
4551
  \ifx\lastskipmacro\zeroskipmacro
3492
4552
  \else
3493
 
    \vskip-\skip0
 
4553
    \vskip-\whatsitskip
3494
4554
  \fi
3495
4555
  %
3496
 
  \dosubindwrite
 
4556
  #1%
3497
4557
  %
3498
4558
  \ifx\lastskipmacro\zeroskipmacro
3499
4559
    % If \lastskip was zero, perhaps the last item was a penalty, and
3501
4561
    % to re-insert the same penalty (values >10000 are used for various
3502
4562
    % signals); since we just inserted a non-discardable item, any
3503
4563
    % following glue (such as a \parskip) would be a breakpoint.  For example:
3504
 
    % 
 
4564
    %
3505
4565
    %   @deffn deffn-whatever
3506
4566
    %   @vindex index-whatever
3507
4567
    %   Description.
3508
4568
    % would allow a break between the index-whatever whatsit
3509
4569
    % and the "Description." paragraph.
3510
 
    \ifnum\count255>9999 \penalty\count255 \fi
 
4570
    \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
3511
4571
  \else
3512
4572
    % On the other hand, if we had a nonzero \lastskip,
3513
4573
    % this make-up glue would be preceded by a non-discardable item
3514
4574
    % (the whatsit from the \write), so we must insert a \nobreak.
3515
 
    \nobreak\vskip\skip0
 
4575
    \nobreak\vskip\whatsitskip
3516
4576
  \fi
 
4577
\fi
3517
4578
}
3518
4579
 
3519
4580
% The index entry written in the file actually looks like
3556
4617
  %
3557
4618
  \smallfonts \rm
3558
4619
  \tolerance = 9500
 
4620
  \plainfrenchspacing
3559
4621
  \everypar = {}% don't want the \kern\-parindent from indentation suppression.
3560
4622
  %
3561
4623
  % See if the index file exists and is nonempty.
3629
4691
%
3630
4692
% A straightforward implementation would start like this:
3631
4693
%       \def\entry#1#2{...
3632
 
% But this frozes the catcodes in the argument, and can cause problems to
 
4694
% But this freezes the catcodes in the argument, and can cause problems to
3633
4695
% @code, which sets - active.  This problem was fixed by a kludge---
3634
4696
% ``-'' was active throughout whole index, but this isn't really right.
3635
4697
%
3685
4747
    % The following is kludged to not output a line of dots in the index if
3686
4748
    % there are no page numbers.  The next person who breaks this will be
3687
4749
    % cursed by a Unix daemon.
3688
 
    \def\tempa{{\rm }}%
3689
 
    \def\tempb{#1}%
3690
 
    \edef\tempc{\tempa}%
3691
 
    \edef\tempd{\tempb}%
3692
 
    \ifx\tempc\tempd
 
4750
    \setbox\boxA = \hbox{#1}%
 
4751
    \ifdim\wd\boxA = 0pt
3693
4752
      \ %
3694
4753
    \else
3695
4754
      %
3713
4772
  \endgroup
3714
4773
}
3715
4774
 
3716
 
% Like \dotfill except takes at least 1 em.
 
4775
% Like plain.tex's \dotfill, except uses up at least 1 em.
3717
4776
\def\indexdotfill{\cleaders
3718
 
  \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill}
 
4777
  \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill}
3719
4778
 
3720
4779
\def\primary #1{\line{#1\hfil}}
3721
4780
 
3825
4884
%
3826
4885
% All done with double columns.
3827
4886
\def\enddoublecolumns{%
 
4887
  % The following penalty ensures that the page builder is exercised
 
4888
  % _before_ we change the output routine.  This is necessary in the
 
4889
  % following situation:
 
4890
  %
 
4891
  % The last section of the index consists only of a single entry.
 
4892
  % Before this section, \pagetotal is less than \pagegoal, so no
 
4893
  % break occurs before the last section starts.  However, the last
 
4894
  % section, consisting of \initial and the single \entry, does not
 
4895
  % fit on the page and has to be broken off.  Without the following
 
4896
  % penalty the page builder will not be exercised until \eject
 
4897
  % below, and by that time we'll already have changed the output
 
4898
  % routine to the \balancecolumns version, so the next-to-last
 
4899
  % double-column page will be processed with \balancecolumns, which
 
4900
  % is wrong:  The two columns will go to the main vertical list, with
 
4901
  % the broken-off section in the recent contributions.  As soon as
 
4902
  % the output routine finishes, TeX starts reconsidering the page
 
4903
  % break.  The two columns and the broken-off section both fit on the
 
4904
  % page, because the two columns now take up only half of the page
 
4905
  % goal.  When TeX sees \eject from below which follows the final
 
4906
  % section, it invokes the new output routine that we've set after
 
4907
  % \balancecolumns below; \onepageout will try to fit the two columns
 
4908
  % and the final section into the vbox of \pageheight (see
 
4909
  % \pagebody), causing an overfull box.
 
4910
  %
 
4911
  % Note that glue won't work here, because glue does not exercise the
 
4912
  % page builder, unlike penalties (see The TeXbook, pp. 280-281).
 
4913
  \penalty0
 
4914
  %
3828
4915
  \output = {%
3829
4916
    % Split the last of the double-column material.  Leave it on the
3830
4917
    % current page, no automatic page break.
3934
5021
  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
3935
5022
  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
3936
5023
 
3937
 
% Each @chapter defines this as the name of the chapter.
3938
 
% page headings and footings can use it.  @section does likewise.
3939
 
% However, they are not reliable, because we don't use marks.
 
5024
% Each @chapter defines these (using marks) as the number+name, number
 
5025
% and name of the chapter.  Page headings and footings can use
 
5026
% these.  @section does likewise.
3940
5027
\def\thischapter{}
 
5028
\def\thischapternum{}
 
5029
\def\thischaptername{}
3941
5030
\def\thissection{}
 
5031
\def\thissectionnum{}
 
5032
\def\thissectionname{}
3942
5033
 
3943
5034
\newcount\absseclevel % used to calculate proper heading level
3944
5035
\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
4051
5142
  \gdef\chaplevelprefix{\the\chapno.}%
4052
5143
  \resetallfloatnos
4053
5144
  %
4054
 
  \message{\putwordChapter\space \the\chapno}%
 
5145
  % \putwordChapter can contain complex things in translations.
 
5146
  \toks0=\expandafter{\putwordChapter}%
 
5147
  \message{\the\toks0 \space \the\chapno}%
4055
5148
  %
4056
5149
  % Write the actual heading.
4057
5150
  \chapmacro{#1}{Ynumbered}{\the\chapno}%
4062
5155
  \global\let\subsubsection = \numberedsubsubsec
4063
5156
}
4064
5157
 
4065
 
\outer\parseargdef\appendix{\apphead0{#1}} % normally apphead0 calls appendixzzz
 
5158
\outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
 
5159
%
4066
5160
\def\appendixzzz#1{%
4067
5161
  \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
4068
5162
    \global\advance\appendixno by 1
4069
5163
  \gdef\chaplevelprefix{\appendixletter.}%
4070
5164
  \resetallfloatnos
4071
5165
  %
4072
 
  \def\appendixnum{\putwordAppendix\space \appendixletter}%
4073
 
  \message{\appendixnum}%
 
5166
  % \putwordAppendix can contain complex things in translations.
 
5167
  \toks0=\expandafter{\putwordAppendix}%
 
5168
  \message{\the\toks0 \space \appendixletter}%
4074
5169
  %
4075
5170
  \chapmacro{#1}{Yappendix}{\appendixletter}%
4076
5171
  %
4202
5297
%       3) Likewise, headings look best if no \parindent is used, and
4203
5298
%          if justification is not attempted.  Hence \raggedright.
4204
5299
 
4205
 
 
4206
5300
\def\majorheading{%
4207
5301
  {\advance\chapheadingskip by 10pt \chapbreak }%
4208
5302
  \parsearg\chapheadingzzz
4211
5305
\def\chapheading{\chapbreak \parsearg\chapheadingzzz}
4212
5306
\def\chapheadingzzz#1{%
4213
5307
  {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
4214
 
                    \parindent=0pt\raggedright
4215
 
                    \rm #1\hfill}}%
 
5308
                    \parindent=0pt\ptexraggedright
 
5309
                    \rmisbold #1\hfill}}%
4216
5310
  \bigskip \par\penalty 200\relax
4217
5311
  \suppressfirstparagraphindent
4218
5312
}
4239
5333
 
4240
5334
\def\chapbreak{\dobreak \chapheadingskip {-4000}}
4241
5335
\def\chappager{\par\vfill\supereject}
4242
 
\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
 
5336
% Because \domark is called before \chapoddpage, the filler page will
 
5337
% get the headings for the next chapter, which is wrong.  But we don't
 
5338
% care -- we just disable all headings on the filler page.
 
5339
\def\chapoddpage{%
 
5340
  \chappager
 
5341
  \ifodd\pageno \else
 
5342
    \begingroup
 
5343
      \evenheadline={\hfil}\evenfootline={\hfil}%
 
5344
      \oddheadline={\hfil}\oddfootline={\hfil}%
 
5345
      \hbox to 0pt{}%
 
5346
      \chappager
 
5347
    \endgroup
 
5348
  \fi
 
5349
}
4243
5350
 
4244
5351
\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
4245
5352
 
4273
5380
\def\Yappendixkeyword{Yappendix}
4274
5381
%
4275
5382
\def\chapmacro#1#2#3{%
 
5383
  % Insert the first mark before the heading break (see notes for \domark).
 
5384
  \let\prevchapterdefs=\lastchapterdefs
 
5385
  \let\prevsectiondefs=\lastsectiondefs
 
5386
  \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
 
5387
                        \gdef\thissection{}}%
 
5388
  %
 
5389
  \def\temptype{#2}%
 
5390
  \ifx\temptype\Ynothingkeyword
 
5391
    \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
 
5392
                          \gdef\thischapter{\thischaptername}}%
 
5393
  \else\ifx\temptype\Yomitfromtockeyword
 
5394
    \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
 
5395
                          \gdef\thischapter{}}%
 
5396
  \else\ifx\temptype\Yappendixkeyword
 
5397
    \toks0={#1}%
 
5398
    \xdef\lastchapterdefs{%
 
5399
      \gdef\noexpand\thischaptername{\the\toks0}%
 
5400
      \gdef\noexpand\thischapternum{\appendixletter}%
 
5401
      % \noexpand\putwordAppendix avoids expanding indigestible
 
5402
      % commands in some of the translations.
 
5403
      \gdef\noexpand\thischapter{\noexpand\putwordAppendix{}
 
5404
                                 \noexpand\thischapternum:
 
5405
                                 \noexpand\thischaptername}%
 
5406
    }%
 
5407
  \else
 
5408
    \toks0={#1}%
 
5409
    \xdef\lastchapterdefs{%
 
5410
      \gdef\noexpand\thischaptername{\the\toks0}%
 
5411
      \gdef\noexpand\thischapternum{\the\chapno}%
 
5412
      % \noexpand\putwordChapter avoids expanding indigestible
 
5413
      % commands in some of the translations.
 
5414
      \gdef\noexpand\thischapter{\noexpand\putwordChapter{}
 
5415
                                 \noexpand\thischapternum:
 
5416
                                 \noexpand\thischaptername}%
 
5417
    }%
 
5418
  \fi\fi\fi
 
5419
  %
 
5420
  % Output the mark.  Pass it through \safewhatsit, to take care of
 
5421
  % the preceding space.
 
5422
  \safewhatsit\domark
 
5423
  %
 
5424
  % Insert the chapter heading break.
4276
5425
  \pchapsepmacro
 
5426
  %
 
5427
  % Now the second mark, after the heading break.  No break points
 
5428
  % between here and the heading.
 
5429
  \let\prevchapterdefs=\lastchapterdefs
 
5430
  \let\prevsectiondefs=\lastsectiondefs
 
5431
  \domark
 
5432
  %
4277
5433
  {%
4278
 
    \chapfonts \rm
 
5434
    \chapfonts \rmisbold
4279
5435
    %
4280
 
    % Have to define \thissection before calling \donoderef, because the
 
5436
    % Have to define \lastsection before calling \donoderef, because the
4281
5437
    % xref code eventually uses it.  On the other hand, it has to be called
4282
5438
    % after \pchapsepmacro, or the headline will change too soon.
4283
 
    \gdef\thissection{#1}%
4284
 
    \gdef\thischaptername{#1}%
 
5439
    \gdef\lastsection{#1}%
4285
5440
    %
4286
5441
    % Only insert the separating space if we have a chapter/appendix
4287
5442
    % number, and don't print the unnumbered ``number''.
4288
 
    \def\temptype{#2}%
4289
5443
    \ifx\temptype\Ynothingkeyword
4290
5444
      \setbox0 = \hbox{}%
4291
5445
      \def\toctype{unnchap}%
4292
 
      \def\thischapter{#1}%
4293
5446
    \else\ifx\temptype\Yomitfromtockeyword
4294
5447
      \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
4295
5448
      \def\toctype{omit}%
4296
 
      \xdef\thischapter{}%
4297
5449
    \else\ifx\temptype\Yappendixkeyword
4298
5450
      \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
4299
5451
      \def\toctype{app}%
4300
 
      % We don't substitute the actual chapter name into \thischapter
4301
 
      % because we don't want its macros evaluated now.  And we don't
4302
 
      % use \thissection because that changes with each section.
4303
 
      %
4304
 
      \xdef\thischapter{\putwordAppendix{} \appendixletter:
4305
 
                        \noexpand\thischaptername}%
4306
5452
    \else
4307
5453
      \setbox0 = \hbox{#3\enspace}%
4308
5454
      \def\toctype{numchap}%
4309
 
      \xdef\thischapter{\putwordChapter{} \the\chapno:
4310
 
                        \noexpand\thischaptername}%
4311
5455
    \fi\fi\fi
4312
5456
    %
4313
5457
    % Write the toc entry for this chapter.  Must come before the
4323
5467
    \donoderef{#2}%
4324
5468
    %
4325
5469
    % Typeset the actual heading.
4326
 
    \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
 
5470
    \nobreak % Avoid page breaks at the interline glue.
 
5471
    \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
4327
5472
          \hangindent=\wd0 \centerparametersmaybe
4328
5473
          \unhbox0 #1\par}%
4329
5474
  }%
4347
5492
%
4348
5493
\def\unnchfopen #1{%
4349
5494
\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
4350
 
                       \parindent=0pt\raggedright
4351
 
                       \rm #1\hfill}}\bigskip \par\nobreak
 
5495
                       \parindent=0pt\ptexraggedright
 
5496
                       \rmisbold #1\hfill}}\bigskip \par\nobreak
4352
5497
}
4353
5498
\def\chfopen #1#2{\chapoddpage {\chapfonts
4354
5499
\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
4357
5502
\def\centerchfopen #1{%
4358
5503
\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
4359
5504
                       \parindent=0pt
4360
 
                       \hfill {\rm #1}\hfill}}\bigskip \par\nobreak
 
5505
                       \hfill {\rmisbold #1}\hfill}}\bigskip \par\nobreak
4361
5506
}
4362
5507
\def\CHAPFopen{%
4363
5508
  \global\let\chapmacro=\chfopen
4385
5530
% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the
4386
5531
% section number.
4387
5532
%
 
5533
\def\seckeyword{sec}
 
5534
%
4388
5535
\def\sectionheading#1#2#3#4{%
4389
5536
  {%
4390
5537
    % Switch to the right set of fonts.
4391
 
    \csname #2fonts\endcsname \rm
 
5538
    \csname #2fonts\endcsname \rmisbold
 
5539
    %
 
5540
    \def\sectionlevel{#2}%
 
5541
    \def\temptype{#3}%
 
5542
    %
 
5543
    % Insert first mark before the heading break (see notes for \domark).
 
5544
    \let\prevsectiondefs=\lastsectiondefs
 
5545
    \ifx\temptype\Ynothingkeyword
 
5546
      \ifx\sectionlevel\seckeyword
 
5547
        \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
 
5548
                              \gdef\thissection{\thissectionname}}%
 
5549
      \fi
 
5550
    \else\ifx\temptype\Yomitfromtockeyword
 
5551
      % Don't redefine \thissection.
 
5552
    \else\ifx\temptype\Yappendixkeyword
 
5553
      \ifx\sectionlevel\seckeyword
 
5554
        \toks0={#1}%
 
5555
        \xdef\lastsectiondefs{%
 
5556
          \gdef\noexpand\thissectionname{\the\toks0}%
 
5557
          \gdef\noexpand\thissectionnum{#4}%
 
5558
          % \noexpand\putwordSection avoids expanding indigestible
 
5559
          % commands in some of the translations.
 
5560
          \gdef\noexpand\thissection{\noexpand\putwordSection{}
 
5561
                                     \noexpand\thissectionnum:
 
5562
                                     \noexpand\thissectionname}%
 
5563
        }%
 
5564
      \fi
 
5565
    \else
 
5566
      \ifx\sectionlevel\seckeyword
 
5567
        \toks0={#1}%
 
5568
        \xdef\lastsectiondefs{%
 
5569
          \gdef\noexpand\thissectionname{\the\toks0}%
 
5570
          \gdef\noexpand\thissectionnum{#4}%
 
5571
          % \noexpand\putwordSection avoids expanding indigestible
 
5572
          % commands in some of the translations.
 
5573
          \gdef\noexpand\thissection{\noexpand\putwordSection{}
 
5574
                                     \noexpand\thissectionnum:
 
5575
                                     \noexpand\thissectionname}%
 
5576
        }%
 
5577
      \fi
 
5578
    \fi\fi\fi
 
5579
    %
 
5580
    % Go into vertical mode.  Usually we'll already be there, but we
 
5581
    % don't want the following whatsit to end up in a preceding paragraph
 
5582
    % if the document didn't happen to have a blank line.
 
5583
    \par
 
5584
    %
 
5585
    % Output the mark.  Pass it through \safewhatsit, to take care of
 
5586
    % the preceding space.
 
5587
    \safewhatsit\domark
4392
5588
    %
4393
5589
    % Insert space above the heading.
4394
5590
    \csname #2headingbreak\endcsname
4395
5591
    %
 
5592
    % Now the second mark, after the heading break.  No break points
 
5593
    % between here and the heading.
 
5594
    \let\prevsectiondefs=\lastsectiondefs
 
5595
    \domark
 
5596
    %
4396
5597
    % Only insert the space after the number if we have a section number.
4397
 
    \def\sectionlevel{#2}%
4398
 
    \def\temptype{#3}%
4399
 
    %
4400
5598
    \ifx\temptype\Ynothingkeyword
4401
5599
      \setbox0 = \hbox{}%
4402
5600
      \def\toctype{unn}%
4403
 
      \gdef\thissection{#1}%
 
5601
      \gdef\lastsection{#1}%
4404
5602
    \else\ifx\temptype\Yomitfromtockeyword
4405
5603
      % for @headings -- no section number, don't include in toc,
4406
 
      % and don't redefine \thissection.
 
5604
      % and don't redefine \lastsection.
4407
5605
      \setbox0 = \hbox{}%
4408
5606
      \def\toctype{omit}%
4409
5607
      \let\sectionlevel=\empty
4410
5608
    \else\ifx\temptype\Yappendixkeyword
4411
5609
      \setbox0 = \hbox{#4\enspace}%
4412
5610
      \def\toctype{app}%
4413
 
      \gdef\thissection{#1}%
 
5611
      \gdef\lastsection{#1}%
4414
5612
    \else
4415
5613
      \setbox0 = \hbox{#4\enspace}%
4416
5614
      \def\toctype{num}%
4417
 
      \gdef\thissection{#1}%
 
5615
      \gdef\lastsection{#1}%
4418
5616
    \fi\fi\fi
4419
5617
    %
4420
 
    % Write the toc entry (before \donoderef).  See comments in \chfplain.
 
5618
    % Write the toc entry (before \donoderef).  See comments in \chapmacro.
4421
5619
    \writetocentry{\toctype\sectionlevel}{#1}{#4}%
4422
5620
    %
4423
5621
    % Write the node reference (= pdf destination for pdftex).
4424
 
    % Again, see comments in \chfplain.
 
5622
    % Again, see comments in \chapmacro.
4425
5623
    \donoderef{#3}%
4426
5624
    %
 
5625
    % Interline glue will be inserted when the vbox is completed.
 
5626
    % That glue will be a valid breakpoint for the page, since it'll be
 
5627
    % preceded by a whatsit (usually from the \donoderef, or from the
 
5628
    % \writetocentry if there was no node).  We don't want to allow that
 
5629
    % break, since then the whatsits could end up on page n while the
 
5630
    % section is on page n+1, thus toc/etc. are wrong.  Debian bug 276000.
 
5631
    \nobreak
 
5632
    %
4427
5633
    % Output the actual section heading.
4428
 
    \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
 
5634
    \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
4429
5635
          \hangindent=\wd0  % zero if no section number
4430
5636
          \unhbox0 #1}%
4431
5637
  }%
4441
5647
  % glue accumulate.  (Not a breakpoint because it's preceded by a
4442
5648
  % discardable item.)
4443
5649
  \vskip-\parskip
4444
 
  % 
 
5650
  %
4445
5651
  % This is purely so the last item on the list is a known \penalty >
4446
5652
  % 10000.  This is so \startdefun can avoid allowing breakpoints after
4447
5653
  % section headings.  Otherwise, it would insert a valid breakpoint between:
4448
 
  % 
 
5654
  %
4449
5655
  %   @section sec-whatever
4450
5656
  %   @deffn def-whatever
4451
5657
  \penalty 10001
4482
5688
    \fi
4483
5689
    %
4484
5690
    \iflinks
4485
 
      \toks0 = {#2}%
4486
 
      \toks2 = \expandafter{\lastnode}%
4487
 
      \edef\temp{\write\tocfile{\realbackslash #1entry{\the\toks0}{#3}%
4488
 
                               {\the\toks2}{\noexpand\folio}}}%
4489
 
      \temp
 
5691
      {\atdummies
 
5692
       \edef\temp{%
 
5693
         \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
 
5694
       \temp
 
5695
      }%
4490
5696
    \fi
4491
5697
  \fi
4492
5698
  %
4499
5705
  \ifpdf \global\pdfmakepagedesttrue \fi
4500
5706
}
4501
5707
 
 
5708
 
 
5709
% These characters do not print properly in the Computer Modern roman
 
5710
% fonts, so we must take special care.  This is more or less redundant
 
5711
% with the Texinfo input format setup at the end of this file.
 
5712
%
 
5713
\def\activecatcodes{%
 
5714
  \catcode`\"=\active
 
5715
  \catcode`\$=\active
 
5716
  \catcode`\<=\active
 
5717
  \catcode`\>=\active
 
5718
  \catcode`\\=\active
 
5719
  \catcode`\^=\active
 
5720
  \catcode`\_=\active
 
5721
  \catcode`\|=\active
 
5722
  \catcode`\~=\active
 
5723
}
 
5724
 
 
5725
 
 
5726
% Read the toc file, which is essentially Texinfo input.
 
5727
\def\readtocfile{%
 
5728
  \setupdatafile
 
5729
  \activecatcodes
 
5730
  \input \tocreadfilename
 
5731
}
 
5732
 
4502
5733
\newskip\contentsrightmargin \contentsrightmargin=1in
4503
5734
\newcount\savepageno
4504
5735
\newcount\lastnegativepageno \lastnegativepageno = -1
4515
5746
  %
4516
5747
  % Don't need to put `Contents' or `Short Contents' in the headline.
4517
5748
  % It is abundantly clear what they are.
4518
 
  \def\thischapter{}%
4519
5749
  \chapmacro{#1}{Yomitfromtoc}{}%
4520
5750
  %
4521
5751
  \savepageno = \pageno
4522
5752
  \begingroup                  % Set up to handle contents files properly.
4523
 
    \catcode`\\=0  \catcode`\{=1  \catcode`\}=2  \catcode`\@=11
4524
 
    % We can't do this, because then an actual ^ in a section
4525
 
    % title fails, e.g., @chapter ^ -- exponentiation.  --karl, 9jul97.
4526
 
    %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
4527
 
    \raggedbottom             % Worry more about breakpoints than the bottom.
 
5753
    \raggedbottom              % Worry more about breakpoints than the bottom.
4528
5754
    \advance\hsize by -\contentsrightmargin % Don't use the full line length.
4529
5755
    %
4530
5756
    % Roman numerals for page numbers.
4531
5757
    \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
4532
5758
}
4533
5759
 
 
5760
% redefined for the two-volume lispref.  We always output on
 
5761
% \jobname.toc even if this is redefined.
 
5762
%
 
5763
\def\tocreadfilename{\jobname.toc}
4534
5764
 
4535
5765
% Normal (long) toc.
 
5766
%
4536
5767
\def\contents{%
4537
5768
  \startcontents{\putwordTOC}%
4538
 
    \openin 1 \jobname.toc
 
5769
    \openin 1 \tocreadfilename\space
4539
5770
    \ifeof 1 \else
4540
 
      \input \jobname.toc
 
5771
      \readtocfile
4541
5772
    \fi
4542
5773
    \vfill \eject
4543
5774
    \contentsalignmacro % in case @setchapternewpage odd is in effect
4573
5804
    \let\numsubsubsecentry = \numsecentry
4574
5805
    \let\appsubsubsecentry = \numsecentry
4575
5806
    \let\unnsubsubsecentry = \numsecentry
4576
 
    \openin 1 \jobname.toc
 
5807
    \openin 1 \tocreadfilename\space
4577
5808
    \ifeof 1 \else
4578
 
      \input \jobname.toc
 
5809
      \readtocfile
4579
5810
    \fi
4580
5811
    \closein 1
4581
5812
    \vfill \eject
4698
5929
\message{environments,}
4699
5930
% @foo ... @end foo.
4700
5931
 
4701
 
% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
4702
 
%
4703
 
% Since these characters are used in examples, it should be an even number of
4704
 
% \tt widths. Each \tt character is 1en, so two makes it 1em.
4705
 
%
4706
 
\def\point{$\star$}
4707
 
\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
4708
 
\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
4709
 
\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
4710
 
\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
4711
 
 
4712
 
% The @error{} command.
4713
 
% Adapted from the TeXbook's \boxit.
4714
 
%
4715
 
\newbox\errorbox
4716
 
%
4717
 
{\tentt \global\dimen0 = 3em}% Width of the box.
4718
 
\dimen2 = .55pt % Thickness of rules
4719
 
% The text. (`r' is open on the right, `e' somewhat less so on the left.)
4720
 
\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
4721
 
%
4722
 
\setbox\errorbox=\hbox to \dimen0{\hfil
4723
 
   \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
4724
 
   \advance\hsize by -2\dimen2 % Rules.
4725
 
   \vbox{%
4726
 
      \hrule height\dimen2
4727
 
      \hbox{\vrule width\dimen2 \kern3pt          % Space to left of text.
4728
 
         \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
4729
 
         \kern3pt\vrule width\dimen2}% Space to right.
4730
 
      \hrule height\dimen2}
4731
 
    \hfil}
4732
 
%
4733
 
\def\error{\leavevmode\lower.7ex\copy\errorbox}
4734
 
 
4735
5932
% @tex ... @end tex    escapes into raw Tex temporarily.
4736
5933
% One exception: @ is still an escape character, so that @end tex works.
4737
5934
% But \@ or @@ will get a plain tex @ character.
4738
5935
 
4739
5936
\envdef\tex{%
 
5937
  \setupmarkupstyle{tex}%
4740
5938
  \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
4741
5939
  \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
4742
5940
  \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
4746
5944
  \catcode `\|=\other
4747
5945
  \catcode `\<=\other
4748
5946
  \catcode `\>=\other
 
5947
  \catcode`\`=\other
 
5948
  \catcode`\'=\other
4749
5949
  \escapechar=`\\
4750
5950
  %
4751
5951
  \let\b=\ptexb
4765
5965
  \let\/=\ptexslash
4766
5966
  \let\*=\ptexstar
4767
5967
  \let\t=\ptext
 
5968
  \expandafter \let\csname top\endcsname=\ptextop  % outer
 
5969
  \let\frenchspacing=\plainfrenchspacing
4768
5970
  %
4769
5971
  \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
4770
5972
  \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
4810
6012
 
4811
6013
\let\afterenvbreak = \aboveenvbreak
4812
6014
 
4813
 
% \nonarrowing is a flag.  If "set", @lisp etc don't narrow margins.
 
6015
% \nonarrowing is a flag.  If "set", @lisp etc don't narrow margins; it will
 
6016
% also clear it, so that its embedded environments do the narrowing again.
4814
6017
\let\nonarrowing=\relax
4815
6018
 
4816
6019
% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
4847
6050
                                % each corner char, and rule thickness
4848
6051
  \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
4849
6052
  % Flag to tell @lisp, etc., not to narrow margin.
4850
 
  \let\nonarrowing=\comment
 
6053
  \let\nonarrowing = t%
4851
6054
  \vbox\bgroup
4852
6055
      \baselineskip=0pt\parskip=0pt\lineskip=0pt
4853
6056
      \carttop
4878
6081
 
4879
6082
% This macro is called at the beginning of all the @example variants,
4880
6083
% inside a group.
 
6084
\newdimen\nonfillparindent
4881
6085
\def\nonfillstart{%
4882
6086
  \aboveenvbreak
4883
6087
  \hfuzz = 12pt % Don't be fussy
4885
6089
  \let\par = \lisppar % don't ignore blank lines
4886
6090
  \obeylines % each line of input is a line of output
4887
6091
  \parskip = 0pt
 
6092
  % Turn off paragraph indentation but redefine \indent to emulate
 
6093
  % the normal \indent.
 
6094
  \nonfillparindent=\parindent
4888
6095
  \parindent = 0pt
 
6096
  \let\indent\nonfillindent
 
6097
  %
4889
6098
  \emergencystretch = 0pt % don't try to avoid overfull boxes
4890
 
  % @cartouche defines \nonarrowing to inhibit narrowing
4891
 
  % at next level down.
4892
6099
  \ifx\nonarrowing\relax
4893
6100
    \advance \leftskip by \lispnarrowing
4894
6101
    \exdentamount=\lispnarrowing
 
6102
  \else
 
6103
    \let\nonarrowing = \relax
4895
6104
  \fi
4896
6105
  \let\exdent=\nofillexdent
4897
6106
}
4898
6107
 
 
6108
\begingroup
 
6109
\obeyspaces
 
6110
% We want to swallow spaces (but not other tokens) after the fake
 
6111
% @indent in our nonfill-environments, where spaces are normally
 
6112
% active and set to @tie, resulting in them not being ignored after
 
6113
% @indent.
 
6114
\gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
 
6115
\gdef\nonfillindentcheck{%
 
6116
\ifx\temp %
 
6117
\expandafter\nonfillindentgobble%
 
6118
\else%
 
6119
\leavevmode\nonfillindentbox%
 
6120
\fi%
 
6121
}%
 
6122
\endgroup
 
6123
\def\nonfillindentgobble#1{\nonfillindent}
 
6124
\def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
 
6125
 
4899
6126
% If you want all examples etc. small: @set dispenvsize small.
4900
6127
% If you want even small examples the full size: @set dispenvsize nosmall.
4901
6128
% This affects the following displayed environments:
4906
6133
\let\SETdispenvsize\relax
4907
6134
\def\setnormaldispenv{%
4908
6135
  \ifx\SETdispenvsize\smallword
 
6136
    % end paragraph for sake of leading, in case document has no blank
 
6137
    % line.  This is redundant with what happens in \aboveenvbreak, but
 
6138
    % we need to do it before changing the fonts, and it's inconvenient
 
6139
    % to change the fonts afterward.
 
6140
    \ifnum \lastpenalty=10000 \else \endgraf \fi
4909
6141
    \smallexamplefonts \rm
4910
6142
  \fi
4911
6143
}
4912
6144
\def\setsmalldispenv{%
4913
6145
  \ifx\SETdispenvsize\nosmallword
4914
6146
  \else
 
6147
    \ifnum \lastpenalty=10000 \else \endgraf \fi
4915
6148
    \smallexamplefonts \rm
4916
6149
  \fi
4917
6150
}
4938
6171
%
4939
6172
\maketwodispenvs {lisp}{example}{%
4940
6173
  \nonfillstart
4941
 
  \tt
 
6174
  \tt\setupmarkupstyle{example}%
4942
6175
  \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
4943
6176
  \gobble       % eat return
4944
6177
}
4945
 
 
4946
6178
% @display/@smalldisplay: same as @lisp except keep current font.
4947
6179
%
4948
6180
\makedispenv {display}{%
4977
6209
\let\Eflushright = \afterenvbreak
4978
6210
 
4979
6211
 
 
6212
% @raggedright does more-or-less normal line breaking but no right
 
6213
% justification.  From plain.tex.
 
6214
\envdef\raggedright{%
 
6215
  \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax
 
6216
}
 
6217
\let\Eraggedright\par
 
6218
 
 
6219
\envdef\raggedleft{%
 
6220
  \parindent=0pt \leftskip0pt plus2em
 
6221
  \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
 
6222
  \hbadness=10000 % Last line will usually be underfull, so turn off
 
6223
                  % badness reporting.
 
6224
}
 
6225
\let\Eraggedleft\par
 
6226
 
 
6227
\envdef\raggedcenter{%
 
6228
  \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em
 
6229
  \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
 
6230
  \hbadness=10000 % Last line will usually be underfull, so turn off
 
6231
                  % badness reporting.
 
6232
}
 
6233
\let\Eraggedcenter\par
 
6234
 
 
6235
 
4980
6236
% @quotation does normal linebreaking (hence we can't use \nonfillstart)
4981
6237
% and narrows the margins.  We keep \parskip nonzero in general, since
4982
6238
% we're doing normal filling.  So, when using \aboveenvbreak and
4983
6239
% \afterenvbreak, temporarily make \parskip 0.
4984
6240
%
4985
 
\envdef\quotation{%
 
6241
\def\quotationstart{%
4986
6242
  {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
4987
6243
  \parindent=0pt
4988
6244
  %
4991
6247
    \advance\leftskip by \lispnarrowing
4992
6248
    \advance\rightskip by \lispnarrowing
4993
6249
    \exdentamount = \lispnarrowing
 
6250
  \else
4994
6251
    \let\nonarrowing = \relax
4995
6252
  \fi
4996
6253
  \parsearg\quotationlabel
4997
6254
}
4998
6255
 
 
6256
\envdef\quotation{%
 
6257
  \setnormaldispenv
 
6258
  \quotationstart
 
6259
}
 
6260
 
 
6261
\envdef\smallquotation{%
 
6262
  \setsmalldispenv
 
6263
  \quotationstart
 
6264
}
 
6265
\let\Esmallquotation = \Equotation
 
6266
 
4999
6267
% We have retained a nonzero parskip for the environment, since we're
5000
6268
% doing normal filling.
5001
6269
%
5031
6299
  \do\ \do\\\do\{\do\}\do\$\do\&%
5032
6300
  \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
5033
6301
  \do\<\do\>\do\|\do\@\do+\do\"%
 
6302
  % Don't do the quotes -- if we do, @set txicodequoteundirected and
 
6303
  % @set txicodequotebacktick will not have effect on @verb and
 
6304
  % @verbatim, and ?` and !` ligatures won't get disabled.
 
6305
  %\do\`\do\'%
5034
6306
}
5035
6307
%
5036
6308
% [Knuth] p. 380
5037
6309
\def\uncatcodespecials{%
5038
6310
  \def\do##1{\catcode`##1=\other}\dospecials}
5039
6311
%
5040
 
% [Knuth] pp. 380,381,391
5041
 
% Disable Spanish ligatures ?` and !` of \tt font
5042
 
\begingroup
5043
 
  \catcode`\`=\active\gdef`{\relax\lq}
5044
 
\endgroup
5045
 
%
5046
6312
% Setup for the @verb command.
5047
6313
%
5048
6314
% Eight spaces for a tab
5054
6320
\def\setupverb{%
5055
6321
  \tt  % easiest (and conventionally used) font for verbatim
5056
6322
  \def\par{\leavevmode\endgraf}%
5057
 
  \catcode`\`=\active
 
6323
  \setupmarkupstyle{verb}%
5058
6324
  \tabeightspaces
5059
6325
  % Respect line breaks,
5060
6326
  % print special symbols as themselves, and
5069
6335
\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
5070
6336
%
5071
6337
\def\starttabbox{\setbox0=\hbox\bgroup}
 
6338
%
5072
6339
\begingroup
5073
6340
  \catcode`\^^I=\active
5074
6341
  \gdef\tabexpand{%
5082
6349
    }%
5083
6350
  }
5084
6351
\endgroup
 
6352
 
 
6353
% start the verbatim environment.
5085
6354
\def\setupverbatim{%
 
6355
  \let\nonarrowing = t%
5086
6356
  \nonfillstart
5087
 
  \advance\leftskip by -\defbodyindent
5088
6357
  % Easiest (and conventionally used) font for verbatim
5089
6358
  \tt
5090
6359
  \def\par{\leavevmode\egroup\box0\endgraf}%
5091
 
  \catcode`\`=\active
5092
6360
  \tabexpand
 
6361
  \setupmarkupstyle{verbatim}%
5093
6362
  % Respect line breaks,
5094
6363
  % print special symbols as themselves, and
5095
6364
  % make each space count
5149
6418
  {%
5150
6419
    \makevalueexpandable
5151
6420
    \setupverbatim
 
6421
    \indexnofonts       % Allow `@@' and other weird things in file names.
5152
6422
    \input #1
5153
6423
    \afterenvbreak
5154
6424
  }%
5174
6444
  \endgroup
5175
6445
}
5176
6446
 
 
6447
 
5177
6448
\message{defuns,}
5178
6449
% @defun etc.
5179
6450
 
5180
6451
\newskip\defbodyindent \defbodyindent=.4in
5181
6452
\newskip\defargsindent \defargsindent=50pt
5182
6453
\newskip\deflastargmargin \deflastargmargin=18pt
 
6454
\newcount\defunpenalty
5183
6455
 
5184
6456
% Start the processing of @deffn:
5185
6457
\def\startdefun{%
5186
6458
  \ifnum\lastpenalty<10000
5187
6459
    \medbreak
 
6460
    \defunpenalty=10003 % Will keep this @deffn together with the
 
6461
                        % following @def command, see below.
5188
6462
  \else
5189
6463
    % If there are two @def commands in a row, we'll have a \nobreak,
5190
6464
    % which is there to keep the function description together with its
5191
6465
    % header.  But if there's nothing but headers, we need to allow a
5192
6466
    % break somewhere.  Check specifically for penalty 10002, inserted
5193
 
    % by \defargscommonending, instead of 10000, since the sectioning
 
6467
    % by \printdefunline, instead of 10000, since the sectioning
5194
6468
    % commands also insert a nobreak penalty, and we don't want to allow
5195
6469
    % a break between a section heading and a defun.
5196
 
    % 
5197
 
    \ifnum\lastpenalty=10002 \penalty2000 \fi
 
6470
    %
 
6471
    % As a minor refinement, we avoid "club" headers by signalling
 
6472
    % with penalty of 10003 after the very first @deffn in the
 
6473
    % sequence (see above), and penalty of 10002 after any following
 
6474
    % @def command.
 
6475
    \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
5198
6476
    %
5199
6477
    % Similarly, after a section heading, do not allow a break.
5200
6478
    % But do insert the glue.
5212
6490
  %
5213
6491
  % As above, allow line break if we have multiple x headers in a row.
5214
6492
  % It's not a great place, though.
5215
 
  \ifnum\lastpenalty=10002 \penalty3000 \fi
 
6493
  \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
5216
6494
  %
5217
6495
  % And now, it's time to reuse the body of the original defun:
5218
6496
  \expandafter\gobbledefun#1%
5230
6508
    \advance\rightskip by 0pt plus 1fil
5231
6509
    \endgraf
5232
6510
    \nobreak\vskip -\parskip
5233
 
    \penalty 10002  % signal to \startdefun and \dodefunx
 
6511
    \penalty\defunpenalty  % signal to \startdefun and \dodefunx
5234
6512
    % Some of the @defun-type tags do not enable magic parentheses,
5235
6513
    % rendering the following check redundant.  But we don't optimize.
5236
6514
    \checkparencounts
5240
6518
\def\Edefun{\endgraf\medbreak}
5241
6519
 
5242
6520
% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
5243
 
% the only thing remainnig is to define \deffnheader.
 
6521
% the only thing remaining is to define \deffnheader.
5244
6522
%
5245
6523
\def\makedefun#1{%
5246
6524
  \expandafter\let\csname E#1\endcsname = \Edefun
5419
6697
  %
5420
6698
  % On the other hand, if an argument has two dashes (for instance), we
5421
6699
  % want a way to get ttsl.  Let's try @var for that.
5422
 
  \let\var=\ttslanted
 
6700
  \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
5423
6701
  #1%
5424
6702
  \sl\hyphenchar\font=45
5425
6703
}
5499
6777
  \ifnum\parencount=0 \else \badparencount \fi
5500
6778
  \ifnum\brackcount=0 \else \badbrackcount \fi
5501
6779
}
 
6780
% these should not use \errmessage; the glibc manual, at least, actually
 
6781
% has such constructs (when documenting function pointers).
5502
6782
\def\badparencount{%
5503
 
  \errmessage{Unbalanced parentheses in @def}%
 
6783
  \message{Warning: unbalanced parentheses in @def...}%
5504
6784
  \global\parencount=0
5505
6785
}
5506
6786
\def\badbrackcount{%
5507
 
  \errmessage{Unbalanced square braces in @def}%
 
6787
  \message{Warning: unbalanced square brackets in @def...}%
5508
6788
  \global\brackcount=0
5509
6789
}
5510
6790
 
5539
6819
    \spaceisspace
5540
6820
    %
5541
6821
    % Append \endinput to make sure that TeX does not see the ending newline.
5542
 
    %
5543
6822
    % I've verified that it is necessary both for e-TeX and for ordinary TeX
5544
6823
    %                                                   --kasal, 29nov03
5545
6824
    \scantokens{#1\endinput}%
5554
6833
\newcount\paramno   % Count of parameters
5555
6834
\newtoks\macname    % Macro name
5556
6835
\newif\ifrecursive  % Is it recursive?
5557
 
\def\macrolist{}    % List of all defined macros in the form
5558
 
                    % \do\macro1\do\macro2...
 
6836
 
 
6837
% List of all defined macros in the form
 
6838
%    \definedummyword\macro1\definedummyword\macro2...
 
6839
% Currently is also contains all @aliases; the list can be split
 
6840
% if there is a need.
 
6841
\def\macrolist{}
 
6842
 
 
6843
% Add the macro to \macrolist
 
6844
\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
 
6845
\def\addtomacrolistxxx#1{%
 
6846
     \toks0 = \expandafter{\macrolist\definedummyword#1}%
 
6847
     \xdef\macrolist{\the\toks0}%
 
6848
}
5559
6849
 
5560
6850
% Utility routines.
5561
6851
% This does \let #1 = #2, with \csnames; that is,
5562
6852
%   \let \csname#1\endcsname = \csname#2\endcsname
5563
6853
% (except of course we have to play expansion games).
5564
 
 
6854
%
5565
6855
\def\cslet#1#2{%
5566
6856
  \expandafter\let
5567
6857
  \csname#1\expandafter\endcsname
5589
6879
% all characters are catcode 10, 11 or 12, except \ which is active
5590
6880
% (as in normal texinfo). It is necessary to change the definition of \.
5591
6881
 
 
6882
% Non-ASCII encodings make 8-bit characters active, so un-activate
 
6883
% them to avoid their expansion.  Must do this non-globally, to
 
6884
% confine the change to the current group.
 
6885
 
5592
6886
% It's necessary to have hard CRs when the macro is executed. This is
5593
6887
% done by  making ^^M (\endlinechar) catcode 12 when reading the macro
5594
6888
% body, and then making it the \newlinechar in \scanmacro.
5603
6897
  \catcode`\_=\other
5604
6898
  \catcode`\|=\other
5605
6899
  \catcode`\~=\other
 
6900
  \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
5606
6901
}
5607
6902
 
5608
6903
\def\scanargctxt{%
5653
6948
     \else \errmessage{Macro name \the\macname\space already defined}\fi
5654
6949
     \global\cslet{macsave.\the\macname}{\the\macname}%
5655
6950
     \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
5656
 
     % Add the macroname to \macrolist
5657
 
     \toks0 = \expandafter{\macrolist\do}%
5658
 
     \xdef\macrolist{\the\toks0
5659
 
       \expandafter\noexpand\csname\the\macname\endcsname}%
 
6951
     \addtomacrolist{\the\macname}%
5660
6952
  \fi
5661
6953
  \begingroup \macrobodyctxt
5662
6954
  \ifrecursive \expandafter\parsermacbody
5670
6962
    % Remove the macro name from \macrolist:
5671
6963
    \begingroup
5672
6964
      \expandafter\let\csname#1\endcsname \relax
5673
 
      \let\do\unmacrodo
 
6965
      \let\definedummyword\unmacrodo
5674
6966
      \xdef\macrolist{\macrolist}%
5675
6967
    \endgroup
5676
6968
  \else
5682
6974
% macro definitions that have been changed to \relax.
5683
6975
%
5684
6976
\def\unmacrodo#1{%
5685
 
  \ifx#1\relax
 
6977
  \ifx #1\relax
5686
6978
    % remove this
5687
6979
  \else
5688
 
    \noexpand\do \noexpand #1%
 
6980
    \noexpand\definedummyword \noexpand#1%
5689
6981
  \fi
5690
6982
}
5691
6983
 
5798
7090
% {.  If so it reads up to the closing }, if not, it reads the whole
5799
7091
% line.  Whatever was read is then fed to the next control sequence
5800
7092
% as an argument (by \parsebrace or \parsearg)
5801
 
\def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx}
 
7093
\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
5802
7094
\def\braceorlinexxx{%
5803
7095
  \ifx\nchar\bgroup\else
5804
7096
    \expandafter\parsearg
5805
 
  \fi \next}
5806
 
 
5807
 
% We want to disable all macros during \shipout so that they are not
5808
 
% expanded by \write.
5809
 
\def\turnoffmacros{\begingroup \def\do##1{\let\noexpand##1=\relax}%
5810
 
  \edef\next{\macrolist}\expandafter\endgroup\next}
5811
 
 
5812
 
% For \indexnofonts, we need to get rid of all macros, leaving only the
5813
 
% arguments (if present).  Of course this is not nearly correct, but it
5814
 
% is the best we can do for now.  makeinfo does not expand macros in the
5815
 
% argument to @deffn, which ends up writing an index entry, and texindex
5816
 
% isn't prepared for an index sort entry that starts with \.
5817
 
5818
 
% Since macro invocations are followed by braces, we can just redefine them
5819
 
% to take a single TeX argument.  The case of a macro invocation that
5820
 
% goes to end-of-line is not handled.
5821
 
5822
 
\def\emptyusermacros{\begingroup
5823
 
  \def\do##1{\let\noexpand##1=\noexpand\asis}%
5824
 
  \edef\next{\macrolist}\expandafter\endgroup\next}
 
7097
  \fi \macnamexxx}
5825
7098
 
5826
7099
 
5827
7100
% @alias.
5832
7105
\def\aliasyyy #1=#2\relax{%
5833
7106
  {%
5834
7107
    \expandafter\let\obeyedspace=\empty
 
7108
    \addtomacrolist{#1}%
5835
7109
    \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
5836
7110
  }%
5837
7111
  \next
5841
7115
\message{cross references,}
5842
7116
 
5843
7117
\newwrite\auxfile
5844
 
 
5845
7118
\newif\ifhavexrefs    % True if xref values are known.
5846
7119
\newif\ifwarnedxrefs  % True if we warned once that they aren't known.
5847
7120
 
5886
7159
 
5887
7160
% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
5888
7161
% anchor), which consists of three parts:
5889
 
% 1) NAME-title - the current sectioning name taken from \thissection,
 
7162
% 1) NAME-title - the current sectioning name taken from \lastsection,
5890
7163
%                 or the anchor name.
5891
7164
% 2) NAME-snt   - section number and type, passed as the SNT arg, or
5892
7165
%                 empty for anchors.
5901
7174
  \iflinks
5902
7175
    {%
5903
7176
      \atdummies  % preserve commands, but don't expand them
5904
 
      \turnoffactive
5905
 
      \otherbackslash
5906
7177
      \edef\writexrdef##1##2{%
5907
7178
        \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
5908
7179
          ##1}{##2}}% these are parameters of \writexrdef
5909
7180
      }%
5910
 
      \toks0 = \expandafter{\thissection}%
 
7181
      \toks0 = \expandafter{\lastsection}%
5911
7182
      \immediate \writexrdef{title}{\the\toks0 }%
5912
7183
      \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
5913
 
      \writexrdef{pg}{\folio}% will be written later, during \shipout
 
7184
      \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, during \shipout
5914
7185
    }%
5915
7186
  \fi
5916
7187
}
5954
7225
  %
5955
7226
  % Make link in pdf output.
5956
7227
  \ifpdf
5957
 
    \leavevmode
5958
 
    \getfilename{#4}%
5959
 
    {\turnoffactive \otherbackslash
 
7228
    {\indexnofonts
 
7229
     \turnoffactive
 
7230
     % This expands tokens, so do it after making catcode changes, so _
 
7231
     % etc. don't get their TeX definitions.
 
7232
     \getfilename{#4}%
 
7233
     %
 
7234
     % See comments at \activebackslashdouble.
 
7235
     {\activebackslashdouble \xdef\pdfxrefdest{#1}%
 
7236
      \backslashparens\pdfxrefdest}%
 
7237
     %
 
7238
     \leavevmode
 
7239
     \startlink attr{/Border [0 0 0]}%
5960
7240
     \ifnum\filenamelength>0
5961
 
       \startlink attr{/Border [0 0 0]}%
5962
 
         goto file{\the\filename.pdf} name{#1}%
 
7241
       goto file{\the\filename.pdf} name{\pdfxrefdest}%
5963
7242
     \else
5964
 
       \startlink attr{/Border [0 0 0]}%
5965
 
         goto name{\pdfmkpgn{#1}}%
 
7243
       goto name{\pdfmkpgn{\pdfxrefdest}}%
5966
7244
     \fi
5967
7245
    }%
5968
 
    \linkcolor
 
7246
    \setcolor{\linkcolor}%
5969
7247
  \fi
5970
7248
  %
5971
7249
  % Float references are printed completely differently: "Figure 1.2"
5976
7254
    % include an _ in the xref name, etc.
5977
7255
    \indexnofonts
5978
7256
    \turnoffactive
5979
 
    \otherbackslash
5980
7257
    \expandafter\global\expandafter\let\expandafter\Xthisreftitle
5981
7258
      \csname XR#1-title\endcsname
5982
7259
  }%
5984
7261
    % If the user specified the print name (third arg) to the ref,
5985
7262
    % print it instead of our usual "Figure 1.2".
5986
7263
    \ifdim\wd0 = 0pt
5987
 
      \refx{#1-snt}%
 
7264
      \refx{#1-snt}{}%
5988
7265
    \else
5989
7266
      \printedrefname
5990
7267
    \fi
6004
7281
    % is a loss.  Therefore, we give the text of the node name again, so it
6005
7282
    % is as if TeX is seeing it for the first time.
6006
7283
    \ifdim \wd1 > 0pt
6007
 
      \putwordsection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}%
 
7284
      \putwordSection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}%
6008
7285
    \else
6009
7286
      % _ (for example) has to be the character _ for the purposes of the
6010
7287
      % control sequence corresponding to the node, but it has to expand
6011
7288
      % into the usual \leavevmode...\vrule stuff for purposes of
6012
7289
      % printing. So we \turnoffactive for the \refx-snt, back on for the
6013
7290
      % printing, back off for the \refx-pg.
6014
 
      {\turnoffactive \otherbackslash
 
7291
      {\turnoffactive
6015
7292
       % Only output a following space if the -snt ref is nonempty; for
6016
7293
       % @unnumbered and @anchor, it won't be.
6017
7294
       \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
6024
7301
      ,\space
6025
7302
      %
6026
7303
      % output the `page 3'.
6027
 
      \turnoffactive \otherbackslash \putwordpage\tie\refx{#1-pg}{}%
 
7304
      \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
6028
7305
    \fi
6029
7306
  \fi
6030
7307
  \endlink
6100
7377
% collisions).  But if this is a float type, we have more work to do.
6101
7378
%
6102
7379
\def\xrdef#1#2{%
6103
 
  \expandafter\gdef\csname XR#1\endcsname{#2}% remember this xref value.
 
7380
  {% The node name might contain 8-bit characters, which in our current
 
7381
   % implementation are changed to commands like @'e.  Don't let these
 
7382
   % mess up the control sequence name.
 
7383
    \indexnofonts
 
7384
    \turnoffactive
 
7385
    \xdef\safexrefname{#1}%
 
7386
  }%
 
7387
  %
 
7388
  \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref
6104
7389
  %
6105
7390
  % Was that xref control sequence that we just defined for a float?
6106
 
  \expandafter\iffloat\csname XR#1\endcsname
 
7391
  \expandafter\iffloat\csname XR\safexrefname\endcsname
6107
7392
    % it was a float, and we have the (safe) float type in \iffloattype.
6108
7393
    \expandafter\let\expandafter\floatlist
6109
7394
      \csname floatlist\iffloattype\endcsname
6118
7403
    %
6119
7404
    % Remember this xref in the control sequence \floatlistFLOATTYPE,
6120
7405
    % for later use in \listoffloats.
6121
 
    \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0{#1}}%
 
7406
    \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
 
7407
      {\safexrefname}}%
6122
7408
  \fi
6123
7409
}
6124
7410
 
6127
7413
\def\tryauxfile{%
6128
7414
  \openin 1 \jobname.aux
6129
7415
  \ifeof 1 \else
6130
 
    \readauxfile
 
7416
    \readdatafile{aux}%
6131
7417
    \global\havexrefstrue
6132
7418
  \fi
6133
7419
  \closein 1
6134
7420
}
6135
7421
 
6136
 
\def\readauxfile{\begingroup
 
7422
\def\setupdatafile{%
6137
7423
  \catcode`\^^@=\other
6138
7424
  \catcode`\^^A=\other
6139
7425
  \catcode`\^^B=\other
6202
7488
  %
6203
7489
  % Make the characters 128-255 be printing characters.
6204
7490
  {%
6205
 
    \count 1=128
 
7491
    \count1=128
6206
7492
    \def\loop{%
6207
 
      \catcode\count 1=\other
6208
 
      \advance\count 1 by 1
6209
 
      \ifnum \count 1<256 \loop \fi
 
7493
      \catcode\count1=\other
 
7494
      \advance\count1 by 1
 
7495
      \ifnum \count1<256 \loop \fi
6210
7496
    }%
6211
7497
  }%
6212
7498
  %
6214
7500
  \catcode`\{=1
6215
7501
  \catcode`\}=2
6216
7502
  \catcode`\@=0
6217
 
  %
6218
 
  \input \jobname.aux
 
7503
}
 
7504
 
 
7505
\def\readdatafile#1{%
 
7506
\begingroup
 
7507
  \setupdatafile
 
7508
  \input\jobname.#1
6219
7509
\endgroup}
6220
7510
 
6221
7511
 
6301
7591
% In case a @footnote appears in a vbox, save the footnote text and create
6302
7592
% the real \insert just after the vbox finished.  Otherwise, the insertion
6303
7593
% would be lost.
6304
 
% Similarily, if a @footnote appears inside an alignment, save the footnote
 
7594
% Similarly, if a @footnote appears inside an alignment, save the footnote
6305
7595
% text to a box and make the \insert when a row of the table is finished.
6306
7596
% And the same can be done for other insert classes.  --kasal, 16nov03.
6307
7597
 
6405
7695
  % If the image is by itself, center it.
6406
7696
  \ifvmode
6407
7697
    \imagevmodetrue
6408
 
    \nobreak\bigskip
 
7698
    \nobreak\medskip
6409
7699
    % Usually we'll have text after the image which will insert
6410
7700
    % \parskip glue, so insert it here too to equalize the space
6411
7701
    % above and below.
6412
7702
    \nobreak\vskip\parskip
6413
7703
    \nobreak
6414
 
    \line\bgroup\hss
6415
7704
  \fi
6416
7705
  %
 
7706
  % Leave vertical mode so that indentation from an enclosing
 
7707
  % environment such as @quotation is respected.  On the other hand, if
 
7708
  % it's at the top level, we don't want the normal paragraph indentation.
 
7709
  \noindent
 
7710
  %
6417
7711
  % Output the image.
6418
7712
  \ifpdf
6419
7713
    \dopdfimage{#1}{#2}{#3}%
6424
7718
    \epsfbox{#1.eps}%
6425
7719
  \fi
6426
7720
  %
6427
 
  \ifimagevmode \hss \egroup \bigbreak \fi  % space after the image
 
7721
  \ifimagevmode \medskip \fi  % space after the standalone image
6428
7722
\endgroup}
6429
7723
 
6430
7724
 
6491
7785
      \global\advance\floatno by 1
6492
7786
      %
6493
7787
      {%
6494
 
        % This magic value for \thissection is output by \setref as the
 
7788
        % This magic value for \lastsection is output by \setref as the
6495
7789
        % XREFLABEL-title value.  \xrefX uses it to distinguish float
6496
7790
        % labels (which have a completely different output format) from
6497
7791
        % node and anchor labels.  And \xrdef uses it to construct the
6498
7792
        % lists of floats.
6499
7793
        %
6500
 
        \edef\thissection{\floatmagic=\safefloattype}%
 
7794
        \edef\lastsection{\floatmagic=\safefloattype}%
6501
7795
        \setref{\floatlabel}{Yfloat}%
6502
7796
      }%
6503
7797
    \fi
6564
7858
      % \floatlabel-lof.  Besides \floatident, we include the short
6565
7859
      % caption if specified, else the full caption if specified, else nothing.
6566
7860
      {%
6567
 
        \atdummies \turnoffactive \otherbackslash
 
7861
        \atdummies
 
7862
        %
6568
7863
        % since we read the caption text in the macro world, where ^^M
6569
7864
        % is turned into a normal character, we have to scan it back, so
6570
7865
        % we don't write the literal three characters "^^M" into the aux file.
6585
7880
  %
6586
7881
  % place the captured inserts
6587
7882
  %
6588
 
  % BEWARE: when the floats start float, we have to issue warning whenever an
6589
 
  % insert appears inside a float which could possibly float. --kasal, 26may04
 
7883
  % BEWARE: when the floats start floating, we have to issue warning
 
7884
  % whenever an insert appears inside a float which could possibly
 
7885
  % float. --kasal, 26may04
6590
7886
  %
6591
7887
  \checkinserts
6592
7888
}
6630
7926
 
6631
7927
% #1 is the control sequence we are passed; we expand into a conditional
6632
7928
% which is true if #1 represents a float ref.  That is, the magic
6633
 
% \thissection value which we \setref above.
 
7929
% \lastsection value which we \setref above.
6634
7930
%
6635
7931
\def\iffloat#1{\expandafter\doiffloat#1==\finish}
6636
7932
%
6691
7987
  \writeentry
6692
7988
}}
6693
7989
 
 
7990
 
6694
7991
\message{localization,}
6695
 
% and i18n.
6696
7992
 
6697
 
% @documentlanguage is usually given very early, just after
6698
 
% @setfilename.  If done too late, it may not override everything
6699
 
% properly.  Single argument is the language abbreviation.
6700
 
% It would be nice if we could set up a hyphenation file here.
 
7993
% For single-language documents, @documentlanguage is usually given very
 
7994
% early, just after @documentencoding.  Single argument is the language
 
7995
% (de) or locale (de_DE) abbreviation.
6701
7996
%
6702
 
\parseargdef\documentlanguage{%
 
7997
{
 
7998
  \catcode`\_ = \active
 
7999
  \globaldefs=1
 
8000
\parseargdef\documentlanguage{\begingroup
 
8001
  \let_=\normalunderscore  % normal _ character for filenames
6703
8002
  \tex % read txi-??.tex file in plain TeX.
6704
 
    % Read the file if it exists.
 
8003
    % Read the file by the name they passed if it exists.
6705
8004
    \openin 1 txi-#1.tex
6706
8005
    \ifeof 1
6707
 
      \errhelp = \nolanghelp
6708
 
      \errmessage{Cannot read language file txi-#1.tex}%
 
8006
      \documentlanguagetrywithoutunderscore{#1_\finish}%
6709
8007
    \else
 
8008
      \globaldefs = 1  % everything in the txi-LL files needs to persist
6710
8009
      \input txi-#1.tex
6711
8010
    \fi
6712
8011
    \closein 1
6713
 
  \endgroup
 
8012
  \endgroup % end raw TeX
 
8013
\endgroup}
 
8014
%
 
8015
% If they passed de_DE, and txi-de_DE.tex doesn't exist,
 
8016
% try txi-de.tex.
 
8017
%
 
8018
\gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
 
8019
  \openin 1 txi-#1.tex
 
8020
  \ifeof 1
 
8021
    \errhelp = \nolanghelp
 
8022
    \errmessage{Cannot read language file txi-#1.tex}%
 
8023
  \else
 
8024
    \globaldefs = 1  % everything in the txi-LL files needs to persist
 
8025
    \input txi-#1.tex
 
8026
  \fi
 
8027
  \closein 1
6714
8028
}
 
8029
}% end of special _ catcode
 
8030
%
6715
8031
\newhelp\nolanghelp{The given language definition file cannot be found or
6716
 
is empty.  Maybe you need to install it?  In the current directory
6717
 
should work if nowhere else does.}
6718
 
 
6719
 
 
6720
 
% @documentencoding should change something in TeX eventually, most
6721
 
% likely, but for now just recognize it.
6722
 
\let\documentencoding = \comment
6723
 
 
6724
 
 
6725
 
% Page size parameters.
6726
 
%
 
8032
is empty.  Maybe you need to install it?  Putting it in the current
 
8033
directory should work if nowhere else does.}
 
8034
 
 
8035
% This macro is called from txi-??.tex files; the first argument is the
 
8036
% \language name to set (without the "\lang@" prefix), the second and
 
8037
% third args are \{left,right}hyphenmin.
 
8038
%
 
8039
% The language names to pass are determined when the format is built.
 
8040
% See the etex.log file created at that time, e.g.,
 
8041
% /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
 
8042
%
 
8043
% With TeX Live 2008, etex now includes hyphenation patterns for all
 
8044
% available languages.  This means we can support hyphenation in
 
8045
% Texinfo, at least to some extent.  (This still doesn't solve the
 
8046
% accented characters problem.)
 
8047
%
 
8048
\catcode`@=11
 
8049
\def\txisetlanguage#1#2#3{%
 
8050
  % do not set the language if the name is undefined in the current TeX.
 
8051
  \expandafter\ifx\csname lang@#1\endcsname \relax
 
8052
    \message{no patterns for #1}%
 
8053
  \else
 
8054
    \global\language = \csname lang@#1\endcsname
 
8055
  \fi
 
8056
  % but there is no harm in adjusting the hyphenmin values regardless.
 
8057
  \global\lefthyphenmin = #2\relax
 
8058
  \global\righthyphenmin = #3\relax
 
8059
}
 
8060
 
 
8061
% Helpers for encodings.
 
8062
% Set the catcode of characters 128 through 255 to the specified number.
 
8063
%
 
8064
\def\setnonasciicharscatcode#1{%
 
8065
   \count255=128
 
8066
   \loop\ifnum\count255<256
 
8067
      \global\catcode\count255=#1\relax
 
8068
      \advance\count255 by 1
 
8069
   \repeat
 
8070
}
 
8071
 
 
8072
\def\setnonasciicharscatcodenonglobal#1{%
 
8073
   \count255=128
 
8074
   \loop\ifnum\count255<256
 
8075
      \catcode\count255=#1\relax
 
8076
      \advance\count255 by 1
 
8077
   \repeat
 
8078
}
 
8079
 
 
8080
% @documentencoding sets the definition of non-ASCII characters
 
8081
% according to the specified encoding.
 
8082
%
 
8083
\parseargdef\documentencoding{%
 
8084
  % Encoding being declared for the document.
 
8085
  \def\declaredencoding{\csname #1.enc\endcsname}%
 
8086
  %
 
8087
  % Supported encodings: names converted to tokens in order to be able
 
8088
  % to compare them with \ifx.
 
8089
  \def\ascii{\csname US-ASCII.enc\endcsname}%
 
8090
  \def\latnine{\csname ISO-8859-15.enc\endcsname}%
 
8091
  \def\latone{\csname ISO-8859-1.enc\endcsname}%
 
8092
  \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
 
8093
  \def\utfeight{\csname UTF-8.enc\endcsname}%
 
8094
  %
 
8095
  \ifx \declaredencoding \ascii
 
8096
     \asciichardefs
 
8097
  %
 
8098
  \else \ifx \declaredencoding \lattwo
 
8099
     \setnonasciicharscatcode\active
 
8100
     \lattwochardefs
 
8101
  %
 
8102
  \else \ifx \declaredencoding \latone
 
8103
     \setnonasciicharscatcode\active
 
8104
     \latonechardefs
 
8105
  %
 
8106
  \else \ifx \declaredencoding \latnine
 
8107
     \setnonasciicharscatcode\active
 
8108
     \latninechardefs
 
8109
  %
 
8110
  \else \ifx \declaredencoding \utfeight
 
8111
     \setnonasciicharscatcode\active
 
8112
     \utfeightchardefs
 
8113
  %
 
8114
  \else
 
8115
    \message{Unknown document encoding #1, ignoring.}%
 
8116
  %
 
8117
  \fi % utfeight
 
8118
  \fi % latnine
 
8119
  \fi % latone
 
8120
  \fi % lattwo
 
8121
  \fi % ascii
 
8122
}
 
8123
 
 
8124
% A message to be logged when using a character that isn't available
 
8125
% the default font encoding (OT1).
 
8126
%
 
8127
\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}}
 
8128
 
 
8129
% Take account of \c (plain) vs. \, (Texinfo) difference.
 
8130
\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
 
8131
 
 
8132
% First, make active non-ASCII characters in order for them to be
 
8133
% correctly categorized when TeX reads the replacement text of
 
8134
% macros containing the character definitions.
 
8135
\setnonasciicharscatcode\active
 
8136
%
 
8137
% Latin1 (ISO-8859-1) character definitions.
 
8138
\def\latonechardefs{%
 
8139
  \gdef^^a0{~}
 
8140
  \gdef^^a1{\exclamdown}
 
8141
  \gdef^^a2{\missingcharmsg{CENT SIGN}}
 
8142
  \gdef^^a3{{\pounds}}
 
8143
  \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
 
8144
  \gdef^^a5{\missingcharmsg{YEN SIGN}}
 
8145
  \gdef^^a6{\missingcharmsg{BROKEN BAR}}
 
8146
  \gdef^^a7{\S}
 
8147
  \gdef^^a8{\"{}}
 
8148
  \gdef^^a9{\copyright}
 
8149
  \gdef^^aa{\ordf}
 
8150
  \gdef^^ab{\guillemetleft}
 
8151
  \gdef^^ac{$\lnot$}
 
8152
  \gdef^^ad{\-}
 
8153
  \gdef^^ae{\registeredsymbol}
 
8154
  \gdef^^af{\={}}
 
8155
  %
 
8156
  \gdef^^b0{\textdegree}
 
8157
  \gdef^^b1{$\pm$}
 
8158
  \gdef^^b2{$^2$}
 
8159
  \gdef^^b3{$^3$}
 
8160
  \gdef^^b4{\'{}}
 
8161
  \gdef^^b5{$\mu$}
 
8162
  \gdef^^b6{\P}
 
8163
  %
 
8164
  \gdef^^b7{$^.$}
 
8165
  \gdef^^b8{\cedilla\ }
 
8166
  \gdef^^b9{$^1$}
 
8167
  \gdef^^ba{\ordm}
 
8168
  %
 
8169
  \gdef^^bb{\guilletright}
 
8170
  \gdef^^bc{$1\over4$}
 
8171
  \gdef^^bd{$1\over2$}
 
8172
  \gdef^^be{$3\over4$}
 
8173
  \gdef^^bf{\questiondown}
 
8174
  %
 
8175
  \gdef^^c0{\`A}
 
8176
  \gdef^^c1{\'A}
 
8177
  \gdef^^c2{\^A}
 
8178
  \gdef^^c3{\~A}
 
8179
  \gdef^^c4{\"A}
 
8180
  \gdef^^c5{\ringaccent A}
 
8181
  \gdef^^c6{\AE}
 
8182
  \gdef^^c7{\cedilla C}
 
8183
  \gdef^^c8{\`E}
 
8184
  \gdef^^c9{\'E}
 
8185
  \gdef^^ca{\^E}
 
8186
  \gdef^^cb{\"E}
 
8187
  \gdef^^cc{\`I}
 
8188
  \gdef^^cd{\'I}
 
8189
  \gdef^^ce{\^I}
 
8190
  \gdef^^cf{\"I}
 
8191
  %
 
8192
  \gdef^^d0{\DH}
 
8193
  \gdef^^d1{\~N}
 
8194
  \gdef^^d2{\`O}
 
8195
  \gdef^^d3{\'O}
 
8196
  \gdef^^d4{\^O}
 
8197
  \gdef^^d5{\~O}
 
8198
  \gdef^^d6{\"O}
 
8199
  \gdef^^d7{$\times$}
 
8200
  \gdef^^d8{\O}
 
8201
  \gdef^^d9{\`U}
 
8202
  \gdef^^da{\'U}
 
8203
  \gdef^^db{\^U}
 
8204
  \gdef^^dc{\"U}
 
8205
  \gdef^^dd{\'Y}
 
8206
  \gdef^^de{\TH}
 
8207
  \gdef^^df{\ss}
 
8208
  %
 
8209
  \gdef^^e0{\`a}
 
8210
  \gdef^^e1{\'a}
 
8211
  \gdef^^e2{\^a}
 
8212
  \gdef^^e3{\~a}
 
8213
  \gdef^^e4{\"a}
 
8214
  \gdef^^e5{\ringaccent a}
 
8215
  \gdef^^e6{\ae}
 
8216
  \gdef^^e7{\cedilla c}
 
8217
  \gdef^^e8{\`e}
 
8218
  \gdef^^e9{\'e}
 
8219
  \gdef^^ea{\^e}
 
8220
  \gdef^^eb{\"e}
 
8221
  \gdef^^ec{\`{\dotless i}}
 
8222
  \gdef^^ed{\'{\dotless i}}
 
8223
  \gdef^^ee{\^{\dotless i}}
 
8224
  \gdef^^ef{\"{\dotless i}}
 
8225
  %
 
8226
  \gdef^^f0{\dh}
 
8227
  \gdef^^f1{\~n}
 
8228
  \gdef^^f2{\`o}
 
8229
  \gdef^^f3{\'o}
 
8230
  \gdef^^f4{\^o}
 
8231
  \gdef^^f5{\~o}
 
8232
  \gdef^^f6{\"o}
 
8233
  \gdef^^f7{$\div$}
 
8234
  \gdef^^f8{\o}
 
8235
  \gdef^^f9{\`u}
 
8236
  \gdef^^fa{\'u}
 
8237
  \gdef^^fb{\^u}
 
8238
  \gdef^^fc{\"u}
 
8239
  \gdef^^fd{\'y}
 
8240
  \gdef^^fe{\th}
 
8241
  \gdef^^ff{\"y}
 
8242
}
 
8243
 
 
8244
% Latin9 (ISO-8859-15) encoding character definitions.
 
8245
\def\latninechardefs{%
 
8246
  % Encoding is almost identical to Latin1.
 
8247
  \latonechardefs
 
8248
  %
 
8249
  \gdef^^a4{\euro}
 
8250
  \gdef^^a6{\v S}
 
8251
  \gdef^^a8{\v s}
 
8252
  \gdef^^b4{\v Z}
 
8253
  \gdef^^b8{\v z}
 
8254
  \gdef^^bc{\OE}
 
8255
  \gdef^^bd{\oe}
 
8256
  \gdef^^be{\"Y}
 
8257
}
 
8258
 
 
8259
% Latin2 (ISO-8859-2) character definitions.
 
8260
\def\lattwochardefs{%
 
8261
  \gdef^^a0{~}
 
8262
  \gdef^^a1{\ogonek{A}}
 
8263
  \gdef^^a2{\u{}}
 
8264
  \gdef^^a3{\L}
 
8265
  \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
 
8266
  \gdef^^a5{\v L}
 
8267
  \gdef^^a6{\'S}
 
8268
  \gdef^^a7{\S}
 
8269
  \gdef^^a8{\"{}}
 
8270
  \gdef^^a9{\v S}
 
8271
  \gdef^^aa{\cedilla S}
 
8272
  \gdef^^ab{\v T}
 
8273
  \gdef^^ac{\'Z}
 
8274
  \gdef^^ad{\-}
 
8275
  \gdef^^ae{\v Z}
 
8276
  \gdef^^af{\dotaccent Z}
 
8277
  %
 
8278
  \gdef^^b0{\textdegree}
 
8279
  \gdef^^b1{\ogonek{a}}
 
8280
  \gdef^^b2{\ogonek{ }}
 
8281
  \gdef^^b3{\l}
 
8282
  \gdef^^b4{\'{}}
 
8283
  \gdef^^b5{\v l}
 
8284
  \gdef^^b6{\'s}
 
8285
  \gdef^^b7{\v{}}
 
8286
  \gdef^^b8{\cedilla\ }
 
8287
  \gdef^^b9{\v s}
 
8288
  \gdef^^ba{\cedilla s}
 
8289
  \gdef^^bb{\v t}
 
8290
  \gdef^^bc{\'z}
 
8291
  \gdef^^bd{\H{}}
 
8292
  \gdef^^be{\v z}
 
8293
  \gdef^^bf{\dotaccent z}
 
8294
  %
 
8295
  \gdef^^c0{\'R}
 
8296
  \gdef^^c1{\'A}
 
8297
  \gdef^^c2{\^A}
 
8298
  \gdef^^c3{\u A}
 
8299
  \gdef^^c4{\"A}
 
8300
  \gdef^^c5{\'L}
 
8301
  \gdef^^c6{\'C}
 
8302
  \gdef^^c7{\cedilla C}
 
8303
  \gdef^^c8{\v C}
 
8304
  \gdef^^c9{\'E}
 
8305
  \gdef^^ca{\ogonek{E}}
 
8306
  \gdef^^cb{\"E}
 
8307
  \gdef^^cc{\v E}
 
8308
  \gdef^^cd{\'I}
 
8309
  \gdef^^ce{\^I}
 
8310
  \gdef^^cf{\v D}
 
8311
  %
 
8312
  \gdef^^d0{\DH}
 
8313
  \gdef^^d1{\'N}
 
8314
  \gdef^^d2{\v N}
 
8315
  \gdef^^d3{\'O}
 
8316
  \gdef^^d4{\^O}
 
8317
  \gdef^^d5{\H O}
 
8318
  \gdef^^d6{\"O}
 
8319
  \gdef^^d7{$\times$}
 
8320
  \gdef^^d8{\v R}
 
8321
  \gdef^^d9{\ringaccent U}
 
8322
  \gdef^^da{\'U}
 
8323
  \gdef^^db{\H U}
 
8324
  \gdef^^dc{\"U}
 
8325
  \gdef^^dd{\'Y}
 
8326
  \gdef^^de{\cedilla T}
 
8327
  \gdef^^df{\ss}
 
8328
  %
 
8329
  \gdef^^e0{\'r}
 
8330
  \gdef^^e1{\'a}
 
8331
  \gdef^^e2{\^a}
 
8332
  \gdef^^e3{\u a}
 
8333
  \gdef^^e4{\"a}
 
8334
  \gdef^^e5{\'l}
 
8335
  \gdef^^e6{\'c}
 
8336
  \gdef^^e7{\cedilla c}
 
8337
  \gdef^^e8{\v c}
 
8338
  \gdef^^e9{\'e}
 
8339
  \gdef^^ea{\ogonek{e}}
 
8340
  \gdef^^eb{\"e}
 
8341
  \gdef^^ec{\v e}
 
8342
  \gdef^^ed{\'\i}
 
8343
  \gdef^^ee{\^\i}
 
8344
  \gdef^^ef{\v d}
 
8345
  %
 
8346
  \gdef^^f0{\dh}
 
8347
  \gdef^^f1{\'n}
 
8348
  \gdef^^f2{\v n}
 
8349
  \gdef^^f3{\'o}
 
8350
  \gdef^^f4{\^o}
 
8351
  \gdef^^f5{\H o}
 
8352
  \gdef^^f6{\"o}
 
8353
  \gdef^^f7{$\div$}
 
8354
  \gdef^^f8{\v r}
 
8355
  \gdef^^f9{\ringaccent u}
 
8356
  \gdef^^fa{\'u}
 
8357
  \gdef^^fb{\H u}
 
8358
  \gdef^^fc{\"u}
 
8359
  \gdef^^fd{\'y}
 
8360
  \gdef^^fe{\cedilla t}
 
8361
  \gdef^^ff{\dotaccent{}}
 
8362
}
 
8363
 
 
8364
% UTF-8 character definitions.
 
8365
%
 
8366
% This code to support UTF-8 is based on LaTeX's utf8.def, with some
 
8367
% changes for Texinfo conventions.  It is included here under the GPL by
 
8368
% permission from Frank Mittelbach and the LaTeX team.
 
8369
%
 
8370
\newcount\countUTFx
 
8371
\newcount\countUTFy
 
8372
\newcount\countUTFz
 
8373
 
 
8374
\gdef\UTFviiiTwoOctets#1#2{\expandafter
 
8375
   \UTFviiiDefined\csname u8:#1\string #2\endcsname}
 
8376
%
 
8377
\gdef\UTFviiiThreeOctets#1#2#3{\expandafter
 
8378
   \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
 
8379
%
 
8380
\gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
 
8381
   \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
 
8382
 
 
8383
\gdef\UTFviiiDefined#1{%
 
8384
  \ifx #1\relax
 
8385
    \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
 
8386
  \else
 
8387
    \expandafter #1%
 
8388
  \fi
 
8389
}
 
8390
 
 
8391
\begingroup
 
8392
  \catcode`\~13
 
8393
  \catcode`\"12
 
8394
 
 
8395
  \def\UTFviiiLoop{%
 
8396
    \global\catcode\countUTFx\active
 
8397
    \uccode`\~\countUTFx
 
8398
    \uppercase\expandafter{\UTFviiiTmp}%
 
8399
    \advance\countUTFx by 1
 
8400
    \ifnum\countUTFx < \countUTFy
 
8401
      \expandafter\UTFviiiLoop
 
8402
    \fi}
 
8403
 
 
8404
  \countUTFx = "C2
 
8405
  \countUTFy = "E0
 
8406
  \def\UTFviiiTmp{%
 
8407
    \xdef~{\noexpand\UTFviiiTwoOctets\string~}}
 
8408
  \UTFviiiLoop
 
8409
 
 
8410
  \countUTFx = "E0
 
8411
  \countUTFy = "F0
 
8412
  \def\UTFviiiTmp{%
 
8413
    \xdef~{\noexpand\UTFviiiThreeOctets\string~}}
 
8414
  \UTFviiiLoop
 
8415
 
 
8416
  \countUTFx = "F0
 
8417
  \countUTFy = "F4
 
8418
  \def\UTFviiiTmp{%
 
8419
    \xdef~{\noexpand\UTFviiiFourOctets\string~}}
 
8420
  \UTFviiiLoop
 
8421
\endgroup
 
8422
 
 
8423
\begingroup
 
8424
  \catcode`\"=12
 
8425
  \catcode`\<=12
 
8426
  \catcode`\.=12
 
8427
  \catcode`\,=12
 
8428
  \catcode`\;=12
 
8429
  \catcode`\!=12
 
8430
  \catcode`\~=13
 
8431
 
 
8432
  \gdef\DeclareUnicodeCharacter#1#2{%
 
8433
    \countUTFz = "#1\relax
 
8434
    \wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
 
8435
    \begingroup
 
8436
      \parseXMLCharref
 
8437
      \def\UTFviiiTwoOctets##1##2{%
 
8438
        \csname u8:##1\string ##2\endcsname}%
 
8439
      \def\UTFviiiThreeOctets##1##2##3{%
 
8440
        \csname u8:##1\string ##2\string ##3\endcsname}%
 
8441
      \def\UTFviiiFourOctets##1##2##3##4{%
 
8442
        \csname u8:##1\string ##2\string ##3\string ##4\endcsname}%
 
8443
      \expandafter\expandafter\expandafter\expandafter
 
8444
       \expandafter\expandafter\expandafter
 
8445
       \gdef\UTFviiiTmp{#2}%
 
8446
    \endgroup}
 
8447
 
 
8448
  \gdef\parseXMLCharref{%
 
8449
    \ifnum\countUTFz < "A0\relax
 
8450
      \errhelp = \EMsimple
 
8451
      \errmessage{Cannot define Unicode char value < 00A0}%
 
8452
    \else\ifnum\countUTFz < "800\relax
 
8453
      \parseUTFviiiA,%
 
8454
      \parseUTFviiiB C\UTFviiiTwoOctets.,%
 
8455
    \else\ifnum\countUTFz < "10000\relax
 
8456
      \parseUTFviiiA;%
 
8457
      \parseUTFviiiA,%
 
8458
      \parseUTFviiiB E\UTFviiiThreeOctets.{,;}%
 
8459
    \else
 
8460
      \parseUTFviiiA;%
 
8461
      \parseUTFviiiA,%
 
8462
      \parseUTFviiiA!%
 
8463
      \parseUTFviiiB F\UTFviiiFourOctets.{!,;}%
 
8464
    \fi\fi\fi
 
8465
  }
 
8466
 
 
8467
  \gdef\parseUTFviiiA#1{%
 
8468
    \countUTFx = \countUTFz
 
8469
    \divide\countUTFz by 64
 
8470
    \countUTFy = \countUTFz
 
8471
    \multiply\countUTFz by 64
 
8472
    \advance\countUTFx by -\countUTFz
 
8473
    \advance\countUTFx by 128
 
8474
    \uccode `#1\countUTFx
 
8475
    \countUTFz = \countUTFy}
 
8476
 
 
8477
  \gdef\parseUTFviiiB#1#2#3#4{%
 
8478
    \advance\countUTFz by "#10\relax
 
8479
    \uccode `#3\countUTFz
 
8480
    \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
 
8481
\endgroup
 
8482
 
 
8483
\def\utfeightchardefs{%
 
8484
  \DeclareUnicodeCharacter{00A0}{\tie}
 
8485
  \DeclareUnicodeCharacter{00A1}{\exclamdown}
 
8486
  \DeclareUnicodeCharacter{00A3}{\pounds}
 
8487
  \DeclareUnicodeCharacter{00A8}{\"{ }}
 
8488
  \DeclareUnicodeCharacter{00A9}{\copyright}
 
8489
  \DeclareUnicodeCharacter{00AA}{\ordf}
 
8490
  \DeclareUnicodeCharacter{00AB}{\guillemetleft}
 
8491
  \DeclareUnicodeCharacter{00AD}{\-}
 
8492
  \DeclareUnicodeCharacter{00AE}{\registeredsymbol}
 
8493
  \DeclareUnicodeCharacter{00AF}{\={ }}
 
8494
 
 
8495
  \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}
 
8496
  \DeclareUnicodeCharacter{00B4}{\'{ }}
 
8497
  \DeclareUnicodeCharacter{00B8}{\cedilla{ }}
 
8498
  \DeclareUnicodeCharacter{00BA}{\ordm}
 
8499
  \DeclareUnicodeCharacter{00BB}{\guillemetright}
 
8500
  \DeclareUnicodeCharacter{00BF}{\questiondown}
 
8501
 
 
8502
  \DeclareUnicodeCharacter{00C0}{\`A}
 
8503
  \DeclareUnicodeCharacter{00C1}{\'A}
 
8504
  \DeclareUnicodeCharacter{00C2}{\^A}
 
8505
  \DeclareUnicodeCharacter{00C3}{\~A}
 
8506
  \DeclareUnicodeCharacter{00C4}{\"A}
 
8507
  \DeclareUnicodeCharacter{00C5}{\AA}
 
8508
  \DeclareUnicodeCharacter{00C6}{\AE}
 
8509
  \DeclareUnicodeCharacter{00C7}{\cedilla{C}}
 
8510
  \DeclareUnicodeCharacter{00C8}{\`E}
 
8511
  \DeclareUnicodeCharacter{00C9}{\'E}
 
8512
  \DeclareUnicodeCharacter{00CA}{\^E}
 
8513
  \DeclareUnicodeCharacter{00CB}{\"E}
 
8514
  \DeclareUnicodeCharacter{00CC}{\`I}
 
8515
  \DeclareUnicodeCharacter{00CD}{\'I}
 
8516
  \DeclareUnicodeCharacter{00CE}{\^I}
 
8517
  \DeclareUnicodeCharacter{00CF}{\"I}
 
8518
 
 
8519
  \DeclareUnicodeCharacter{00D0}{\DH}
 
8520
  \DeclareUnicodeCharacter{00D1}{\~N}
 
8521
  \DeclareUnicodeCharacter{00D2}{\`O}
 
8522
  \DeclareUnicodeCharacter{00D3}{\'O}
 
8523
  \DeclareUnicodeCharacter{00D4}{\^O}
 
8524
  \DeclareUnicodeCharacter{00D5}{\~O}
 
8525
  \DeclareUnicodeCharacter{00D6}{\"O}
 
8526
  \DeclareUnicodeCharacter{00D8}{\O}
 
8527
  \DeclareUnicodeCharacter{00D9}{\`U}
 
8528
  \DeclareUnicodeCharacter{00DA}{\'U}
 
8529
  \DeclareUnicodeCharacter{00DB}{\^U}
 
8530
  \DeclareUnicodeCharacter{00DC}{\"U}
 
8531
  \DeclareUnicodeCharacter{00DD}{\'Y}
 
8532
  \DeclareUnicodeCharacter{00DE}{\TH}
 
8533
  \DeclareUnicodeCharacter{00DF}{\ss}
 
8534
 
 
8535
  \DeclareUnicodeCharacter{00E0}{\`a}
 
8536
  \DeclareUnicodeCharacter{00E1}{\'a}
 
8537
  \DeclareUnicodeCharacter{00E2}{\^a}
 
8538
  \DeclareUnicodeCharacter{00E3}{\~a}
 
8539
  \DeclareUnicodeCharacter{00E4}{\"a}
 
8540
  \DeclareUnicodeCharacter{00E5}{\aa}
 
8541
  \DeclareUnicodeCharacter{00E6}{\ae}
 
8542
  \DeclareUnicodeCharacter{00E7}{\cedilla{c}}
 
8543
  \DeclareUnicodeCharacter{00E8}{\`e}
 
8544
  \DeclareUnicodeCharacter{00E9}{\'e}
 
8545
  \DeclareUnicodeCharacter{00EA}{\^e}
 
8546
  \DeclareUnicodeCharacter{00EB}{\"e}
 
8547
  \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}
 
8548
  \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}
 
8549
  \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}
 
8550
  \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}
 
8551
 
 
8552
  \DeclareUnicodeCharacter{00F0}{\dh}
 
8553
  \DeclareUnicodeCharacter{00F1}{\~n}
 
8554
  \DeclareUnicodeCharacter{00F2}{\`o}
 
8555
  \DeclareUnicodeCharacter{00F3}{\'o}
 
8556
  \DeclareUnicodeCharacter{00F4}{\^o}
 
8557
  \DeclareUnicodeCharacter{00F5}{\~o}
 
8558
  \DeclareUnicodeCharacter{00F6}{\"o}
 
8559
  \DeclareUnicodeCharacter{00F8}{\o}
 
8560
  \DeclareUnicodeCharacter{00F9}{\`u}
 
8561
  \DeclareUnicodeCharacter{00FA}{\'u}
 
8562
  \DeclareUnicodeCharacter{00FB}{\^u}
 
8563
  \DeclareUnicodeCharacter{00FC}{\"u}
 
8564
  \DeclareUnicodeCharacter{00FD}{\'y}
 
8565
  \DeclareUnicodeCharacter{00FE}{\th}
 
8566
  \DeclareUnicodeCharacter{00FF}{\"y}
 
8567
 
 
8568
  \DeclareUnicodeCharacter{0100}{\=A}
 
8569
  \DeclareUnicodeCharacter{0101}{\=a}
 
8570
  \DeclareUnicodeCharacter{0102}{\u{A}}
 
8571
  \DeclareUnicodeCharacter{0103}{\u{a}}
 
8572
  \DeclareUnicodeCharacter{0104}{\ogonek{A}}
 
8573
  \DeclareUnicodeCharacter{0105}{\ogonek{a}}
 
8574
  \DeclareUnicodeCharacter{0106}{\'C}
 
8575
  \DeclareUnicodeCharacter{0107}{\'c}
 
8576
  \DeclareUnicodeCharacter{0108}{\^C}
 
8577
  \DeclareUnicodeCharacter{0109}{\^c}
 
8578
  \DeclareUnicodeCharacter{0118}{\ogonek{E}}
 
8579
  \DeclareUnicodeCharacter{0119}{\ogonek{e}}
 
8580
  \DeclareUnicodeCharacter{010A}{\dotaccent{C}}
 
8581
  \DeclareUnicodeCharacter{010B}{\dotaccent{c}}
 
8582
  \DeclareUnicodeCharacter{010C}{\v{C}}
 
8583
  \DeclareUnicodeCharacter{010D}{\v{c}}
 
8584
  \DeclareUnicodeCharacter{010E}{\v{D}}
 
8585
 
 
8586
  \DeclareUnicodeCharacter{0112}{\=E}
 
8587
  \DeclareUnicodeCharacter{0113}{\=e}
 
8588
  \DeclareUnicodeCharacter{0114}{\u{E}}
 
8589
  \DeclareUnicodeCharacter{0115}{\u{e}}
 
8590
  \DeclareUnicodeCharacter{0116}{\dotaccent{E}}
 
8591
  \DeclareUnicodeCharacter{0117}{\dotaccent{e}}
 
8592
  \DeclareUnicodeCharacter{011A}{\v{E}}
 
8593
  \DeclareUnicodeCharacter{011B}{\v{e}}
 
8594
  \DeclareUnicodeCharacter{011C}{\^G}
 
8595
  \DeclareUnicodeCharacter{011D}{\^g}
 
8596
  \DeclareUnicodeCharacter{011E}{\u{G}}
 
8597
  \DeclareUnicodeCharacter{011F}{\u{g}}
 
8598
 
 
8599
  \DeclareUnicodeCharacter{0120}{\dotaccent{G}}
 
8600
  \DeclareUnicodeCharacter{0121}{\dotaccent{g}}
 
8601
  \DeclareUnicodeCharacter{0124}{\^H}
 
8602
  \DeclareUnicodeCharacter{0125}{\^h}
 
8603
  \DeclareUnicodeCharacter{0128}{\~I}
 
8604
  \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}
 
8605
  \DeclareUnicodeCharacter{012A}{\=I}
 
8606
  \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}
 
8607
  \DeclareUnicodeCharacter{012C}{\u{I}}
 
8608
  \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}
 
8609
 
 
8610
  \DeclareUnicodeCharacter{0130}{\dotaccent{I}}
 
8611
  \DeclareUnicodeCharacter{0131}{\dotless{i}}
 
8612
  \DeclareUnicodeCharacter{0132}{IJ}
 
8613
  \DeclareUnicodeCharacter{0133}{ij}
 
8614
  \DeclareUnicodeCharacter{0134}{\^J}
 
8615
  \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}
 
8616
  \DeclareUnicodeCharacter{0139}{\'L}
 
8617
  \DeclareUnicodeCharacter{013A}{\'l}
 
8618
 
 
8619
  \DeclareUnicodeCharacter{0141}{\L}
 
8620
  \DeclareUnicodeCharacter{0142}{\l}
 
8621
  \DeclareUnicodeCharacter{0143}{\'N}
 
8622
  \DeclareUnicodeCharacter{0144}{\'n}
 
8623
  \DeclareUnicodeCharacter{0147}{\v{N}}
 
8624
  \DeclareUnicodeCharacter{0148}{\v{n}}
 
8625
  \DeclareUnicodeCharacter{014C}{\=O}
 
8626
  \DeclareUnicodeCharacter{014D}{\=o}
 
8627
  \DeclareUnicodeCharacter{014E}{\u{O}}
 
8628
  \DeclareUnicodeCharacter{014F}{\u{o}}
 
8629
 
 
8630
  \DeclareUnicodeCharacter{0150}{\H{O}}
 
8631
  \DeclareUnicodeCharacter{0151}{\H{o}}
 
8632
  \DeclareUnicodeCharacter{0152}{\OE}
 
8633
  \DeclareUnicodeCharacter{0153}{\oe}
 
8634
  \DeclareUnicodeCharacter{0154}{\'R}
 
8635
  \DeclareUnicodeCharacter{0155}{\'r}
 
8636
  \DeclareUnicodeCharacter{0158}{\v{R}}
 
8637
  \DeclareUnicodeCharacter{0159}{\v{r}}
 
8638
  \DeclareUnicodeCharacter{015A}{\'S}
 
8639
  \DeclareUnicodeCharacter{015B}{\'s}
 
8640
  \DeclareUnicodeCharacter{015C}{\^S}
 
8641
  \DeclareUnicodeCharacter{015D}{\^s}
 
8642
  \DeclareUnicodeCharacter{015E}{\cedilla{S}}
 
8643
  \DeclareUnicodeCharacter{015F}{\cedilla{s}}
 
8644
 
 
8645
  \DeclareUnicodeCharacter{0160}{\v{S}}
 
8646
  \DeclareUnicodeCharacter{0161}{\v{s}}
 
8647
  \DeclareUnicodeCharacter{0162}{\cedilla{t}}
 
8648
  \DeclareUnicodeCharacter{0163}{\cedilla{T}}
 
8649
  \DeclareUnicodeCharacter{0164}{\v{T}}
 
8650
 
 
8651
  \DeclareUnicodeCharacter{0168}{\~U}
 
8652
  \DeclareUnicodeCharacter{0169}{\~u}
 
8653
  \DeclareUnicodeCharacter{016A}{\=U}
 
8654
  \DeclareUnicodeCharacter{016B}{\=u}
 
8655
  \DeclareUnicodeCharacter{016C}{\u{U}}
 
8656
  \DeclareUnicodeCharacter{016D}{\u{u}}
 
8657
  \DeclareUnicodeCharacter{016E}{\ringaccent{U}}
 
8658
  \DeclareUnicodeCharacter{016F}{\ringaccent{u}}
 
8659
 
 
8660
  \DeclareUnicodeCharacter{0170}{\H{U}}
 
8661
  \DeclareUnicodeCharacter{0171}{\H{u}}
 
8662
  \DeclareUnicodeCharacter{0174}{\^W}
 
8663
  \DeclareUnicodeCharacter{0175}{\^w}
 
8664
  \DeclareUnicodeCharacter{0176}{\^Y}
 
8665
  \DeclareUnicodeCharacter{0177}{\^y}
 
8666
  \DeclareUnicodeCharacter{0178}{\"Y}
 
8667
  \DeclareUnicodeCharacter{0179}{\'Z}
 
8668
  \DeclareUnicodeCharacter{017A}{\'z}
 
8669
  \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}
 
8670
  \DeclareUnicodeCharacter{017C}{\dotaccent{z}}
 
8671
  \DeclareUnicodeCharacter{017D}{\v{Z}}
 
8672
  \DeclareUnicodeCharacter{017E}{\v{z}}
 
8673
 
 
8674
  \DeclareUnicodeCharacter{01C4}{D\v{Z}}
 
8675
  \DeclareUnicodeCharacter{01C5}{D\v{z}}
 
8676
  \DeclareUnicodeCharacter{01C6}{d\v{z}}
 
8677
  \DeclareUnicodeCharacter{01C7}{LJ}
 
8678
  \DeclareUnicodeCharacter{01C8}{Lj}
 
8679
  \DeclareUnicodeCharacter{01C9}{lj}
 
8680
  \DeclareUnicodeCharacter{01CA}{NJ}
 
8681
  \DeclareUnicodeCharacter{01CB}{Nj}
 
8682
  \DeclareUnicodeCharacter{01CC}{nj}
 
8683
  \DeclareUnicodeCharacter{01CD}{\v{A}}
 
8684
  \DeclareUnicodeCharacter{01CE}{\v{a}}
 
8685
  \DeclareUnicodeCharacter{01CF}{\v{I}}
 
8686
 
 
8687
  \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}
 
8688
  \DeclareUnicodeCharacter{01D1}{\v{O}}
 
8689
  \DeclareUnicodeCharacter{01D2}{\v{o}}
 
8690
  \DeclareUnicodeCharacter{01D3}{\v{U}}
 
8691
  \DeclareUnicodeCharacter{01D4}{\v{u}}
 
8692
 
 
8693
  \DeclareUnicodeCharacter{01E2}{\={\AE}}
 
8694
  \DeclareUnicodeCharacter{01E3}{\={\ae}}
 
8695
  \DeclareUnicodeCharacter{01E6}{\v{G}}
 
8696
  \DeclareUnicodeCharacter{01E7}{\v{g}}
 
8697
  \DeclareUnicodeCharacter{01E8}{\v{K}}
 
8698
  \DeclareUnicodeCharacter{01E9}{\v{k}}
 
8699
 
 
8700
  \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}
 
8701
  \DeclareUnicodeCharacter{01F1}{DZ}
 
8702
  \DeclareUnicodeCharacter{01F2}{Dz}
 
8703
  \DeclareUnicodeCharacter{01F3}{dz}
 
8704
  \DeclareUnicodeCharacter{01F4}{\'G}
 
8705
  \DeclareUnicodeCharacter{01F5}{\'g}
 
8706
  \DeclareUnicodeCharacter{01F8}{\`N}
 
8707
  \DeclareUnicodeCharacter{01F9}{\`n}
 
8708
  \DeclareUnicodeCharacter{01FC}{\'{\AE}}
 
8709
  \DeclareUnicodeCharacter{01FD}{\'{\ae}}
 
8710
  \DeclareUnicodeCharacter{01FE}{\'{\O}}
 
8711
  \DeclareUnicodeCharacter{01FF}{\'{\o}}
 
8712
 
 
8713
  \DeclareUnicodeCharacter{021E}{\v{H}}
 
8714
  \DeclareUnicodeCharacter{021F}{\v{h}}
 
8715
 
 
8716
  \DeclareUnicodeCharacter{0226}{\dotaccent{A}}
 
8717
  \DeclareUnicodeCharacter{0227}{\dotaccent{a}}
 
8718
  \DeclareUnicodeCharacter{0228}{\cedilla{E}}
 
8719
  \DeclareUnicodeCharacter{0229}{\cedilla{e}}
 
8720
  \DeclareUnicodeCharacter{022E}{\dotaccent{O}}
 
8721
  \DeclareUnicodeCharacter{022F}{\dotaccent{o}}
 
8722
 
 
8723
  \DeclareUnicodeCharacter{0232}{\=Y}
 
8724
  \DeclareUnicodeCharacter{0233}{\=y}
 
8725
  \DeclareUnicodeCharacter{0237}{\dotless{j}}
 
8726
 
 
8727
  \DeclareUnicodeCharacter{02DB}{\ogonek{ }}
 
8728
 
 
8729
  \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}
 
8730
  \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}
 
8731
  \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}
 
8732
  \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}
 
8733
  \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}
 
8734
  \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}
 
8735
  \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}
 
8736
  \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}
 
8737
  \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}
 
8738
  \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}
 
8739
  \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}
 
8740
  \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}
 
8741
 
 
8742
  \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}
 
8743
  \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}
 
8744
 
 
8745
  \DeclareUnicodeCharacter{1E20}{\=G}
 
8746
  \DeclareUnicodeCharacter{1E21}{\=g}
 
8747
  \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}
 
8748
  \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}
 
8749
  \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}
 
8750
  \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}
 
8751
  \DeclareUnicodeCharacter{1E26}{\"H}
 
8752
  \DeclareUnicodeCharacter{1E27}{\"h}
 
8753
 
 
8754
  \DeclareUnicodeCharacter{1E30}{\'K}
 
8755
  \DeclareUnicodeCharacter{1E31}{\'k}
 
8756
  \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}
 
8757
  \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}
 
8758
  \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}
 
8759
  \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}
 
8760
  \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}
 
8761
  \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}
 
8762
  \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}
 
8763
  \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}
 
8764
  \DeclareUnicodeCharacter{1E3E}{\'M}
 
8765
  \DeclareUnicodeCharacter{1E3F}{\'m}
 
8766
 
 
8767
  \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}
 
8768
  \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}
 
8769
  \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}
 
8770
  \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}
 
8771
  \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}
 
8772
  \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}
 
8773
  \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}
 
8774
  \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}
 
8775
  \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}
 
8776
  \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}
 
8777
 
 
8778
  \DeclareUnicodeCharacter{1E54}{\'P}
 
8779
  \DeclareUnicodeCharacter{1E55}{\'p}
 
8780
  \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}
 
8781
  \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}
 
8782
  \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}
 
8783
  \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}
 
8784
  \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}
 
8785
  \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}
 
8786
  \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}
 
8787
  \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}
 
8788
 
 
8789
  \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}
 
8790
  \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}
 
8791
  \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}
 
8792
  \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}
 
8793
  \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}
 
8794
  \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}
 
8795
  \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}
 
8796
  \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}
 
8797
  \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}
 
8798
  \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}
 
8799
 
 
8800
  \DeclareUnicodeCharacter{1E7C}{\~V}
 
8801
  \DeclareUnicodeCharacter{1E7D}{\~v}
 
8802
  \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}
 
8803
  \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}
 
8804
 
 
8805
  \DeclareUnicodeCharacter{1E80}{\`W}
 
8806
  \DeclareUnicodeCharacter{1E81}{\`w}
 
8807
  \DeclareUnicodeCharacter{1E82}{\'W}
 
8808
  \DeclareUnicodeCharacter{1E83}{\'w}
 
8809
  \DeclareUnicodeCharacter{1E84}{\"W}
 
8810
  \DeclareUnicodeCharacter{1E85}{\"w}
 
8811
  \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}
 
8812
  \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}
 
8813
  \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}
 
8814
  \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}
 
8815
  \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}
 
8816
  \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}
 
8817
  \DeclareUnicodeCharacter{1E8C}{\"X}
 
8818
  \DeclareUnicodeCharacter{1E8D}{\"x}
 
8819
  \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}
 
8820
  \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}
 
8821
 
 
8822
  \DeclareUnicodeCharacter{1E90}{\^Z}
 
8823
  \DeclareUnicodeCharacter{1E91}{\^z}
 
8824
  \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}
 
8825
  \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}
 
8826
  \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}
 
8827
  \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}
 
8828
  \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}
 
8829
  \DeclareUnicodeCharacter{1E97}{\"t}
 
8830
  \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}
 
8831
  \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}
 
8832
 
 
8833
  \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}
 
8834
  \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}
 
8835
 
 
8836
  \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}
 
8837
  \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}
 
8838
  \DeclareUnicodeCharacter{1EBC}{\~E}
 
8839
  \DeclareUnicodeCharacter{1EBD}{\~e}
 
8840
 
 
8841
  \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}
 
8842
  \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}
 
8843
  \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}
 
8844
  \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}
 
8845
 
 
8846
  \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}
 
8847
  \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}
 
8848
 
 
8849
  \DeclareUnicodeCharacter{1EF2}{\`Y}
 
8850
  \DeclareUnicodeCharacter{1EF3}{\`y}
 
8851
  \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}
 
8852
 
 
8853
  \DeclareUnicodeCharacter{1EF8}{\~Y}
 
8854
  \DeclareUnicodeCharacter{1EF9}{\~y}
 
8855
 
 
8856
  \DeclareUnicodeCharacter{2013}{--}
 
8857
  \DeclareUnicodeCharacter{2014}{---}
 
8858
  \DeclareUnicodeCharacter{2018}{\quoteleft}
 
8859
  \DeclareUnicodeCharacter{2019}{\quoteright}
 
8860
  \DeclareUnicodeCharacter{201A}{\quotesinglbase}
 
8861
  \DeclareUnicodeCharacter{201C}{\quotedblleft}
 
8862
  \DeclareUnicodeCharacter{201D}{\quotedblright}
 
8863
  \DeclareUnicodeCharacter{201E}{\quotedblbase}
 
8864
  \DeclareUnicodeCharacter{2022}{\bullet}
 
8865
  \DeclareUnicodeCharacter{2026}{\dots}
 
8866
  \DeclareUnicodeCharacter{2039}{\guilsinglleft}
 
8867
  \DeclareUnicodeCharacter{203A}{\guilsinglright}
 
8868
  \DeclareUnicodeCharacter{20AC}{\euro}
 
8869
 
 
8870
  \DeclareUnicodeCharacter{2192}{\expansion}
 
8871
  \DeclareUnicodeCharacter{21D2}{\result}
 
8872
 
 
8873
  \DeclareUnicodeCharacter{2212}{\minus}
 
8874
  \DeclareUnicodeCharacter{2217}{\point}
 
8875
  \DeclareUnicodeCharacter{2261}{\equiv}
 
8876
}% end of \utfeightchardefs
 
8877
 
 
8878
 
 
8879
% US-ASCII character definitions.
 
8880
\def\asciichardefs{% nothing need be done
 
8881
   \relax
 
8882
}
 
8883
 
 
8884
% Make non-ASCII characters printable again for compatibility with
 
8885
% existing Texinfo documents that may use them, even without declaring a
 
8886
% document encoding.
 
8887
%
 
8888
\setnonasciicharscatcode \other
 
8889
 
 
8890
 
 
8891
\message{formatting,}
 
8892
 
6727
8893
\newdimen\defaultparindent \defaultparindent = 15pt
6728
8894
 
6729
8895
\chapheadingskip = 15pt plus 4pt minus 2pt
6736
8902
% Don't be so finicky about underfull hboxes, either.
6737
8903
\hbadness = 2000
6738
8904
 
6739
 
% Following George Bush, just get rid of widows and orphans.
 
8905
% Following George Bush, get rid of widows and orphans.
6740
8906
\widowpenalty=10000
6741
8907
\clubpenalty=10000
6742
8908
 
6754
8920
  \fi
6755
8921
}
6756
8922
 
6757
 
% Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
6758
 
% 4) hoffset; 5) binding offset; 6) topskip; 7) physical page height; 8)
6759
 
% physical page width.
 
8923
% Parameters in order: 1) textheight; 2) textwidth;
 
8924
% 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
 
8925
% 7) physical page height; 8) physical page width.
6760
8926
%
6761
8927
% We also call \setleading{\textleading}, so the caller should define
6762
8928
% \textleading.  The caller should also set \parskip.
6783
8949
  \ifpdf
6784
8950
    \pdfpageheight #7\relax
6785
8951
    \pdfpagewidth #8\relax
 
8952
    % if we don't reset these, they will remain at "1 true in" of
 
8953
    % whatever layout pdftex was dumped with.
 
8954
    \pdfhorigin = 1 true in
 
8955
    \pdfvorigin = 1 true in
6786
8956
  \fi
6787
8957
  %
6788
8958
  \setleading{\textleading}
6797
8967
  \textleading = 13.2pt
6798
8968
  %
6799
8969
  % If page is nothing but text, make it come out even.
6800
 
  \internalpagesizes{46\baselineskip}{6in}%
 
8970
  \internalpagesizes{607.2pt}{6in}% that's 46 lines
6801
8971
                    {\voffset}{.25in}%
6802
8972
                    {\bindingoffset}{36pt}%
6803
8973
                    {11in}{8.5in}%
6804
8974
}}
6805
8975
 
6806
 
% Use @smallbook to reset parameters for 7x9.5 (or so) format.
 
8976
% Use @smallbook to reset parameters for 7x9.25 trim size.
6807
8977
\def\smallbook{{\globaldefs = 1
6808
8978
  \parskip = 2pt plus 1pt
6809
8979
  \textleading = 12pt
6810
8980
  %
6811
8981
  \internalpagesizes{7.5in}{5in}%
6812
 
                    {\voffset}{.25in}%
 
8982
                    {-.2in}{0in}%
6813
8983
                    {\bindingoffset}{16pt}%
6814
8984
                    {9.25in}{7in}%
6815
8985
  %
6820
8990
  \defbodyindent = .5cm
6821
8991
}}
6822
8992
 
 
8993
% Use @smallerbook to reset parameters for 6x9 trim size.
 
8994
% (Just testing, parameters still in flux.)
 
8995
\def\smallerbook{{\globaldefs = 1
 
8996
  \parskip = 1.5pt plus 1pt
 
8997
  \textleading = 12pt
 
8998
  %
 
8999
  \internalpagesizes{7.4in}{4.8in}%
 
9000
                    {-.2in}{-.4in}%
 
9001
                    {0pt}{14pt}%
 
9002
                    {9in}{6in}%
 
9003
  %
 
9004
  \lispnarrowing = 0.25in
 
9005
  \tolerance = 700
 
9006
  \hfuzz = 1pt
 
9007
  \contentsrightmargin = 0pt
 
9008
  \defbodyindent = .4cm
 
9009
}}
 
9010
 
6823
9011
% Use @afourpaper to print on European A4 paper.
6824
9012
\def\afourpaper{{\globaldefs = 1
6825
9013
  \parskip = 3pt plus 2pt minus 1pt
6835
9023
  % \global\normaloffset = -6mm
6836
9024
  % \global\bindingoffset = 10mm
6837
9025
  % @end tex
6838
 
  \internalpagesizes{51\baselineskip}{160mm}
 
9026
  \internalpagesizes{673.2pt}{160mm}% that's 51 lines
6839
9027
                    {\voffset}{\hoffset}%
6840
9028
                    {\bindingoffset}{44pt}%
6841
9029
                    {297mm}{210mm}%
6900
9088
  \parskip = 3pt plus 2pt minus 1pt
6901
9089
  \setleading{\textleading}%
6902
9090
  %
6903
 
  \dimen0 = #1
 
9091
  \dimen0 = #1\relax
6904
9092
  \advance\dimen0 by \voffset
6905
9093
  %
6906
9094
  \dimen2 = \hsize
6919
9107
 
6920
9108
\message{and turning on texinfo input format.}
6921
9109
 
 
9110
% DEL is a comment character, in case @c does not suffice.
 
9111
\catcode`\^^? = 14
 
9112
 
6922
9113
% Define macros to output various characters with catcode for normal text.
6923
9114
\catcode`\"=\other
6924
9115
\catcode`\~=\other
6972
9163
 
6973
9164
\catcode`\_=\active
6974
9165
\def_{\ifusingtt\normalunderscore\_}
 
9166
\let\realunder=_
6975
9167
% Subroutine for the previous macro.
6976
9168
\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
6977
9169
 
6994
9186
% \otherifyactive is called near the end of this file.
6995
9187
\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
6996
9188
 
 
9189
% Used sometimes to turn off (effectively) the active characters even after
 
9190
% parsing them.
 
9191
\def\turnoffactive{%
 
9192
  \normalturnoffactive
 
9193
  \otherbackslash
 
9194
}
 
9195
 
6997
9196
\catcode`\@=0
6998
9197
 
6999
9198
% \backslashcurfont outputs one backslash character in current font,
7001
9200
\global\chardef\backslashcurfont=`\\
7002
9201
\global\let\rawbackslashxx=\backslashcurfont  % let existing .??s files work
7003
9202
 
 
9203
% \realbackslash is an actual character `\' with catcode other, and
 
9204
% \doublebackslash is two of them (for the pdf outlines).
 
9205
{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
 
9206
 
 
9207
% In texinfo, backslash is an active character; it prints the backslash
 
9208
% in fixed width font.
 
9209
\catcode`\\=\active
 
9210
@def@normalbackslash{{@tt@backslashcurfont}}
 
9211
% On startup, @fixbackslash assigns:
 
9212
%  @let \ = @normalbackslash
 
9213
 
7004
9214
% \rawbackslash defines an active \ to do \backslashcurfont.
7005
9215
% \otherbackslash defines an active \ to be a literal `\' character with
7006
9216
% catcode other.
7007
 
{\catcode`\\=\active
7008
 
 @gdef@rawbackslash{@let\=@backslashcurfont}
7009
 
 @gdef@otherbackslash{@let\=@realbackslash}
7010
 
}
7011
 
 
7012
 
% \realbackslash is an actual character `\' with catcode other.
7013
 
{\catcode`\\=\other @gdef@realbackslash{\}}
7014
 
 
7015
 
% \normalbackslash outputs one backslash in fixed width font.
7016
 
\def\normalbackslash{{\tt\backslashcurfont}}
7017
 
 
7018
 
\catcode`\\=\active
7019
 
 
7020
 
% Used sometimes to turn off (effectively) the active characters
7021
 
% even after parsing them.
7022
 
@def@turnoffactive{%
 
9217
@gdef@rawbackslash{@let\=@backslashcurfont}
 
9218
@gdef@otherbackslash{@let\=@realbackslash}
 
9219
 
 
9220
% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
 
9221
% the literal character `\'.
 
9222
%
 
9223
@def@normalturnoffactive{%
 
9224
  @let\=@normalbackslash
7023
9225
  @let"=@normaldoublequote
7024
 
  @let\=@realbackslash
7025
9226
  @let~=@normaltilde
7026
9227
  @let^=@normalcaret
7027
9228
  @let_=@normalunderscore
7030
9231
  @let>=@normalgreater
7031
9232
  @let+=@normalplus
7032
9233
  @let$=@normaldollar %$ font-lock fix
 
9234
  @markupsetuplqdefault
 
9235
  @markupsetuprqdefault
7033
9236
  @unsepspaces
7034
9237
}
7035
9238
 
7036
 
% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
7037
 
% the literal character `\'.  (Thus, \ is not expandable when this is in
7038
 
% effect.)
7039
 
%
7040
 
@def@normalturnoffactive{@turnoffactive @let\=@normalbackslash}
7041
 
 
7042
9239
% Make _ and + \other characters, temporarily.
7043
9240
% This is canceled by @fixbackslash.
7044
9241
@otherifyactive
7051
9248
@global@let\ = @eatinput
7052
9249
 
7053
9250
% On the other hand, perhaps the file did not have a `\input texinfo'. Then
7054
 
% the first `\{ in the file would cause an error. This macro tries to fix
 
9251
% the first `\' in the file would cause an error. This macro tries to fix
7055
9252
% that, assuming it is called before the first `\' could plausibly occur.
7056
 
% Also back turn on active characters that might appear in the input
 
9253
% Also turn back on active characters that might appear in the input
7057
9254
% file name, in case not using a pre-dumped format.
7058
9255
%
7059
9256
@gdef@fixbackslash{%
7070
9267
@catcode`@# = @other
7071
9268
@catcode`@% = @other
7072
9269
 
 
9270
@c Finally, make ` and ' active, so that txicodequoteundirected and
 
9271
@c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}.  If we
 
9272
@c don't make ` and ' active, @code will not get them as active chars.
 
9273
@c Do this last of all since we use ` in the previous @catcode assignments.
 
9274
@catcode`@'=@active
 
9275
@catcode`@`=@active
 
9276
@markupsetuplqdefault
 
9277
@markupsetuprqdefault
7073
9278
 
7074
9279
@c Local variables:
7075
9280
@c eval: (add-hook 'write-file-hooks 'time-stamp)