~ubuntu-branches/ubuntu/vivid/org-mode-doc/vivid-proposed

« back to all changes in this revision

Viewing changes to doc/texinfo.tex

  • Committer: Package Import Robot
  • Author(s): Sebastien Delafond
  • Date: 2014-06-14 12:50:29 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20140614125029-8sclvlzyh8d2n6wh
Tags: 8.2.7-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
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{2012-01-03.18}
 
6
\def\texinfoversion{2013-09-11.11}
7
7
%
8
 
% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
 
8
% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
9
9
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
10
 
% 2007, 2008-2013 Free Software Foundation, Inc.
 
10
% 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
11
11
%
12
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
24
24
%
25
25
% As a special exception, when this file is read by TeX when processing
26
26
% a Texinfo source document, you may use the result without
27
 
% restriction.  (This has been our intent since Texinfo was invented.)
 
27
% restriction. This Exception is an additional permission under section 7
 
28
% of the GNU General Public License, version 3 ("GPLv3").
28
29
%
29
30
% Please try the latest version of texinfo.tex before submitting bug
30
31
% reports; you can get the latest version from:
31
 
%   http://www.gnu.org/software/texinfo/ (the Texinfo home page), or
32
 
%   ftp://tug.org/tex/texinfo.tex
33
 
%     (and all CTAN mirrors, see http://www.ctan.org).
 
32
%   http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
 
33
%   http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
 
34
%   http://www.gnu.org/software/texinfo/ (the Texinfo home page)
34
35
% The texinfo.tex in any given distribution could well be out
35
36
% of date, so if that's what you're using, please check.
36
37
%
65
66
\everyjob{\message{[Texinfo version \texinfoversion]}%
66
67
  \catcode`+=\active \catcode`\_=\active}
67
68
 
68
 
 
69
69
\chardef\other=12
70
70
 
71
71
% We never want plain's \outer definition of \+ in Texinfo.
93
93
\let\ptexnewwrite\newwrite
94
94
\let\ptexnoindent=\noindent
95
95
\let\ptexplus=+
 
96
\let\ptexraggedright=\raggedright
96
97
\let\ptexrbrace=\}
97
98
\let\ptexslash=\/
98
99
\let\ptexstar=\*
99
100
\let\ptext=\t
100
101
\let\ptextop=\top
 
102
{\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode
101
103
 
102
104
% If this character appears in an error message or help string, it
103
105
% starts a new line in the output.
115
117
% Set up fixed words for English if not already set.
116
118
\ifx\putwordAppendix\undefined  \gdef\putwordAppendix{Appendix}\fi
117
119
\ifx\putwordChapter\undefined   \gdef\putwordChapter{Chapter}\fi
 
120
\ifx\putworderror\undefined     \gdef\putworderror{error}\fi
118
121
\ifx\putwordfile\undefined      \gdef\putwordfile{file}\fi
119
122
\ifx\putwordin\undefined        \gdef\putwordin{in}\fi
120
 
\ifx\putwordIndexIsEmpty\undefined     \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
121
 
\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
 
123
\ifx\putwordIndexIsEmpty\undefined       \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
 
124
\ifx\putwordIndexNonexistent\undefined   \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
122
125
\ifx\putwordInfo\undefined      \gdef\putwordInfo{Info}\fi
123
126
\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
124
127
\ifx\putwordMethodon\undefined  \gdef\putwordMethodon{Method on}\fi
157
160
\def\spaceisspace{\catcode`\ =\spacecat}
158
161
 
159
162
% sometimes characters are active, so we need control sequences.
 
163
\chardef\ampChar   = `\&
160
164
\chardef\colonChar = `\:
161
165
\chardef\commaChar = `\,
162
166
\chardef\dashChar  = `\-
163
167
\chardef\dotChar   = `\.
164
168
\chardef\exclamChar= `\!
 
169
\chardef\hashChar  = `\#
165
170
\chardef\lquoteChar= `\`
166
171
\chardef\questChar = `\?
167
172
\chardef\rquoteChar= `\'
168
173
\chardef\semiChar  = `\;
 
174
\chardef\slashChar = `\/
169
175
\chardef\underChar = `\_
170
176
 
171
177
% Ignore a token.
196
202
% that mark overfull boxes (in case you have decided
197
203
% that the text looks ok even though it passes the margin).
198
204
%
199
 
\def\finalout{\overfullrule=0pt}
200
 
 
201
 
% @| inserts a changebar to the left of the current line.  It should
202
 
% surround any changed text.  This approach does *not* work if the
203
 
% change spans more than two lines of output.  To handle that, we would
204
 
% have adopt a much more difficult approach (putting marks into the main
205
 
% vertical list for the beginning and end of each change).
206
 
%
207
 
\def\|{%
208
 
  % \vadjust can only be used in horizontal mode.
209
 
  \leavevmode
210
 
  %
211
 
  % Append this vertical mode material after the current line in the output.
212
 
  \vadjust{%
213
 
    % We want to insert a rule with the height and depth of the current
214
 
    % leading; that is exactly what \strutbox is supposed to record.
215
 
    \vskip-\baselineskip
216
 
    %
217
 
    % \vadjust-items are inserted at the left edge of the type.  So
218
 
    % the \llap here moves out into the left-hand margin.
219
 
    \llap{%
220
 
      %
221
 
      % For a thicker or thinner bar, change the `1pt'.
222
 
      \vrule height\baselineskip width1pt
223
 
      %
224
 
      % This is the space between the bar and the text.
225
 
      \hskip 12pt
226
 
    }%
227
 
  }%
228
 
}
 
205
\def\finalout{\overfullrule=0pt }
229
206
 
230
207
% Sometimes it is convenient to have everything in the transcript file
231
208
% and nothing on the terminal.  We don't just call \tracingall here,
243
220
  \tracingmacros2
244
221
  \tracingrestores1
245
222
  \showboxbreadth\maxdimen \showboxdepth\maxdimen
246
 
  \ifx\eTeXversion\undefined\else % etex gives us more logging
 
223
  \ifx\eTeXversion\thisisundefined\else % etex gives us more logging
247
224
    \tracingscantokens1
248
225
    \tracingifs1
249
226
    \tracinggroups1
254
231
  \errorcontextlines16
255
232
}%
256
233
 
 
234
% @errormsg{MSG}.  Do the index-like expansions on MSG, but if things
 
235
% aren't perfect, it's not the end of the world, being an error message,
 
236
% after all.
 
237
%
 
238
\def\errormsg{\begingroup \indexnofonts \doerrormsg}
 
239
\def\doerrormsg#1{\errmessage{#1}}
 
240
 
257
241
% add check for \lastpenalty to plain's definitions.  If the last thing
258
242
% we did was a \nobreak, we don't want to insert more space.
259
243
%
264
248
\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
265
249
  \removelastskip\penalty-200\bigskip\fi\fi}
266
250
 
267
 
% For @cropmarks command.
268
251
% Do @cropmarks to get crop marks.
269
252
%
270
253
\newif\ifcropmarks
298
281
  \toks6=\expandafter{\prevsectiondefs}%
299
282
  \toks8=\expandafter{\lastcolordefs}%
300
283
  \mark{%
301
 
                   \the\toks0 \the\toks2
302
 
      \noexpand\or \the\toks4 \the\toks6
303
 
    \noexpand\else \the\toks8
 
284
                   \the\toks0 \the\toks2  % 0: top marks (\last...)
 
285
      \noexpand\or \the\toks4 \the\toks6  % 1: bottom marks (default, \prev...)
 
286
    \noexpand\else \the\toks8             % 2: color marks
304
287
  }%
305
288
}
306
289
% \topmark doesn't work for the very first chapter (after the title
339
322
  %
340
323
  % Do this outside of the \shipout so @code etc. will be expanded in
341
324
  % the headline as they should be, not taken literally (outputting ''code).
 
325
  \def\commmonheadfootline{\let\hsize=\pagewidth \texinfochars}
 
326
  %
342
327
  \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
343
 
  \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
 
328
  \global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}%
 
329
  %
344
330
  \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
345
 
  \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
 
331
  \global\setbox\footlinebox = \vbox{\commmonheadfootline \makefootline}%
346
332
  %
347
333
  {%
348
334
    % Have to do this stuff outside the \shipout because we want it to
355
341
               % We don't want .vr (or whatever) entries like this:
356
342
               % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}}
357
343
               % "\acronym" won't work when it's read back in;
358
 
               % it needs to be 
 
344
               % it needs to be
359
345
               % {\code {{\tt \backslashcurfont }acronym}
360
346
    \shipout\vbox{%
361
347
      % Do this early so pdf references go to the beginning of the page.
574
560
}
575
561
\def\inenvironment#1{%
576
562
  \ifx#1\empty
577
 
    out of any environment%
 
563
    outside of any environment%
578
564
  \else
579
565
    in environment \expandafter\string#1%
580
566
  \fi
586
572
\parseargdef\end{%
587
573
  \if 1\csname iscond.#1\endcsname
588
574
  \else
589
 
    % The general wording of \badenverr may not be ideal, but... --kasal, 06nov03
 
575
    % The general wording of \badenverr may not be ideal.
590
576
    \expandafter\checkenv\csname#1\endcsname
591
577
    \csname E#1\endcsname
592
578
    \endgroup
596
582
\newhelp\EMsimple{Press RETURN to continue.}
597
583
 
598
584
 
599
 
%% Simple single-character @ commands
600
 
 
601
 
% @@ prints an @
602
 
% Kludge this until the fonts are right (grr).
603
 
\def\@{{\tt\char64}}
604
 
 
605
 
% This is turned off because it was never documented
606
 
% and you can use @w{...} around a quote to suppress ligatures.
607
 
%% Define @` and @' to be the same as ` and '
608
 
%% but suppressing ligatures.
609
 
%\def\`{{`}}
610
 
%\def\'{{'}}
611
 
 
612
 
% Used to generate quoted braces.
613
 
\def\mylbrace {{\tt\char123}}
614
 
\def\myrbrace {{\tt\char125}}
615
 
\let\{=\mylbrace
616
 
\let\}=\myrbrace
617
 
\begingroup
618
 
  % Definitions to produce \{ and \} commands for indices,
619
 
  % and @{ and @} for the aux/toc files.
620
 
  \catcode`\{ = \other \catcode`\} = \other
621
 
  \catcode`\[ = 1 \catcode`\] = 2
622
 
  \catcode`\! = 0 \catcode`\\ = \other
623
 
  !gdef!lbracecmd[\{]%
624
 
  !gdef!rbracecmd[\}]%
625
 
  !gdef!lbraceatcmd[@{]%
626
 
  !gdef!rbraceatcmd[@}]%
627
 
!endgroup
628
 
 
629
 
% @comma{} to avoid , parsing problems.
630
 
\let\comma = ,
631
 
 
632
 
% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
633
 
% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
634
 
\let\, = \c
635
 
\let\dotaccent = \.
636
 
\def\ringaccent#1{{\accent23 #1}}
637
 
\let\tieaccent = \t
638
 
\let\ubaraccent = \b
639
 
\let\udotaccent = \d
640
 
 
641
 
% Other special characters: @questiondown @exclamdown @ordf @ordm
642
 
% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
643
 
\def\questiondown{?`}
644
 
\def\exclamdown{!`}
645
 
\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
646
 
\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
647
 
 
648
 
% Dotless i and dotless j, used for accents.
649
 
\def\imacro{i}
650
 
\def\jmacro{j}
651
 
\def\dotless#1{%
652
 
  \def\temp{#1}%
653
 
  \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
654
 
  \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
655
 
  \else \errmessage{@dotless can be used only with i or j}%
656
 
  \fi\fi
657
 
}
658
 
 
659
 
% The \TeX{} logo, as in plain, but resetting the spacing so that a
660
 
% period following counts as ending a sentence.  (Idea found in latex.)
661
 
%
662
 
\edef\TeX{\TeX \spacefactor=1000 }
663
 
 
664
 
% @LaTeX{} logo.  Not quite the same results as the definition in
665
 
% latex.ltx, since we use a different font for the raised A; it's most
666
 
% convenient for us to use an explicitly smaller font, rather than using
667
 
% the \scriptstyle font (since we don't reset \scriptstyle and
668
 
% \scriptscriptstyle).
669
 
%
670
 
\def\LaTeX{%
671
 
  L\kern-.36em
672
 
  {\setbox0=\hbox{T}%
673
 
   \vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}%
674
 
  \kern-.15em
675
 
  \TeX
676
 
}
677
 
 
678
585
% Be sure we're in horizontal mode when doing a tie, since we make space
679
586
% equivalent to this in @example-like environments. Otherwise, a space
680
587
% at the beginning of a line will start with \penalty -- and
691
598
\def\:{\spacefactor=1000 }
692
599
 
693
600
% @* forces a line break.
694
 
\def\*{\hfil\break\hbox{}\ignorespaces}
 
601
\def\*{\unskip\hfil\break\hbox{}\ignorespaces}
695
602
 
696
603
% @/ allows a line break.
697
604
\let\/=\allowbreak
706
613
\def\?{?\spacefactor=\endofsentencespacefactor\space}
707
614
 
708
615
% @frenchspacing on|off  says whether to put extra space after punctuation.
709
 
 
616
%
710
617
\def\onword{on}
711
618
\def\offword{off}
712
619
%
716
623
  \else\ifx\temp\offword \plainnonfrenchspacing
717
624
  \else
718
625
    \errhelp = \EMsimple
719
 
    \errmessage{Unknown @frenchspacing option `\temp', must be on/off}%
 
626
    \errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
720
627
  \fi\fi
721
628
}
722
629
 
798
705
 
799
706
\newdimen\mil  \mil=0.001in
800
707
 
801
 
% Old definition--didn't work.
802
 
%\parseargdef\need{\par %
803
 
%% This method tries to make TeX break the page naturally
804
 
%% if the depth of the box does not fit.
805
 
%{\baselineskip=0pt%
806
 
%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
807
 
%\prevdepth=-1000pt
808
 
%}}
809
 
 
810
708
\parseargdef\need{%
811
709
  % Ensure vertical mode, so we don't make a big box in the middle of a
812
710
  % paragraph.
870
768
 
871
769
% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
872
770
% paragraph.  For more general purposes, use the \margin insertion
873
 
% class.  WHICH is `l' or `r'.
 
771
% class.  WHICH is `l' or `r'.  Not documented, written for gawk manual.
874
772
%
875
773
\newskip\inmarginspacing \inmarginspacing=1cm
876
774
\def\strutdepth{\dp\strutbox}
917
815
  \temp
918
816
}
919
817
 
 
818
% @| inserts a changebar to the left of the current line.  It should
 
819
% surround any changed text.  This approach does *not* work if the
 
820
% change spans more than two lines of output.  To handle that, we would
 
821
% have adopt a much more difficult approach (putting marks into the main
 
822
% vertical list for the beginning and end of each change).  This command
 
823
% is not documented, not supported, and doesn't work.
 
824
%
 
825
\def\|{%
 
826
  % \vadjust can only be used in horizontal mode.
 
827
  \leavevmode
 
828
  %
 
829
  % Append this vertical mode material after the current line in the output.
 
830
  \vadjust{%
 
831
    % We want to insert a rule with the height and depth of the current
 
832
    % leading; that is exactly what \strutbox is supposed to record.
 
833
    \vskip-\baselineskip
 
834
    %
 
835
    % \vadjust-items are inserted at the left edge of the type.  So
 
836
    % the \llap here moves out into the left-hand margin.
 
837
    \llap{%
 
838
      %
 
839
      % For a thicker or thinner bar, change the `1pt'.
 
840
      \vrule height\baselineskip width1pt
 
841
      %
 
842
      % This is the space between the bar and the text.
 
843
      \hskip 12pt
 
844
    }%
 
845
  }%
 
846
}
 
847
 
920
848
% @include FILE -- \input text of FILE.
921
849
%
922
850
\def\include{\parseargusing\filenamecatcodes\includezzz}
926
854
  {%
927
855
    \makevalueexpandable  % we want to expand any @value in FILE.
928
856
    \turnoffactive        % and allow special characters in the expansion
 
857
    \indexnofonts         % Allow `@@' and other weird things in file names.
 
858
    \wlog{texinfo.tex: doing @include of #1^^J}%
929
859
    \edef\temp{\noexpand\input #1 }%
930
860
    %
931
861
    % This trickery is to read FILE outside of a group, in case it makes
944
874
  \catcode`>=\other
945
875
  \catcode`+=\other
946
876
  \catcode`-=\other
 
877
  \catcode`\`=\other
 
878
  \catcode`\'=\other
947
879
}
948
880
 
949
881
\def\pushthisfilestack{%
959
891
\def\popthisfilestack{\errthisfilestackempty}
960
892
\def\errthisfilestackempty{\errmessage{Internal error:
961
893
  the stack of filenames is empty.}}
962
 
 
 
894
%
963
895
\def\thisfile{}
964
896
 
965
897
% @center line
967
899
%
968
900
\parseargdef\center{%
969
901
  \ifhmode
970
 
    \let\next\centerH
 
902
    \let\centersub\centerH
971
903
  \else
972
 
    \let\next\centerV
 
904
    \let\centersub\centerV
973
905
  \fi
974
 
  \next{\hfil \ignorespaces#1\unskip \hfil}%
975
 
}
976
 
\def\centerH#1{%
977
 
  {%
978
 
    \hfil\break
979
 
    \advance\hsize by -\leftskip
980
 
    \advance\hsize by -\rightskip
981
 
    \line{#1}%
982
 
    \break
983
 
  }%
984
 
}
985
 
\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}}
 
906
  \centersub{\hfil \ignorespaces#1\unskip \hfil}%
 
907
  \let\centersub\relax % don't let the definition persist, just in case
 
908
}
 
909
\def\centerH#1{{%
 
910
  \hfil\break
 
911
  \advance\hsize by -\leftskip
 
912
  \advance\hsize by -\rightskip
 
913
  \line{#1}%
 
914
  \break
 
915
}}
 
916
%
 
917
\newcount\centerpenalty
 
918
\def\centerV#1{%
 
919
  % The idea here is the same as in \startdefun, \cartouche, etc.: if
 
920
  % @center is the first thing after a section heading, we need to wipe
 
921
  % out the negative parskip inserted by \sectionheading, but still
 
922
  % prevent a page break here.
 
923
  \centerpenalty = \lastpenalty
 
924
  \ifnum\centerpenalty>10000 \vskip\parskip \fi
 
925
  \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
 
926
  \line{\kern\leftskip #1\kern\rightskip}%
 
927
}
986
928
 
987
929
% @sp n   outputs n lines of vertical space
988
 
 
 
930
%
989
931
\parseargdef\sp{\vskip #1\baselineskip}
990
932
 
991
933
% @comment ...line which is ignored...
992
934
% @c is the same as @comment
993
935
% @ignore ... @end ignore  is another way to write a comment
994
 
 
 
936
%
995
937
\def\comment{\begingroup \catcode`\^^M=\other%
996
938
\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
997
939
\commentxxx}
998
940
{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
999
 
 
 
941
%
1000
942
\let\c=\comment
1001
943
 
1002
944
% @paragraphindent NCHARS
1089
1031
}
1090
1032
 
1091
1033
 
1092
 
% @asis just yields its argument.  Used with @table, for example.
1093
 
%
1094
 
\def\asis#1{#1}
1095
 
 
1096
 
% @math outputs its argument in math mode.
1097
 
%
1098
 
% One complication: _ usually means subscripts, but it could also mean
1099
 
% an actual _ character, as in @math{@var{some_variable} + 1}.  So make
1100
 
% _ active, and distinguish by seeing if the current family is \slfam,
1101
 
% which is what @var uses.
1102
 
{
1103
 
  \catcode`\_ = \active
1104
 
  \gdef\mathunderscore{%
1105
 
    \catcode`\_=\active
1106
 
    \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
1107
 
  }
1108
 
}
1109
 
% Another complication: we want \\ (and @\) to output a \ character.
1110
 
% FYI, plain.tex uses \\ as a temporary control sequence (why?), but
1111
 
% this is not advertised and we don't care.  Texinfo does not
1112
 
% otherwise define @\.
1113
 
%
1114
 
% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
1115
 
\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
1116
 
%
1117
 
\def\math{%
1118
 
  \tex
1119
 
  \mathunderscore
1120
 
  \let\\ = \mathbackslash
1121
 
  \mathactive
1122
 
  % make the texinfo accent commands work in math mode
1123
 
  \let\"=\ddot
1124
 
  \let\'=\acute
1125
 
  \let\==\bar
1126
 
  \let\^=\hat
1127
 
  \let\`=\grave
1128
 
  \let\u=\breve
1129
 
  \let\v=\check
1130
 
  \let\~=\tilde
1131
 
  \let\dotaccent=\dot
1132
 
  $\finishmath
1133
 
}
1134
 
\def\finishmath#1{#1$\endgroup}  % Close the group opened by \tex.
1135
 
 
1136
 
% Some active characters (such as <) are spaced differently in math.
1137
 
% We have to reset their definitions in case the @math was an argument
1138
 
% to a command which sets the catcodes (such as @item or @section).
1139
 
%
1140
 
{
1141
 
  \catcode`^ = \active
1142
 
  \catcode`< = \active
1143
 
  \catcode`> = \active
1144
 
  \catcode`+ = \active
1145
 
  \gdef\mathactive{%
1146
 
    \let^ = \ptexhat
1147
 
    \let< = \ptexless
1148
 
    \let> = \ptexgtr
1149
 
    \let+ = \ptexplus
1150
 
  }
1151
 
}
1152
 
 
1153
 
% Some math mode symbols.
1154
 
\def\bullet{$\ptexbullet$}
1155
 
\def\geq{\ifmmode \ge\else $\ge$\fi}
1156
 
\def\leq{\ifmmode \le\else $\le$\fi}
1157
 
\def\minus{\ifmmode -\else $-$\fi}
1158
 
 
1159
 
% @dots{} outputs an ellipsis using the current font.
1160
 
% We do .5em per period so that it has the same spacing in the cm
1161
 
% typewriter fonts as three actual period characters; on the other hand,
1162
 
% in other typewriter fonts three periods are wider than 1.5em.  So do
1163
 
% whichever is larger.
1164
 
%
1165
 
\def\dots{%
1166
 
  \leavevmode
1167
 
  \setbox0=\hbox{...}% get width of three periods
1168
 
  \ifdim\wd0 > 1.5em
1169
 
    \dimen0 = \wd0
1170
 
  \else
1171
 
    \dimen0 = 1.5em
1172
 
  \fi
1173
 
  \hbox to \dimen0{%
1174
 
    \hskip 0pt plus.25fil
1175
 
    .\hskip 0pt plus1fil
1176
 
    .\hskip 0pt plus1fil
1177
 
    .\hskip 0pt plus.5fil
1178
 
  }%
1179
 
}
1180
 
 
1181
 
% @enddots{} is an end-of-sentence ellipsis.
1182
 
%
1183
 
\def\enddots{%
1184
 
  \dots
1185
 
  \spacefactor=\endofsentencespacefactor
1186
 
}
1187
 
 
1188
 
% @comma{} is so commas can be inserted into text without messing up
1189
 
% Texinfo's parsing.
1190
 
%
1191
 
\let\comma = ,
1192
 
 
1193
1034
% @refill is a no-op.
1194
1035
\let\refill=\relax
1195
1036
 
1254
1095
\newif\ifpdfmakepagedest
1255
1096
 
1256
1097
% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
1257
 
% can be set).  So we test for \relax and 0 as well as \undefined,
1258
 
% borrowed from ifpdf.sty.
1259
 
\ifx\pdfoutput\undefined
 
1098
% can be set).  So we test for \relax and 0 as well as being undefined.
 
1099
\ifx\pdfoutput\thisisundefined
1260
1100
\else
1261
1101
  \ifx\pdfoutput\relax
1262
1102
  \else
1271
1111
% for display in the outlines, and in other places.  Thus, we have to
1272
1112
% double any backslashes.  Otherwise, a name like "\node" will be
1273
1113
% interpreted as a newline (\n), followed by o, d, e.  Not good.
1274
 
% http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html
1275
 
% (and related messages, the final outcome is that it is up to the TeX
1276
 
% user to double the backslashes and otherwise make the string valid, so
1277
 
% that's what we do).
1278
 
 
1279
 
% double active backslashes.
1280
 
1281
 
{\catcode`\@=0 \catcode`\\=\active
1282
 
 @gdef@activebackslashdouble{%
1283
 
   @catcode`@\=@active
1284
 
   @let\=@doublebackslash}
1285
 
}
1286
 
 
1287
 
% To handle parens, we must adopt a different approach, since parens are
1288
 
% not active characters.  hyperref.dtx (which has the same problem as
1289
 
% us) handles it with this amazing macro to replace tokens, with minor
1290
 
% changes for Texinfo.  It is included here under the GPL by permission
1291
 
% from the author, Heiko Oberdiek.
1292
 
1293
 
% #1 is the tokens to replace.
1294
 
% #2 is the replacement.
1295
 
% #3 is the control sequence with the string.
1296
 
1297
 
\def\HyPsdSubst#1#2#3{%
1298
 
  \def\HyPsdReplace##1#1##2\END{%
1299
 
    ##1%
1300
 
    \ifx\\##2\\%
1301
 
    \else
1302
 
      #2%
1303
 
      \HyReturnAfterFi{%
1304
 
        \HyPsdReplace##2\END
1305
 
      }%
1306
 
    \fi
1307
 
  }%
1308
 
  \xdef#3{\expandafter\HyPsdReplace#3#1\END}%
1309
 
}
1310
 
\long\def\HyReturnAfterFi#1\fi{\fi#1}
1311
 
 
1312
 
% #1 is a control sequence in which to do the replacements.
1313
 
\def\backslashparens#1{%
1314
 
  \xdef#1{#1}% redefine it as its expansion; the definition is simply
1315
 
             % \lastnode when called from \setref -> \pdfmkdest.
1316
 
  \HyPsdSubst{(}{\realbackslash(}{#1}%
1317
 
  \HyPsdSubst{)}{\realbackslash)}{#1}%
 
1114
%
 
1115
% See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
 
1116
% related messages.  The final outcome is that it is up to the TeX user
 
1117
% to double the backslashes and otherwise make the string valid, so
 
1118
% that's what we do.  pdftex 1.30.0 (ca.2005) introduced a primitive to
 
1119
% do this reliably, so we use it.
 
1120
 
 
1121
% #1 is a control sequence in which to do the replacements,
 
1122
% which we \xdef.
 
1123
\def\txiescapepdf#1{%
 
1124
  \ifx\pdfescapestring\thisisundefined
 
1125
    % No primitive available; should we give a warning or log?
 
1126
    % Many times it won't matter.
 
1127
  \else
 
1128
    % The expandable \pdfescapestring primitive escapes parentheses,
 
1129
    % backslashes, and other special chars.
 
1130
    \xdef#1{\pdfescapestring{#1}}%
 
1131
  \fi
1318
1132
}
1319
1133
 
1320
1134
\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
1324
1138
 
1325
1139
\ifpdf
1326
1140
  %
1327
 
  % Color manipulation macros based on pdfcolor.tex.
1328
 
  \def\cmykDarkRed{0.28 1 1 0.35}
1329
 
  \def\cmykBlack{0 0 0 1}
1330
 
  %
1331
 
  \def\pdfsetcolor#1{\pdfliteral{#1 k}}
 
1141
  % Color manipulation macros based on pdfcolor.tex,
 
1142
  % except using rgb instead of cmyk; the latter is said to render as a
 
1143
  % very dark gray on-screen and a very dark halftone in print, instead
 
1144
  % of actual black.
 
1145
  \def\rgbDarkRed{0.50 0.09 0.12}
 
1146
  \def\rgbBlack{0 0 0}
 
1147
  %
 
1148
  % k sets the color for filling (usual text, etc.);
 
1149
  % K sets the color for stroking (thin rules, e.g., normal _'s).
 
1150
  \def\pdfsetcolor#1{\pdfliteral{#1 rg  #1 RG}}
 
1151
  %
1332
1152
  % Set color, and create a mark which defines \thiscolor accordingly,
1333
1153
  % so that \makeheadline knows which color to restore.
1334
1154
  \def\setcolor#1{%
1337
1157
    \pdfsetcolor{#1}%
1338
1158
  }
1339
1159
  %
1340
 
  \def\maincolor{\cmykBlack}
 
1160
  \def\maincolor{\rgbBlack}
1341
1161
  \pdfsetcolor{\maincolor}
1342
1162
  \edef\thiscolor{\maincolor}
1343
1163
  \def\lastcolordefs{}
1367
1187
  %
1368
1188
  % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
1369
1189
  \def\dopdfimage#1#2#3{%
1370
 
    \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
1371
 
    \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
 
1190
    \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
 
1191
    \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
1372
1192
    %
1373
 
    % pdftex (and the PDF format) support .png, .jpg, .pdf (among
1374
 
    % others).  Let's try in that order.
 
1193
    % pdftex (and the PDF format) support .pdf, .png, .jpg (among
 
1194
    % others).  Let's try in that order, PDF first since if
 
1195
    % someone has a scalable image, presumably better to use that than a
 
1196
    % bitmap.
1375
1197
    \let\pdfimgext=\empty
1376
1198
    \begingroup
1377
 
      \openin 1 #1.png \ifeof 1
1378
 
        \openin 1 #1.jpg \ifeof 1
1379
 
          \openin 1 #1.jpeg \ifeof 1
1380
 
            \openin 1 #1.JPG \ifeof 1
1381
 
              \openin 1 #1.pdf \ifeof 1
1382
 
                \openin 1 #1.PDF \ifeof 1
 
1199
      \openin 1 #1.pdf \ifeof 1
 
1200
        \openin 1 #1.PDF \ifeof 1
 
1201
          \openin 1 #1.png \ifeof 1
 
1202
            \openin 1 #1.jpg \ifeof 1
 
1203
              \openin 1 #1.jpeg \ifeof 1
 
1204
                \openin 1 #1.JPG \ifeof 1
1383
1205
                  \errhelp = \nopdfimagehelp
1384
1206
                  \errmessage{Could not find image file #1 for pdf}%
1385
 
                \else \gdef\pdfimgext{PDF}%
 
1207
                \else \gdef\pdfimgext{JPG}%
1386
1208
                \fi
1387
 
              \else \gdef\pdfimgext{pdf}%
 
1209
              \else \gdef\pdfimgext{jpeg}%
1388
1210
              \fi
1389
 
            \else \gdef\pdfimgext{JPG}%
 
1211
            \else \gdef\pdfimgext{jpg}%
1390
1212
            \fi
1391
 
          \else \gdef\pdfimgext{jpeg}%
 
1213
          \else \gdef\pdfimgext{png}%
1392
1214
          \fi
1393
 
        \else \gdef\pdfimgext{jpg}%
 
1215
        \else \gdef\pdfimgext{PDF}%
1394
1216
        \fi
1395
 
      \else \gdef\pdfimgext{png}%
 
1217
      \else \gdef\pdfimgext{pdf}%
1396
1218
      \fi
1397
1219
      \closein 1
1398
1220
    \endgroup
1404
1226
    \else
1405
1227
      \immediate\pdfximage
1406
1228
    \fi
1407
 
      \ifdim \wd0 >0pt width \imagewidth \fi
1408
 
      \ifdim \wd2 >0pt height \imageheight \fi
 
1229
      \ifdim \wd0 >0pt width \pdfimagewidth \fi
 
1230
      \ifdim \wd2 >0pt height \pdfimageheight \fi
1409
1231
      \ifnum\pdftexversion<13
1410
1232
         #1.\pdfimgext
1411
1233
       \else
1420
1242
    % such as \, aren't expanded when present in a section title.
1421
1243
    \indexnofonts
1422
1244
    \turnoffactive
1423
 
    \activebackslashdouble
1424
1245
    \makevalueexpandable
1425
1246
    \def\pdfdestname{#1}%
1426
 
    \backslashparens\pdfdestname
 
1247
    \txiescapepdf\pdfdestname
1427
1248
    \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
1428
1249
  }}
1429
1250
  %
1432
1253
  %
1433
1254
  % by default, use a color that is dark enough to print on paper as
1434
1255
  % nearly black, but still distinguishable for online viewing.
1435
 
  \def\urlcolor{\cmykDarkRed}
1436
 
  \def\linkcolor{\cmykDarkRed}
 
1256
  \def\urlcolor{\rgbDarkRed}
 
1257
  \def\linkcolor{\rgbDarkRed}
1437
1258
  \def\endlink{\setcolor{\maincolor}\pdfendlink}
1438
1259
  %
1439
1260
  % Adding outlines to PDF; macros for calculating structure of outlines
1455
1276
    % page number.  We could generate a destination for the section
1456
1277
    % text in the case where a section has no node, but it doesn't
1457
1278
    % seem worth the trouble, since most documents are normally structured.
1458
 
    \def\pdfoutlinedest{#3}%
 
1279
    \edef\pdfoutlinedest{#3}%
1459
1280
    \ifx\pdfoutlinedest\empty
1460
1281
      \def\pdfoutlinedest{#4}%
1461
1282
    \else
1462
 
      % Doubled backslashes in the name.
1463
 
      {\activebackslashdouble \xdef\pdfoutlinedest{#3}%
1464
 
       \backslashparens\pdfoutlinedest}%
 
1283
      \txiescapepdf\pdfoutlinedest
1465
1284
    \fi
1466
1285
    %
1467
 
    % Also double the backslashes in the display string.
1468
 
    {\activebackslashdouble \xdef\pdfoutlinetext{#1}%
1469
 
     \backslashparens\pdfoutlinetext}%
 
1286
    % Also escape PDF chars in the display string.
 
1287
    \edef\pdfoutlinetext{#1}%
 
1288
    \txiescapepdf\pdfoutlinetext
1470
1289
    %
1471
1290
    \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
1472
1291
  }
1473
1292
  %
1474
1293
  \def\pdfmakeoutlines{%
1475
1294
    \begingroup
1476
 
      % Thanh's hack / proper braces in bookmarks
1477
 
      \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
1478
 
      \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
1479
 
      %
1480
1295
      % Read toc silently, to get counts of subentries for \pdfoutline.
 
1296
      \def\partentry##1##2##3##4{}% ignore parts in the outlines
1481
1297
      \def\numchapentry##1##2##3##4{%
1482
1298
        \def\thischapnum{##2}%
1483
1299
        \def\thissecnum{0}%
1531
1347
      % Latin 2 (0xea) gets translated to a | character.  Info from
1532
1348
      % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
1533
1349
      %
1534
 
      % xx to do this right, we have to translate 8-bit characters to
1535
 
      % their "best" equivalent, based on the @documentencoding.  Right
1536
 
      % now, I guess we'll just let the pdf reader have its way.
 
1350
      % TODO this right, we have to translate 8-bit characters to
 
1351
      % their "best" equivalent, based on the @documentencoding.  Too
 
1352
      % much work for too little return.  Just use the ASCII equivalents
 
1353
      % we use for the index sort strings.
 
1354
      %
1537
1355
      \indexnofonts
1538
1356
      \setupdatafile
 
1357
      % We can have normal brace characters in the PDF outlines, unlike
 
1358
      % Texinfo index files.  So set that up.
 
1359
      \def\{{\lbracecharliteral}%
 
1360
      \def\}{\rbracecharliteral}%
1539
1361
      \catcode`\\=\active \otherbackslash
1540
1362
      \input \tocreadfilename
1541
1363
    \endgroup
1542
1364
  }
 
1365
  {\catcode`[=1 \catcode`]=2
 
1366
   \catcode`{=\other \catcode`}=\other
 
1367
   \gdef\lbracecharliteral[{]%
 
1368
   \gdef\rbracecharliteral[}]%
 
1369
  ]
1543
1370
  %
1544
1371
  \def\skipspaces#1{\def\PP{#1}\def\D{|}%
1545
1372
    \ifx\PP\D\let\nextsp\relax
1546
1373
    \else\let\nextsp\skipspaces
1547
 
      \ifx\p\space\else\addtokens{\filename}{\PP}%
1548
 
        \advance\filenamelength by 1
1549
 
      \fi
 
1374
      \addtokens{\filename}{\PP}%
 
1375
      \advance\filenamelength by 1
1550
1376
    \fi
1551
1377
    \nextsp}
1552
 
  \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
 
1378
  \def\getfilename#1{%
 
1379
    \filenamelength=0
 
1380
    % If we don't expand the argument now, \skipspaces will get
 
1381
    % snagged on things like "@value{foo}".
 
1382
    \edef\temp{#1}%
 
1383
    \expandafter\skipspaces\temp|\relax
 
1384
  }
1553
1385
  \ifnum\pdftexversion < 14
1554
1386
    \let \startlink \pdfannotlink
1555
1387
  \else
1562
1394
      % tried to figure out what each command should do in the context
1563
1395
      % of @url.  for now, just make @/ a no-op, that's the only one
1564
1396
      % people have actually reported a problem with.
1565
 
      % 
 
1397
      %
1566
1398
      \normalturnoffactive
1567
1399
      \def\@{@}%
1568
1400
      \let\/=\empty
1569
1401
      \makevalueexpandable
 
1402
      % do we want to go so far as to use \indexnofonts instead of just
 
1403
      % special-casing \var here?
 
1404
      \def\var##1{##1}%
 
1405
      %
1570
1406
      \leavevmode\setcolor{\urlcolor}%
1571
1407
      \startlink attr{/Border [0 0 0]}%
1572
1408
        user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
1597
1433
    \setcolor{\linkcolor}#1\endlink}
1598
1434
  \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
1599
1435
\else
 
1436
  % non-pdf mode
1600
1437
  \let\pdfmkdest = \gobble
1601
1438
  \let\pdfurl = \gobble
1602
1439
  \let\endlink = \relax
1627
1464
\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
1628
1465
\def\tt{\fam=\ttfam \setfontstyle{tt}}
1629
1466
 
 
1467
% Unfortunately, we have to override this for titles and the like, since
 
1468
% in those cases "rm" is bold.  Sigh.
 
1469
\def\rmisbold{\rm\def\curfontstyle{bf}}
 
1470
 
1630
1471
% Texinfo sort of supports the sans serif font style, which plain TeX does not.
1631
1472
% So we set up a \sf.
1632
1473
\newfam\sffam
1637
1478
\def\ttsl{\setfontstyle{ttsl}}
1638
1479
 
1639
1480
 
1640
 
% Default leading.
1641
 
\newdimen\textleading  \textleading = 13.2pt
1642
 
 
1643
1481
% Set the baselineskip to #1, and the lineskip and strut size
1644
1482
% correspondingly.  There is no deep meaning behind these magic numbers
1645
1483
% used as factors; they just match (closely enough) what Knuth defined.
1651
1489
% can get a sort of poor man's double spacing by redefining this.
1652
1490
\def\baselinefactor{1}
1653
1491
%
 
1492
\newdimen\textleading
1654
1493
\def\setleading#1{%
1655
1494
  \dimen0 = #1\relax
1656
1495
  \normalbaselineskip = \baselinefactor\dimen0
1672
1511
% if we are producing pdf, and we have \pdffontattr, then define cmaps.
1673
1512
% (\pdffontattr was introduced many years ago, but people still run
1674
1513
% older pdftex's; it's easy to conditionalize, so we do.)
1675
 
\ifpdf \ifx\pdffontattr\undefined \else
 
1514
\ifpdf \ifx\pdffontattr\thisisundefined \else
1676
1515
  \begingroup
1677
1516
    \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
1678
1517
    \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
1923
1762
\fi\fi
1924
1763
 
1925
1764
 
1926
 
% Set the font macro #1 to the font named #2, adding on the
1927
 
% specified font prefix (normally `cm').
 
1765
% Set the font macro #1 to the font named \fontprefix#2.
1928
1766
% #3 is the font's design size, #4 is a scale factor, #5 is the CMap
1929
 
% encoding (currently only OT1, OT1IT and OT1TT are allowed, pass
1930
 
% empty to omit).
 
1767
% encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit).
 
1768
% Example:
 
1769
% #1 = \textrm
 
1770
% #2 = \rmshape
 
1771
% #3 = 10
 
1772
% #4 = \mainmagstep
 
1773
% #5 = OT1
 
1774
%
1931
1775
\def\setfont#1#2#3#4#5{%
1932
1776
  \font#1=\fontprefix#2#3 scaled #4
1933
1777
  \csname cmap#5\endcsname#1%
1934
1778
}
1935
1779
% This is what gets called when #5 of \setfont is empty.
1936
1780
\let\cmap\gobble
1937
 
% emacs-page end of cmaps
 
1781
%
 
1782
% (end of cmaps)
1938
1783
 
1939
1784
% Use cm as the default font prefix.
1940
1785
% To specify the font prefix, you must define \fontprefix
1941
1786
% before you read in texinfo.tex.
1942
 
\ifx\fontprefix\undefined
 
1787
\ifx\fontprefix\thisisundefined
1943
1788
\def\fontprefix{cm}
1944
1789
\fi
1945
1790
% Support font families that don't use the same naming scheme as CM.
1946
1791
\def\rmshape{r}
1947
 
\def\rmbshape{bx}               %where the normal face is bold
 
1792
\def\rmbshape{bx}               % where the normal face is bold
1948
1793
\def\bfshape{b}
1949
1794
\def\bxshape{bx}
1950
1795
\def\ttshape{tt}
1959
1804
\def\scshape{csc}
1960
1805
\def\scbshape{csc}
1961
1806
 
1962
 
% Definitions for a main text size of 11pt.  This is the default in
1963
 
% Texinfo.
1964
 
 
1807
% Definitions for a main text size of 11pt.  (The default in Texinfo.)
 
1808
%
1965
1809
\def\definetextfontsizexi{%
1966
1810
% Text fonts (11.2pt, magstep1).
1967
1811
\def\textnominalsize{11pt}
2024
1868
\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
2025
1869
\font\titlei=cmmi12 scaled \magstep3
2026
1870
\font\titlesy=cmsy10 scaled \magstep4
2027
 
\def\authorrm{\secrm}
2028
 
\def\authortt{\sectt}
2029
1871
\def\titleecsize{2074}
2030
1872
 
2031
1873
% Chapter (and unnumbered) fonts (17.28pt).
2084
1926
\font\reducedsy=cmsy10
2085
1927
\def\reducedecsize{1000}
2086
1928
 
2087
 
% reset the current fonts
2088
 
\textfonts
 
1929
\textleading = 13.2pt % line spacing for 11pt CM
 
1930
\textfonts            % reset the current fonts
2089
1931
\rm
2090
 
} % end of 11pt text font size definitions
 
1932
} % end of 11pt text font size definitions, \definetextfontsizexi
2091
1933
 
2092
1934
 
2093
1935
% Definitions to make the main text be 10pt Computer Modern, with
2094
1936
% section, chapter, etc., sizes following suit.  This is for the GNU
2095
1937
% Press printing of the Emacs 22 manual.  Maybe other manuals in the
2096
1938
% future.  Used with @smallbook, which sets the leading to 12pt.
2097
 
 
1939
%
2098
1940
\def\definetextfontsizex{%
2099
1941
% Text fonts (10pt).
2100
1942
\def\textnominalsize{10pt}
2157
1999
\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
2158
2000
\font\titlei=cmmi12 scaled \magstep3
2159
2001
\font\titlesy=cmsy10 scaled \magstep4
2160
 
\def\authorrm{\secrm}
2161
 
\def\authortt{\sectt}
2162
2002
\def\titleecsize{2074}
2163
2003
 
2164
2004
% Chapter fonts (14.4pt).
2185
2025
\setfont\secsf\sfbshape{12}{1000}{OT1}
2186
2026
\let\secbf\secrm
2187
2027
\setfont\secsc\scbshape{10}{\magstep1}{OT1}
2188
 
\font\seci=cmmi12 
 
2028
\font\seci=cmmi12
2189
2029
\font\secsy=cmsy10 scaled \magstep1
2190
2030
\def\sececsize{1200}
2191
2031
 
2217
2057
\font\reducedsy=cmsy9
2218
2058
\def\reducedecsize{0900}
2219
2059
 
2220
 
% reduce space between paragraphs
2221
 
\divide\parskip by 2
2222
 
 
2223
 
% reset the current fonts
2224
 
\textfonts
 
2060
\divide\parskip by 2  % reduce space between paragraphs
 
2061
\textleading = 12pt   % line spacing for 10pt CM
 
2062
\textfonts            % reset the current fonts
2225
2063
\rm
2226
 
} % end of 10pt text font size definitions
 
2064
} % end of 10pt text font size definitions, \definetextfontsizex
2227
2065
 
2228
2066
 
2229
2067
% We provide the user-level command
2230
2068
%   @fonttextsize 10
2231
2069
% (or 11) to redefine the text font size.  pt is assumed.
2232
 
 
2070
%
 
2071
\def\xiword{11}
2233
2072
\def\xword{10}
2234
 
\def\xiword{11}
 
2073
\def\xwordpt{10pt}
2235
2074
%
2236
2075
\parseargdef\fonttextsize{%
2237
2076
  \def\textsizearg{#1}%
2238
 
  \wlog{doing @fonttextsize \textsizearg}%
 
2077
  %\wlog{doing @fonttextsize \textsizearg}%
2239
2078
  %
2240
2079
  % Set \globaldefs so that documents can use this inside @tex, since
2241
2080
  % makeinfo 4.8 does not support it, but we need it nonetheless.
2242
 
  % 
 
2081
  %
2243
2082
 \begingroup \globaldefs=1
2244
2083
  \ifx\textsizearg\xword \definetextfontsizex
2245
2084
  \else \ifx\textsizearg\xiword \definetextfontsizexi
2289
2128
  \let\tenttsl=\titlettsl
2290
2129
  \def\curfontsize{title}%
2291
2130
  \def\lsize{chap}\def\lllsize{subsec}%
2292
 
  \resetmathfonts \setleading{25pt}}
2293
 
\def\titlefont#1{{\titlefonts\rm #1}}
 
2131
  \resetmathfonts \setleading{27pt}}
 
2132
\def\titlefont#1{{\titlefonts\rmisbold #1}}
2294
2133
\def\chapfonts{%
2295
2134
  \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
2296
2135
  \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
2341
2180
  \def\lsize{smaller}\def\lllsize{smaller}%
2342
2181
  \resetmathfonts \setleading{9.5pt}}
2343
2182
 
 
2183
% Fonts for short table of contents.
 
2184
\setfont\shortcontrm\rmshape{12}{1000}{OT1}
 
2185
\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1}  % no cmb12
 
2186
\setfont\shortcontsl\slshape{12}{1000}{OT1}
 
2187
\setfont\shortconttt\ttshape{12}{1000}{OT1TT}
 
2188
 
 
2189
% Define these just so they can be easily changed for other fonts.
 
2190
\def\angleleft{$\langle$}
 
2191
\def\angleright{$\rangle$}
 
2192
 
2344
2193
% Set the fonts to use with the @small... environments.
2345
2194
\let\smallexamplefonts = \smallfonts
2346
2195
 
2354
2203
%
2355
2204
% By the way, for comparison, here's what fits with @example (10pt):
2356
2205
%   8.5x11=71  smallbook=60  a4=75  a5=58
2357
 
%
2358
 
% I wish the USA used A4 paper.
2359
2206
% --karl, 24jan03.
2360
2207
 
2361
 
 
2362
2208
% Set up the default fonts, so we can use them for creating boxes.
2363
2209
%
2364
2210
\definetextfontsizexi
2365
2211
 
2366
 
% Define these so they can be easily changed for other fonts.
2367
 
\def\angleleft{$\langle$}
2368
 
\def\angleright{$\rangle$}
 
2212
 
 
2213
\message{markup,}
 
2214
 
 
2215
% Check if we are currently using a typewriter font.  Since all the
 
2216
% Computer Modern typewriter fonts have zero interword stretch (and
 
2217
% shrink), and it is reasonable to expect all typewriter fonts to have
 
2218
% this property, we can check that font parameter.
 
2219
%
 
2220
\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
 
2221
 
 
2222
% Markup style infrastructure.  \defmarkupstylesetup\INITMACRO will
 
2223
% define and register \INITMACRO to be called on markup style changes.
 
2224
% \INITMACRO can check \currentmarkupstyle for the innermost
 
2225
% style and the set of \ifmarkupSTYLE switches for all styles
 
2226
% currently in effect.
 
2227
\newif\ifmarkupvar
 
2228
\newif\ifmarkupsamp
 
2229
\newif\ifmarkupkey
 
2230
%\newif\ifmarkupfile % @file == @samp.
 
2231
%\newif\ifmarkupoption % @option == @samp.
 
2232
\newif\ifmarkupcode
 
2233
\newif\ifmarkupkbd
 
2234
%\newif\ifmarkupenv % @env == @code.
 
2235
%\newif\ifmarkupcommand % @command == @code.
 
2236
\newif\ifmarkuptex % @tex (and part of @math, for now).
 
2237
\newif\ifmarkupexample
 
2238
\newif\ifmarkupverb
 
2239
\newif\ifmarkupverbatim
 
2240
 
 
2241
\let\currentmarkupstyle\empty
 
2242
 
 
2243
\def\setupmarkupstyle#1{%
 
2244
  \csname markup#1true\endcsname
 
2245
  \def\currentmarkupstyle{#1}%
 
2246
  \markupstylesetup
 
2247
}
 
2248
 
 
2249
\let\markupstylesetup\empty
 
2250
 
 
2251
\def\defmarkupstylesetup#1{%
 
2252
  \expandafter\def\expandafter\markupstylesetup
 
2253
    \expandafter{\markupstylesetup #1}%
 
2254
  \def#1%
 
2255
}
 
2256
 
 
2257
% Markup style setup for left and right quotes.
 
2258
\defmarkupstylesetup\markupsetuplq{%
 
2259
  \expandafter\let\expandafter \temp
 
2260
    \csname markupsetuplq\currentmarkupstyle\endcsname
 
2261
  \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
 
2262
}
 
2263
 
 
2264
\defmarkupstylesetup\markupsetuprq{%
 
2265
  \expandafter\let\expandafter \temp
 
2266
    \csname markupsetuprq\currentmarkupstyle\endcsname
 
2267
  \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
 
2268
}
 
2269
 
 
2270
{
 
2271
\catcode`\'=\active
 
2272
\catcode`\`=\active
 
2273
 
 
2274
\gdef\markupsetuplqdefault{\let`\lq}
 
2275
\gdef\markupsetuprqdefault{\let'\rq}
 
2276
 
 
2277
\gdef\markupsetcodequoteleft{\let`\codequoteleft}
 
2278
\gdef\markupsetcodequoteright{\let'\codequoteright}
 
2279
}
 
2280
 
 
2281
\let\markupsetuplqcode \markupsetcodequoteleft
 
2282
\let\markupsetuprqcode \markupsetcodequoteright
 
2283
%
 
2284
\let\markupsetuplqexample \markupsetcodequoteleft
 
2285
\let\markupsetuprqexample \markupsetcodequoteright
 
2286
%
 
2287
\let\markupsetuplqkbd     \markupsetcodequoteleft
 
2288
\let\markupsetuprqkbd     \markupsetcodequoteright
 
2289
%
 
2290
\let\markupsetuplqsamp \markupsetcodequoteleft
 
2291
\let\markupsetuprqsamp \markupsetcodequoteright
 
2292
%
 
2293
\let\markupsetuplqverb \markupsetcodequoteleft
 
2294
\let\markupsetuprqverb \markupsetcodequoteright
 
2295
%
 
2296
\let\markupsetuplqverbatim \markupsetcodequoteleft
 
2297
\let\markupsetuprqverbatim \markupsetcodequoteright
 
2298
 
 
2299
% Allow an option to not use regular directed right quote/apostrophe
 
2300
% (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
 
2301
% The undirected quote is ugly, so don't make it the default, but it
 
2302
% works for pasting with more pdf viewers (at least evince), the
 
2303
% lilypond developers report.  xpdf does work with the regular 0x27.
 
2304
%
 
2305
\def\codequoteright{%
 
2306
  \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
 
2307
    \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
 
2308
      '%
 
2309
    \else \char'15 \fi
 
2310
  \else \char'15 \fi
 
2311
}
 
2312
%
 
2313
% and a similar option for the left quote char vs. a grave accent.
 
2314
% Modern fonts display ASCII 0x60 as a grave accent, so some people like
 
2315
% the code environments to do likewise.
 
2316
%
 
2317
\def\codequoteleft{%
 
2318
  \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
 
2319
    \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
 
2320
      % [Knuth] pp. 380,381,391
 
2321
      % \relax disables Spanish ligatures ?` and !` of \tt font.
 
2322
      \relax`%
 
2323
    \else \char'22 \fi
 
2324
  \else \char'22 \fi
 
2325
}
 
2326
 
 
2327
% Commands to set the quote options.
 
2328
%
 
2329
\parseargdef\codequoteundirected{%
 
2330
  \def\temp{#1}%
 
2331
  \ifx\temp\onword
 
2332
    \expandafter\let\csname SETtxicodequoteundirected\endcsname
 
2333
      = t%
 
2334
  \else\ifx\temp\offword
 
2335
    \expandafter\let\csname SETtxicodequoteundirected\endcsname
 
2336
      = \relax
 
2337
  \else
 
2338
    \errhelp = \EMsimple
 
2339
    \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
 
2340
  \fi\fi
 
2341
}
 
2342
%
 
2343
\parseargdef\codequotebacktick{%
 
2344
  \def\temp{#1}%
 
2345
  \ifx\temp\onword
 
2346
    \expandafter\let\csname SETtxicodequotebacktick\endcsname
 
2347
      = t%
 
2348
  \else\ifx\temp\offword
 
2349
    \expandafter\let\csname SETtxicodequotebacktick\endcsname
 
2350
      = \relax
 
2351
  \else
 
2352
    \errhelp = \EMsimple
 
2353
    \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
 
2354
  \fi\fi
 
2355
}
 
2356
 
 
2357
% [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
 
2358
\def\noligaturesquoteleft{\relax\lq}
2369
2359
 
2370
2360
% Count depth in font-changes, for error checks
2371
2361
\newcount\fontdepth \fontdepth=0
2372
2362
 
2373
 
% Fonts for short table of contents.
2374
 
\setfont\shortcontrm\rmshape{12}{1000}{OT1}
2375
 
\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1}  % no cmb12
2376
 
\setfont\shortcontsl\slshape{12}{1000}{OT1}
2377
 
\setfont\shortconttt\ttshape{12}{1000}{OT1TT}
2378
 
 
2379
 
%% Add scribe-like font environments, plus @l for inline lisp (usually sans
2380
 
%% serif) and @ii for TeX italic
2381
 
 
2382
 
% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
2383
 
% unless the following character is such as not to need one.
2384
 
\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else
2385
 
                    \ptexslash\fi\fi\fi}
2386
 
\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx}
2387
 
\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx}
2388
 
 
2389
 
% like \smartslanted except unconditionally uses \ttsl.
2390
 
% @var is set to this for defun arguments.
2391
 
\def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx}
2392
 
 
2393
 
% like \smartslanted except unconditionally use \sl.  We never want
 
2363
% Font commands.
 
2364
 
 
2365
% #1 is the font command (\sl or \it), #2 is the text to slant.
 
2366
% If we are in a monospaced environment, however, 1) always use \ttsl,
 
2367
% and 2) do not add an italic correction.
 
2368
\def\dosmartslant#1#2{%
 
2369
  \ifusingtt
 
2370
    {{\ttsl #2}\let\next=\relax}%
 
2371
    {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
 
2372
  \next
 
2373
}
 
2374
\def\smartslanted{\dosmartslant\sl}
 
2375
\def\smartitalic{\dosmartslant\it}
 
2376
 
 
2377
% Output an italic correction unless \next (presumed to be the following
 
2378
% character) is such as not to need one.
 
2379
\def\smartitaliccorrection{%
 
2380
  \ifx\next,%
 
2381
  \else\ifx\next-%
 
2382
  \else\ifx\next.%
 
2383
  \else\ifx\next\.%
 
2384
  \else\ifx\next\comma%
 
2385
  \else\ptexslash
 
2386
  \fi\fi\fi\fi\fi
 
2387
  \aftersmartic
 
2388
}
 
2389
 
 
2390
% Unconditional use \ttsl, and no ic.  @var is set to this for defuns.
 
2391
\def\ttslanted#1{{\ttsl #1}}
 
2392
 
 
2393
% @cite is like \smartslanted except unconditionally use \sl.  We never want
2394
2394
% ttsl for book titles, do we?
2395
 
\def\cite#1{{\sl #1}\futurelet\next\smartitalicx}
 
2395
\def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
 
2396
 
 
2397
\def\aftersmartic{}
 
2398
\def\var#1{%
 
2399
  \let\saveaftersmartic = \aftersmartic
 
2400
  \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
 
2401
  \smartslanted{#1}%
 
2402
}
2396
2403
 
2397
2404
\let\i=\smartitalic
2398
2405
\let\slanted=\smartslanted
2399
 
\let\var=\smartslanted
2400
2406
\let\dfn=\smartslanted
2401
2407
\let\emph=\smartitalic
2402
2408
 
2403
 
% @b, explicit bold.
 
2409
% Explicit font changes: @r, @sc, undocumented @ii.
 
2410
\def\r#1{{\rm #1}}              % roman font
 
2411
\def\sc#1{{\smallcaps#1}}       % smallcaps font
 
2412
\def\ii#1{{\it #1}}             % italic font
 
2413
 
 
2414
% @b, explicit bold.  Also @strong.
2404
2415
\def\b#1{{\bf #1}}
2405
2416
\let\strong=\b
2406
2417
 
2432
2443
\catcode`@=\other
2433
2444
\def\endofsentencespacefactor{3000}% default
2434
2445
 
 
2446
% @t, explicit typewriter.
2435
2447
\def\t#1{%
2436
2448
  {\tt \rawbackslash \plainfrenchspacing #1}%
2437
2449
  \null
2438
2450
}
2439
 
\def\samp#1{`\tclose{#1}'\null}
2440
 
\setfont\keyrm\rmshape{8}{1000}{OT1}
2441
 
\font\keysy=cmsy9
2442
 
\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
2443
 
  \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
2444
 
    \vbox{\hrule\kern-0.4pt
2445
 
     \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
2446
 
    \kern-0.4pt\hrule}%
2447
 
  \kern-.06em\raise0.4pt\hbox{\angleright}}}}
2448
 
\def\key #1{{\nohyphenation \uppercase{#1}}\null}
2449
 
% The old definition, with no lozenge:
2450
 
%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
2451
 
\def\ctrl #1{{\tt \rawbackslash \hat}#1}
2452
 
 
2453
 
% @file, @option are the same as @samp.
2454
 
\let\file=\samp
2455
 
\let\option=\samp
2456
 
 
2457
 
% @code is a modification of @t,
2458
 
% which makes spaces the same size as normal in the surrounding text.
 
2451
 
 
2452
% @samp.
 
2453
\def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
 
2454
 
 
2455
% @indicateurl is \samp, that is, with quotes.
 
2456
\let\indicateurl=\samp
 
2457
 
 
2458
% @code (and similar) prints in typewriter, but with spaces the same
 
2459
% size as normal in the surrounding text, without hyphenation, etc.
 
2460
% This is a subroutine for that.
2459
2461
\def\tclose#1{%
2460
2462
  {%
2461
2463
    % Change normal interword space to be same as for the current font.
2474
2476
    \plainfrenchspacing
2475
2477
    #1%
2476
2478
  }%
2477
 
  \null
 
2479
  \null % reset spacefactor to 1000
2478
2480
}
2479
2481
 
2480
2482
% We *must* turn on hyphenation at `-' and `_' in @code.
 
2483
% (But see \codedashfinish below.)
2481
2484
% Otherwise, it is too hard to avoid overfull hboxes
2482
2485
% in the Emacs manual, the Library manual, etc.
2483
 
 
 
2486
%
2484
2487
% Unfortunately, TeX uses one parameter (\hyphenchar) to control
2485
2488
% both hyphenation at - and hyphenation within words.
2486
2489
% We must therefore turn them both off (\tclose does that)
2487
 
% and arrange explicitly to hyphenate at a dash.
2488
 
%  -- rms.
 
2490
% and arrange explicitly to hyphenate at a dash. -- rms.
2489
2491
{
2490
2492
  \catcode`\-=\active \catcode`\_=\active
2491
2493
  \catcode`\'=\active \catcode`\`=\active
 
2494
  \global\let'=\rq \global\let`=\lq  % default definitions
2492
2495
  %
2493
2496
  \global\def\code{\begingroup
2494
 
    \catcode\rquoteChar=\active \catcode\lquoteChar=\active
2495
 
    \let'\codequoteright \let`\codequoteleft
2496
 
    %
 
2497
    \setupmarkupstyle{code}%
 
2498
    % The following should really be moved into \setupmarkupstyle handlers.
2497
2499
    \catcode\dashChar=\active  \catcode\underChar=\active
2498
2500
    \ifallowcodebreaks
2499
2501
     \let-\codedash
2500
2502
     \let_\codeunder
2501
2503
    \else
2502
 
     \let-\realdash
 
2504
     \let-\normaldash
2503
2505
     \let_\realunder
2504
2506
    \fi
 
2507
    % Given -foo (with a single dash), we do not want to allow a break
 
2508
    % after the hyphen.
 
2509
    \global\let\codedashprev=\codedash
 
2510
    %
2505
2511
    \codex
2506
2512
  }
 
2513
  %
 
2514
  \gdef\codedash{\futurelet\next\codedashfinish}
 
2515
  \gdef\codedashfinish{%
 
2516
    \normaldash % always output the dash character itself.
 
2517
    %
 
2518
    % Now, output a discretionary to allow a line break, unless
 
2519
    % (a) the next character is a -, or
 
2520
    % (b) the preceding character is a -.
 
2521
    % E.g., given --posix, we do not want to allow a break after either -.
 
2522
    % Given --foo-bar, we do want to allow a break between the - and the b.
 
2523
    \ifx\next\codedash \else
 
2524
      \ifx\codedashprev\codedash
 
2525
      \else \discretionary{}{}{}\fi
 
2526
    \fi
 
2527
    % we need the space after the = for the case when \next itself is a
 
2528
    % space token; it would get swallowed otherwise.  As in @code{- a}.
 
2529
    \global\let\codedashprev= \next
 
2530
  }
2507
2531
}
 
2532
\def\normaldash{-}
 
2533
%
 
2534
\def\codex #1{\tclose{#1}\endgroup}
2508
2535
 
2509
 
\def\realdash{-}
2510
 
\def\codedash{-\discretionary{}{}{}}
2511
2536
\def\codeunder{%
2512
2537
  % this is all so @math{@code{var_name}+1} can work.  In math mode, _
2513
2538
  % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
2519
2544
             \discretionary{}{}{}}%
2520
2545
            {\_}%
2521
2546
}
2522
 
\def\codex #1{\tclose{#1}\endgroup}
2523
2547
 
2524
2548
% An additional complication: the above will allow breaks after, e.g.,
2525
 
% each of the four underscores in __typeof__.  This is undesirable in
2526
 
% some manuals, especially if they don't have long identifiers in
2527
 
% general.  @allowcodebreaks provides a way to control this.
2528
 
 
2549
% each of the four underscores in __typeof__.  This is bad.
 
2550
% @allowcodebreaks provides a document-level way to turn breaking at -
 
2551
% and _ on and off.
 
2552
%
2529
2553
\newif\ifallowcodebreaks  \allowcodebreakstrue
2530
2554
 
2531
2555
\def\keywordtrue{true}
2539
2563
    \allowcodebreaksfalse
2540
2564
  \else
2541
2565
    \errhelp = \EMsimple
2542
 
    \errmessage{Unknown @allowcodebreaks option `\txiarg'}%
 
2566
    \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
2543
2567
  \fi\fi
2544
2568
}
2545
2569
 
2546
 
% @kbd is like @code, except that if the argument is just one @key command,
2547
 
% then @kbd has no effect.
 
2570
% For @command, @env, @file, @option quotes seem unnecessary,
 
2571
% so use \code rather than \samp.
 
2572
\let\command=\code
 
2573
\let\env=\code
 
2574
\let\file=\code
 
2575
\let\option=\code
 
2576
 
 
2577
% @uref (abbreviation for `urlref') takes an optional (comma-separated)
 
2578
% second argument specifying the text to display and an optional third
 
2579
% arg as text to display instead of (rather than in addition to) the url
 
2580
% itself.  First (mandatory) arg is the url.
 
2581
% (This \urefnobreak definition isn't used now, leaving it for a while
 
2582
% for comparison.)
 
2583
\def\urefnobreak#1{\dourefnobreak #1,,,\finish}
 
2584
\def\dourefnobreak#1,#2,#3,#4\finish{\begingroup
 
2585
  \unsepspaces
 
2586
  \pdfurl{#1}%
 
2587
  \setbox0 = \hbox{\ignorespaces #3}%
 
2588
  \ifdim\wd0 > 0pt
 
2589
    \unhbox0 % third arg given, show only that
 
2590
  \else
 
2591
    \setbox0 = \hbox{\ignorespaces #2}%
 
2592
    \ifdim\wd0 > 0pt
 
2593
      \ifpdf
 
2594
        \unhbox0             % PDF: 2nd arg given, show only it
 
2595
      \else
 
2596
        \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
 
2597
      \fi
 
2598
    \else
 
2599
      \code{#1}% only url given, so show it
 
2600
    \fi
 
2601
  \fi
 
2602
  \endlink
 
2603
\endgroup}
 
2604
 
 
2605
% This \urefbreak definition is the active one.
 
2606
\def\urefbreak{\begingroup \urefcatcodes \dourefbreak}
 
2607
\let\uref=\urefbreak
 
2608
\def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
 
2609
\def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
 
2610
  \unsepspaces
 
2611
  \pdfurl{#1}%
 
2612
  \setbox0 = \hbox{\ignorespaces #3}%
 
2613
  \ifdim\wd0 > 0pt
 
2614
    \unhbox0 % third arg given, show only that
 
2615
  \else
 
2616
    \setbox0 = \hbox{\ignorespaces #2}%
 
2617
    \ifdim\wd0 > 0pt
 
2618
      \ifpdf
 
2619
        \unhbox0             % PDF: 2nd arg given, show only it
 
2620
      \else
 
2621
        \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url
 
2622
      \fi
 
2623
    \else
 
2624
      \urefcode{#1}% only url given, so show it
 
2625
    \fi
 
2626
  \fi
 
2627
  \endlink
 
2628
\endgroup}
 
2629
 
 
2630
% Allow line breaks around only a few characters (only).
 
2631
\def\urefcatcodes{%
 
2632
  \catcode\ampChar=\active   \catcode\dotChar=\active
 
2633
  \catcode\hashChar=\active  \catcode\questChar=\active
 
2634
  \catcode\slashChar=\active
 
2635
}
 
2636
{
 
2637
  \urefcatcodes
 
2638
  %
 
2639
  \global\def\urefcode{\begingroup
 
2640
    \setupmarkupstyle{code}%
 
2641
    \urefcatcodes
 
2642
    \let&\urefcodeamp
 
2643
    \let.\urefcodedot
 
2644
    \let#\urefcodehash
 
2645
    \let?\urefcodequest
 
2646
    \let/\urefcodeslash
 
2647
    \codex
 
2648
  }
 
2649
  %
 
2650
  % By default, they are just regular characters.
 
2651
  \global\def&{\normalamp}
 
2652
  \global\def.{\normaldot}
 
2653
  \global\def#{\normalhash}
 
2654
  \global\def?{\normalquest}
 
2655
  \global\def/{\normalslash}
 
2656
}
 
2657
 
 
2658
% we put a little stretch before and after the breakable chars, to help
 
2659
% line breaking of long url's.  The unequal skips make look better in
 
2660
% cmtt at least, especially for dots.
 
2661
\def\urefprestretch{\urefprebreak \hskip0pt plus.13em }
 
2662
\def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em }
 
2663
%
 
2664
\def\urefcodeamp{\urefprestretch \&\urefpoststretch}
 
2665
\def\urefcodedot{\urefprestretch .\urefpoststretch}
 
2666
\def\urefcodehash{\urefprestretch \#\urefpoststretch}
 
2667
\def\urefcodequest{\urefprestretch ?\urefpoststretch}
 
2668
\def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
 
2669
{
 
2670
  \catcode`\/=\active
 
2671
  \global\def\urefcodeslashfinish{%
 
2672
    \urefprestretch \slashChar
 
2673
    % Allow line break only after the final / in a sequence of
 
2674
    % slashes, to avoid line break between the slashes in http://.
 
2675
    \ifx\next/\else \urefpoststretch \fi
 
2676
  }
 
2677
}
 
2678
 
 
2679
% One more complication: by default we'll break after the special
 
2680
% characters, but some people like to break before the special chars, so
 
2681
% allow that.  Also allow no breaking at all, for manual control.
 
2682
%
 
2683
\parseargdef\urefbreakstyle{%
 
2684
  \def\txiarg{#1}%
 
2685
  \ifx\txiarg\wordnone
 
2686
    \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
 
2687
  \else\ifx\txiarg\wordbefore
 
2688
    \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
 
2689
  \else\ifx\txiarg\wordafter
 
2690
    \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
 
2691
  \else
 
2692
    \errhelp = \EMsimple
 
2693
    \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
 
2694
  \fi\fi\fi
 
2695
}
 
2696
\def\wordafter{after}
 
2697
\def\wordbefore{before}
 
2698
\def\wordnone{none}
 
2699
 
 
2700
\urefbreakstyle after
 
2701
 
 
2702
% @url synonym for @uref, since that's how everyone uses it.
 
2703
%
 
2704
\let\url=\uref
 
2705
 
 
2706
% rms does not like angle brackets --karl, 17may97.
 
2707
% So now @email is just like @uref, unless we are pdf.
 
2708
%
 
2709
%\def\email#1{\angleleft{\tt #1}\angleright}
 
2710
\ifpdf
 
2711
  \def\email#1{\doemail#1,,\finish}
 
2712
  \def\doemail#1,#2,#3\finish{\begingroup
 
2713
    \unsepspaces
 
2714
    \pdfurl{mailto:#1}%
 
2715
    \setbox0 = \hbox{\ignorespaces #2}%
 
2716
    \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
 
2717
    \endlink
 
2718
  \endgroup}
 
2719
\else
 
2720
  \let\email=\uref
 
2721
\fi
2548
2722
 
2549
2723
% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
2550
2724
%   `example' (@kbd uses ttsl only inside of @example and friends),
2559
2733
    \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
2560
2734
  \else
2561
2735
    \errhelp = \EMsimple
2562
 
    \errmessage{Unknown @kbdinputstyle option `\txiarg'}%
 
2736
    \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
2563
2737
  \fi\fi\fi
2564
2738
}
2565
2739
\def\worddistinct{distinct}
2566
2740
\def\wordexample{example}
2567
2741
\def\wordcode{code}
2568
2742
 
2569
 
% Default is `distinct.'
 
2743
% Default is `distinct'.
2570
2744
\kbdinputstyle distinct
2571
2745
 
 
2746
% @kbd is like @code, except that if the argument is just one @key command,
 
2747
% then @kbd has no effect.
 
2748
\def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}}
 
2749
 
2572
2750
\def\xkey{\key}
2573
 
\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
2574
 
\ifx\one\xkey\ifx\threex\three \key{#2}%
2575
 
\else{\tclose{\kbdfont\look}}\fi
2576
 
\else{\tclose{\kbdfont\look}}\fi}
2577
 
 
2578
 
% For @indicateurl, @env, @command quotes seem unnecessary, so use \code.
2579
 
\let\indicateurl=\code
2580
 
\let\env=\code
2581
 
\let\command=\code
 
2751
\def\kbdsub#1#2#3\par{%
 
2752
  \def\one{#1}\def\three{#3}\def\threex{??}%
 
2753
  \ifx\one\xkey\ifx\threex\three \key{#2}%
 
2754
  \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
 
2755
  \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
 
2756
}
 
2757
 
 
2758
% definition of @key that produces a lozenge.  Doesn't adjust to text size.
 
2759
%\setfont\keyrm\rmshape{8}{1000}{OT1}
 
2760
%\font\keysy=cmsy9
 
2761
%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
 
2762
%  \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
 
2763
%    \vbox{\hrule\kern-0.4pt
 
2764
%     \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
 
2765
%    \kern-0.4pt\hrule}%
 
2766
%  \kern-.06em\raise0.4pt\hbox{\angleright}}}}
 
2767
 
 
2768
% definition of @key with no lozenge.  If the current font is already
 
2769
% monospace, don't change it; that way, we respect @kbdinputstyle.  But
 
2770
% if it isn't monospace, then use \tt.
 
2771
%
 
2772
\def\key#1{{\setupmarkupstyle{key}%
 
2773
  \nohyphenation
 
2774
  \ifmonospace\else\tt\fi
 
2775
  #1}\null}
2582
2776
 
2583
2777
% @clicksequence{File @click{} Open ...}
2584
2778
\def\clicksequence#1{\begingroup #1\endgroup}
2587
2781
\parseargdef\clickstyle{\def\click{#1}}
2588
2782
\def\click{\arrow}
2589
2783
 
2590
 
% @uref (abbreviation for `urlref') takes an optional (comma-separated)
2591
 
% second argument specifying the text to display and an optional third
2592
 
% arg as text to display instead of (rather than in addition to) the url
2593
 
% itself.  First (mandatory) arg is the url.  Perhaps eventually put in
2594
 
% a hypertex \special here.
2595
 
%
2596
 
\def\uref#1{\douref #1,,,\finish}
2597
 
\def\douref#1,#2,#3,#4\finish{\begingroup
2598
 
  \unsepspaces
2599
 
  \pdfurl{#1}%
2600
 
  \setbox0 = \hbox{\ignorespaces #3}%
2601
 
  \ifdim\wd0 > 0pt
2602
 
    \unhbox0 % third arg given, show only that
2603
 
  \else
2604
 
    \setbox0 = \hbox{\ignorespaces #2}%
2605
 
    \ifdim\wd0 > 0pt
2606
 
      \ifpdf
2607
 
        \unhbox0             % PDF: 2nd arg given, show only it
2608
 
      \else
2609
 
        \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
2610
 
      \fi
2611
 
    \else
2612
 
      \code{#1}% only url given, so show it
2613
 
    \fi
2614
 
  \fi
2615
 
  \endlink
2616
 
\endgroup}
2617
 
 
2618
 
% @url synonym for @uref, since that's how everyone uses it.
2619
 
%
2620
 
\let\url=\uref
2621
 
 
2622
 
% rms does not like angle brackets --karl, 17may97.
2623
 
% So now @email is just like @uref, unless we are pdf.
2624
 
%
2625
 
%\def\email#1{\angleleft{\tt #1}\angleright}
2626
 
\ifpdf
2627
 
  \def\email#1{\doemail#1,,\finish}
2628
 
  \def\doemail#1,#2,#3\finish{\begingroup
2629
 
    \unsepspaces
2630
 
    \pdfurl{mailto:#1}%
2631
 
    \setbox0 = \hbox{\ignorespaces #2}%
2632
 
    \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
2633
 
    \endlink
2634
 
  \endgroup}
2635
 
\else
2636
 
  \let\email=\uref
2637
 
\fi
2638
 
 
2639
 
% Check if we are currently using a typewriter font.  Since all the
2640
 
% Computer Modern typewriter fonts have zero interword stretch (and
2641
 
% shrink), and it is reasonable to expect all typewriter fonts to have
2642
 
% this property, we can check that font parameter.
2643
 
%
2644
 
\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
2645
 
 
2646
2784
% Typeset a dimension, e.g., `in' or `pt'.  The only reason for the
2647
2785
% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
2648
2786
%
2649
2787
\def\dmn#1{\thinspace #1}
2650
2788
 
2651
 
\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
2652
 
 
2653
2789
% @l was never documented to mean ``switch to the Lisp font'',
2654
2790
% and it is not used as such in any manual I can find.  We need it for
2655
2791
% Polish suppressed-l.  --karl, 22sep96.
2656
2792
%\def\l#1{{\li #1}\null}
2657
2793
 
2658
 
% Explicit font changes: @r, @sc, undocumented @ii.
2659
 
\def\r#1{{\rm #1}}              % roman font
2660
 
\def\sc#1{{\smallcaps#1}}       % smallcaps font
2661
 
\def\ii#1{{\it #1}}             % italic font
2662
 
 
2663
2794
% @acronym for "FBI", "NATO", and the like.
2664
2795
% We print this one point size smaller, since it's intended for
2665
2796
% all-uppercase.
2666
 
 
2797
%
2667
2798
\def\acronym#1{\doacronym #1,,\finish}
2668
2799
\def\doacronym#1,#2,#3\finish{%
2669
2800
  {\selectfonts\lsize #1}%
2671
2802
  \ifx\temp\empty \else
2672
2803
    \space ({\unsepspaces \ignorespaces \temp \unskip})%
2673
2804
  \fi
 
2805
  \null % reset \spacefactor=1000
2674
2806
}
2675
2807
 
2676
2808
% @abbr for "Comput. J." and the like.
2677
2809
% No font change, but don't do end-of-sentence spacing.
2678
 
 
2810
%
2679
2811
\def\abbr#1{\doabbr #1,,\finish}
2680
2812
\def\doabbr#1,#2,#3\finish{%
2681
2813
  {\plainfrenchspacing #1}%
2683
2815
  \ifx\temp\empty \else
2684
2816
    \space ({\unsepspaces \ignorespaces \temp \unskip})%
2685
2817
  \fi
2686
 
}
 
2818
  \null % reset \spacefactor=1000
 
2819
}
 
2820
 
 
2821
% @asis just yields its argument.  Used with @table, for example.
 
2822
%
 
2823
\def\asis#1{#1}
 
2824
 
 
2825
% @math outputs its argument in math mode.
 
2826
%
 
2827
% One complication: _ usually means subscripts, but it could also mean
 
2828
% an actual _ character, as in @math{@var{some_variable} + 1}.  So make
 
2829
% _ active, and distinguish by seeing if the current family is \slfam,
 
2830
% which is what @var uses.
 
2831
{
 
2832
  \catcode`\_ = \active
 
2833
  \gdef\mathunderscore{%
 
2834
    \catcode`\_=\active
 
2835
    \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
 
2836
  }
 
2837
}
 
2838
% Another complication: we want \\ (and @\) to output a math (or tt) \.
 
2839
% FYI, plain.tex uses \\ as a temporary control sequence (for no
 
2840
% particular reason), but this is not advertised and we don't care.
 
2841
%
 
2842
% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
 
2843
\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
 
2844
%
 
2845
\def\math{%
 
2846
  \tex
 
2847
  \mathunderscore
 
2848
  \let\\ = \mathbackslash
 
2849
  \mathactive
 
2850
  % make the texinfo accent commands work in math mode
 
2851
  \let\"=\ddot
 
2852
  \let\'=\acute
 
2853
  \let\==\bar
 
2854
  \let\^=\hat
 
2855
  \let\`=\grave
 
2856
  \let\u=\breve
 
2857
  \let\v=\check
 
2858
  \let\~=\tilde
 
2859
  \let\dotaccent=\dot
 
2860
  $\finishmath
 
2861
}
 
2862
\def\finishmath#1{#1$\endgroup}  % Close the group opened by \tex.
 
2863
 
 
2864
% Some active characters (such as <) are spaced differently in math.
 
2865
% We have to reset their definitions in case the @math was an argument
 
2866
% to a command which sets the catcodes (such as @item or @section).
 
2867
%
 
2868
{
 
2869
  \catcode`^ = \active
 
2870
  \catcode`< = \active
 
2871
  \catcode`> = \active
 
2872
  \catcode`+ = \active
 
2873
  \catcode`' = \active
 
2874
  \gdef\mathactive{%
 
2875
    \let^ = \ptexhat
 
2876
    \let< = \ptexless
 
2877
    \let> = \ptexgtr
 
2878
    \let+ = \ptexplus
 
2879
    \let' = \ptexquoteright
 
2880
  }
 
2881
}
 
2882
 
 
2883
% ctrl is no longer a Texinfo command, but leave this definition for fun.
 
2884
\def\ctrl #1{{\tt \rawbackslash \hat}#1}
 
2885
 
 
2886
% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
 
2887
% Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
 
2888
% except specified as a normal braced arg, so no newlines to worry about.
 
2889
%
 
2890
\def\outfmtnametex{tex}
 
2891
%
 
2892
\long\def\inlinefmt#1{\doinlinefmt #1,\finish}
 
2893
\long\def\doinlinefmt#1,#2,\finish{%
 
2894
  \def\inlinefmtname{#1}%
 
2895
  \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
 
2896
}
 
2897
%
 
2898
% @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if
 
2899
% FMTNAME is tex, else ELSE-TEXT.
 
2900
\long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish}
 
2901
\long\def\doinlinefmtifelse#1,#2,#3,#4,\finish{%
 
2902
  \def\inlinefmtname{#1}%
 
2903
  \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\else \ignorespaces #3\fi
 
2904
}
 
2905
%
 
2906
% For raw, must switch into @tex before parsing the argument, to avoid
 
2907
% setting catcodes prematurely.  Doing it this way means that, for
 
2908
% example, @inlineraw{html, foo{bar} gets a parse error instead of being
 
2909
% ignored.  But this isn't important because if people want a literal
 
2910
% *right* brace they would have to use a command anyway, so they may as
 
2911
% well use a command to get a left brace too.  We could re-use the
 
2912
% delimiter character idea from \verb, but it seems like overkill.
 
2913
%
 
2914
\long\def\inlineraw{\tex \doinlineraw}
 
2915
\long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
 
2916
\def\doinlinerawtwo#1,#2,\finish{%
 
2917
  \def\inlinerawname{#1}%
 
2918
  \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
 
2919
  \endgroup % close group opened by \tex.
 
2920
}
 
2921
 
 
2922
% @inlineifset{VAR, TEXT} expands TEXT if VAR is @set.
 
2923
%
 
2924
\long\def\inlineifset#1{\doinlineifset #1,\finish}
 
2925
\long\def\doinlineifset#1,#2,\finish{%
 
2926
  \def\inlinevarname{#1}%
 
2927
  \expandafter\ifx\csname SET\inlinevarname\endcsname\relax
 
2928
  \else\ignorespaces#2\fi
 
2929
}
 
2930
 
 
2931
% @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set.
 
2932
%
 
2933
\long\def\inlineifclear#1{\doinlineifclear #1,\finish}
 
2934
\long\def\doinlineifclear#1,#2,\finish{%
 
2935
  \def\inlinevarname{#1}%
 
2936
  \expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces#2\fi
 
2937
}
 
2938
 
 
2939
 
 
2940
\message{glyphs,}
 
2941
% and logos.
 
2942
 
 
2943
% @@ prints an @, as does @atchar{}.
 
2944
\def\@{\char64 }
 
2945
\let\atchar=\@
 
2946
 
 
2947
% @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
 
2948
% Unless we're in typewriter, use \ecfont because the CM text fonts do
 
2949
% not have braces, and we don't want to switch into math.
 
2950
\def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}}
 
2951
\def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}}
 
2952
\let\{=\mylbrace \let\lbracechar=\{
 
2953
\let\}=\myrbrace \let\rbracechar=\}
 
2954
\begingroup
 
2955
  % Definitions to produce \{ and \} commands for indices,
 
2956
  % and @{ and @} for the aux/toc files.
 
2957
  \catcode`\{ = \other \catcode`\} = \other
 
2958
  \catcode`\[ = 1 \catcode`\] = 2
 
2959
  \catcode`\! = 0 \catcode`\\ = \other
 
2960
  !gdef!lbracecmd[\{]%
 
2961
  !gdef!rbracecmd[\}]%
 
2962
  !gdef!lbraceatcmd[@{]%
 
2963
  !gdef!rbraceatcmd[@}]%
 
2964
!endgroup
 
2965
 
 
2966
% @comma{} to avoid , parsing problems.
 
2967
\let\comma = ,
 
2968
 
 
2969
% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
 
2970
% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
 
2971
\let\, = \ptexc
 
2972
\let\dotaccent = \ptexdot
 
2973
\def\ringaccent#1{{\accent23 #1}}
 
2974
\let\tieaccent = \ptext
 
2975
\let\ubaraccent = \ptexb
 
2976
\let\udotaccent = \d
 
2977
 
 
2978
% Other special characters: @questiondown @exclamdown @ordf @ordm
 
2979
% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
 
2980
\def\questiondown{?`}
 
2981
\def\exclamdown{!`}
 
2982
\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
 
2983
\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
 
2984
 
 
2985
% Dotless i and dotless j, used for accents.
 
2986
\def\imacro{i}
 
2987
\def\jmacro{j}
 
2988
\def\dotless#1{%
 
2989
  \def\temp{#1}%
 
2990
  \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
 
2991
  \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
 
2992
  \else \errmessage{@dotless can be used only with i or j}%
 
2993
  \fi\fi
 
2994
}
 
2995
 
 
2996
% The \TeX{} logo, as in plain, but resetting the spacing so that a
 
2997
% period following counts as ending a sentence.  (Idea found in latex.)
 
2998
%
 
2999
\edef\TeX{\TeX \spacefactor=1000 }
 
3000
 
 
3001
% @LaTeX{} logo.  Not quite the same results as the definition in
 
3002
% latex.ltx, since we use a different font for the raised A; it's most
 
3003
% convenient for us to use an explicitly smaller font, rather than using
 
3004
% the \scriptstyle font (since we don't reset \scriptstyle and
 
3005
% \scriptscriptstyle).
 
3006
%
 
3007
\def\LaTeX{%
 
3008
  L\kern-.36em
 
3009
  {\setbox0=\hbox{T}%
 
3010
   \vbox to \ht0{\hbox{%
 
3011
     \ifx\textnominalsize\xwordpt
 
3012
       % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX.
 
3013
       % Revert to plain's \scriptsize, which is 7pt.
 
3014
       \count255=\the\fam $\fam\count255 \scriptstyle A$%
 
3015
     \else
 
3016
       % For 11pt, we can use our lllsize.
 
3017
       \selectfonts\lllsize A%
 
3018
     \fi
 
3019
     }%
 
3020
     \vss
 
3021
  }}%
 
3022
  \kern-.15em
 
3023
  \TeX
 
3024
}
 
3025
 
 
3026
% Some math mode symbols.
 
3027
\def\bullet{$\ptexbullet$}
 
3028
\def\geq{\ifmmode \ge\else $\ge$\fi}
 
3029
\def\leq{\ifmmode \le\else $\le$\fi}
 
3030
\def\minus{\ifmmode -\else $-$\fi}
 
3031
 
 
3032
% @dots{} outputs an ellipsis using the current font.
 
3033
% We do .5em per period so that it has the same spacing in the cm
 
3034
% typewriter fonts as three actual period characters; on the other hand,
 
3035
% in other typewriter fonts three periods are wider than 1.5em.  So do
 
3036
% whichever is larger.
 
3037
%
 
3038
\def\dots{%
 
3039
  \leavevmode
 
3040
  \setbox0=\hbox{...}% get width of three periods
 
3041
  \ifdim\wd0 > 1.5em
 
3042
    \dimen0 = \wd0
 
3043
  \else
 
3044
    \dimen0 = 1.5em
 
3045
  \fi
 
3046
  \hbox to \dimen0{%
 
3047
    \hskip 0pt plus.25fil
 
3048
    .\hskip 0pt plus1fil
 
3049
    .\hskip 0pt plus1fil
 
3050
    .\hskip 0pt plus.5fil
 
3051
  }%
 
3052
}
 
3053
 
 
3054
% @enddots{} is an end-of-sentence ellipsis.
 
3055
%
 
3056
\def\enddots{%
 
3057
  \dots
 
3058
  \spacefactor=\endofsentencespacefactor
 
3059
}
 
3060
 
 
3061
% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
 
3062
%
 
3063
% Since these characters are used in examples, they should be an even number of
 
3064
% \tt widths. Each \tt character is 1en, so two makes it 1em.
 
3065
%
 
3066
\def\point{$\star$}
 
3067
\def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
 
3068
\def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
 
3069
\def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
 
3070
\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
 
3071
\def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
 
3072
 
 
3073
% The @error{} command.
 
3074
% Adapted from the TeXbook's \boxit.
 
3075
%
 
3076
\newbox\errorbox
 
3077
%
 
3078
{\tentt \global\dimen0 = 3em}% Width of the box.
 
3079
\dimen2 = .55pt % Thickness of rules
 
3080
% The text. (`r' is open on the right, `e' somewhat less so on the left.)
 
3081
\setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
 
3082
%
 
3083
\setbox\errorbox=\hbox to \dimen0{\hfil
 
3084
   \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
 
3085
   \advance\hsize by -2\dimen2 % Rules.
 
3086
   \vbox{%
 
3087
      \hrule height\dimen2
 
3088
      \hbox{\vrule width\dimen2 \kern3pt          % Space to left of text.
 
3089
         \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
 
3090
         \kern3pt\vrule width\dimen2}% Space to right.
 
3091
      \hrule height\dimen2}
 
3092
    \hfil}
 
3093
%
 
3094
\def\error{\leavevmode\lower.7ex\copy\errorbox}
2687
3095
 
2688
3096
% @pounds{} is a sterling sign, which Knuth put in the CM italic font.
2689
3097
%
2694
3102
% Theiling, which support regular, slanted, bold and bold slanted (and
2695
3103
% "outlined" (blackboard board, sort of) versions, which we don't need).
2696
3104
% It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
2697
 
 
3105
%
2698
3106
% Although only regular is the truly official Euro symbol, we ignore
2699
3107
% that.  The Euro is designed to be slightly taller than the regular
2700
3108
% font height.
2701
 
 
3109
%
2702
3110
% feymr - regular
2703
3111
% feymo - slanted
2704
3112
% feybr - bold
2705
3113
% feybo - bold slanted
2706
 
 
3114
%
2707
3115
% There is no good (free) typewriter version, to my knowledge.
2708
3116
% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
2709
3117
% Hmm.
2710
 
 
3118
%
2711
3119
% Also doesn't work in math.  Do we need to do math with euro symbols?
2712
3120
% Hope not.
2713
 
2714
 
 
3121
%
 
3122
%
2715
3123
\def\euro{{\eurofont e}}
2716
3124
\def\eurofont{%
2717
3125
  % We set the font at each command, rather than predefining it in
2718
3126
  % \textfonts and the other font-switching commands, so that
2719
3127
  % installations which never need the symbol don't have to have the
2720
3128
  % font installed.
2721
 
  % 
 
3129
  %
2722
3130
  % There is only one designed size (nominal 10pt), so we always scale
2723
3131
  % that to the current nominal size.
2724
 
  % 
 
3132
  %
2725
3133
  % By the way, simply using "at 1em" works for cmr10 and the like, but
2726
3134
  % does not work for cmbx10 and other extended/shrunken fonts.
2727
 
  % 
 
3135
  %
2728
3136
  \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
2729
3137
  %
2730
 
  \ifx\curfontstyle\bfstylename 
 
3138
  \ifx\curfontstyle\bfstylename
2731
3139
    % bold:
2732
3140
    \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
2733
 
  \else 
 
3141
  \else
2734
3142
    % regular:
2735
3143
    \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
2736
3144
  \fi
2737
3145
  \thiseurofont
2738
3146
}
2739
3147
 
2740
 
% Hacks for glyphs from the EC fonts similar to \euro.  We don't
2741
 
% use \let for the aliases, because sometimes we redefine the original
2742
 
% macro, and the alias should reflect the redefinition.
 
3148
% Glyphs from the EC fonts.  We don't use \let for the aliases, because
 
3149
% sometimes we redefine the original macro, and the alias should reflect
 
3150
% the redefinition.
 
3151
%
 
3152
% Use LaTeX names for the Icelandic letters.
 
3153
\def\DH{{\ecfont \char"D0}} % Eth
 
3154
\def\dh{{\ecfont \char"F0}} % eth
 
3155
\def\TH{{\ecfont \char"DE}} % Thorn
 
3156
\def\th{{\ecfont \char"FE}} % thorn
 
3157
%
2743
3158
\def\guillemetleft{{\ecfont \char"13}}
2744
3159
\def\guillemotleft{\guillemetleft}
2745
3160
\def\guillemetright{{\ecfont \char"14}}
2749
3164
\def\quotedblbase{{\ecfont \char"12}}
2750
3165
\def\quotesinglbase{{\ecfont \char"0D}}
2751
3166
%
 
3167
% This positioning is not perfect (see the ogonek LaTeX package), but
 
3168
% we have the precomposed glyphs for the most common cases.  We put the
 
3169
% tests to use those glyphs in the single \ogonek macro so we have fewer
 
3170
% dummy definitions to worry about for index entries, etc.
 
3171
%
 
3172
% ogonek is also used with other letters in Lithuanian (IOU), but using
 
3173
% the precomposed glyphs for those is not so easy since they aren't in
 
3174
% the same EC font.
 
3175
\def\ogonek#1{{%
 
3176
  \def\temp{#1}%
 
3177
  \ifx\temp\macrocharA\Aogonek
 
3178
  \else\ifx\temp\macrochara\aogonek
 
3179
  \else\ifx\temp\macrocharE\Eogonek
 
3180
  \else\ifx\temp\macrochare\eogonek
 
3181
  \else
 
3182
    \ecfont \setbox0=\hbox{#1}%
 
3183
    \ifdim\ht0=1ex\accent"0C #1%
 
3184
    \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
 
3185
    \fi
 
3186
  \fi\fi\fi\fi
 
3187
  }%
 
3188
}
 
3189
\def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
 
3190
\def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
 
3191
\def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
 
3192
\def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
 
3193
%
 
3194
% Use the ec* fonts (cm-super in outline format) for non-CM glyphs.
2752
3195
\def\ecfont{%
2753
 
  % We can't distinguish serif/sanserif and italic/slanted, but this
 
3196
  % We can't distinguish serif/sans and italic/slanted, but this
2754
3197
  % is used for crude hacks anyway (like adding French and German
2755
3198
  % quotes to documents typeset with CM, where we lose kerning), so
2756
3199
  % hopefully nobody will notice/care.
2757
3200
  \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
2758
3201
  \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
2759
 
  \ifx\curfontstyle\bfstylename
2760
 
    % bold:
2761
 
    \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
 
3202
  \ifmonospace
 
3203
    % typewriter:
 
3204
    \font\thisecfont = ectt\ecsize \space at \nominalsize
2762
3205
  \else
2763
 
    % regular:
2764
 
    \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
 
3206
    \ifx\curfontstyle\bfstylename
 
3207
      % bold:
 
3208
      \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
 
3209
    \else
 
3210
      % regular:
 
3211
      \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
 
3212
    \fi
2765
3213
  \fi
2766
3214
  \thisecfont
2767
3215
}
2783
3231
% Laurent Siebenmann reports \Orb undefined with:
2784
3232
%  Textures 1.7.7 (preloaded format=plain 93.10.14)  (68K)  16 APR 2004 02:38
2785
3233
% so we'll define it if necessary.
2786
 
2787
 
\ifx\Orb\undefined
 
3234
%
 
3235
\ifx\Orb\thisisundefined
2788
3236
\def\Orb{\mathhexbox20D}
2789
3237
\fi
2790
3238
 
2812
3260
\newif\ifsetshortcontentsaftertitlepage
2813
3261
 \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
2814
3262
 
2815
 
\parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
2816
 
        \endgroup\page\hbox{}\page}
 
3263
\parseargdef\shorttitlepage{%
 
3264
  \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
 
3265
  \endgroup\page\hbox{}\page}
2817
3266
 
2818
3267
\envdef\titlepage{%
2819
3268
  % Open one extra group, as we want to close it in the middle of \Etitlepage.
2873
3322
  \finishedtitlepagetrue
2874
3323
}
2875
3324
 
2876
 
%%% Macros to be used within @titlepage:
 
3325
% Settings used for typesetting titles: no hyphenation, no indentation,
 
3326
% don't worry much about spacing, ragged right.  This should be used
 
3327
% inside a \vbox, and fonts need to be set appropriately first.  Because
 
3328
% it is always used for titles, nothing else, we call \rmisbold.  \par
 
3329
% should be specified before the end of the \vbox, since a vbox is a group.
 
3330
%
 
3331
\def\raggedtitlesettings{%
 
3332
  \rmisbold
 
3333
  \hyphenpenalty=10000
 
3334
  \parindent=0pt
 
3335
  \tolerance=5000
 
3336
  \ptexraggedright
 
3337
}
 
3338
 
 
3339
% Macros to be used within @titlepage:
2877
3340
 
2878
3341
\let\subtitlerm=\tenrm
2879
3342
\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
2880
3343
 
2881
 
\def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines
2882
 
                \let\tt=\authortt}
2883
 
 
2884
3344
\parseargdef\title{%
2885
3345
  \checkenv\titlepage
2886
 
  \leftline{\titlefonts\rm #1}
 
3346
  \vbox{\titlefonts \raggedtitlesettings #1\par}%
2887
3347
  % print a rule at the page bottom also.
2888
3348
  \finishedtitlepagefalse
2889
3349
  \vskip4pt \hrule height 4pt width \hsize \vskip4pt
2904
3364
  \else
2905
3365
    \checkenv\titlepage
2906
3366
    \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
2907
 
    {\authorfont \leftline{#1}}%
 
3367
    {\secfonts\rmisbold \leftline{#1}}%
2908
3368
  \fi
2909
3369
}
2910
3370
 
2911
3371
 
2912
 
%%% Set up page headings and footings.
 
3372
% Set up page headings and footings.
2913
3373
 
2914
3374
\let\thispage=\folio
2915
3375
 
3003
3463
 
3004
3464
\def\headings #1 {\csname HEADINGS#1\endcsname}
3005
3465
 
3006
 
\def\HEADINGSoff{%
3007
 
\global\evenheadline={\hfil} \global\evenfootline={\hfil}
3008
 
\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
3009
 
\HEADINGSoff
 
3466
\def\headingsoff{% non-global headings elimination
 
3467
  \evenheadline={\hfil}\evenfootline={\hfil}%
 
3468
   \oddheadline={\hfil}\oddfootline={\hfil}%
 
3469
}
 
3470
 
 
3471
\def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
 
3472
\HEADINGSoff  % it's the default
 
3473
 
3010
3474
% When we turn headings on, set the page number to 1.
3011
3475
% For double-sided printing, put current file name in lower left corner,
3012
3476
% chapter name on inside top of right hand pages, document
3057
3521
% This produces Day Month Year style of output.
3058
3522
% Only define if not already defined, in case a txi-??.tex file has set
3059
3523
% up a different format (e.g., txi-cs.tex does this).
3060
 
\ifx\today\undefined
 
3524
\ifx\today\thisisundefined
3061
3525
\def\today{%
3062
3526
  \number\day\space
3063
3527
  \ifcase\month
3118
3582
    \begingroup
3119
3583
      \advance\leftskip by-\tableindent
3120
3584
      \advance\hsize by\tableindent
3121
 
      \advance\rightskip by0pt plus1fil
 
3585
      \advance\rightskip by0pt plus1fil\relax
3122
3586
      \leavevmode\unhbox0\par
3123
3587
    \endgroup
3124
3588
    %
3132
3596
    % cause the example and the item to crash together.  So we use this
3133
3597
    % bizarre value of 10001 as a signal to \aboveenvbreak to insert
3134
3598
    % \parskip glue after all.  Section titles are handled this way also.
3135
 
    % 
 
3599
    %
3136
3600
    \penalty 10001
3137
3601
    \endgroup
3138
3602
    \itemxneedsnegativevskipfalse
3226
3690
  \parindent=0pt
3227
3691
  \parskip=\smallskipamount
3228
3692
  \ifdim\parskip=0pt \parskip=2pt \fi
 
3693
  %
 
3694
  % Try typesetting the item mark that if the document erroneously says
 
3695
  % something like @itemize @samp (intending @table), there's an error
 
3696
  % right away at the @itemize.  It's not the best error message in the
 
3697
  % world, but it's better than leaving it to the @item.  This means if
 
3698
  % the user wants an empty mark, they have to say @w{} not just @w.
3229
3699
  \def\itemcontents{#1}%
 
3700
  \setbox0 = \hbox{\itemcontents}%
 
3701
  %
3230
3702
  % @itemize with no arg is equivalent to @itemize @bullet.
3231
3703
  \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
 
3704
  %
3232
3705
  \let\item=\itemizeitem
3233
3706
}
3234
3707
 
3249
3722
   \ifnum\lastpenalty<10000 \parskip=0in \fi
3250
3723
   \noindent
3251
3724
   \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
 
3725
   %
3252
3726
   \vadjust{\penalty 1200}}% not good to break after first line of item.
3253
3727
  \flushcr
3254
3728
}
3470
3944
%
3471
3945
% @headitem starts a heading row, which we typeset in bold.
3472
3946
% Assignments have to be global since we are inside the implicit group
3473
 
% of an alignment entry.  Note that \everycr resets \everytab.
3474
 
\def\headitem{\checkenv\multitable \crcr \global\everytab={\bf}\the\everytab}%
 
3947
% of an alignment entry.  \everycr resets \everytab so we don't have to
 
3948
% undo it ourselves.
 
3949
\def\headitemfont{\b}% for people to use in the template row; not changeable
 
3950
\def\headitem{%
 
3951
  \checkenv\multitable
 
3952
  \crcr
 
3953
  \global\everytab={\bf}% can't use \headitemfont since the parsing differs
 
3954
  \the\everytab % for the first item
 
3955
}%
3475
3956
%
3476
3957
% A \tab used to include \hskip1sp.  But then the space in a template
3477
3958
% line is not enough.  That is bad.  So let's go back to just `&' until
3478
 
% we encounter the problem it was intended to solve again.
 
3959
% we again encounter the problem the 1sp was intended to solve.
3479
3960
%                                       --karl, nathan@acm.org, 20apr99.
3480
3961
\def\tab{\checkenv\multitable &\the\everytab}%
3481
3962
 
3587
4068
\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
3588
4069
\global\advance\multitablelinespace by-\ht0
3589
4070
\fi
3590
 
%% Test to see if parskip is larger than space between lines of
3591
 
%% table. If not, do nothing.
3592
 
%%        If so, set to same dimension as multitablelinespace.
 
4071
% Test to see if parskip is larger than space between lines of
 
4072
% table. If not, do nothing.
 
4073
%        If so, set to same dimension as multitablelinespace.
3593
4074
\ifdim\multitableparskip>\multitablelinespace
3594
4075
\global\multitableparskip=\multitablelinespace
3595
 
\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
3596
 
                                      %% than skip between lines in the table.
 
4076
\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
 
4077
                                      % than skip between lines in the table.
3597
4078
\fi%
3598
4079
\ifdim\multitableparskip=0pt
3599
4080
\global\multitableparskip=\multitablelinespace
3600
 
\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
3601
 
                                      %% than skip between lines in the table.
 
4081
\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
 
4082
                                      % than skip between lines in the table.
3602
4083
\fi}
3603
4084
 
3604
4085
 
3750
4231
\def\value{\begingroup\makevalueexpandable\valuexxx}
3751
4232
\def\valuexxx#1{\expandablevalue{#1}\endgroup}
3752
4233
{
3753
 
  \catcode`\- = \active \catcode`\_ = \active
 
4234
  \catcode`\-=\active \catcode`\_=\active
3754
4235
  %
3755
4236
  \gdef\makevalueexpandable{%
3756
4237
    \let\value = \expandablevalue
3759
4240
    % ..., but we might end up with active ones in the argument if
3760
4241
    % we're called from @code, as @code{@value{foo-bar_}}, though.
3761
4242
    % So \let them to their normal equivalents.
3762
 
    \let-\realdash \let_\normalunderscore
 
4243
    \let-\normaldash \let_\normalunderscore
3763
4244
  }
3764
4245
}
3765
4246
 
3771
4252
% it will fail (although perhaps we could fix that with sufficient work
3772
4253
% to do a one-level expansion on the result, instead of complete).
3773
4254
%
 
4255
% Unfortunately, this has the consequence that when _ is in the *value*
 
4256
% of an @set, it does not print properly in the roman fonts (get the cmr
 
4257
% dot accent at position 126 instead).  No fix comes to mind, and it's
 
4258
% been this way since 2003 or earlier, so just ignore it.
 
4259
%
3774
4260
\def\expandablevalue#1{%
3775
4261
  \expandafter\ifx\csname SET#1\endcsname\relax
3776
4262
    {[No value for ``#1'']}%
3783
4269
% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
3784
4270
% with @set.
3785
4271
%
3786
 
% To get special treatment of `@end ifset,' call \makeond and the redefine.
 
4272
% To get the special treatment we need for `@end ifset,' we call
 
4273
% \makecond and then redefine.
3787
4274
%
3788
4275
\makecond{ifset}
3789
4276
\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
3799
4286
}
3800
4287
\def\ifsetfail{\doignore{ifset}}
3801
4288
 
3802
 
% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
 
4289
% @ifclear VAR ... @end executes the `...' iff VAR has never been
3803
4290
% defined with @set, or has been undefined with @clear.
3804
4291
%
3805
4292
% The `\else' inside the `\doifset' parameter is a trick to reuse the
3810
4297
\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
3811
4298
\def\ifclearfail{\doignore{ifclear}}
3812
4299
 
 
4300
% @ifcommandisdefined CMD ... @end executes the `...' if CMD (written
 
4301
% without the @) is in fact defined.  We can only feasibly check at the
 
4302
% TeX level, so something like `mathcode' is going to considered
 
4303
% defined even though it is not a Texinfo command.
 
4304
%
 
4305
\makecond{ifcommanddefined}
 
4306
\def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
 
4307
%
 
4308
\def\doifcmddefined#1#2{{%
 
4309
    \makevalueexpandable
 
4310
    \let\next=\empty
 
4311
    \expandafter\ifx\csname #2\endcsname\relax
 
4312
      #1% If not defined, \let\next as above.
 
4313
    \fi
 
4314
    \expandafter
 
4315
  }\next
 
4316
}
 
4317
\def\ifcmddefinedfail{\doignore{ifcommanddefined}}
 
4318
 
 
4319
% @ifcommandnotdefined CMD ... handled similar to @ifclear above.
 
4320
\makecond{ifcommandnotdefined}
 
4321
\def\ifcommandnotdefined{%
 
4322
  \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}}
 
4323
\def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}}
 
4324
 
 
4325
% Set the `txicommandconditionals' variable, so documents have a way to
 
4326
% test if the @ifcommand...defined conditionals are available.
 
4327
\set txicommandconditionals
 
4328
 
3813
4329
% @dircategory CATEGORY  -- specify a category of the dir file
3814
4330
% which this file should belong to.  Ignore this in TeX.
3815
4331
\let\dircategory=\comment
3874
4390
\def\dosynindex#1#2#3{%
3875
4391
  % Only do \closeout if we haven't already done it, else we'll end up
3876
4392
  % closing the target index.
3877
 
  \expandafter \ifx\csname donesynindex#2\endcsname \undefined
 
4393
  \expandafter \ifx\csname donesynindex#2\endcsname \relax
3878
4394
    % The \closeout helps reduce unnecessary open files; the limit on the
3879
4395
    % Acorn RISC OS is a mere 16 files.
3880
4396
    \expandafter\closeout\csname#2indfile\endcsname
3881
 
    \expandafter\let\csname\donesynindex#2\endcsname = 1
 
4397
    \expandafter\let\csname donesynindex#2\endcsname = 1
3882
4398
  \fi
3883
4399
  % redefine \fooindfile:
3884
4400
  \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
3913
4429
  \def\@{@}% change to @@ when we switch to @ as escape char in index files.
3914
4430
  \def\ {\realbackslash\space }%
3915
4431
  %
3916
 
  % Need these in case \tex is in effect and \{ is a \delimiter again.
3917
 
  % But can't use \lbracecmd and \rbracecmd because texindex assumes
3918
 
  % braces and backslashes are used only as delimiters.
3919
 
  \let\{ = \mylbrace
3920
 
  \let\} = \myrbrace
 
4432
  % Need these unexpandable (because we define \tt as a dummy)
 
4433
  % definitions when @{ or @} appear in index entry text.  Also, more
 
4434
  % complicated, when \tex is in effect and \{ is a \delimiter again.
 
4435
  % We can't use \lbracecmd and \rbracecmd because texindex assumes
 
4436
  % braces and backslashes are used only as delimiters.  Perhaps we
 
4437
  % should define @lbrace and @rbrace commands a la @comma.
 
4438
  \def\{{{\tt\char123}}%
 
4439
  \def\}{{\tt\char125}}%
3921
4440
  %
3922
4441
  % I don't entirely understand this, but when an index entry is
3923
4442
  % generated from a macro call, the \endinput which \scanmacro inserts
3928
4447
  % processing continues to some further point.  On the other hand, it
3929
4448
  % seems \endinput does not hurt in the printed index arg, since that
3930
4449
  % is still getting written without apparent harm.
3931
 
  % 
 
4450
  %
3932
4451
  % Sample source (mac-idx3.tex, reported by Graham Percival to
3933
4452
  % help-texinfo, 22may06):
3934
4453
  % @macro funindex {WORD}
3936
4455
  % @end macro
3937
4456
  % ...
3938
4457
  % @funindex commtest
3939
 
  % 
 
4458
  %
3940
4459
  % The above is not enough to reproduce the bug, but it gives the flavor.
3941
 
  % 
 
4460
  %
3942
4461
  % Sample whatsit resulting:
3943
4462
  % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}}
3944
 
  % 
 
4463
  %
3945
4464
  % So:
3946
4465
  \let\endinput = \empty
3947
4466
  %
3970
4489
\def\commondummies{%
3971
4490
  %
3972
4491
  % \definedummyword defines \#1 as \string\#1\space, thus effectively
3973
 
  % preventing its expansion.  This is used only for control% words,
 
4492
  % preventing its expansion.  This is used only for control words,
3974
4493
  % not control letters, because the \space would be incorrect for
3975
4494
  % control characters, but is needed to separate the control word
3976
4495
  % from whatever follows.
3989
4508
  \commondummiesnofonts
3990
4509
  %
3991
4510
  \definedummyletter\_%
 
4511
  \definedummyletter\-%
3992
4512
  %
3993
4513
  % Non-English letters.
3994
4514
  \definedummyword\AA
3995
4515
  \definedummyword\AE
 
4516
  \definedummyword\DH
3996
4517
  \definedummyword\L
 
4518
  \definedummyword\O
3997
4519
  \definedummyword\OE
3998
 
  \definedummyword\O
 
4520
  \definedummyword\TH
3999
4521
  \definedummyword\aa
4000
4522
  \definedummyword\ae
 
4523
  \definedummyword\dh
 
4524
  \definedummyword\exclamdown
4001
4525
  \definedummyword\l
 
4526
  \definedummyword\o
4002
4527
  \definedummyword\oe
4003
 
  \definedummyword\o
4004
 
  \definedummyword\ss
4005
 
  \definedummyword\exclamdown
4006
 
  \definedummyword\questiondown
4007
4528
  \definedummyword\ordf
4008
4529
  \definedummyword\ordm
 
4530
  \definedummyword\questiondown
 
4531
  \definedummyword\ss
 
4532
  \definedummyword\th
4009
4533
  %
4010
4534
  % Although these internal commands shouldn't show up, sometimes they do.
4011
4535
  \definedummyword\bf
4021
4545
  \definedummyword\TeX
4022
4546
  %
4023
4547
  % Assorted special characters.
 
4548
  \definedummyword\arrow
4024
4549
  \definedummyword\bullet
4025
4550
  \definedummyword\comma
4026
4551
  \definedummyword\copyright
4027
4552
  \definedummyword\registeredsymbol
4028
4553
  \definedummyword\dots
4029
4554
  \definedummyword\enddots
 
4555
  \definedummyword\entrybreak
4030
4556
  \definedummyword\equiv
4031
4557
  \definedummyword\error
4032
4558
  \definedummyword\euro
 
4559
  \definedummyword\expansion
 
4560
  \definedummyword\geq
4033
4561
  \definedummyword\guillemetleft
4034
4562
  \definedummyword\guillemetright
4035
4563
  \definedummyword\guilsinglleft
4036
4564
  \definedummyword\guilsinglright
4037
 
  \definedummyword\expansion
 
4565
  \definedummyword\lbracechar
 
4566
  \definedummyword\leq
4038
4567
  \definedummyword\minus
 
4568
  \definedummyword\ogonek
4039
4569
  \definedummyword\pounds
4040
4570
  \definedummyword\point
4041
4571
  \definedummyword\print
4045
4575
  \definedummyword\quoteleft
4046
4576
  \definedummyword\quoteright
4047
4577
  \definedummyword\quotesinglbase
 
4578
  \definedummyword\rbracechar
4048
4579
  \definedummyword\result
4049
4580
  \definedummyword\textdegree
4050
4581
  %
4079
4610
  \definedummyword\v
4080
4611
  \definedummyword\H
4081
4612
  \definedummyword\dotaccent
 
4613
  \definedummyword\ogonek
4082
4614
  \definedummyword\ringaccent
4083
4615
  \definedummyword\tieaccent
4084
4616
  \definedummyword\ubaraccent
4089
4621
  \definedummyword\b
4090
4622
  \definedummyword\i
4091
4623
  \definedummyword\r
 
4624
  \definedummyword\sansserif
4092
4625
  \definedummyword\sc
 
4626
  \definedummyword\slanted
4093
4627
  \definedummyword\t
4094
4628
  %
4095
4629
  % Commands that take arguments.
 
4630
  \definedummyword\abbr
4096
4631
  \definedummyword\acronym
 
4632
  \definedummyword\anchor
4097
4633
  \definedummyword\cite
4098
4634
  \definedummyword\code
4099
4635
  \definedummyword\command
4100
4636
  \definedummyword\dfn
 
4637
  \definedummyword\dmn
 
4638
  \definedummyword\email
4101
4639
  \definedummyword\emph
4102
4640
  \definedummyword\env
4103
4641
  \definedummyword\file
 
4642
  \definedummyword\image
 
4643
  \definedummyword\indicateurl
 
4644
  \definedummyword\inforef
4104
4645
  \definedummyword\kbd
4105
4646
  \definedummyword\key
4106
4647
  \definedummyword\math
4128
4669
  \def\definedummyaccent##1{\let##1\asis}%
4129
4670
  % We can just ignore other control letters.
4130
4671
  \def\definedummyletter##1{\let##1\empty}%
4131
 
  % Hopefully, all control words can become @asis.
 
4672
  % All control words become @asis by default; overrides below.
4132
4673
  \let\definedummyword\definedummyaccent
4133
4674
  %
4134
4675
  \commondummiesnofonts
4140
4681
  %
4141
4682
  \def\ { }%
4142
4683
  \def\@{@}%
4143
 
  % how to handle braces?
4144
4684
  \def\_{\normalunderscore}%
 
4685
  \def\-{}% @- shouldn't affect sorting
 
4686
  %
 
4687
  % Unfortunately, texindex is not prepared to handle braces in the
 
4688
  % content at all.  So for index sorting, we map @{ and @} to strings
 
4689
  % starting with |, since that ASCII character is between ASCII { and }.
 
4690
  \def\{{|a}%
 
4691
  \def\lbracechar{|a}%
 
4692
  %
 
4693
  \def\}{|b}%
 
4694
  \def\rbracechar{|b}%
4145
4695
  %
4146
4696
  % Non-English letters.
4147
4697
  \def\AA{AA}%
4148
4698
  \def\AE{AE}%
 
4699
  \def\DH{DZZ}%
4149
4700
  \def\L{L}%
4150
4701
  \def\OE{OE}%
4151
4702
  \def\O{O}%
 
4703
  \def\TH{ZZZ}%
4152
4704
  \def\aa{aa}%
4153
4705
  \def\ae{ae}%
 
4706
  \def\dh{dzz}%
 
4707
  \def\exclamdown{!}%
4154
4708
  \def\l{l}%
4155
4709
  \def\oe{oe}%
 
4710
  \def\ordf{a}%
 
4711
  \def\ordm{o}%
4156
4712
  \def\o{o}%
 
4713
  \def\questiondown{?}%
4157
4714
  \def\ss{ss}%
4158
 
  \def\exclamdown{!}%
4159
 
  \def\questiondown{?}%
4160
 
  \def\ordf{a}%
4161
 
  \def\ordm{o}%
 
4715
  \def\th{zzz}%
4162
4716
  %
4163
4717
  \def\LaTeX{LaTeX}%
4164
4718
  \def\TeX{TeX}%
4165
4719
  %
4166
4720
  % Assorted special characters.
4167
4721
  % (The following {} will end up in the sort string, but that's ok.)
 
4722
  \def\arrow{->}%
4168
4723
  \def\bullet{bullet}%
4169
4724
  \def\comma{,}%
4170
4725
  \def\copyright{copyright}%
4171
 
  \def\registeredsymbol{R}%
4172
4726
  \def\dots{...}%
4173
4727
  \def\enddots{...}%
4174
4728
  \def\equiv{==}%
4175
4729
  \def\error{error}%
4176
4730
  \def\euro{euro}%
 
4731
  \def\expansion{==>}%
 
4732
  \def\geq{>=}%
4177
4733
  \def\guillemetleft{<<}%
4178
4734
  \def\guillemetright{>>}%
4179
4735
  \def\guilsinglleft{<}%
4180
4736
  \def\guilsinglright{>}%
4181
 
  \def\expansion{==>}%
 
4737
  \def\leq{<=}%
4182
4738
  \def\minus{-}%
 
4739
  \def\point{.}%
4183
4740
  \def\pounds{pounds}%
4184
 
  \def\point{.}%
4185
4741
  \def\print{-|}%
4186
4742
  \def\quotedblbase{"}%
4187
4743
  \def\quotedblleft{"}%
4189
4745
  \def\quoteleft{`}%
4190
4746
  \def\quoteright{'}%
4191
4747
  \def\quotesinglbase{,}%
 
4748
  \def\registeredsymbol{R}%
4192
4749
  \def\result{=>}%
4193
 
  \def\textdegree{degrees}%
 
4750
  \def\textdegree{o}%
 
4751
  %
 
4752
  \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax
 
4753
  \else \indexlquoteignore \fi
4194
4754
  %
4195
4755
  % We need to get rid of all macros, leaving only the arguments (if present).
4196
4756
  % Of course this is not nearly correct, but it is the best we can do for now.
4197
4757
  % makeinfo does not expand macros in the argument to @deffn, which ends up
4198
4758
  % writing an index entry, and texindex isn't prepared for an index sort entry
4199
4759
  % that starts with \.
4200
 
  % 
 
4760
  %
4201
4761
  % Since macro invocations are followed by braces, we can just redefine them
4202
4762
  % to take a single TeX argument.  The case of a macro invocation that
4203
4763
  % goes to end-of-line is not handled.
4204
 
  % 
 
4764
  %
4205
4765
  \macrolist
4206
4766
}
4207
4767
 
 
4768
% Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us
 
4769
% ignore left quotes in the sort term.
 
4770
{\catcode`\`=\active
 
4771
 \gdef\indexlquoteignore{\let`=\empty}}
 
4772
 
4208
4773
\let\indexbackslash=0  %overridden during \printindex.
4209
4774
\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
4210
4775
 
4302
4867
%
4303
4868
% ..., ready, GO:
4304
4869
%
4305
 
\def\safewhatsit#1{%
4306
 
\ifhmode
 
4870
\def\safewhatsit#1{\ifhmode
4307
4871
  #1%
4308
 
\else
 
4872
 \else
4309
4873
  % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
4310
4874
  \whatsitskip = \lastskip
4311
4875
  \edef\lastskipmacro{\the\lastskip}%
4329
4893
    % to re-insert the same penalty (values >10000 are used for various
4330
4894
    % signals); since we just inserted a non-discardable item, any
4331
4895
    % following glue (such as a \parskip) would be a breakpoint.  For example:
4332
 
    % 
4333
4896
    %   @deffn deffn-whatever
4334
4897
    %   @vindex index-whatever
4335
4898
    %   Description.
4342
4905
    % (the whatsit from the \write), so we must insert a \nobreak.
4343
4906
    \nobreak\vskip\whatsitskip
4344
4907
  \fi
4345
 
\fi
4346
 
}
 
4908
\fi}
4347
4909
 
4348
4910
% The index entry written in the file actually looks like
4349
4911
%  \entry {sortstring}{page}{topic}
4462
5024
% But this freezes the catcodes in the argument, and can cause problems to
4463
5025
% @code, which sets - active.  This problem was fixed by a kludge---
4464
5026
% ``-'' was active throughout whole index, but this isn't really right.
4465
 
%
4466
5027
% The right solution is to prevent \entry from swallowing the whole text.
4467
5028
%                                 --kasal, 21nov03
4468
5029
\def\entry{%
4499
5060
    % columns.
4500
5061
    \vskip 0pt plus1pt
4501
5062
    %
 
5063
    % When reading the text of entry, convert explicit line breaks
 
5064
    % from @* into spaces.  The user might give these in long section
 
5065
    % titles, for instance.
 
5066
    \def\*{\unskip\space\ignorespaces}%
 
5067
    \def\entrybreak{\hfil\break}%
 
5068
    %
4502
5069
    % Swallow the left brace of the text (first parameter):
4503
5070
    \afterassignment\doentry
4504
5071
    \let\temp =
4505
5072
}
 
5073
\def\entrybreak{\unskip\space\ignorespaces}%
4506
5074
\def\doentry{%
4507
5075
    \bgroup % Instead of the swallowed brace.
4508
5076
      \noindent
4735
5303
\message{sectioning,}
4736
5304
% Chapters, sections, etc.
4737
5305
 
4738
 
% \unnumberedno is an oxymoron, of course.  But we count the unnumbered
 
5306
% Let's start with @part.
 
5307
\outer\parseargdef\part{\partzzz{#1}}
 
5308
\def\partzzz#1{%
 
5309
  \chapoddpage
 
5310
  \null
 
5311
  \vskip.3\vsize  % move it down on the page a bit
 
5312
  \begingroup
 
5313
    \noindent \titlefonts\rmisbold #1\par % the text
 
5314
    \let\lastnode=\empty      % no node to associate with
 
5315
    \writetocentry{part}{#1}{}% but put it in the toc
 
5316
    \headingsoff              % no headline or footline on the part page
 
5317
    \chapoddpage
 
5318
  \endgroup
 
5319
}
 
5320
 
 
5321
% \unnumberedno is an oxymoron.  But we count the unnumbered
4739
5322
% sections so that we can refer to them unambiguously in the pdf
4740
5323
% outlines by their "section number".  We avoid collisions with chapter
4741
5324
% numbers by starting them at 10000.  (If a document ever has 10000
4814
5397
\chardef\maxseclevel = 3
4815
5398
%
4816
5399
% A numbered section within an unnumbered changes to unnumbered too.
4817
 
% To achive this, remember the "biggest" unnum. sec. we are currently in:
4818
 
\chardef\unmlevel = \maxseclevel
 
5400
% To achieve this, remember the "biggest" unnum. sec. we are currently in:
 
5401
\chardef\unnlevel = \maxseclevel
4819
5402
%
4820
5403
% Trace whether the current chapter is an appendix or not:
4821
5404
% \chapheadtype is "N" or "A", unnumbered chapters are ignored.
4840
5423
  % The heading type:
4841
5424
  \def\headtype{#1}%
4842
5425
  \if \headtype U%
4843
 
    \ifnum \absseclevel < \unmlevel
4844
 
      \chardef\unmlevel = \absseclevel
 
5426
    \ifnum \absseclevel < \unnlevel
 
5427
      \chardef\unnlevel = \absseclevel
4845
5428
    \fi
4846
5429
  \else
4847
5430
    % Check for appendix sections:
4853
5436
      \fi\fi
4854
5437
    \fi
4855
5438
    % Check for numbered within unnumbered:
4856
 
    \ifnum \absseclevel > \unmlevel
 
5439
    \ifnum \absseclevel > \unnlevel
4857
5440
      \def\headtype{U}%
4858
5441
    \else
4859
 
      \chardef\unmlevel = 3
 
5442
      \chardef\unnlevel = 3
4860
5443
    \fi
4861
5444
  \fi
4862
5445
  % Now print the heading:
4910
5493
  \gdef\chaplevelprefix{\the\chapno.}%
4911
5494
  \resetallfloatnos
4912
5495
  %
4913
 
  \message{\putwordChapter\space \the\chapno}%
 
5496
  % \putwordChapter can contain complex things in translations.
 
5497
  \toks0=\expandafter{\putwordChapter}%
 
5498
  \message{\the\toks0 \space \the\chapno}%
4914
5499
  %
4915
5500
  % Write the actual heading.
4916
5501
  \chapmacro{#1}{Ynumbered}{\the\chapno}%
4921
5506
  \global\let\subsubsection = \numberedsubsubsec
4922
5507
}
4923
5508
 
4924
 
\outer\parseargdef\appendix{\apphead0{#1}} % normally apphead0 calls appendixzzz
 
5509
\outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
 
5510
%
4925
5511
\def\appendixzzz#1{%
4926
5512
  \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
4927
5513
    \global\advance\appendixno by 1
4928
5514
  \gdef\chaplevelprefix{\appendixletter.}%
4929
5515
  \resetallfloatnos
4930
5516
  %
4931
 
  \def\appendixnum{\putwordAppendix\space \appendixletter}%
4932
 
  \message{\appendixnum}%
 
5517
  % \putwordAppendix can contain complex things in translations.
 
5518
  \toks0=\expandafter{\putwordAppendix}%
 
5519
  \message{\the\toks0 \space \appendixletter}%
4933
5520
  %
4934
5521
  \chapmacro{#1}{Yappendix}{\appendixletter}%
4935
5522
  %
4938
5525
  \global\let\subsubsection = \appendixsubsubsec
4939
5526
}
4940
5527
 
4941
 
\outer\parseargdef\unnumbered{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
 
5528
% normally unnmhead0 calls unnumberedzzz:
 
5529
\outer\parseargdef\unnumbered{\unnmhead0{#1}}
4942
5530
\def\unnumberedzzz#1{%
4943
5531
  \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
4944
5532
    \global\advance\unnumberedno by 1
4982
5570
\let\top\unnumbered
4983
5571
 
4984
5572
% Sections.
 
5573
%
4985
5574
\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
4986
5575
\def\seczzz#1{%
4987
5576
  \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
4988
5577
  \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
4989
5578
}
4990
5579
 
4991
 
\outer\parseargdef\appendixsection{\apphead1{#1}} % normally calls appendixsectionzzz
 
5580
% normally calls appendixsectionzzz:
 
5581
\outer\parseargdef\appendixsection{\apphead1{#1}}
4992
5582
\def\appendixsectionzzz#1{%
4993
5583
  \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
4994
5584
  \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
4995
5585
}
4996
5586
\let\appendixsec\appendixsection
4997
5587
 
4998
 
\outer\parseargdef\unnumberedsec{\unnmhead1{#1}} % normally calls unnumberedseczzz
 
5588
% normally calls unnumberedseczzz:
 
5589
\outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
4999
5590
\def\unnumberedseczzz#1{%
5000
5591
  \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
5001
5592
  \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
5002
5593
}
5003
5594
 
5004
5595
% Subsections.
5005
 
\outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numberedsubseczzz
 
5596
%
 
5597
% normally calls numberedsubseczzz:
 
5598
\outer\parseargdef\numberedsubsec{\numhead2{#1}}
5006
5599
\def\numberedsubseczzz#1{%
5007
5600
  \global\subsubsecno=0  \global\advance\subsecno by 1
5008
5601
  \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
5009
5602
}
5010
5603
 
5011
 
\outer\parseargdef\appendixsubsec{\apphead2{#1}} % normally calls appendixsubseczzz
 
5604
% normally calls appendixsubseczzz:
 
5605
\outer\parseargdef\appendixsubsec{\apphead2{#1}}
5012
5606
\def\appendixsubseczzz#1{%
5013
5607
  \global\subsubsecno=0  \global\advance\subsecno by 1
5014
5608
  \sectionheading{#1}{subsec}{Yappendix}%
5015
5609
                 {\appendixletter.\the\secno.\the\subsecno}%
5016
5610
}
5017
5611
 
5018
 
\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
 
5612
% normally calls unnumberedsubseczzz:
 
5613
\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
5019
5614
\def\unnumberedsubseczzz#1{%
5020
5615
  \global\subsubsecno=0  \global\advance\subsecno by 1
5021
5616
  \sectionheading{#1}{subsec}{Ynothing}%
5023
5618
}
5024
5619
 
5025
5620
% Subsubsections.
5026
 
\outer\parseargdef\numberedsubsubsec{\numhead3{#1}} % normally numberedsubsubseczzz
 
5621
%
 
5622
% normally numberedsubsubseczzz:
 
5623
\outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
5027
5624
\def\numberedsubsubseczzz#1{%
5028
5625
  \global\advance\subsubsecno by 1
5029
5626
  \sectionheading{#1}{subsubsec}{Ynumbered}%
5030
5627
                 {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
5031
5628
}
5032
5629
 
5033
 
\outer\parseargdef\appendixsubsubsec{\apphead3{#1}} % normally appendixsubsubseczzz
 
5630
% normally appendixsubsubseczzz:
 
5631
\outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
5034
5632
\def\appendixsubsubseczzz#1{%
5035
5633
  \global\advance\subsubsecno by 1
5036
5634
  \sectionheading{#1}{subsubsec}{Yappendix}%
5037
5635
                 {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
5038
5636
}
5039
5637
 
5040
 
\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
 
5638
% normally unnumberedsubsubseczzz:
 
5639
\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
5041
5640
\def\unnumberedsubsubseczzz#1{%
5042
5641
  \global\advance\subsubsecno by 1
5043
5642
  \sectionheading{#1}{subsubsec}{Ynothing}%
5053
5652
 
5054
5653
% Define @majorheading, @heading and @subheading
5055
5654
 
5056
 
% NOTE on use of \vbox for chapter headings, section headings, and such:
5057
 
%       1) We use \vbox rather than the earlier \line to permit
5058
 
%          overlong headings to fold.
5059
 
%       2) \hyphenpenalty is set to 10000 because hyphenation in a
5060
 
%          heading is obnoxious; this forbids it.
5061
 
%       3) Likewise, headings look best if no \parindent is used, and
5062
 
%          if justification is not attempted.  Hence \raggedright.
5063
 
 
5064
 
 
5065
5655
\def\majorheading{%
5066
5656
  {\advance\chapheadingskip by 10pt \chapbreak }%
5067
5657
  \parsearg\chapheadingzzz
5069
5659
 
5070
5660
\def\chapheading{\chapbreak \parsearg\chapheadingzzz}
5071
5661
\def\chapheadingzzz#1{%
5072
 
  {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
5073
 
                    \parindent=0pt\raggedright
5074
 
                    \rm #1\hfill}}%
5075
 
  \bigskip \par\penalty 200\relax
 
5662
  \vbox{\chapfonts \raggedtitlesettings #1\par}%
 
5663
  \nobreak\bigskip \nobreak
5076
5664
  \suppressfirstparagraphindent
5077
5665
}
5078
5666
 
5088
5676
% (including whitespace, linebreaking, etc. around it),
5089
5677
% given all the information in convenient, parsed form.
5090
5678
 
5091
 
%%% Args are the skip and penalty (usually negative)
 
5679
% Args are the skip and penalty (usually negative)
5092
5680
\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
5093
5681
 
5094
 
%%% Define plain chapter starts, and page on/off switching for it
5095
5682
% Parameter controlling skip before chapter headings (if needed)
5096
 
 
5097
5683
\newskip\chapheadingskip
5098
5684
 
 
5685
% Define plain chapter starts, and page on/off switching for it.
5099
5686
\def\chapbreak{\dobreak \chapheadingskip {-4000}}
5100
5687
\def\chappager{\par\vfill\supereject}
5101
5688
% Because \domark is called before \chapoddpage, the filler page will
5105
5692
  \chappager
5106
5693
  \ifodd\pageno \else
5107
5694
    \begingroup
5108
 
      \evenheadline={\hfil}\evenfootline={\hfil}%
5109
 
      \oddheadline={\hfil}\oddfootline={\hfil}%
5110
 
      \hbox to 0pt{}%
 
5695
      \headingsoff
 
5696
      \null
5111
5697
      \chappager
5112
5698
    \endgroup
5113
5699
  \fi
5163
5749
    \xdef\lastchapterdefs{%
5164
5750
      \gdef\noexpand\thischaptername{\the\toks0}%
5165
5751
      \gdef\noexpand\thischapternum{\appendixletter}%
5166
 
      \gdef\noexpand\thischapter{\putwordAppendix{} \noexpand\thischapternum:
 
5752
      % \noexpand\putwordAppendix avoids expanding indigestible
 
5753
      % commands in some of the translations.
 
5754
      \gdef\noexpand\thischapter{\noexpand\putwordAppendix{}
 
5755
                                 \noexpand\thischapternum:
5167
5756
                                 \noexpand\thischaptername}%
5168
5757
    }%
5169
5758
  \else
5171
5760
    \xdef\lastchapterdefs{%
5172
5761
      \gdef\noexpand\thischaptername{\the\toks0}%
5173
5762
      \gdef\noexpand\thischapternum{\the\chapno}%
5174
 
      \gdef\noexpand\thischapter{\putwordChapter{} \noexpand\thischapternum:
 
5763
      % \noexpand\putwordChapter avoids expanding indigestible
 
5764
      % commands in some of the translations.
 
5765
      \gdef\noexpand\thischapter{\noexpand\putwordChapter{}
 
5766
                                 \noexpand\thischapternum:
5175
5767
                                 \noexpand\thischaptername}%
5176
5768
    }%
5177
5769
  \fi\fi\fi
5190
5782
  \domark
5191
5783
  %
5192
5784
  {%
5193
 
    \chapfonts \rm
 
5785
    \chapfonts \rmisbold
5194
5786
    %
5195
5787
    % Have to define \lastsection before calling \donoderef, because the
5196
5788
    % xref code eventually uses it.  On the other hand, it has to be called
5227
5819
    %
5228
5820
    % Typeset the actual heading.
5229
5821
    \nobreak % Avoid page breaks at the interline glue.
5230
 
    \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
5231
 
          \hangindent=\wd0 \centerparametersmaybe
 
5822
    \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe
5232
5823
          \unhbox0 #1\par}%
5233
5824
  }%
5234
5825
  \nobreak\bigskip % no page break after a chapter title
5250
5841
\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
5251
5842
%
5252
5843
\def\unnchfopen #1{%
5253
 
\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
5254
 
                       \parindent=0pt\raggedright
5255
 
                       \rm #1\hfill}}\bigskip \par\nobreak
 
5844
  \chapoddpage
 
5845
  \vbox{\chapfonts \raggedtitlesettings #1\par}%
 
5846
  \nobreak\bigskip\nobreak
5256
5847
}
5257
5848
\def\chfopen #1#2{\chapoddpage {\chapfonts
5258
5849
\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
5259
5850
\par\penalty 5000 %
5260
5851
}
5261
5852
\def\centerchfopen #1{%
5262
 
\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
5263
 
                       \parindent=0pt
5264
 
                       \hfill {\rm #1}\hfill}}\bigskip \par\nobreak
 
5853
  \chapoddpage
 
5854
  \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}%
 
5855
  \nobreak\bigskip \nobreak
5265
5856
}
5266
5857
\def\CHAPFopen{%
5267
5858
  \global\let\chapmacro=\chfopen
5293
5884
%
5294
5885
\def\sectionheading#1#2#3#4{%
5295
5886
  {%
 
5887
    \checkenv{}% should not be in an environment.
 
5888
    %
5296
5889
    % Switch to the right set of fonts.
5297
 
    \csname #2fonts\endcsname \rm
 
5890
    \csname #2fonts\endcsname \rmisbold
5298
5891
    %
5299
5892
    \def\sectionlevel{#2}%
5300
5893
    \def\temptype{#3}%
5314
5907
        \xdef\lastsectiondefs{%
5315
5908
          \gdef\noexpand\thissectionname{\the\toks0}%
5316
5909
          \gdef\noexpand\thissectionnum{#4}%
5317
 
          \gdef\noexpand\thissection{\putwordSection{} \noexpand\thissectionnum:
 
5910
          % \noexpand\putwordSection avoids expanding indigestible
 
5911
          % commands in some of the translations.
 
5912
          \gdef\noexpand\thissection{\noexpand\putwordSection{}
 
5913
                                     \noexpand\thissectionnum:
5318
5914
                                     \noexpand\thissectionname}%
5319
5915
        }%
5320
5916
      \fi
5324
5920
        \xdef\lastsectiondefs{%
5325
5921
          \gdef\noexpand\thissectionname{\the\toks0}%
5326
5922
          \gdef\noexpand\thissectionnum{#4}%
5327
 
          \gdef\noexpand\thissection{\putwordSection{} \noexpand\thissectionnum:
 
5923
          % \noexpand\putwordSection avoids expanding indigestible
 
5924
          % commands in some of the translations.
 
5925
          \gdef\noexpand\thissection{\noexpand\putwordSection{}
 
5926
                                     \noexpand\thissectionnum:
5328
5927
                                     \noexpand\thissectionname}%
5329
5928
        }%
5330
5929
      \fi
5331
5930
    \fi\fi\fi
5332
5931
    %
 
5932
    % Go into vertical mode.  Usually we'll already be there, but we
 
5933
    % don't want the following whatsit to end up in a preceding paragraph
 
5934
    % if the document didn't happen to have a blank line.
 
5935
    \par
 
5936
    %
5333
5937
    % Output the mark.  Pass it through \safewhatsit, to take care of
5334
5938
    % the preceding space.
5335
5939
    \safewhatsit\domark
5339
5943
    %
5340
5944
    % Now the second mark, after the heading break.  No break points
5341
5945
    % between here and the heading.
5342
 
    \let\prevsectiondefs=\lastsectiondefs
 
5946
    \global\let\prevsectiondefs=\lastsectiondefs
5343
5947
    \domark
5344
5948
    %
5345
5949
    % Only insert the space after the number if we have a section number.
5379
5983
    \nobreak
5380
5984
    %
5381
5985
    % Output the actual section heading.
5382
 
    \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
 
5986
    \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
5383
5987
          \hangindent=\wd0  % zero if no section number
5384
5988
          \unhbox0 #1}%
5385
5989
  }%
5393
5997
  %
5394
5998
  % We'll almost certainly start a paragraph next, so don't let that
5395
5999
  % glue accumulate.  (Not a breakpoint because it's preceded by a
5396
 
  % discardable item.)
 
6000
  % discardable item.)  However, when a paragraph is not started next
 
6001
  % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
 
6002
  % or the negative glue will cause weirdly wrong output, typically
 
6003
  % obscuring the section heading with something else.
5397
6004
  \vskip-\parskip
5398
 
  % 
5399
 
  % This is purely so the last item on the list is a known \penalty >
5400
 
  % 10000.  This is so \startdefun can avoid allowing breakpoints after
5401
 
  % section headings.  Otherwise, it would insert a valid breakpoint between:
5402
 
  % 
5403
 
  %   @section sec-whatever
5404
 
  %   @deffn def-whatever
 
6005
  %
 
6006
  % This is so the last item on the main vertical list is a known
 
6007
  % \penalty > 10000, so \startdefun, etc., can recognize the situation
 
6008
  % and do the needful.
5405
6009
  \penalty 10001
5406
6010
}
5407
6011
 
5457
6061
% These characters do not print properly in the Computer Modern roman
5458
6062
% fonts, so we must take special care.  This is more or less redundant
5459
6063
% with the Texinfo input format setup at the end of this file.
5460
 
 
6064
%
5461
6065
\def\activecatcodes{%
5462
6066
  \catcode`\"=\active
5463
6067
  \catcode`\$=\active
5507
6111
 
5508
6112
% redefined for the two-volume lispref.  We always output on
5509
6113
% \jobname.toc even if this is redefined.
5510
 
 
6114
%
5511
6115
\def\tocreadfilename{\jobname.toc}
5512
6116
 
5513
6117
% Normal (long) toc.
5533
6137
\def\summarycontents{%
5534
6138
  \startcontents{\putwordShortTOC}%
5535
6139
    %
 
6140
    \let\partentry = \shortpartentry
5536
6141
    \let\numchapentry = \shortchapentry
5537
6142
    \let\appentry = \shortchapentry
5538
6143
    \let\unnchapentry = \shortunnchapentry
5588
6193
% The last argument is the page number.
5589
6194
% The arguments in between are the chapter number, section number, ...
5590
6195
 
 
6196
% Parts, in the main contents.  Replace the part number, which doesn't
 
6197
% exist, with an empty box.  Let's hope all the numbers have the same width.
 
6198
% Also ignore the page number, which is conventionally not printed.
 
6199
\def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
 
6200
\def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
 
6201
%
 
6202
% Parts, in the short toc.
 
6203
\def\shortpartentry#1#2#3#4{%
 
6204
  \penalty-300
 
6205
  \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
 
6206
  \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
 
6207
}
 
6208
 
5591
6209
% Chapters, in the main contents.
5592
6210
\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
5593
6211
%
5677
6295
\message{environments,}
5678
6296
% @foo ... @end foo.
5679
6297
 
5680
 
% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
5681
 
%
5682
 
% Since these characters are used in examples, they should be an even number of
5683
 
% \tt widths. Each \tt character is 1en, so two makes it 1em.
5684
 
%
5685
 
\def\point{$\star$}
5686
 
\def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
5687
 
\def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
5688
 
\def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
5689
 
\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
5690
 
\def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
5691
 
 
5692
 
% The @error{} command.
5693
 
% Adapted from the TeXbook's \boxit.
5694
 
%
5695
 
\newbox\errorbox
5696
 
%
5697
 
{\tentt \global\dimen0 = 3em}% Width of the box.
5698
 
\dimen2 = .55pt % Thickness of rules
5699
 
% The text. (`r' is open on the right, `e' somewhat less so on the left.)
5700
 
\setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt}
5701
 
%
5702
 
\setbox\errorbox=\hbox to \dimen0{\hfil
5703
 
   \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
5704
 
   \advance\hsize by -2\dimen2 % Rules.
5705
 
   \vbox{%
5706
 
      \hrule height\dimen2
5707
 
      \hbox{\vrule width\dimen2 \kern3pt          % Space to left of text.
5708
 
         \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
5709
 
         \kern3pt\vrule width\dimen2}% Space to right.
5710
 
      \hrule height\dimen2}
5711
 
    \hfil}
5712
 
%
5713
 
\def\error{\leavevmode\lower.7ex\copy\errorbox}
5714
 
 
5715
 
% @tex ... @end tex    escapes into raw Tex temporarily.
 
6298
% @tex ... @end tex    escapes into raw TeX temporarily.
5716
6299
% One exception: @ is still an escape character, so that @end tex works.
5717
 
% But \@ or @@ will get a plain tex @ character.
 
6300
% But \@ or @@ will get a plain @ character.
5718
6301
 
5719
6302
\envdef\tex{%
 
6303
  \setupmarkupstyle{tex}%
5720
6304
  \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
5721
6305
  \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
5722
6306
  \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
5726
6310
  \catcode `\|=\other
5727
6311
  \catcode `\<=\other
5728
6312
  \catcode `\>=\other
 
6313
  \catcode `\`=\other
 
6314
  \catcode `\'=\other
5729
6315
  \escapechar=`\\
5730
6316
  %
 
6317
  % ' is active in math mode (mathcode"8000).  So reset it, and all our
 
6318
  % other math active characters (just in case), to plain's definitions.
 
6319
  \mathactive
 
6320
  %
5731
6321
  \let\b=\ptexb
5732
6322
  \let\bullet=\ptexbullet
5733
6323
  \let\c=\ptexc
5745
6335
  \let\/=\ptexslash
5746
6336
  \let\*=\ptexstar
5747
6337
  \let\t=\ptext
5748
 
  \expandafter \let\csname top\endcsname=\ptextop  % outer
 
6338
  \expandafter \let\csname top\endcsname=\ptextop  % we've made it outer
5749
6339
  \let\frenchspacing=\plainfrenchspacing
5750
6340
  %
5751
6341
  \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
5831
6421
  \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
5832
6422
  % Flag to tell @lisp, etc., not to narrow margin.
5833
6423
  \let\nonarrowing = t%
 
6424
  %
 
6425
  % If this cartouche directly follows a sectioning command, we need the
 
6426
  % \parskip glue (backspaced over by default) or the cartouche can
 
6427
  % collide with the section heading.
 
6428
  \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
 
6429
  %
5834
6430
  \vbox\bgroup
5835
6431
      \baselineskip=0pt\parskip=0pt\lineskip=0pt
5836
6432
      \carttop
5844
6440
              \lineskip=\normlskip
5845
6441
              \parskip=\normpskip
5846
6442
              \vskip -\parskip
5847
 
              \comment % For explanation, see the end of \def\group.
 
6443
              \comment % For explanation, see the end of def\group.
5848
6444
}
5849
6445
\def\Ecartouche{%
5850
6446
              \ifhmode\par\fi
5861
6457
 
5862
6458
% This macro is called at the beginning of all the @example variants,
5863
6459
% inside a group.
 
6460
\newdimen\nonfillparindent
5864
6461
\def\nonfillstart{%
5865
6462
  \aboveenvbreak
5866
 
  \hfuzz = 12pt % Don't be fussy
 
6463
  \ifdim\hfuzz < 12pt \hfuzz = 12pt \fi % Don't be fussy
5867
6464
  \sepspaces % Make spaces be word-separators rather than space tokens.
5868
6465
  \let\par = \lisppar % don't ignore blank lines
5869
6466
  \obeylines % each line of input is a line of output
5870
6467
  \parskip = 0pt
 
6468
  % Turn off paragraph indentation but redefine \indent to emulate
 
6469
  % the normal \indent.
 
6470
  \nonfillparindent=\parindent
5871
6471
  \parindent = 0pt
 
6472
  \let\indent\nonfillindent
 
6473
  %
5872
6474
  \emergencystretch = 0pt % don't try to avoid overfull boxes
5873
6475
  \ifx\nonarrowing\relax
5874
6476
    \advance \leftskip by \lispnarrowing
5879
6481
  \let\exdent=\nofillexdent
5880
6482
}
5881
6483
 
 
6484
\begingroup
 
6485
\obeyspaces
 
6486
% We want to swallow spaces (but not other tokens) after the fake
 
6487
% @indent in our nonfill-environments, where spaces are normally
 
6488
% active and set to @tie, resulting in them not being ignored after
 
6489
% @indent.
 
6490
\gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
 
6491
\gdef\nonfillindentcheck{%
 
6492
\ifx\temp %
 
6493
\expandafter\nonfillindentgobble%
 
6494
\else%
 
6495
\leavevmode\nonfillindentbox%
 
6496
\fi%
 
6497
}%
 
6498
\endgroup
 
6499
\def\nonfillindentgobble#1{\nonfillindent}
 
6500
\def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
 
6501
 
5882
6502
% If you want all examples etc. small: @set dispenvsize small.
5883
6503
% If you want even small examples the full size: @set dispenvsize nosmall.
5884
6504
% This affects the following displayed environments:
5906
6526
}
5907
6527
 
5908
6528
% We often define two environments, @foo and @smallfoo.
5909
 
% Let's do it by one command:
5910
 
\def\makedispenv #1#2{
5911
 
  \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}
5912
 
  \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}
 
6529
% Let's do it in one command.  #1 is the env name, #2 the definition.
 
6530
\def\makedispenvdef#1#2{%
 
6531
  \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
 
6532
  \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
5913
6533
  \expandafter\let\csname E#1\endcsname \afterenvbreak
5914
6534
  \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
5915
6535
}
5916
6536
 
5917
 
% Define two synonyms:
5918
 
\def\maketwodispenvs #1#2#3{
5919
 
  \makedispenv{#1}{#3}
5920
 
  \makedispenv{#2}{#3}
 
6537
% Define two environment synonyms (#1 and #2) for an environment.
 
6538
\def\maketwodispenvdef#1#2#3{%
 
6539
  \makedispenvdef{#1}{#3}%
 
6540
  \makedispenvdef{#2}{#3}%
5921
6541
}
5922
 
 
5923
 
% @lisp: indented, narrowed, typewriter font; @example: same as @lisp.
 
6542
%
 
6543
% @lisp: indented, narrowed, typewriter font;
 
6544
% @example: same as @lisp.
5924
6545
%
5925
6546
% @smallexample and @smalllisp: use smaller fonts.
5926
6547
% Originally contributed by Pavel@xerox.
5927
6548
%
5928
 
\maketwodispenvs {lisp}{example}{%
 
6549
\maketwodispenvdef{lisp}{example}{%
5929
6550
  \nonfillstart
5930
 
  \tt\quoteexpand
 
6551
  \tt\setupmarkupstyle{example}%
5931
6552
  \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
5932
 
  \gobble       % eat return
 
6553
  \gobble % eat return
5933
6554
}
5934
6555
% @display/@smalldisplay: same as @lisp except keep current font.
5935
6556
%
5936
 
\makedispenv {display}{%
 
6557
\makedispenvdef{display}{%
5937
6558
  \nonfillstart
5938
6559
  \gobble
5939
6560
}
5940
6561
 
5941
6562
% @format/@smallformat: same as @display except don't narrow margins.
5942
6563
%
5943
 
\makedispenv{format}{%
 
6564
\makedispenvdef{format}{%
5944
6565
  \let\nonarrowing = t%
5945
6566
  \nonfillstart
5946
6567
  \gobble
5959
6580
\envdef\flushright{%
5960
6581
  \let\nonarrowing = t%
5961
6582
  \nonfillstart
5962
 
  \advance\leftskip by 0pt plus 1fill
 
6583
  \advance\leftskip by 0pt plus 1fill\relax
5963
6584
  \gobble
5964
6585
}
5965
6586
\let\Eflushright = \afterenvbreak
5966
6587
 
5967
6588
 
 
6589
% @raggedright does more-or-less normal line breaking but no right
 
6590
% justification.  From plain.tex.
 
6591
\envdef\raggedright{%
 
6592
  \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax
 
6593
}
 
6594
\let\Eraggedright\par
 
6595
 
 
6596
\envdef\raggedleft{%
 
6597
  \parindent=0pt \leftskip0pt plus2em
 
6598
  \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
 
6599
  \hbadness=10000 % Last line will usually be underfull, so turn off
 
6600
                  % badness reporting.
 
6601
}
 
6602
\let\Eraggedleft\par
 
6603
 
 
6604
\envdef\raggedcenter{%
 
6605
  \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em
 
6606
  \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
 
6607
  \hbadness=10000 % Last line will usually be underfull, so turn off
 
6608
                  % badness reporting.
 
6609
}
 
6610
\let\Eraggedcenter\par
 
6611
 
 
6612
 
5968
6613
% @quotation does normal linebreaking (hence we can't use \nonfillstart)
5969
6614
% and narrows the margins.  We keep \parskip nonzero in general, since
5970
6615
% we're doing normal filling.  So, when using \aboveenvbreak and
5971
6616
% \afterenvbreak, temporarily make \parskip 0.
5972
6617
%
5973
 
\envdef\quotation{%
5974
 
  {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
5975
 
  \parindent=0pt
5976
 
  %
5977
 
  % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
 
6618
\makedispenvdef{quotation}{\quotationstart}
 
6619
%
 
6620
\def\quotationstart{%
 
6621
  \indentedblockstart % same as \indentedblock, but increase right margin too.
5978
6622
  \ifx\nonarrowing\relax
5979
 
    \advance\leftskip by \lispnarrowing
5980
6623
    \advance\rightskip by \lispnarrowing
5981
 
    \exdentamount = \lispnarrowing
5982
 
  \else
5983
 
    \let\nonarrowing = \relax
5984
6624
  \fi
5985
6625
  \parsearg\quotationlabel
5986
6626
}
5990
6630
%
5991
6631
\def\Equotation{%
5992
6632
  \par
5993
 
  \ifx\quotationauthor\undefined\else
 
6633
  \ifx\quotationauthor\thisisundefined\else
5994
6634
    % indent a bit.
5995
6635
    \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
5996
6636
  \fi
5997
6637
  {\parskip=0pt \afterenvbreak}%
5998
6638
}
 
6639
\def\Esmallquotation{\Equotation}
5999
6640
 
6000
6641
% If we're given an argument, typeset it in bold with a colon after.
6001
6642
\def\quotationlabel#1{%
6005
6646
  \fi
6006
6647
}
6007
6648
 
 
6649
% @indentedblock is like @quotation, but indents only on the left and
 
6650
% has no optional argument.
 
6651
%
 
6652
\makedispenvdef{indentedblock}{\indentedblockstart}
 
6653
%
 
6654
\def\indentedblockstart{%
 
6655
  {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
 
6656
  \parindent=0pt
 
6657
  %
 
6658
  % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
 
6659
  \ifx\nonarrowing\relax
 
6660
    \advance\leftskip by \lispnarrowing
 
6661
    \exdentamount = \lispnarrowing
 
6662
  \else
 
6663
    \let\nonarrowing = \relax
 
6664
  \fi
 
6665
}
 
6666
 
 
6667
% Keep a nonzero parskip for the environment, since we're doing normal filling.
 
6668
%
 
6669
\def\Eindentedblock{%
 
6670
  \par
 
6671
  {\parskip=0pt \afterenvbreak}%
 
6672
}
 
6673
\def\Esmallindentedblock{\Eindentedblock}
 
6674
 
6008
6675
 
6009
6676
% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
6010
6677
% If we want to allow any <char> as delimiter,
6020
6687
  \do\ \do\\\do\{\do\}\do\$\do\&%
6021
6688
  \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
6022
6689
  \do\<\do\>\do\|\do\@\do+\do\"%
 
6690
  % Don't do the quotes -- if we do, @set txicodequoteundirected and
 
6691
  % @set txicodequotebacktick will not have effect on @verb and
 
6692
  % @verbatim, and ?` and !` ligatures won't get disabled.
 
6693
  %\do\`\do\'%
6023
6694
}
6024
6695
%
6025
6696
% [Knuth] p. 380
6026
6697
\def\uncatcodespecials{%
6027
6698
  \def\do##1{\catcode`##1=\other}\dospecials}
6028
6699
%
6029
 
% [Knuth] pp. 380,381,391
6030
 
% Disable Spanish ligatures ?` and !` of \tt font
6031
 
\begingroup
6032
 
  \catcode`\`=\active\gdef`{\relax\lq}
6033
 
\endgroup
6034
 
%
6035
6700
% Setup for the @verb command.
6036
6701
%
6037
6702
% Eight spaces for a tab
6043
6708
\def\setupverb{%
6044
6709
  \tt  % easiest (and conventionally used) font for verbatim
6045
6710
  \def\par{\leavevmode\endgraf}%
6046
 
  \catcode`\`=\active
 
6711
  \setupmarkupstyle{verb}%
6047
6712
  \tabeightspaces
6048
6713
  % Respect line breaks,
6049
6714
  % print special symbols as themselves, and
6054
6719
 
6055
6720
% Setup for the @verbatim environment
6056
6721
%
6057
 
% Real tab expansion
 
6722
% Real tab expansion.
6058
6723
\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
6059
6724
%
6060
 
\def\starttabbox{\setbox0=\hbox\bgroup}
6061
 
 
6062
 
% Allow an option to not replace quotes with a regular directed right
6063
 
% quote/apostrophe (char 0x27), but instead use the undirected quote
6064
 
% from cmtt (char 0x0d).  The undirected quote is ugly, so don't make it
6065
 
% the default, but it works for pasting with more pdf viewers (at least
6066
 
% evince), the lilypond developers report.  xpdf does work with the
6067
 
% regular 0x27.  
6068
 
6069
 
\def\codequoteright{%
6070
 
  \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
6071
 
    \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
6072
 
      '%
6073
 
    \else \char'15 \fi
6074
 
  \else \char'15 \fi
6075
 
}
6076
 
%
6077
 
% and a similar option for the left quote char vs. a grave accent.
6078
 
% Modern fonts display ASCII 0x60 as a grave accent, so some people like
6079
 
% the code environments to do likewise.
6080
 
6081
 
\def\codequoteleft{%
6082
 
  \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
6083
 
    \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
6084
 
      `%
6085
 
    \else \char'22 \fi
6086
 
  \else \char'22 \fi
6087
 
}
 
6725
% We typeset each line of the verbatim in an \hbox, so we can handle
 
6726
% tabs.  The \global is in case the verbatim line starts with an accent,
 
6727
% or some other command that starts with a begin-group.  Otherwise, the
 
6728
% entire \verbbox would disappear at the corresponding end-group, before
 
6729
% it is typeset.  Meanwhile, we can't have nested verbatim commands
 
6730
% (can we?), so the \global won't be overwriting itself.
 
6731
\newbox\verbbox
 
6732
\def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
6088
6733
%
6089
6734
\begingroup
6090
6735
  \catcode`\^^I=\active
6091
6736
  \gdef\tabexpand{%
6092
6737
    \catcode`\^^I=\active
6093
6738
    \def^^I{\leavevmode\egroup
6094
 
      \dimen0=\wd0 % the width so far, or since the previous tab
6095
 
      \divide\dimen0 by\tabw
6096
 
      \multiply\dimen0 by\tabw % compute previous multiple of \tabw
6097
 
      \advance\dimen0 by\tabw  % advance to next multiple of \tabw
6098
 
      \wd0=\dimen0 \box0 \starttabbox
 
6739
      \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
 
6740
      \divide\dimen\verbbox by\tabw
 
6741
      \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
 
6742
      \advance\dimen\verbbox by\tabw  % advance to next multiple of \tabw
 
6743
      \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox
6099
6744
    }%
6100
6745
  }
6101
 
  \catcode`\'=\active
6102
 
  \gdef\rquoteexpand{\catcode\rquoteChar=\active \def'{\codequoteright}}%
6103
 
  %
6104
 
  \catcode`\`=\active
6105
 
  \gdef\lquoteexpand{\catcode\lquoteChar=\active \def`{\codequoteleft}}%
6106
 
  %
6107
 
  \gdef\quoteexpand{\rquoteexpand \lquoteexpand}%
6108
6746
\endgroup
6109
6747
 
6110
6748
% start the verbatim environment.
6111
6749
\def\setupverbatim{%
6112
6750
  \let\nonarrowing = t%
6113
6751
  \nonfillstart
6114
 
  % Easiest (and conventionally used) font for verbatim
6115
 
  \tt
6116
 
  \def\par{\leavevmode\egroup\box0\endgraf}%
6117
 
  \catcode`\`=\active
 
6752
  \tt % easiest (and conventionally used) font for verbatim
 
6753
  % The \leavevmode here is for blank lines.  Otherwise, we would
 
6754
  % never \starttabox and the \egroup would end verbatim mode.
 
6755
  \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
6118
6756
  \tabexpand
6119
 
  \quoteexpand
 
6757
  \setupmarkupstyle{verbatim}%
6120
6758
  % Respect line breaks,
6121
6759
  % print special symbols as themselves, and
6122
 
  % make each space count
6123
 
  % must do in this order:
 
6760
  % make each space count.
 
6761
  % Must do in this order:
6124
6762
  \obeylines \uncatcodespecials \sepspaces
6125
6763
  \everypar{\starttabbox}%
6126
6764
}
6176
6814
  {%
6177
6815
    \makevalueexpandable
6178
6816
    \setupverbatim
 
6817
    \indexnofonts       % Allow `@@' and other weird things in file names.
 
6818
    \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
6179
6819
    \input #1
6180
6820
    \afterenvbreak
6181
6821
  }%
6225
6865
    % commands also insert a nobreak penalty, and we don't want to allow
6226
6866
    % a break between a section heading and a defun.
6227
6867
    %
6228
 
    % As a minor refinement, we avoid "club" headers by signalling
 
6868
    % As a further refinement, we avoid "club" headers by signalling
6229
6869
    % with penalty of 10003 after the very first @deffn in the
6230
6870
    % sequence (see above), and penalty of 10002 after any following
6231
6871
    % @def command.
6262
6902
    #1#2 \endheader
6263
6903
    % common ending:
6264
6904
    \interlinepenalty = 10000
6265
 
    \advance\rightskip by 0pt plus 1fil
 
6905
    \advance\rightskip by 0pt plus 1fil\relax
6266
6906
    \endgraf
6267
6907
    \nobreak\vskip -\parskip
6268
6908
    \penalty\defunpenalty  % signal to \startdefun and \dodefunx
6292
6932
\def\domakedefun#1#2#3{%
6293
6933
  \envdef#1{%
6294
6934
    \startdefun
 
6935
    \doingtypefnfalse    % distinguish typed functions from all else
6295
6936
    \parseargusing\activeparens{\printdefunline#3}%
6296
6937
  }%
6297
6938
  \def#2{\dodefunx#1}%
6298
6939
  \def#3%
6299
6940
}
6300
6941
 
6301
 
%%% Untyped functions:
 
6942
\newif\ifdoingtypefn       % doing typed function?
 
6943
\newif\ifrettypeownline    % typeset return type on its own line?
 
6944
 
 
6945
% @deftypefnnewline on|off says whether the return type of typed functions
 
6946
% are printed on their own line.  This affects @deftypefn, @deftypefun,
 
6947
% @deftypeop, and @deftypemethod.
 
6948
%
 
6949
\parseargdef\deftypefnnewline{%
 
6950
  \def\temp{#1}%
 
6951
  \ifx\temp\onword
 
6952
    \expandafter\let\csname SETtxideftypefnnl\endcsname
 
6953
      = \empty
 
6954
  \else\ifx\temp\offword
 
6955
    \expandafter\let\csname SETtxideftypefnnl\endcsname
 
6956
      = \relax
 
6957
  \else
 
6958
    \errhelp = \EMsimple
 
6959
    \errmessage{Unknown @txideftypefnnl value `\temp',
 
6960
                must be on|off}%
 
6961
  \fi\fi
 
6962
}
 
6963
 
 
6964
% Untyped functions:
6302
6965
 
6303
6966
% @deffn category name args
6304
6967
\makedefun{deffn}{\deffngeneral{}}
6317
6980
  \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
6318
6981
}
6319
6982
 
6320
 
%%% Typed functions:
 
6983
% Typed functions:
6321
6984
 
6322
6985
% @deftypefn category type name args
6323
6986
\makedefun{deftypefn}{\deftypefngeneral{}}
6332
6995
%
6333
6996
\def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
6334
6997
  \dosubind{fn}{\code{#4}}{#1}%
 
6998
  \doingtypefntrue
6335
6999
  \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
6336
7000
}
6337
7001
 
6338
 
%%% Typed variables:
 
7002
% Typed variables:
6339
7003
 
6340
7004
% @deftypevr category type var args
6341
7005
\makedefun{deftypevr}{\deftypecvgeneral{}}
6353
7017
  \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
6354
7018
}
6355
7019
 
6356
 
%%% Untyped variables:
 
7020
% Untyped variables:
6357
7021
 
6358
7022
% @defvr category var args
6359
7023
\makedefun{defvr}#1 {\deftypevrheader{#1} {} }
6364
7028
% \defcvof {category of}class var args
6365
7029
\def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
6366
7030
 
6367
 
%%% Type:
 
7031
% Types:
 
7032
 
6368
7033
% @deftp category name args
6369
7034
\makedefun{deftp}#1 #2 #3\endheader{%
6370
7035
  \doind{tp}{\code{#2}}%
6392
7057
% We are followed by (but not passed) the arguments, if any.
6393
7058
%
6394
7059
\def\defname#1#2#3{%
 
7060
  \par
6395
7061
  % Get the values of \leftskip and \rightskip as they were outside the @def...
6396
7062
  \advance\leftskip by -\defbodyindent
6397
7063
  %
6398
 
  % How we'll format the type name.  Putting it in brackets helps
 
7064
  % Determine if we are typesetting the return type of a typed function
 
7065
  % on a line by itself.
 
7066
  \rettypeownlinefalse
 
7067
  \ifdoingtypefn  % doing a typed function specifically?
 
7068
    % then check user option for putting return type on its own line:
 
7069
    \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
 
7070
      \rettypeownlinetrue
 
7071
    \fi
 
7072
  \fi
 
7073
  %
 
7074
  % How we'll format the category name.  Putting it in brackets helps
6399
7075
  % distinguish it from the body text that may end up on the next line
6400
7076
  % just below it.
6401
7077
  \def\temp{#1}%
6402
7078
  \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
6403
7079
  %
6404
 
  % Figure out line sizes for the paragraph shape.
 
7080
  % Figure out line sizes for the paragraph shape.  We'll always have at
 
7081
  % least two.
 
7082
  \tempnum = 2
 
7083
  %
6405
7084
  % The first line needs space for \box0; but if \rightskip is nonzero,
6406
7085
  % we need only space for the part of \box0 which exceeds it:
6407
7086
  \dimen0=\hsize  \advance\dimen0 by -\wd0  \advance\dimen0 by \rightskip
 
7087
  %
 
7088
  % If doing a return type on its own line, we'll have another line.
 
7089
  \ifrettypeownline
 
7090
    \advance\tempnum by 1
 
7091
    \def\maybeshapeline{0in \hsize}%
 
7092
  \else
 
7093
    \def\maybeshapeline{}%
 
7094
  \fi
 
7095
  %
6408
7096
  % The continuations:
6409
7097
  \dimen2=\hsize  \advance\dimen2 by -\defargsindent
6410
 
  % (plain.tex says that \dimen1 should be used only as global.)
6411
 
  \parshape 2 0in \dimen0 \defargsindent \dimen2
6412
 
  %
6413
 
  % Put the type name to the right margin.
 
7098
  %
 
7099
  % The final paragraph shape:
 
7100
  \parshape \tempnum  0in \dimen0  \maybeshapeline  \defargsindent \dimen2
 
7101
  %
 
7102
  % Put the category name at the right margin.
6414
7103
  \noindent
6415
7104
  \hbox to 0pt{%
6416
7105
    \hfil\box0 \kern-\hsize
6432
7121
    % . this still does not fix the ?` and !` ligatures, but so far no
6433
7122
    %   one has made identifiers using them :).
6434
7123
    \df \tt
6435
 
    \def\temp{#2}% return value type
6436
 
    \ifx\temp\empty\else \tclose{\temp} \fi
 
7124
    \def\temp{#2}% text of the return type
 
7125
    \ifx\temp\empty\else
 
7126
      \tclose{\temp}% typeset the return type
 
7127
      \ifrettypeownline
 
7128
        % put return type on its own line; prohibit line break following:
 
7129
        \hfil\vadjust{\nobreak}\break
 
7130
      \else
 
7131
        \space  % type on same line, so just followed by a space
 
7132
      \fi
 
7133
    \fi           % no return type
6437
7134
    #3% output function name
6438
7135
  }%
6439
7136
  {\rm\enskip}% hskip 0.5 em of \tenrm
6453
7150
  \df \sl \hyphenchar\font=0
6454
7151
  %
6455
7152
  % On the other hand, if an argument has two dashes (for instance), we
6456
 
  % want a way to get ttsl.  Let's try @var for that.
6457
 
  \let\var=\ttslanted
 
7153
  % want a way to get ttsl.  We used to recommend @var for that, so
 
7154
  % leave the code in, but it's strange for @var to lead to typewriter.
 
7155
  % Nowadays we recommend @code, since the difference between a ttsl hyphen
 
7156
  % and a tt hyphen is pretty tiny.  @code also disables ?` !`.
 
7157
  \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
6458
7158
  #1%
6459
7159
  \sl\hyphenchar\font=45
6460
7160
}
6551
7251
 
6552
7252
% To do this right we need a feature of e-TeX, \scantokens,
6553
7253
% which we arrange to emulate with a temporary file in ordinary TeX.
6554
 
\ifx\eTeXversion\undefined
 
7254
\ifx\eTeXversion\thisisundefined
6555
7255
  \newwrite\macscribble
6556
7256
  \def\scantokens#1{%
6557
7257
    \toks0={#1}%
6562
7262
  }
6563
7263
\fi
6564
7264
 
6565
 
\def\scanmacro#1{%
6566
 
  \begingroup
6567
 
    \newlinechar`\^^M
6568
 
    \let\xeatspaces\eatspaces
6569
 
    % Undo catcode changes of \startcontents and \doprintindex
6570
 
    % When called from @insertcopying or (short)caption, we need active
6571
 
    % backslash to get it printed correctly.  Previously, we had
6572
 
    % \catcode`\\=\other instead.  We'll see whether a problem appears
6573
 
    % with macro expansion.                             --kasal, 19aug04
6574
 
    \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
6575
 
    % ... and \example
6576
 
    \spaceisspace
6577
 
    %
6578
 
    % Append \endinput to make sure that TeX does not see the ending newline.
6579
 
    % I've verified that it is necessary both for e-TeX and for ordinary TeX
6580
 
    %                                                   --kasal, 29nov03
6581
 
    \scantokens{#1\endinput}%
6582
 
  \endgroup
6583
 
}
 
7265
\def\scanmacro#1{\begingroup
 
7266
  \newlinechar`\^^M
 
7267
  \let\xeatspaces\eatspaces
 
7268
  %
 
7269
  % Undo catcode changes of \startcontents and \doprintindex
 
7270
  % When called from @insertcopying or (short)caption, we need active
 
7271
  % backslash to get it printed correctly.  Previously, we had
 
7272
  % \catcode`\\=\other instead.  We'll see whether a problem appears
 
7273
  % with macro expansion.                               --kasal, 19aug04
 
7274
  \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
 
7275
  %
 
7276
  % ... and for \example:
 
7277
  \spaceisspace
 
7278
  %
 
7279
  % The \empty here causes a following catcode 5 newline to be eaten as
 
7280
  % part of reading whitespace after a control sequence.  It does not
 
7281
  % eat a catcode 13 newline.  There's no good way to handle the two
 
7282
  % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX
 
7283
  % would then have different behavior).  See the Macro Details node in
 
7284
  % the manual for the workaround we recommend for macros and
 
7285
  % line-oriented commands.
 
7286
  %
 
7287
  \scantokens{#1\empty}%
 
7288
\endgroup}
6584
7289
 
6585
7290
\def\scanexp#1{%
6586
7291
  \edef\temp{\noexpand\scanmacro{#1}}%
6608
7313
% This does \let #1 = #2, with \csnames; that is,
6609
7314
%   \let \csname#1\endcsname = \csname#2\endcsname
6610
7315
% (except of course we have to play expansion games).
6611
 
 
7316
%
6612
7317
\def\cslet#1#2{%
6613
7318
  \expandafter\let
6614
7319
  \csname#1\expandafter\endcsname
6634
7339
 
6635
7340
% Macro bodies are absorbed as an argument in a context where
6636
7341
% all characters are catcode 10, 11 or 12, except \ which is active
6637
 
% (as in normal texinfo). It is necessary to change the definition of \.
6638
 
 
 
7342
% (as in normal texinfo). It is necessary to change the definition of \
 
7343
% to recognize macro arguments; this is the job of \mbodybackslash.
 
7344
%
6639
7345
% Non-ASCII encodings make 8-bit characters active, so un-activate
6640
7346
% them to avoid their expansion.  Must do this non-globally, to
6641
7347
% confine the change to the current group.
6642
 
 
 
7348
%
6643
7349
% It's necessary to have hard CRs when the macro is executed. This is
6644
 
% done by  making ^^M (\endlinechar) catcode 12 when reading the macro
 
7350
% done by making ^^M (\endlinechar) catcode 12 when reading the macro
6645
7351
% body, and then making it the \newlinechar in \scanmacro.
6646
 
 
6647
 
\def\scanctxt{%
 
7352
%
 
7353
\def\scanctxt{% used as subroutine
6648
7354
  \catcode`\"=\other
6649
7355
  \catcode`\+=\other
6650
7356
  \catcode`\<=\other
6657
7363
  \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
6658
7364
}
6659
7365
 
6660
 
\def\scanargctxt{%
 
7366
\def\scanargctxt{% used for copying and captions, not macros.
6661
7367
  \scanctxt
6662
7368
  \catcode`\\=\other
6663
7369
  \catcode`\^^M=\other
6664
7370
}
6665
7371
 
6666
 
\def\macrobodyctxt{%
 
7372
\def\macrobodyctxt{% used for @macro definitions
6667
7373
  \scanctxt
6668
7374
  \catcode`\{=\other
6669
7375
  \catcode`\}=\other
6671
7377
  \usembodybackslash
6672
7378
}
6673
7379
 
6674
 
\def\macroargctxt{%
 
7380
\def\macroargctxt{% used when scanning invocations
6675
7381
  \scanctxt
6676
 
  \catcode`\\=\other
 
7382
  \catcode`\\=0
6677
7383
}
 
7384
% why catcode 0 for \ in the above?  To recognize \\ \{ \} as "escapes"
 
7385
% for the single characters \ { }.  Thus, we end up with the "commands"
 
7386
% that would be written @\ @{ @} in a Texinfo document.
 
7387
%
 
7388
% We already have @{ and @}.  For @\, we define it here, and only for
 
7389
% this purpose, to produce a typewriter backslash (so, the @\ that we
 
7390
% define for @math can't be used with @macro calls):
 
7391
%
 
7392
\def\\{\normalbackslash}%
 
7393
%
 
7394
% We would like to do this for \, too, since that is what makeinfo does.
 
7395
% But it is not possible, because Texinfo already has a command @, for a
 
7396
% cedilla accent.  Documents must use @comma{} instead.
 
7397
%
 
7398
% \anythingelse will almost certainly be an error of some kind.
 
7399
 
6678
7400
 
6679
7401
% \mbodybackslash is the definition of \ in @macro bodies.
6680
7402
% It maps \foo\ => \csname macarg.foo\endcsname => #N
6681
7403
% where N is the macro parameter number.
6682
7404
% We define \csname macarg.\endcsname to be \realbackslash, so
6683
7405
% \\ in macro replacement text gets you a backslash.
6684
 
 
 
7406
%
6685
7407
{\catcode`@=0 @catcode`@\=@active
6686
7408
 @gdef@usembodybackslash{@let\=@mbodybackslash}
6687
7409
 @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
6688
7410
}
6689
7411
\expandafter\def\csname macarg.\endcsname{\realbackslash}
6690
7412
 
 
7413
\def\margbackslash#1{\char`\#1 }
 
7414
 
6691
7415
\def\macro{\recursivefalse\parsearg\macroxxx}
6692
7416
\def\rmacro{\recursivetrue\parsearg\macroxxx}
6693
7417
 
6694
7418
\def\macroxxx#1{%
6695
 
  \getargs{#1}%           now \macname is the macname and \argl the arglist
 
7419
  \getargs{#1}% now \macname is the macname and \argl the arglist
6696
7420
  \ifx\argl\empty       % no arguments
6697
 
     \paramno=0%
 
7421
     \paramno=0\relax
6698
7422
  \else
6699
7423
     \expandafter\parsemargdef \argl;%
 
7424
     \if\paramno>256\relax
 
7425
       \ifx\eTeXversion\thisisundefined
 
7426
         \errhelp = \EMsimple
 
7427
         \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
 
7428
       \fi
 
7429
     \fi
6700
7430
  \fi
6701
7431
  \if1\csname ismacro.\the\macname\endcsname
6702
7432
     \message{Warning: redefining \the\macname}%
6743
7473
% an opening brace, and that opening brace is not consumed.
6744
7474
\def\getargs#1{\getargsxxx#1{}}
6745
7475
\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
6746
 
\def\getmacname #1 #2\relax{\macname={#1}}
 
7476
\def\getmacname#1 #2\relax{\macname={#1}}
6747
7477
\def\getmacargs#1{\def\argl{#1}}
6748
7478
 
 
7479
% For macro processing make @ a letter so that we can make Texinfo private macro names.
 
7480
\edef\texiatcatcode{\the\catcode`\@}
 
7481
\catcode `@=11\relax
 
7482
 
6749
7483
% Parse the optional {params} list.  Set up \paramno and \paramlist
6750
 
% so \defmacro knows what to do.  Define \macarg.blah for each blah
6751
 
% in the params list, to be ##N where N is the position in that list.
 
7484
% so \defmacro knows what to do.  Define \macarg.BLAH for each BLAH
 
7485
% in the params list to some hook where the argument si to be expanded.  If
 
7486
% there are less than 10 arguments that hook is to be replaced by ##N where N
 
7487
% is the position in that list, that is to say the macro arguments are to be
 
7488
% defined `a la TeX in the macro body.
 
7489
%
6752
7490
% That gets used by \mbodybackslash (above).
6753
 
 
 
7491
%
6754
7492
% We need to get `macro parameter char #' into several definitions.
6755
 
% The technique used is stolen from LaTeX:  let \hash be something
 
7493
% The technique used is stolen from LaTeX: let \hash be something
6756
7494
% unexpandable, insert that wherever you need a #, and then redefine
6757
7495
% it to # just before using the token list produced.
6758
7496
%
6759
7497
% The same technique is used to protect \eatspaces till just before
6760
7498
% the macro is used.
6761
 
 
6762
 
\def\parsemargdef#1;{\paramno=0\def\paramlist{}%
6763
 
        \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,}
 
7499
%
 
7500
% If there are 10 or more arguments, a different technique is used, where the
 
7501
% hook remains in the body, and when macro is to be expanded the body is
 
7502
% processed again to replace the arguments.
 
7503
%
 
7504
% In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
 
7505
% argument N value and then \edef  the body (nothing else will expand because of
 
7506
% the catcode regime underwhich the body was input).
 
7507
%
 
7508
% If you compile with TeX (not eTeX), and you have macros with 10 or more
 
7509
% arguments, you need that no macro has more than 256 arguments, otherwise an
 
7510
% error is produced.
 
7511
\def\parsemargdef#1;{%
 
7512
  \paramno=0\def\paramlist{}%
 
7513
  \let\hash\relax
 
7514
  \let\xeatspaces\relax
 
7515
  \parsemargdefxxx#1,;,%
 
7516
  % In case that there are 10 or more arguments we parse again the arguments
 
7517
  % list to set new definitions for the \macarg.BLAH macros corresponding to
 
7518
  % each BLAH argument. It was anyhow needed to parse already once this list
 
7519
  % in order to count the arguments, and as macros with at most 9 arguments
 
7520
  % are by far more frequent than macro with 10 or more arguments, defining
 
7521
  % twice the \macarg.BLAH macros does not cost too much processing power.
 
7522
  \ifnum\paramno<10\relax\else
 
7523
    \paramno0\relax
 
7524
    \parsemmanyargdef@@#1,;,% 10 or more arguments
 
7525
  \fi
 
7526
}
6764
7527
\def\parsemargdefxxx#1,{%
6765
7528
  \if#1;\let\next=\relax
6766
7529
  \else \let\next=\parsemargdefxxx
6767
 
    \advance\paramno by 1%
 
7530
    \advance\paramno by 1
6768
7531
    \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
6769
7532
        {\xeatspaces{\hash\the\paramno}}%
6770
7533
    \edef\paramlist{\paramlist\hash\the\paramno,}%
6771
7534
  \fi\next}
6772
7535
 
 
7536
\def\parsemmanyargdef@@#1,{%
 
7537
  \if#1;\let\next=\relax
 
7538
  \else
 
7539
    \let\next=\parsemmanyargdef@@
 
7540
    \edef\tempb{\eatspaces{#1}}%
 
7541
    \expandafter\def\expandafter\tempa
 
7542
       \expandafter{\csname macarg.\tempb\endcsname}%
 
7543
    % Note that we need some extra \noexpand\noexpand, this is because we
 
7544
    % don't want \the  to be expanded in the \parsermacbody  as it uses an
 
7545
    % \xdef .
 
7546
    \expandafter\edef\tempa
 
7547
      {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
 
7548
    \advance\paramno by 1\relax
 
7549
  \fi\next}
 
7550
 
6773
7551
% These two commands read recursive and nonrecursive macro bodies.
6774
7552
% (They're different since rec and nonrec macros end differently.)
 
7553
%
6775
7554
 
 
7555
\catcode `\@\texiatcatcode
6776
7556
\long\def\parsemacbody#1@end macro%
6777
7557
{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
6778
7558
\long\def\parsermacbody#1@end rmacro%
6779
7559
{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
6780
 
 
6781
 
% This defines the macro itself. There are six cases: recursive and
6782
 
% nonrecursive macros of zero, one, and many arguments.
 
7560
\catcode `\@=11\relax
 
7561
 
 
7562
\let\endargs@\relax
 
7563
\let\nil@\relax
 
7564
\def\nilm@{\nil@}%
 
7565
\long\def\nillm@{\nil@}%
 
7566
 
 
7567
% This macro is expanded during the Texinfo macro expansion, not during its
 
7568
% definition.  It gets all the arguments values and assigns them to macros
 
7569
% macarg.ARGNAME
 
7570
%
 
7571
% #1 is the macro name
 
7572
% #2 is the list of argument names
 
7573
% #3 is the list of argument values
 
7574
\def\getargvals@#1#2#3{%
 
7575
  \def\macargdeflist@{}%
 
7576
  \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
 
7577
  \def\paramlist{#2,\nil@}%
 
7578
  \def\macroname{#1}%
 
7579
  \begingroup
 
7580
  \macroargctxt
 
7581
  \def\argvaluelist{#3,\nil@}%
 
7582
  \def\@tempa{#3}%
 
7583
  \ifx\@tempa\empty
 
7584
    \setemptyargvalues@
 
7585
  \else
 
7586
    \getargvals@@
 
7587
  \fi
 
7588
}
 
7589
 
 
7590
%
 
7591
\def\getargvals@@{%
 
7592
  \ifx\paramlist\nilm@
 
7593
      % Some sanity check needed here that \argvaluelist is also empty.
 
7594
      \ifx\argvaluelist\nillm@
 
7595
      \else
 
7596
        \errhelp = \EMsimple
 
7597
        \errmessage{Too many arguments in macro `\macroname'!}%
 
7598
      \fi
 
7599
      \let\next\macargexpandinbody@
 
7600
  \else
 
7601
    \ifx\argvaluelist\nillm@
 
7602
       % No more arguments values passed to macro.  Set remaining named-arg
 
7603
       % macros to empty.
 
7604
       \let\next\setemptyargvalues@
 
7605
    \else
 
7606
      % pop current arg name into \@tempb
 
7607
      \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
 
7608
      \expandafter\@tempa\expandafter{\paramlist}%
 
7609
       % pop current argument value into \@tempc
 
7610
      \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
 
7611
      \expandafter\@tempa\expandafter{\argvaluelist}%
 
7612
       % Here \@tempb is the current arg name and \@tempc is the current arg value.
 
7613
       % First place the new argument macro definition into \@tempd
 
7614
       \expandafter\macname\expandafter{\@tempc}%
 
7615
       \expandafter\let\csname macarg.\@tempb\endcsname\relax
 
7616
       \expandafter\def\expandafter\@tempe\expandafter{%
 
7617
         \csname macarg.\@tempb\endcsname}%
 
7618
       \edef\@tempd{\long\def\@tempe{\the\macname}}%
 
7619
       \push@\@tempd\macargdeflist@
 
7620
       \let\next\getargvals@@
 
7621
    \fi
 
7622
  \fi
 
7623
  \next
 
7624
}
 
7625
 
 
7626
\def\push@#1#2{%
 
7627
  \expandafter\expandafter\expandafter\def
 
7628
  \expandafter\expandafter\expandafter#2%
 
7629
  \expandafter\expandafter\expandafter{%
 
7630
  \expandafter#1#2}%
 
7631
}
 
7632
 
 
7633
% Replace arguments by their values in the macro body, and place the result
 
7634
% in macro \@tempa
 
7635
\def\macvalstoargs@{%
 
7636
  %  To do this we use the property that token registers that are \the'ed
 
7637
  % within an \edef  expand only once. So we are going to place all argument
 
7638
  % values into respective token registers.
 
7639
  %
 
7640
  % First we save the token context, and initialize argument numbering.
 
7641
  \begingroup
 
7642
    \paramno0\relax
 
7643
    % Then, for each argument number #N, we place the corresponding argument
 
7644
    % value into a new token list register \toks#N
 
7645
    \expandafter\putargsintokens@\saveparamlist@,;,%
 
7646
    % Then, we expand the body so that argument are replaced by their
 
7647
    % values. The trick for values not to be expanded themselves is that they
 
7648
    % are within tokens and that tokens expand only once in an \edef .
 
7649
    \edef\@tempc{\csname mac.\macroname .body\endcsname}%
 
7650
    % Now we restore the token stack pointer to free the token list registers
 
7651
    % which we have used, but we make sure that expanded body is saved after
 
7652
    % group.
 
7653
    \expandafter
 
7654
  \endgroup
 
7655
  \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
 
7656
  }
 
7657
 
 
7658
\def\macargexpandinbody@{%
 
7659
  %% Define the named-macro outside of this group and then close this group.
 
7660
  \expandafter
 
7661
  \endgroup
 
7662
  \macargdeflist@
 
7663
  % First the replace in body the macro arguments by their values, the result
 
7664
  % is in \@tempa .
 
7665
  \macvalstoargs@
 
7666
  % Then we point at the \norecurse or \gobble (for recursive) macro value
 
7667
  % with \@tempb .
 
7668
  \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
 
7669
  % Depending on whether it is recursive or not, we need some tailing
 
7670
  % \egroup .
 
7671
  \ifx\@tempb\gobble
 
7672
     \let\@tempc\relax
 
7673
  \else
 
7674
     \let\@tempc\egroup
 
7675
  \fi
 
7676
  % And now we do the real job:
 
7677
  \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
 
7678
  \@tempd
 
7679
}
 
7680
 
 
7681
\def\putargsintokens@#1,{%
 
7682
  \if#1;\let\next\relax
 
7683
  \else
 
7684
    \let\next\putargsintokens@
 
7685
    % First we allocate the new token list register, and give it a temporary
 
7686
    % alias \@tempb .
 
7687
    \toksdef\@tempb\the\paramno
 
7688
    % Then we place the argument value into that token list register.
 
7689
    \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
 
7690
    \expandafter\@tempb\expandafter{\@tempa}%
 
7691
    \advance\paramno by 1\relax
 
7692
  \fi
 
7693
  \next
 
7694
}
 
7695
 
 
7696
% Save the token stack pointer into macro #1
 
7697
\def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}}
 
7698
% Restore the token stack pointer from number in macro #1
 
7699
\def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax}
 
7700
% newtoks that can be used non \outer .
 
7701
\def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi}
 
7702
 
 
7703
% Tailing missing arguments are set to empty
 
7704
\def\setemptyargvalues@{%
 
7705
  \ifx\paramlist\nilm@
 
7706
    \let\next\macargexpandinbody@
 
7707
  \else
 
7708
    \expandafter\setemptyargvaluesparser@\paramlist\endargs@
 
7709
    \let\next\setemptyargvalues@
 
7710
  \fi
 
7711
  \next
 
7712
}
 
7713
 
 
7714
\def\setemptyargvaluesparser@#1,#2\endargs@{%
 
7715
  \expandafter\def\expandafter\@tempa\expandafter{%
 
7716
    \expandafter\def\csname macarg.#1\endcsname{}}%
 
7717
  \push@\@tempa\macargdeflist@
 
7718
  \def\paramlist{#2}%
 
7719
}
 
7720
 
 
7721
% #1 is the element target macro
 
7722
% #2 is the list macro
 
7723
% #3,#4\endargs@ is the list value
 
7724
\def\pop@#1#2#3,#4\endargs@{%
 
7725
   \def#1{#3}%
 
7726
   \def#2{#4}%
 
7727
}
 
7728
\long\def\longpop@#1#2#3,#4\endargs@{%
 
7729
   \long\def#1{#3}%
 
7730
   \long\def#2{#4}%
 
7731
}
 
7732
 
 
7733
% This defines a Texinfo @macro. There are eight cases: recursive and
 
7734
% nonrecursive macros of zero, one, up to nine, and many arguments.
6783
7735
% Much magic with \expandafter here.
6784
7736
% \xdef is used so that macro definitions will survive the file
6785
7737
% they're defined in; @include reads the file inside a group.
 
7738
%
6786
7739
\def\defmacro{%
6787
7740
  \let\hash=##% convert placeholders to macro parameter chars
6788
7741
  \ifrecursive
6797
7750
         \expandafter\noexpand\csname\the\macname xxx\endcsname}%
6798
7751
      \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
6799
7752
         \egroup\noexpand\scanmacro{\temp}}%
6800
 
    \else % many
 
7753
    \else
 
7754
      \ifnum\paramno<10\relax % at most 9
 
7755
        \expandafter\xdef\csname\the\macname\endcsname{%
 
7756
           \bgroup\noexpand\macroargctxt
 
7757
           \noexpand\csname\the\macname xx\endcsname}%
 
7758
        \expandafter\xdef\csname\the\macname xx\endcsname##1{%
 
7759
            \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
 
7760
        \expandafter\expandafter
 
7761
        \expandafter\xdef
 
7762
        \expandafter\expandafter
 
7763
          \csname\the\macname xxx\endcsname
 
7764
            \paramlist{\egroup\noexpand\scanmacro{\temp}}%
 
7765
      \else % 10 or more
 
7766
        \expandafter\xdef\csname\the\macname\endcsname{%
 
7767
          \noexpand\getargvals@{\the\macname}{\argl}%
 
7768
        }%
 
7769
        \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
 
7770
        \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
 
7771
      \fi
 
7772
    \fi
 
7773
  \else
 
7774
    \ifcase\paramno
 
7775
    % 0
 
7776
      \expandafter\xdef\csname\the\macname\endcsname{%
 
7777
        \noexpand\norecurse{\the\macname}%
 
7778
        \noexpand\scanmacro{\temp}\egroup}%
 
7779
    \or % 1
6801
7780
      \expandafter\xdef\csname\the\macname\endcsname{%
6802
7781
         \bgroup\noexpand\macroargctxt
6803
 
         \noexpand\csname\the\macname xx\endcsname}%
6804
 
      \expandafter\xdef\csname\the\macname xx\endcsname##1{%
6805
 
          \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
6806
 
      \expandafter\expandafter
6807
 
      \expandafter\xdef
6808
 
      \expandafter\expandafter
 
7782
         \noexpand\braceorline
 
7783
         \expandafter\noexpand\csname\the\macname xxx\endcsname}%
 
7784
      \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
 
7785
        \egroup
 
7786
        \noexpand\norecurse{\the\macname}%
 
7787
        \noexpand\scanmacro{\temp}\egroup}%
 
7788
    \else % at most 9
 
7789
      \ifnum\paramno<10\relax
 
7790
        \expandafter\xdef\csname\the\macname\endcsname{%
 
7791
           \bgroup\noexpand\macroargctxt
 
7792
           \expandafter\noexpand\csname\the\macname xx\endcsname}%
 
7793
        \expandafter\xdef\csname\the\macname xx\endcsname##1{%
 
7794
            \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
 
7795
        \expandafter\expandafter
 
7796
        \expandafter\xdef
 
7797
        \expandafter\expandafter
6809
7798
        \csname\the\macname xxx\endcsname
6810
 
          \paramlist{\egroup\noexpand\scanmacro{\temp}}%
6811
 
    \fi
6812
 
  \else
6813
 
    \ifcase\paramno
6814
 
    % 0
6815
 
      \expandafter\xdef\csname\the\macname\endcsname{%
6816
 
        \noexpand\norecurse{\the\macname}%
6817
 
        \noexpand\scanmacro{\temp}\egroup}%
6818
 
    \or % 1
6819
 
      \expandafter\xdef\csname\the\macname\endcsname{%
6820
 
         \bgroup\noexpand\macroargctxt
6821
 
         \noexpand\braceorline
6822
 
         \expandafter\noexpand\csname\the\macname xxx\endcsname}%
6823
 
      \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
6824
 
        \egroup
6825
 
        \noexpand\norecurse{\the\macname}%
6826
 
        \noexpand\scanmacro{\temp}\egroup}%
6827
 
    \else % many
6828
 
      \expandafter\xdef\csname\the\macname\endcsname{%
6829
 
         \bgroup\noexpand\macroargctxt
6830
 
         \expandafter\noexpand\csname\the\macname xx\endcsname}%
6831
 
      \expandafter\xdef\csname\the\macname xx\endcsname##1{%
6832
 
          \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
6833
 
      \expandafter\expandafter
6834
 
      \expandafter\xdef
6835
 
      \expandafter\expandafter
6836
 
      \csname\the\macname xxx\endcsname
6837
 
      \paramlist{%
6838
 
          \egroup
6839
 
          \noexpand\norecurse{\the\macname}%
6840
 
          \noexpand\scanmacro{\temp}\egroup}%
 
7799
        \paramlist{%
 
7800
            \egroup
 
7801
            \noexpand\norecurse{\the\macname}%
 
7802
            \noexpand\scanmacro{\temp}\egroup}%
 
7803
      \else % 10 or more:
 
7804
        \expandafter\xdef\csname\the\macname\endcsname{%
 
7805
          \noexpand\getargvals@{\the\macname}{\argl}%
 
7806
        }%
 
7807
        \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
 
7808
        \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse
 
7809
      \fi
6841
7810
    \fi
6842
7811
  \fi}
6843
7812
 
 
7813
\catcode `\@\texiatcatcode\relax
 
7814
 
6844
7815
\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
6845
7816
 
6846
7817
% \braceorline decides whether the next nonwhitespace character is a
6847
7818
% {.  If so it reads up to the closing }, if not, it reads the whole
6848
7819
% line.  Whatever was read is then fed to the next control sequence
6849
 
% as an argument (by \parsebrace or \parsearg)
 
7820
% as an argument (by \parsebrace or \parsearg).
 
7821
%
6850
7822
\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
6851
7823
\def\braceorlinexxx{%
6852
7824
  \ifx\nchar\bgroup\else
6856
7828
 
6857
7829
% @alias.
6858
7830
% We need some trickery to remove the optional spaces around the equal
6859
 
% sign.  Just make them active and then expand them all to nothing.
 
7831
% sign.  Make them active and then expand them all to nothing.
 
7832
%
6860
7833
\def\alias{\parseargusing\obeyspaces\aliasxxx}
6861
7834
\def\aliasxxx #1{\aliasyyy#1\relax}
6862
7835
\def\aliasyyy #1=#2\relax{%
6877
7850
 
6878
7851
% @inforef is relatively simple.
6879
7852
\def\inforef #1{\inforefzzz #1,,,,**}
6880
 
\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
 
7853
\def\inforefzzz #1,#2,#3,#4**{%
 
7854
  \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
6881
7855
  node \samp{\ignorespaces#1{}}}
6882
7856
 
6883
7857
% @node's only job in TeX is to define \lastnode, which is used in
6938
7912
      \toks0 = \expandafter{\lastsection}%
6939
7913
      \immediate \writexrdef{title}{\the\toks0 }%
6940
7914
      \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
6941
 
      \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, during \shipout
 
7915
      \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
6942
7916
    }%
6943
7917
  \fi
6944
7918
}
6945
7919
 
 
7920
% @xrefautosectiontitle on|off says whether @section(ing) names are used
 
7921
% automatically in xrefs, if the third arg is not explicitly specified.
 
7922
% This was provided as a "secret" @set xref-automatic-section-title
 
7923
% variable, now it's official.
 
7924
%
 
7925
\parseargdef\xrefautomaticsectiontitle{%
 
7926
  \def\temp{#1}%
 
7927
  \ifx\temp\onword
 
7928
    \expandafter\let\csname SETxref-automatic-section-title\endcsname
 
7929
      = \empty
 
7930
  \else\ifx\temp\offword
 
7931
    \expandafter\let\csname SETxref-automatic-section-title\endcsname
 
7932
      = \relax
 
7933
  \else
 
7934
    \errhelp = \EMsimple
 
7935
    \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
 
7936
                must be on|off}%
 
7937
  \fi\fi
 
7938
}
 
7939
 
 
7940
6946
7941
% @xref, @pxref, and @ref generate cross-references.  For \xrefX, #1 is
6947
7942
% the node name, #2 the name of the Info cross-reference, #3 the printed
6948
7943
% node name, #4 the name of the Info file, #5 the name of the printed
6951
7946
\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
6952
7947
\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
6953
7948
\def\ref#1{\xrefX[#1,,,,,,,]}
 
7949
%
 
7950
\newbox\toprefbox
 
7951
\newbox\printedrefnamebox
 
7952
\newbox\infofilenamebox
 
7953
\newbox\printedmanualbox
 
7954
%
6954
7955
\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
6955
7956
  \unsepspaces
 
7957
  %
 
7958
  % Get args without leading/trailing spaces.
 
7959
  \def\printedrefname{\ignorespaces #3}%
 
7960
  \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
 
7961
  %
 
7962
  \def\infofilename{\ignorespaces #4}%
 
7963
  \setbox\infofilenamebox = \hbox{\infofilename\unskip}%
 
7964
  %
6956
7965
  \def\printedmanual{\ignorespaces #5}%
6957
 
  \def\printedrefname{\ignorespaces #3}%
6958
 
  \setbox1=\hbox{\printedmanual\unskip}%
6959
 
  \setbox0=\hbox{\printedrefname\unskip}%
6960
 
  \ifdim \wd0 = 0pt
 
7966
  \setbox\printedmanualbox  = \hbox{\printedmanual\unskip}%
 
7967
  %
 
7968
  % If the printed reference name (arg #3) was not explicitly given in
 
7969
  % the @xref, figure out what we want to use.
 
7970
  \ifdim \wd\printedrefnamebox = 0pt
6961
7971
    % No printed node name was explicitly given.
6962
 
    \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax
6963
 
      % Use the node name inside the square brackets.
 
7972
    \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
 
7973
      % Not auto section-title: use node name inside the square brackets.
6964
7974
      \def\printedrefname{\ignorespaces #1}%
6965
7975
    \else
6966
 
      % Use the actual chapter/section title appear inside
6967
 
      % the square brackets.  Use the real section title if we have it.
6968
 
      \ifdim \wd1 > 0pt
6969
 
        % It is in another manual, so we don't have it.
 
7976
      % Auto section-title: use chapter/section title inside
 
7977
      % the square brackets if we have it.
 
7978
      \ifdim \wd\printedmanualbox > 0pt
 
7979
        % It is in another manual, so we don't have it; use node name.
6970
7980
        \def\printedrefname{\ignorespaces #1}%
6971
7981
      \else
6972
7982
        \ifhavexrefs
6973
 
          % We know the real title if we have the xref values.
 
7983
          % We (should) know the real title if we have the xref values.
6974
7984
          \def\printedrefname{\refx{#1-title}{}}%
6975
7985
        \else
6976
7986
          % Otherwise just copy the Info node name.
6984
7994
  \ifpdf
6985
7995
    {\indexnofonts
6986
7996
     \turnoffactive
 
7997
     \makevalueexpandable
6987
7998
     % This expands tokens, so do it after making catcode changes, so _
6988
 
     % etc. don't get their TeX definitions.
 
7999
     % etc. don't get their TeX definitions.  This ignores all spaces in
 
8000
     % #4, including (wrongly) those in the middle of the filename.
6989
8001
     \getfilename{#4}%
6990
8002
     %
6991
 
     % See comments at \activebackslashdouble.
6992
 
     {\activebackslashdouble \xdef\pdfxrefdest{#1}%
6993
 
      \backslashparens\pdfxrefdest}%
 
8003
     % This (wrongly) does not take account of leading or trailing
 
8004
     % spaces in #1, which should be ignored.
 
8005
     \edef\pdfxrefdest{#1}%
 
8006
     \ifx\pdfxrefdest\empty
 
8007
       \def\pdfxrefdest{Top}% no empty targets
 
8008
     \else
 
8009
       \txiescapepdf\pdfxrefdest  % escape PDF special chars
 
8010
     \fi
6994
8011
     %
6995
8012
     \leavevmode
6996
8013
     \startlink attr{/Border [0 0 0]}%
7017
8034
  \iffloat\Xthisreftitle
7018
8035
    % If the user specified the print name (third arg) to the ref,
7019
8036
    % print it instead of our usual "Figure 1.2".
7020
 
    \ifdim\wd0 = 0pt
 
8037
    \ifdim\wd\printedrefnamebox = 0pt
7021
8038
      \refx{#1-snt}{}%
7022
8039
    \else
7023
8040
      \printedrefname
7024
8041
    \fi
7025
8042
    %
7026
 
    % if the user also gave the printed manual name (fifth arg), append
 
8043
    % If the user also gave the printed manual name (fifth arg), append
7027
8044
    % "in MANUALNAME".
7028
 
    \ifdim \wd1 > 0pt
 
8045
    \ifdim \wd\printedmanualbox > 0pt
7029
8046
      \space \putwordin{} \cite{\printedmanual}%
7030
8047
    \fi
7031
8048
  \else
7032
8049
    % node/anchor (non-float) references.
7033
8050
    %
7034
 
    % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
7035
 
    % insert empty discretionaries after hyphens, which means that it will
7036
 
    % not find a line break at a hyphen in a node names.  Since some manuals
7037
 
    % are best written with fairly long node names, containing hyphens, this
7038
 
    % is a loss.  Therefore, we give the text of the node name again, so it
7039
 
    % is as if TeX is seeing it for the first time.
7040
 
    \ifdim \wd1 > 0pt
7041
 
      \putwordSection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}%
 
8051
    % If we use \unhbox to print the node names, TeX does not insert
 
8052
    % empty discretionaries after hyphens, which means that it will not
 
8053
    % find a line break at a hyphen in a node names.  Since some manuals
 
8054
    % are best written with fairly long node names, containing hyphens,
 
8055
    % this is a loss.  Therefore, we give the text of the node name
 
8056
    % again, so it is as if TeX is seeing it for the first time.
 
8057
    %
 
8058
    \ifdim \wd\printedmanualbox > 0pt
 
8059
      % Cross-manual reference with a printed manual name.
 
8060
      %
 
8061
      \crossmanualxref{\cite{\printedmanual\unskip}}%
 
8062
    %
 
8063
    \else\ifdim \wd\infofilenamebox > 0pt
 
8064
      % Cross-manual reference with only an info filename (arg 4), no
 
8065
      % printed manual name (arg 5).  This is essentially the same as
 
8066
      % the case above; we output the filename, since we have nothing else.
 
8067
      %
 
8068
      \crossmanualxref{\code{\infofilename\unskip}}%
 
8069
    %
7042
8070
    \else
 
8071
      % Reference within this manual.
 
8072
      %
7043
8073
      % _ (for example) has to be the character _ for the purposes of the
7044
8074
      % control sequence corresponding to the node, but it has to expand
7045
8075
      % into the usual \leavevmode...\vrule stuff for purposes of
7051
8081
       \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
7052
8082
       \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
7053
8083
      }%
7054
 
      % output the `[mynode]' via a macro so it can be overridden.
 
8084
      % output the `[mynode]' via the macro below so it can be overridden.
7055
8085
      \xrefprintnodename\printedrefname
7056
8086
      %
7057
8087
      % But we always want a comma and a space:
7059
8089
      %
7060
8090
      % output the `page 3'.
7061
8091
      \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
7062
 
    \fi
 
8092
    \fi\fi
7063
8093
  \fi
7064
8094
  \endlink
7065
8095
\endgroup}
7066
8096
 
 
8097
% Output a cross-manual xref to #1.  Used just above (twice).
 
8098
%
 
8099
% Only include the text "Section ``foo'' in" if the foo is neither
 
8100
% missing or Top.  Thus, @xref{,,,foo,The Foo Manual} outputs simply
 
8101
% "see The Foo Manual", the idea being to refer to the whole manual.
 
8102
%
 
8103
% But, this being TeX, we can't easily compare our node name against the
 
8104
% string "Top" while ignoring the possible spaces before and after in
 
8105
% the input.  By adding the arbitrary 7sp below, we make it much less
 
8106
% likely that a real node name would have the same width as "Top" (e.g.,
 
8107
% in a monospaced font).  Hopefully it will never happen in practice.
 
8108
%
 
8109
% For the same basic reason, we retypeset the "Top" at every
 
8110
% reference, since the current font is indeterminate.
 
8111
%
 
8112
\def\crossmanualxref#1{%
 
8113
  \setbox\toprefbox = \hbox{Top\kern7sp}%
 
8114
  \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
 
8115
  \ifdim \wd2 > 7sp  % nonempty?
 
8116
    \ifdim \wd2 = \wd\toprefbox \else  % same as Top?
 
8117
      \putwordSection{} ``\printedrefname'' \putwordin{}\space
 
8118
    \fi
 
8119
  \fi
 
8120
  #1%
 
8121
}
 
8122
 
7067
8123
% This macro is called from \xrefX for the `[nodename]' part of xref
7068
8124
% output.  It's a separate macro only so it can be changed more easily,
7069
8125
% since square brackets don't work well in some documents.  Particularly
7114
8170
    \angleleft un\-de\-fined\angleright
7115
8171
    \iflinks
7116
8172
      \ifhavexrefs
7117
 
        \message{\linenumber Undefined cross reference `#1'.}%
 
8173
        {\toks0 = {#1}% avoid expansion of possibly-complex value
 
8174
         \message{\linenumber Undefined cross reference `\the\toks0'.}}%
7118
8175
      \else
7119
8176
        \ifwarnedxrefs\else
7120
8177
          \global\warnedxrefstrue
7278
8335
% space to prevent strange expansion errors.)
7279
8336
\def\supereject{\par\penalty -20000\footnoteno =0 }
7280
8337
 
7281
 
% @footnotestyle is meaningful for info output only.
 
8338
% @footnotestyle is meaningful for Info output only.
7282
8339
\let\footnotestyle=\comment
7283
8340
 
7284
8341
{\catcode `\@=11
7341
8398
  % expands into a box, it must come within the paragraph, lest it
7342
8399
  % provide a place where TeX can split the footnote.
7343
8400
  \footstrut
 
8401
  %
 
8402
  % Invoke rest of plain TeX footnote routine.
7344
8403
  \futurelet\next\fo@t
7345
8404
}
7346
8405
}%end \catcode `\@=11
7428
8487
  it from ftp://tug.org/tex/epsf.tex.}
7429
8488
%
7430
8489
\def\image#1{%
7431
 
  \ifx\epsfbox\undefined
 
8490
  \ifx\epsfbox\thisisundefined
7432
8491
    \ifwarnednoepsf \else
7433
8492
      \errhelp = \noepsfhelp
7434
8493
      \errmessage{epsf.tex not found, images will be ignored}%
7444
8503
% #2 is (optional) width, #3 is (optional) height.
7445
8504
% #4 is (ignored optional) html alt text.
7446
8505
% #5 is (ignored optional) extension.
7447
 
% #6 is just the usual extra ignored arg for parsing this stuff.
 
8506
% #6 is just the usual extra ignored arg for parsing stuff.
7448
8507
\newif\ifimagevmode
7449
8508
\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
7450
8509
  \catcode`\^^M = 5     % in case we're inside an example
7452
8511
  % If the image is by itself, center it.
7453
8512
  \ifvmode
7454
8513
    \imagevmodetrue
 
8514
  \else \ifx\centersub\centerV
 
8515
    % for @center @image, we need a vbox so we can have our vertical space
 
8516
    \imagevmodetrue
 
8517
    \vbox\bgroup % vbox has better behavior than vtop herev
 
8518
  \fi\fi
 
8519
  %
 
8520
  \ifimagevmode
7455
8521
    \nobreak\medskip
7456
8522
    % Usually we'll have text after the image which will insert
7457
8523
    % \parskip glue, so insert it here too to equalize the space
7461
8527
  \fi
7462
8528
  %
7463
8529
  % Leave vertical mode so that indentation from an enclosing
7464
 
  % environment such as @quotation is respected.  On the other hand, if
7465
 
  % it's at the top level, we don't want the normal paragraph indentation.
7466
 
  \noindent
 
8530
  %  environment such as @quotation is respected.
 
8531
  % However, if we're at the top level, we don't want the
 
8532
  %  normal paragraph indentation.
 
8533
  % On the other hand, if we are in the case of @center @image, we don't
 
8534
  %  want to start a paragraph, which will create a hsize-width box and
 
8535
  %  eradicate the centering.
 
8536
  \ifx\centersub\centerV\else \noindent \fi
7467
8537
  %
7468
8538
  % Output the image.
7469
8539
  \ifpdf
7475
8545
    \epsfbox{#1.eps}%
7476
8546
  \fi
7477
8547
  %
7478
 
  \ifimagevmode \medskip \fi  % space after the standalone image
 
8548
  \ifimagevmode
 
8549
    \medskip  % space after a standalone image
 
8550
  \fi
 
8551
  \ifx\centersub\centerV \egroup \fi
7479
8552
\endgroup}
7480
8553
 
7481
8554
 
7747
8820
 
7748
8821
\message{localization,}
7749
8822
 
7750
 
% @documentlanguage is usually given very early, just after
7751
 
% @setfilename.  If done too late, it may not override everything
7752
 
% properly.  Single argument is the language (de) or locale (de_DE)
7753
 
% abbreviation.  It would be nice if we could set up a hyphenation file.
 
8823
% For single-language documents, @documentlanguage is usually given very
 
8824
% early, just after @documentencoding.  Single argument is the language
 
8825
% (de) or locale (de_DE) abbreviation.
7754
8826
%
7755
8827
{
7756
8828
  \catcode`\_ = \active
7763
8835
    \ifeof 1
7764
8836
      \documentlanguagetrywithoutunderscore{#1_\finish}%
7765
8837
    \else
 
8838
      \globaldefs = 1  % everything in the txi-LL files needs to persist
7766
8839
      \input txi-#1.tex
7767
8840
    \fi
7768
8841
    \closein 1
7769
 
  \endgroup
 
8842
  \endgroup % end raw TeX
7770
8843
\endgroup}
7771
 
}
7772
8844
%
7773
8845
% If they passed de_DE, and txi-de_DE.tex doesn't exist,
7774
8846
% try txi-de.tex.
7775
 
7776
 
\def\documentlanguagetrywithoutunderscore#1_#2\finish{%
 
8847
%
 
8848
\gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
7777
8849
  \openin 1 txi-#1.tex
7778
8850
  \ifeof 1
7779
8851
    \errhelp = \nolanghelp
7780
8852
    \errmessage{Cannot read language file txi-#1.tex}%
7781
8853
  \else
 
8854
    \globaldefs = 1  % everything in the txi-LL files needs to persist
7782
8855
    \input txi-#1.tex
7783
8856
  \fi
7784
8857
  \closein 1
7785
8858
}
 
8859
}% end of special _ catcode
7786
8860
%
7787
8861
\newhelp\nolanghelp{The given language definition file cannot be found or
7788
 
is empty.  Maybe you need to install it?  In the current directory
7789
 
should work if nowhere else does.}
7790
 
 
 
8862
is empty.  Maybe you need to install it?  Putting it in the current
 
8863
directory should work if nowhere else does.}
 
8864
 
 
8865
% This macro is called from txi-??.tex files; the first argument is the
 
8866
% \language name to set (without the "\lang@" prefix), the second and
 
8867
% third args are \{left,right}hyphenmin.
 
8868
%
 
8869
% The language names to pass are determined when the format is built.
 
8870
% See the etex.log file created at that time, e.g.,
 
8871
% /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
 
8872
%
 
8873
% With TeX Live 2008, etex now includes hyphenation patterns for all
 
8874
% available languages.  This means we can support hyphenation in
 
8875
% Texinfo, at least to some extent.  (This still doesn't solve the
 
8876
% accented characters problem.)
 
8877
%
 
8878
\catcode`@=11
 
8879
\def\txisetlanguage#1#2#3{%
 
8880
  % do not set the language if the name is undefined in the current TeX.
 
8881
  \expandafter\ifx\csname lang@#1\endcsname \relax
 
8882
    \message{no patterns for #1}%
 
8883
  \else
 
8884
    \global\language = \csname lang@#1\endcsname
 
8885
  \fi
 
8886
  % but there is no harm in adjusting the hyphenmin values regardless.
 
8887
  \global\lefthyphenmin = #2\relax
 
8888
  \global\righthyphenmin = #3\relax
 
8889
}
 
8890
 
 
8891
% Helpers for encodings.
7791
8892
% Set the catcode of characters 128 through 255 to the specified number.
7792
8893
%
7793
8894
\def\setnonasciicharscatcode#1{%
7828
8929
     \setnonasciicharscatcode\active
7829
8930
     \lattwochardefs
7830
8931
  %
7831
 
  \else \ifx \declaredencoding \latone 
 
8932
  \else \ifx \declaredencoding \latone
7832
8933
     \setnonasciicharscatcode\active
7833
8934
     \latonechardefs
7834
8935
  %
7840
8941
     \setnonasciicharscatcode\active
7841
8942
     \utfeightchardefs
7842
8943
  %
7843
 
  \else 
 
8944
  \else
7844
8945
    \message{Unknown document encoding #1, ignoring.}%
7845
8946
  %
7846
8947
  \fi % utfeight
7852
8953
 
7853
8954
% A message to be logged when using a character that isn't available
7854
8955
% the default font encoding (OT1).
7855
 
 
8956
%
7856
8957
\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}}
7857
8958
 
7858
8959
% Take account of \c (plain) vs. \, (Texinfo) difference.
7865
8966
%
7866
8967
% Latin1 (ISO-8859-1) character definitions.
7867
8968
\def\latonechardefs{%
7868
 
  \gdef^^a0{~} 
 
8969
  \gdef^^a0{\tie}
7869
8970
  \gdef^^a1{\exclamdown}
7870
 
  \gdef^^a2{\missingcharmsg{CENT SIGN}} 
 
8971
  \gdef^^a2{\missingcharmsg{CENT SIGN}}
7871
8972
  \gdef^^a3{{\pounds}}
7872
8973
  \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
7873
8974
  \gdef^^a5{\missingcharmsg{YEN SIGN}}
7874
 
  \gdef^^a6{\missingcharmsg{BROKEN BAR}} 
 
8975
  \gdef^^a6{\missingcharmsg{BROKEN BAR}}
7875
8976
  \gdef^^a7{\S}
7876
 
  \gdef^^a8{\"{}} 
7877
 
  \gdef^^a9{\copyright} 
 
8977
  \gdef^^a8{\"{}}
 
8978
  \gdef^^a9{\copyright}
7878
8979
  \gdef^^aa{\ordf}
7879
 
  \gdef^^ab{\missingcharmsg{LEFT-POINTING DOUBLE ANGLE QUOTATION MARK}} 
 
8980
  \gdef^^ab{\guillemetleft}
7880
8981
  \gdef^^ac{$\lnot$}
7881
 
  \gdef^^ad{\-} 
7882
 
  \gdef^^ae{\registeredsymbol} 
 
8982
  \gdef^^ad{\-}
 
8983
  \gdef^^ae{\registeredsymbol}
7883
8984
  \gdef^^af{\={}}
7884
8985
  %
7885
8986
  \gdef^^b0{\textdegree}
7895
8996
  \gdef^^b9{$^1$}
7896
8997
  \gdef^^ba{\ordm}
7897
8998
  %
7898
 
  \gdef^^bb{\missingcharmsg{RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK}}
 
8999
  \gdef^^bb{\guillemetright}
7899
9000
  \gdef^^bc{$1\over4$}
7900
9001
  \gdef^^bd{$1\over2$}
7901
9002
  \gdef^^be{$3\over4$}
7906
9007
  \gdef^^c2{\^A}
7907
9008
  \gdef^^c3{\~A}
7908
9009
  \gdef^^c4{\"A}
7909
 
  \gdef^^c5{\ringaccent A} 
 
9010
  \gdef^^c5{\ringaccent A}
7910
9011
  \gdef^^c6{\AE}
7911
9012
  \gdef^^c7{\cedilla C}
7912
9013
  \gdef^^c8{\`E}
7918
9019
  \gdef^^ce{\^I}
7919
9020
  \gdef^^cf{\"I}
7920
9021
  %
7921
 
  \gdef^^d0{\missingcharmsg{LATIN CAPITAL LETTER ETH}}
 
9022
  \gdef^^d0{\DH}
7922
9023
  \gdef^^d1{\~N}
7923
9024
  \gdef^^d2{\`O}
7924
9025
  \gdef^^d3{\'O}
7932
9033
  \gdef^^db{\^U}
7933
9034
  \gdef^^dc{\"U}
7934
9035
  \gdef^^dd{\'Y}
7935
 
  \gdef^^de{\missingcharmsg{LATIN CAPITAL LETTER THORN}}
 
9036
  \gdef^^de{\TH}
7936
9037
  \gdef^^df{\ss}
7937
9038
  %
7938
9039
  \gdef^^e0{\`a}
7952
9053
  \gdef^^ee{\^{\dotless i}}
7953
9054
  \gdef^^ef{\"{\dotless i}}
7954
9055
  %
7955
 
  \gdef^^f0{\missingcharmsg{LATIN SMALL LETTER ETH}}
 
9056
  \gdef^^f0{\dh}
7956
9057
  \gdef^^f1{\~n}
7957
9058
  \gdef^^f2{\`o}
7958
9059
  \gdef^^f3{\'o}
7966
9067
  \gdef^^fb{\^u}
7967
9068
  \gdef^^fc{\"u}
7968
9069
  \gdef^^fd{\'y}
7969
 
  \gdef^^fe{\missingcharmsg{LATIN SMALL LETTER THORN}}
 
9070
  \gdef^^fe{\th}
7970
9071
  \gdef^^ff{\"y}
7971
9072
}
7972
9073
 
7987
9088
 
7988
9089
% Latin2 (ISO-8859-2) character definitions.
7989
9090
\def\lattwochardefs{%
7990
 
  \gdef^^a0{~}
7991
 
  \gdef^^a1{\missingcharmsg{LATIN CAPITAL LETTER A WITH OGONEK}}
 
9091
  \gdef^^a0{\tie}
 
9092
  \gdef^^a1{\ogonek{A}}
7992
9093
  \gdef^^a2{\u{}}
7993
9094
  \gdef^^a3{\L}
7994
9095
  \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
8005
9106
  \gdef^^af{\dotaccent Z}
8006
9107
  %
8007
9108
  \gdef^^b0{\textdegree}
8008
 
  \gdef^^b1{\missingcharmsg{LATIN SMALL LETTER A WITH OGONEK}}
8009
 
  \gdef^^b2{\missingcharmsg{OGONEK}}
 
9109
  \gdef^^b1{\ogonek{a}}
 
9110
  \gdef^^b2{\ogonek{ }}
8010
9111
  \gdef^^b3{\l}
8011
9112
  \gdef^^b4{\'{}}
8012
9113
  \gdef^^b5{\v l}
8031
9132
  \gdef^^c7{\cedilla C}
8032
9133
  \gdef^^c8{\v C}
8033
9134
  \gdef^^c9{\'E}
8034
 
  \gdef^^ca{\missingcharmsg{LATIN CAPITAL LETTER E WITH OGONEK}}
 
9135
  \gdef^^ca{\ogonek{E}}
8035
9136
  \gdef^^cb{\"E}
8036
9137
  \gdef^^cc{\v E}
8037
9138
  \gdef^^cd{\'I}
8038
9139
  \gdef^^ce{\^I}
8039
9140
  \gdef^^cf{\v D}
8040
9141
  %
8041
 
  \gdef^^d0{\missingcharmsg{LATIN CAPITAL LETTER D WITH STROKE}}
 
9142
  \gdef^^d0{\DH}
8042
9143
  \gdef^^d1{\'N}
8043
9144
  \gdef^^d2{\v N}
8044
9145
  \gdef^^d3{\'O}
8047
9148
  \gdef^^d6{\"O}
8048
9149
  \gdef^^d7{$\times$}
8049
9150
  \gdef^^d8{\v R}
8050
 
  \gdef^^d9{\ringaccent U} 
 
9151
  \gdef^^d9{\ringaccent U}
8051
9152
  \gdef^^da{\'U}
8052
9153
  \gdef^^db{\H U}
8053
9154
  \gdef^^dc{\"U}
8065
9166
  \gdef^^e7{\cedilla c}
8066
9167
  \gdef^^e8{\v c}
8067
9168
  \gdef^^e9{\'e}
8068
 
  \gdef^^ea{\missingcharmsg{LATIN SMALL LETTER E WITH OGONEK}}
 
9169
  \gdef^^ea{\ogonek{e}}
8069
9170
  \gdef^^eb{\"e}
8070
9171
  \gdef^^ec{\v e}
8071
 
  \gdef^^ed{\'\i}
8072
 
  \gdef^^ee{\^\i}
 
9172
  \gdef^^ed{\'{\dotless{i}}}
 
9173
  \gdef^^ee{\^{\dotless{i}}}
8073
9174
  \gdef^^ef{\v d}
8074
9175
  %
8075
 
  \gdef^^f0{\missingcharmsg{LATIN SMALL LETTER D WITH STROKE}}
 
9176
  \gdef^^f0{\dh}
8076
9177
  \gdef^^f1{\'n}
8077
9178
  \gdef^^f2{\v n}
8078
9179
  \gdef^^f3{\'o}
8091
9192
}
8092
9193
 
8093
9194
% UTF-8 character definitions.
8094
 
 
9195
%
8095
9196
% This code to support UTF-8 is based on LaTeX's utf8.def, with some
8096
9197
% changes for Texinfo conventions.  It is included here under the GPL by
8097
9198
% permission from Frank Mittelbach and the LaTeX team.
8098
 
 
9199
%
8099
9200
\newcount\countUTFx
8100
9201
\newcount\countUTFy
8101
9202
\newcount\countUTFz
8160
9261
 
8161
9262
  \gdef\DeclareUnicodeCharacter#1#2{%
8162
9263
    \countUTFz = "#1\relax
8163
 
    \wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
 
9264
    %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
8164
9265
    \begingroup
8165
9266
      \parseXMLCharref
8166
9267
      \def\UTFviiiTwoOctets##1##2{%
8245
9346
  \DeclareUnicodeCharacter{00CE}{\^I}
8246
9347
  \DeclareUnicodeCharacter{00CF}{\"I}
8247
9348
 
 
9349
  \DeclareUnicodeCharacter{00D0}{\DH}
8248
9350
  \DeclareUnicodeCharacter{00D1}{\~N}
8249
9351
  \DeclareUnicodeCharacter{00D2}{\`O}
8250
9352
  \DeclareUnicodeCharacter{00D3}{\'O}
8257
9359
  \DeclareUnicodeCharacter{00DB}{\^U}
8258
9360
  \DeclareUnicodeCharacter{00DC}{\"U}
8259
9361
  \DeclareUnicodeCharacter{00DD}{\'Y}
 
9362
  \DeclareUnicodeCharacter{00DE}{\TH}
8260
9363
  \DeclareUnicodeCharacter{00DF}{\ss}
8261
9364
 
8262
9365
  \DeclareUnicodeCharacter{00E0}{\`a}
8276
9379
  \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}
8277
9380
  \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}
8278
9381
 
 
9382
  \DeclareUnicodeCharacter{00F0}{\dh}
8279
9383
  \DeclareUnicodeCharacter{00F1}{\~n}
8280
9384
  \DeclareUnicodeCharacter{00F2}{\`o}
8281
9385
  \DeclareUnicodeCharacter{00F3}{\'o}
8288
9392
  \DeclareUnicodeCharacter{00FB}{\^u}
8289
9393
  \DeclareUnicodeCharacter{00FC}{\"u}
8290
9394
  \DeclareUnicodeCharacter{00FD}{\'y}
 
9395
  \DeclareUnicodeCharacter{00FE}{\th}
8291
9396
  \DeclareUnicodeCharacter{00FF}{\"y}
8292
9397
 
8293
9398
  \DeclareUnicodeCharacter{0100}{\=A}
8294
9399
  \DeclareUnicodeCharacter{0101}{\=a}
8295
9400
  \DeclareUnicodeCharacter{0102}{\u{A}}
8296
9401
  \DeclareUnicodeCharacter{0103}{\u{a}}
 
9402
  \DeclareUnicodeCharacter{0104}{\ogonek{A}}
 
9403
  \DeclareUnicodeCharacter{0105}{\ogonek{a}}
8297
9404
  \DeclareUnicodeCharacter{0106}{\'C}
8298
9405
  \DeclareUnicodeCharacter{0107}{\'c}
8299
9406
  \DeclareUnicodeCharacter{0108}{\^C}
8300
9407
  \DeclareUnicodeCharacter{0109}{\^c}
 
9408
  \DeclareUnicodeCharacter{0118}{\ogonek{E}}
 
9409
  \DeclareUnicodeCharacter{0119}{\ogonek{e}}
8301
9410
  \DeclareUnicodeCharacter{010A}{\dotaccent{C}}
8302
9411
  \DeclareUnicodeCharacter{010B}{\dotaccent{c}}
8303
9412
  \DeclareUnicodeCharacter{010C}{\v{C}}
8445
9554
  \DeclareUnicodeCharacter{0233}{\=y}
8446
9555
  \DeclareUnicodeCharacter{0237}{\dotless{j}}
8447
9556
 
 
9557
  \DeclareUnicodeCharacter{02DB}{\ogonek{ }}
 
9558
 
8448
9559
  \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}
8449
9560
  \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}
8450
9561
  \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}
8618
9729
% Prevent underfull vbox error messages.
8619
9730
\vbadness = 10000
8620
9731
 
8621
 
% Don't be so finicky about underfull hboxes, either.
8622
 
\hbadness = 2000
 
9732
% Don't be very finicky about underfull hboxes, either.
 
9733
\hbadness = 6666
8623
9734
 
8624
9735
% Following George Bush, get rid of widows and orphans.
8625
9736
\widowpenalty=10000
8826
9937
 
8827
9938
\message{and turning on texinfo input format.}
8828
9939
 
 
9940
\def^^L{\par} % remove \outer, so ^L can appear in an @comment
 
9941
 
 
9942
% DEL is a comment character, in case @c does not suffice.
 
9943
\catcode`\^^? = 14
 
9944
 
8829
9945
% Define macros to output various characters with catcode for normal text.
8830
 
\catcode`\"=\other
8831
 
\catcode`\~=\other
8832
 
\catcode`\^=\other
8833
 
\catcode`\_=\other
8834
 
\catcode`\|=\other
8835
 
\catcode`\<=\other
8836
 
\catcode`\>=\other
8837
 
\catcode`\+=\other
8838
 
\catcode`\$=\other
8839
 
\def\normaldoublequote{"}
8840
 
\def\normaltilde{~}
8841
 
\def\normalcaret{^}
8842
 
\def\normalunderscore{_}
8843
 
\def\normalverticalbar{|}
8844
 
\def\normalless{<}
8845
 
\def\normalgreater{>}
8846
 
\def\normalplus{+}
8847
 
\def\normaldollar{$}%$ font-lock fix
 
9946
\catcode`\"=\other \def\normaldoublequote{"}
 
9947
\catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
 
9948
\catcode`\+=\other \def\normalplus{+}
 
9949
\catcode`\<=\other \def\normalless{<}
 
9950
\catcode`\>=\other \def\normalgreater{>}
 
9951
\catcode`\^=\other \def\normalcaret{^}
 
9952
\catcode`\_=\other \def\normalunderscore{_}
 
9953
\catcode`\|=\other \def\normalverticalbar{|}
 
9954
\catcode`\~=\other \def\normaltilde{~}
8848
9955
 
8849
9956
% This macro is used to make a character print one way in \tt
8850
9957
% (where it can probably be output as-is), and another way in other fonts,
8871
9978
\catcode`\"=\active
8872
9979
\def\activedoublequote{{\tt\char34}}
8873
9980
\let"=\activedoublequote
8874
 
\catcode`\~=\active
8875
 
\def~{{\tt\char126}}
 
9981
\catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde
8876
9982
\chardef\hat=`\^
8877
 
\catcode`\^=\active
8878
 
\def^{{\tt \hat}}
 
9983
\catcode`\^=\active \def\activehat{{\tt \hat}} \let^ = \activehat
8879
9984
 
8880
9985
\catcode`\_=\active
8881
9986
\def_{\ifusingtt\normalunderscore\_}
8885
9990
 
8886
9991
\catcode`\|=\active
8887
9992
\def|{{\tt\char124}}
 
9993
 
8888
9994
\chardef \less=`\<
8889
 
\catcode`\<=\active
8890
 
\def<{{\tt \less}}
 
9995
\catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless
8891
9996
\chardef \gtr=`\>
8892
 
\catcode`\>=\active
8893
 
\def>{{\tt \gtr}}
8894
 
\catcode`\+=\active
8895
 
\def+{{\tt \char 43}}
8896
 
\catcode`\$=\active
8897
 
\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
 
9997
\catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr
 
9998
\catcode`\+=\active \def+{{\tt \char 43}}
 
9999
\catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
 
10000
 
 
10001
% used for headline/footline in the output routine, in case the page
 
10002
% breaks in the middle of an @tex block.
 
10003
\def\texinfochars{%
 
10004
  \let< = \activeless
 
10005
  \let> = \activegtr
 
10006
  \let~ = \activetilde
 
10007
  \let^ = \activehat
 
10008
  \markupsetuplqdefault \markupsetuprqdefault
 
10009
  \let\b = \strong
 
10010
  \let\i = \smartitalic
 
10011
  % in principle, all other definitions in \tex have to be undone too.
 
10012
}
8898
10013
 
8899
10014
% If a .fmt file is being used, characters that might appear in a file
8900
10015
% name cannot be active until we have parsed the command line.
8922
10037
 
8923
10038
% In texinfo, backslash is an active character; it prints the backslash
8924
10039
% in fixed width font.
8925
 
\catcode`\\=\active
8926
 
@def@normalbackslash{{@tt@backslashcurfont}}
 
10040
\catcode`\\=\active  % @ for escape char from now on.
 
10041
 
 
10042
% The story here is that in math mode, the \char of \backslashcurfont
 
10043
% ends up printing the roman \ from the math symbol font (because \char
 
10044
% in math mode uses the \mathcode, and plain.tex sets
 
10045
% \mathcode`\\="026E).  It seems better for @backslashchar{} to always
 
10046
% print a typewriter backslash, hence we use an explicit \mathchar,
 
10047
% which is the decimal equivalent of "715c (class 7, e.g., use \fam;
 
10048
% ignored family value; char position "5C).  We can't use " for the
 
10049
% usual hex value because it has already been made active.
 
10050
@def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
 
10051
@let@backslashchar = @normalbackslash % @backslashchar{} is for user documents.
 
10052
 
8927
10053
% On startup, @fixbackslash assigns:
8928
10054
%  @let \ = @normalbackslash
8929
 
 
8930
10055
% \rawbackslash defines an active \ to do \backslashcurfont.
8931
10056
% \otherbackslash defines an active \ to be a literal `\' character with
8932
 
% catcode other.
 
10057
% catcode other.  We switch back and forth between these.
8933
10058
@gdef@rawbackslash{@let\=@backslashcurfont}
8934
10059
@gdef@otherbackslash{@let\=@realbackslash}
8935
10060
 
8936
10061
% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
8937
 
% the literal character `\'.
8938
 
8939
 
@def@normalturnoffactive{%
8940
 
  @let\=@normalbackslash
8941
 
  @let"=@normaldoublequote
8942
 
  @let~=@normaltilde
8943
 
  @let^=@normalcaret
8944
 
  @let_=@normalunderscore
8945
 
  @let|=@normalverticalbar
8946
 
  @let<=@normalless
8947
 
  @let>=@normalgreater
8948
 
  @let+=@normalplus
8949
 
  @let$=@normaldollar %$ font-lock fix
8950
 
  @unsepspaces
 
10062
% the literal character `\'.  Also revert - to its normal character, in
 
10063
% case the active - from code has slipped in.
 
10064
%
 
10065
{@catcode`- = @active
 
10066
 @gdef@normalturnoffactive{%
 
10067
   @let-=@normaldash
 
10068
   @let"=@normaldoublequote
 
10069
   @let$=@normaldollar %$ font-lock fix
 
10070
   @let+=@normalplus
 
10071
   @let<=@normalless
 
10072
   @let>=@normalgreater
 
10073
   @let\=@normalbackslash
 
10074
   @let^=@normalcaret
 
10075
   @let_=@normalunderscore
 
10076
   @let|=@normalverticalbar
 
10077
   @let~=@normaltilde
 
10078
   @markupsetuplqdefault
 
10079
   @markupsetuprqdefault
 
10080
   @unsepspaces
 
10081
 }
8951
10082
}
8952
10083
 
8953
10084
% Make _ and + \other characters, temporarily.
8976
10107
% Say @foo, not \foo, in error messages.
8977
10108
@escapechar = `@@
8978
10109
 
 
10110
% These (along with & and #) are made active for url-breaking, so need
 
10111
% active definitions as the normal characters.
 
10112
@def@normaldot{.}
 
10113
@def@normalquest{?}
 
10114
@def@normalslash{/}
 
10115
 
8979
10116
% These look ok in all fonts, so just make them not special.
8980
 
@catcode`@& = @other
8981
 
@catcode`@# = @other
8982
 
@catcode`@% = @other
8983
 
 
 
10117
% @hashchar{} gets its own user-level command, because of #line.
 
10118
@catcode`@& = @other @def@normalamp{&}
 
10119
@catcode`@# = @other @def@normalhash{#}
 
10120
@catcode`@% = @other @def@normalpercent{%}
 
10121
 
 
10122
@let @hashchar = @normalhash
 
10123
 
 
10124
@c Finally, make ` and ' active, so that txicodequoteundirected and
 
10125
@c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}.  If we
 
10126
@c don't make ` and ' active, @code will not get them as active chars.
 
10127
@c Do this last of all since we use ` in the previous @catcode assignments.
 
10128
@catcode`@'=@active
 
10129
@catcode`@`=@active
 
10130
@markupsetuplqdefault
 
10131
@markupsetuprqdefault
8984
10132
 
8985
10133
@c Local variables:
8986
10134
@c eval: (add-hook 'write-file-hooks 'time-stamp)
8992
10140
 
8993
10141
@c vim:sw=2:
8994
10142
 
 
10143
@ignore
 
10144
   arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
 
10145
@end ignore