596
582
\newhelp\EMsimple{Press RETURN to continue.}
599
%% Simple single-character @ commands
602
% Kludge this until the fonts are right (grr).
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.
612
% Used to generate quoted braces.
613
\def\mylbrace {{\tt\char123}}
614
\def\myrbrace {{\tt\char125}}
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
625
!gdef!lbraceatcmd[@{]%
626
!gdef!rbraceatcmd[@}]%
629
% @comma{} to avoid , parsing problems.
632
% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
633
% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
636
\def\ringaccent#1{{\accent23 #1}}
641
% Other special characters: @questiondown @exclamdown @ordf @ordm
642
% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
643
\def\questiondown{?`}
645
\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
646
\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
648
% Dotless i and dotless j, used for accents.
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}%
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.)
662
\edef\TeX{\TeX \spacefactor=1000 }
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).
673
\vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}%
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
1092
% @asis just yields its argument. Used with @table, for example.
1096
% @math outputs its argument in math mode.
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.
1103
\catcode`\_ = \active
1104
\gdef\mathunderscore{%
1106
\def_{\ifnum\fam=\slfam \_\else\sb\fi}%
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 @\.
1114
% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
1115
\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
1120
\let\\ = \mathbackslash
1122
% make the texinfo accent commands work in math mode
1134
\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
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).
1141
\catcode`^ = \active
1142
\catcode`< = \active
1143
\catcode`> = \active
1144
\catcode`+ = \active
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}
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.
1167
\setbox0=\hbox{...}% get width of three periods
1174
\hskip 0pt plus.25fil
1175
.\hskip 0pt plus1fil
1176
.\hskip 0pt plus1fil
1177
.\hskip 0pt plus.5fil
1181
% @enddots{} is an end-of-sentence ellipsis.
1185
\spacefactor=\endofsentencespacefactor
1188
% @comma{} is so commas can be inserted into text without messing up
1189
% Texinfo's parsing.
1193
1034
% @refill is a no-op.
1194
1035
\let\refill=\relax
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).
1279
% double active backslashes.
1281
{\catcode`\@=0 \catcode`\\=\active
1282
@gdef@activebackslashdouble{%
1284
@let\=@doublebackslash}
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.
1293
% #1 is the tokens to replace.
1294
% #2 is the replacement.
1295
% #3 is the control sequence with the string.
1297
\def\HyPsdSubst#1#2#3{%
1298
\def\HyPsdReplace##1#1##2\END{%
1304
\HyPsdReplace##2\END
1308
\xdef#3{\expandafter\HyPsdReplace#3#1\END}%
1310
\long\def\HyReturnAfterFi#1\fi{\fi#1}
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}%
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.
1121
% #1 is a control sequence in which to do the replacements,
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.
1128
% The expandable \pdfescapestring primitive escapes parentheses,
1129
% backslashes, and other special chars.
1130
\xdef#1{\pdfescapestring{#1}}%
1320
1134
\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
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}%
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
1375
1197
\let\pdfimgext=\empty
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}%
1387
\else \gdef\pdfimgext{pdf}%
1209
\else \gdef\pdfimgext{jpeg}%
1389
\else \gdef\pdfimgext{JPG}%
1211
\else \gdef\pdfimgext{jpg}%
1391
\else \gdef\pdfimgext{jpeg}%
1213
\else \gdef\pdfimgext{png}%
1393
\else \gdef\pdfimgext{jpg}%
1215
\else \gdef\pdfimgext{PDF}%
1395
\else \gdef\pdfimgext{png}%
1217
\else \gdef\pdfimgext{pdf}%
1531
1347
% Latin 2 (0xea) gets translated to a | character. Info from
1532
1348
% Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
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.
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
1365
{\catcode`[=1 \catcode`]=2
1366
\catcode`{=\other \catcode`}=\other
1367
\gdef\lbracecharliteral[{]%
1368
\gdef\rbracecharliteral[}]%
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
1374
\addtokens{\filename}{\PP}%
1375
\advance\filenamelength by 1
1552
\def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
1378
\def\getfilename#1{%
1380
% If we don't expand the argument now, \skipspaces will get
1381
% snagged on things like "@value{foo}".
1383
\expandafter\skipspaces\temp|\relax
1553
1385
\ifnum\pdftexversion < 14
1554
1386
\let \startlink \pdfannotlink
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
2358
% I wish the USA used A4 paper.
2359
2206
% --karl, 24jan03.
2362
2208
% Set up the default fonts, so we can use them for creating boxes.
2364
2210
\definetextfontsizexi
2366
% Define these so they can be easily changed for other fonts.
2367
\def\angleleft{$\langle$}
2368
\def\angleright{$\rangle$}
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.
2220
\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
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.
2230
%\newif\ifmarkupfile % @file == @samp.
2231
%\newif\ifmarkupoption % @option == @samp.
2234
%\newif\ifmarkupenv % @env == @code.
2235
%\newif\ifmarkupcommand % @command == @code.
2236
\newif\ifmarkuptex % @tex (and part of @math, for now).
2237
\newif\ifmarkupexample
2239
\newif\ifmarkupverbatim
2241
\let\currentmarkupstyle\empty
2243
\def\setupmarkupstyle#1{%
2244
\csname markup#1true\endcsname
2245
\def\currentmarkupstyle{#1}%
2249
\let\markupstylesetup\empty
2251
\def\defmarkupstylesetup#1{%
2252
\expandafter\def\expandafter\markupstylesetup
2253
\expandafter{\markupstylesetup #1}%
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
2264
\defmarkupstylesetup\markupsetuprq{%
2265
\expandafter\let\expandafter \temp
2266
\csname markupsetuprq\currentmarkupstyle\endcsname
2267
\ifx\temp\relax \markupsetuprqdefault \else \temp \fi
2274
\gdef\markupsetuplqdefault{\let`\lq}
2275
\gdef\markupsetuprqdefault{\let'\rq}
2277
\gdef\markupsetcodequoteleft{\let`\codequoteleft}
2278
\gdef\markupsetcodequoteright{\let'\codequoteright}
2281
\let\markupsetuplqcode \markupsetcodequoteleft
2282
\let\markupsetuprqcode \markupsetcodequoteright
2284
\let\markupsetuplqexample \markupsetcodequoteleft
2285
\let\markupsetuprqexample \markupsetcodequoteright
2287
\let\markupsetuplqkbd \markupsetcodequoteleft
2288
\let\markupsetuprqkbd \markupsetcodequoteright
2290
\let\markupsetuplqsamp \markupsetcodequoteleft
2291
\let\markupsetuprqsamp \markupsetcodequoteright
2293
\let\markupsetuplqverb \markupsetcodequoteleft
2294
\let\markupsetuprqverb \markupsetcodequoteright
2296
\let\markupsetuplqverbatim \markupsetcodequoteleft
2297
\let\markupsetuprqverbatim \markupsetcodequoteright
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.
2305
\def\codequoteright{%
2306
\expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
2307
\expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
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.
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.
2327
% Commands to set the quote options.
2329
\parseargdef\codequoteundirected{%
2332
\expandafter\let\csname SETtxicodequoteundirected\endcsname
2334
\else\ifx\temp\offword
2335
\expandafter\let\csname SETtxicodequoteundirected\endcsname
2338
\errhelp = \EMsimple
2339
\errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
2343
\parseargdef\codequotebacktick{%
2346
\expandafter\let\csname SETtxicodequotebacktick\endcsname
2348
\else\ifx\temp\offword
2349
\expandafter\let\csname SETtxicodequotebacktick\endcsname
2352
\errhelp = \EMsimple
2353
\errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
2357
% [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
2358
\def\noligaturesquoteleft{\relax\lq}
2370
2360
% Count depth in font-changes, for error checks
2371
2361
\newcount\fontdepth \fontdepth=0
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}
2379
%% Add scribe-like font environments, plus @l for inline lisp (usually sans
2380
%% serif) and @ii for TeX italic
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}
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}
2393
% like \smartslanted except unconditionally use \sl. We never want
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{%
2370
{{\ttsl #2}\let\next=\relax}%
2371
{\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
2374
\def\smartslanted{\dosmartslant\sl}
2375
\def\smartitalic{\dosmartslant\it}
2377
% Output an italic correction unless \next (presumed to be the following
2378
% character) is such as not to need one.
2379
\def\smartitaliccorrection{%
2384
\else\ifx\next\comma%
2390
% Unconditional use \ttsl, and no ic. @var is set to this for defuns.
2391
\def\ttslanted#1{{\ttsl #1}}
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}
2399
\let\saveaftersmartic = \aftersmartic
2400
\def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
2397
2404
\let\i=\smartitalic
2398
2405
\let\slanted=\smartslanted
2399
\let\var=\smartslanted
2400
2406
\let\dfn=\smartslanted
2401
2407
\let\emph=\smartitalic
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
2414
% @b, explicit bold. Also @strong.
2404
2415
\def\b#1{{\bf #1}}
2474
2476
\plainfrenchspacing
2479
\null % reset spacefactor to 1000
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.
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.
2490
% and arrange explicitly to hyphenate at a dash. -- rms.
2490
2492
\catcode`\-=\active \catcode`\_=\active
2491
2493
\catcode`\'=\active \catcode`\`=\active
2494
\global\let'=\rq \global\let`=\lq % default definitions
2493
2496
\global\def\code{\begingroup
2494
\catcode\rquoteChar=\active \catcode\lquoteChar=\active
2495
\let'\codequoteright \let`\codequoteleft
2497
\setupmarkupstyle{code}%
2498
% The following should really be moved into \setupmarkupstyle handlers.
2497
2499
\catcode\dashChar=\active \catcode\underChar=\active
2498
2500
\ifallowcodebreaks
2500
2502
\let_\codeunder
2503
2505
\let_\realunder
2507
% Given -foo (with a single dash), we do not want to allow a break
2509
\global\let\codedashprev=\codedash
2514
\gdef\codedash{\futurelet\next\codedashfinish}
2515
\gdef\codedashfinish{%
2516
\normaldash % always output the dash character itself.
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
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
2534
\def\codex #1{\tclose{#1}\endgroup}
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.)
2539
2563
\allowcodebreaksfalse
2541
2565
\errhelp = \EMsimple
2542
\errmessage{Unknown @allowcodebreaks option `\txiarg'}%
2566
\errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
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.
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
2583
\def\urefnobreak#1{\dourefnobreak #1,,,\finish}
2584
\def\dourefnobreak#1,#2,#3,#4\finish{\begingroup
2587
\setbox0 = \hbox{\ignorespaces #3}%
2589
\unhbox0 % third arg given, show only that
2591
\setbox0 = \hbox{\ignorespaces #2}%
2594
\unhbox0 % PDF: 2nd arg given, show only it
2596
\unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
2599
\code{#1}% only url given, so show it
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
2612
\setbox0 = \hbox{\ignorespaces #3}%
2614
\unhbox0 % third arg given, show only that
2616
\setbox0 = \hbox{\ignorespaces #2}%
2619
\unhbox0 % PDF: 2nd arg given, show only it
2621
\unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url
2624
\urefcode{#1}% only url given, so show it
2630
% Allow line breaks around only a few characters (only).
2632
\catcode\ampChar=\active \catcode\dotChar=\active
2633
\catcode\hashChar=\active \catcode\questChar=\active
2634
\catcode\slashChar=\active
2639
\global\def\urefcode{\begingroup
2640
\setupmarkupstyle{code}%
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}
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 }
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}
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
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.
2683
\parseargdef\urefbreakstyle{%
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}
2692
\errhelp = \EMsimple
2693
\errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
2696
\def\wordafter{after}
2697
\def\wordbefore{before}
2700
\urefbreakstyle after
2702
% @url synonym for @uref, since that's how everyone uses it.
2706
% rms does not like angle brackets --karl, 17may97.
2707
% So now @email is just like @uref, unless we are pdf.
2709
%\def\email#1{\angleleft{\tt #1}\angleright}
2711
\def\email#1{\doemail#1,,\finish}
2712
\def\doemail#1,#2,#3\finish{\begingroup
2715
\setbox0 = \hbox{\ignorespaces #2}%
2716
\ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
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}%
2561
2735
\errhelp = \EMsimple
2562
\errmessage{Unknown @kbdinputstyle option `\txiarg'}%
2736
\errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
2565
2739
\def\worddistinct{distinct}
2566
2740
\def\wordexample{example}
2567
2741
\def\wordcode{code}
2569
% Default is `distinct.'
2743
% Default is `distinct'.
2570
2744
\kbdinputstyle distinct
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}}
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}
2578
% For @indicateurl, @env, @command quotes seem unnecessary, so use \code.
2579
\let\indicateurl=\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
2758
% definition of @key that produces a lozenge. Doesn't adjust to text size.
2759
%\setfont\keyrm\rmshape{8}{1000}{OT1}
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}}}}
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.
2772
\def\key#1{{\setupmarkupstyle{key}%
2774
\ifmonospace\else\tt\fi
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}
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.
2596
\def\uref#1{\douref #1,,,\finish}
2597
\def\douref#1,#2,#3,#4\finish{\begingroup
2600
\setbox0 = \hbox{\ignorespaces #3}%
2602
\unhbox0 % third arg given, show only that
2604
\setbox0 = \hbox{\ignorespaces #2}%
2607
\unhbox0 % PDF: 2nd arg given, show only it
2609
\unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
2612
\code{#1}% only url given, so show it
2618
% @url synonym for @uref, since that's how everyone uses it.
2622
% rms does not like angle brackets --karl, 17may97.
2623
% So now @email is just like @uref, unless we are pdf.
2625
%\def\email#1{\angleleft{\tt #1}\angleright}
2627
\def\email#1{\doemail#1,,\finish}
2628
\def\doemail#1,#2,#3\finish{\begingroup
2631
\setbox0 = \hbox{\ignorespaces #2}%
2632
\ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
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.
2644
\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
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.
2649
2787
\def\dmn#1{\thinspace #1}
2651
\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
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}
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
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.
2667
2798
\def\acronym#1{\doacronym #1,,\finish}
2668
2799
\def\doacronym#1,#2,#3\finish{%
2669
2800
{\selectfonts\lsize #1}%
2683
2815
\ifx\temp\empty \else
2684
2816
\space ({\unsepspaces \ignorespaces \temp \unskip})%
2818
\null % reset \spacefactor=1000
2821
% @asis just yields its argument. Used with @table, for example.
2825
% @math outputs its argument in math mode.
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.
2832
\catcode`\_ = \active
2833
\gdef\mathunderscore{%
2835
\def_{\ifnum\fam=\slfam \_\else\sb\fi}%
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.
2842
% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
2843
\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
2848
\let\\ = \mathbackslash
2850
% make the texinfo accent commands work in math mode
2862
\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
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).
2869
\catcode`^ = \active
2870
\catcode`< = \active
2871
\catcode`> = \active
2872
\catcode`+ = \active
2873
\catcode`' = \active
2879
\let' = \ptexquoteright
2883
% ctrl is no longer a Texinfo command, but leave this definition for fun.
2884
\def\ctrl #1{{\tt \rawbackslash \hat}#1}
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.
2890
\def\outfmtnametex{tex}
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
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
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.
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.
2922
% @inlineifset{VAR, TEXT} expands TEXT if VAR is @set.
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
2931
% @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set.
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
2943
% @@ prints an @, as does @atchar{}.
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=\}
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[@}]%
2966
% @comma{} to avoid , parsing problems.
2969
% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
2970
% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
2972
\let\dotaccent = \ptexdot
2973
\def\ringaccent#1{{\accent23 #1}}
2974
\let\tieaccent = \ptext
2975
\let\ubaraccent = \ptexb
2976
\let\udotaccent = \d
2978
% Other special characters: @questiondown @exclamdown @ordf @ordm
2979
% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
2980
\def\questiondown{?`}
2982
\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
2983
\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
2985
% Dotless i and dotless j, used for accents.
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}%
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.)
2999
\edef\TeX{\TeX \spacefactor=1000 }
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).
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$%
3016
% For 11pt, we can use our lllsize.
3017
\selectfonts\lllsize A%
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}
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.
3040
\setbox0=\hbox{...}% get width of three periods
3047
\hskip 0pt plus.25fil
3048
.\hskip 0pt plus1fil
3049
.\hskip 0pt plus1fil
3050
.\hskip 0pt plus.5fil
3054
% @enddots{} is an end-of-sentence ellipsis.
3058
\spacefactor=\endofsentencespacefactor
3061
% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
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.
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}}
3073
% The @error{} command.
3074
% Adapted from the TeXbook's \boxit.
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}
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.
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}
3094
\def\error{\leavevmode\lower.7ex\copy\errorbox}
2688
3096
% @pounds{} is a sterling sign, which Knuth put in the CM italic font.
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.
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
2702
3110
% feymr - regular
2703
3111
% feymo - slanted
2705
3113
% feybo - bold slanted
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.
2711
3119
% Also doesn't work in math. Do we need to do math with euro symbols?
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.
2722
3130
% There is only one designed size (nominal 10pt), so we always scale
2723
3131
% that to the current nominal size.
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.
2728
3136
\def\eurosize{\csname\curfontsize nominalsize\endcsname}%
2730
\ifx\curfontstyle\bfstylename
3138
\ifx\curfontstyle\bfstylename
2732
3140
\font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
2735
3143
\font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
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
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
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}}
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.
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
3177
\ifx\temp\macrocharA\Aogonek
3178
\else\ifx\temp\macrochara\aogonek
3179
\else\ifx\temp\macrocharE\Eogonek
3180
\else\ifx\temp\macrochare\eogonek
3182
\ecfont \setbox0=\hbox{#1}%
3183
\ifdim\ht0=1ex\accent"0C #1%
3184
\else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
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}
3194
% Use the ec* fonts (cm-super in outline format) for non-CM glyphs.
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
2761
\font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
3204
\font\thisecfont = ectt\ecsize \space at \nominalsize
2764
\font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
3206
\ifx\curfontstyle\bfstylename
3208
\font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
3211
\font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
4982
5570
\let\top\unnumbered
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}%
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}%
4996
5586
\let\appendixsec\appendixsection
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}%
5005
\outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numberedsubseczzz
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}%
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}%
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}%
5677
6295
\message{environments,}
5678
6296
% @foo ... @end foo.
5680
% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
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.
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}}
5692
% The @error{} command.
5693
% Adapted from the TeXbook's \boxit.
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}
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.
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}
5713
\def\error{\leavevmode\lower.7ex\copy\errorbox}
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.
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
6055
6720
% Setup for the @verbatim environment
6057
% Real tab expansion
6722
% Real tab expansion.
6058
6723
\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
6060
\def\starttabbox{\setbox0=\hbox\bgroup}
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
6069
\def\codequoteright{%
6070
\expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
6071
\expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
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.
6081
\def\codequoteleft{%
6082
\expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
6083
\expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
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.
6732
\def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
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
6102
\gdef\rquoteexpand{\catcode\rquoteChar=\active \def'{\codequoteright}}%
6105
\gdef\lquoteexpand{\catcode\lquoteChar=\active \def`{\codequoteleft}}%
6107
\gdef\quoteexpand{\rquoteexpand \lquoteexpand}%
6110
6748
% start the verbatim environment.
6111
6749
\def\setupverbatim{%
6112
6750
\let\nonarrowing = t%
6114
% Easiest (and conventionally used) font for verbatim
6116
\def\par{\leavevmode\egroup\box0\endgraf}%
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}%
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}%
6671
7377
\usembodybackslash
7380
\def\macroargctxt{% used when scanning invocations
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.
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):
7392
\def\\{\normalbackslash}%
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.
7398
% \anythingelse will almost certainly be an error of some kind.
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.
6685
7407
{\catcode`@=0 @catcode`@\=@active
6686
7408
@gdef@usembodybackslash{@let\=@mbodybackslash}
6687
7409
@gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
6689
7411
\expandafter\def\csname macarg.\endcsname{\realbackslash}
7413
\def\margbackslash#1{\char`\#1 }
6691
7415
\def\macro{\recursivefalse\parsearg\macroxxx}
6692
7416
\def\rmacro{\recursivetrue\parsearg\macroxxx}
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
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}
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}}
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
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.
6752
7490
% That gets used by \mbodybackslash (above).
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.
6759
7497
% The same technique is used to protect \eatspaces till just before
6760
7498
% the macro is used.
6762
\def\parsemargdef#1;{\paramno=0\def\paramlist{}%
6763
\let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,}
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.
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).
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{}%
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
7524
\parsemmanyargdef@@#1,;,% 10 or more arguments
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,}%
7536
\def\parsemmanyargdef@@#1,{%
7537
\if#1;\let\next=\relax
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
7546
\expandafter\edef\tempa
7547
{\noexpand\noexpand\noexpand\the\toks\the\paramno}%
7548
\advance\paramno by 1\relax
6773
7551
% These two commands read recursive and nonrecursive macro bodies.
6774
7552
% (They're different since rec and nonrec macros end differently.)
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}%
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
7565
\long\def\nillm@{\nil@}%
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
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@}%
7581
\def\argvaluelist{#3,\nil@}%
7592
\ifx\paramlist\nilm@
7593
% Some sanity check needed here that \argvaluelist is also empty.
7594
\ifx\argvaluelist\nillm@
7596
\errhelp = \EMsimple
7597
\errmessage{Too many arguments in macro `\macroname'!}%
7599
\let\next\macargexpandinbody@
7601
\ifx\argvaluelist\nillm@
7602
% No more arguments values passed to macro. Set remaining named-arg
7604
\let\next\setemptyargvalues@
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@@
7627
\expandafter\expandafter\expandafter\def
7628
\expandafter\expandafter\expandafter#2%
7629
\expandafter\expandafter\expandafter{%
7633
% Replace arguments by their values in the macro body, and place the result
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.
7640
% First we save the token context, and initialize argument numbering.
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
7655
\expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
7658
\def\macargexpandinbody@{%
7659
%% Define the named-macro outside of this group and then close this group.
7663
% First the replace in body the macro arguments by their values, the result
7666
% Then we point at the \norecurse or \gobble (for recursive) macro value
7668
\expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
7669
% Depending on whether it is recursive or not, we need some tailing
7676
% And now we do the real job:
7677
\edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
7681
\def\putargsintokens@#1,{%
7682
\if#1;\let\next\relax
7684
\let\next\putargsintokens@
7685
% First we allocate the new token list register, and give it a temporary
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
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}
7703
% Tailing missing arguments are set to empty
7704
\def\setemptyargvalues@{%
7705
\ifx\paramlist\nilm@
7706
\let\next\macargexpandinbody@
7708
\expandafter\setemptyargvaluesparser@\paramlist\endargs@
7709
\let\next\setemptyargvalues@
7714
\def\setemptyargvaluesparser@#1,#2\endargs@{%
7715
\expandafter\def\expandafter\@tempa\expandafter{%
7716
\expandafter\def\csname macarg.#1\endcsname{}}%
7717
\push@\@tempa\macargdeflist@
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@{%
7728
\long\def\longpop@#1#2#3,#4\endargs@{%
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.
6786
7739
\def\defmacro{%
6787
7740
\let\hash=##% convert placeholders to macro parameter chars
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}}%
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
7762
\expandafter\expandafter
7763
\csname\the\macname xxx\endcsname
7764
\paramlist{\egroup\noexpand\scanmacro{\temp}}%
7766
\expandafter\xdef\csname\the\macname\endcsname{%
7767
\noexpand\getargvals@{\the\macname}{\argl}%
7769
\global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
7770
\global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
7776
\expandafter\xdef\csname\the\macname\endcsname{%
7777
\noexpand\norecurse{\the\macname}%
7778
\noexpand\scanmacro{\temp}\egroup}%
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
6808
\expandafter\expandafter
7782
\noexpand\braceorline
7783
\expandafter\noexpand\csname\the\macname xxx\endcsname}%
7784
\expandafter\xdef\csname\the\macname xxx\endcsname##1{%
7786
\noexpand\norecurse{\the\macname}%
7787
\noexpand\scanmacro{\temp}\egroup}%
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
7797
\expandafter\expandafter
6809
7798
\csname\the\macname xxx\endcsname
6810
\paramlist{\egroup\noexpand\scanmacro{\temp}}%
6815
\expandafter\xdef\csname\the\macname\endcsname{%
6816
\noexpand\norecurse{\the\macname}%
6817
\noexpand\scanmacro{\temp}\egroup}%
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{%
6825
\noexpand\norecurse{\the\macname}%
6826
\noexpand\scanmacro{\temp}\egroup}%
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
6835
\expandafter\expandafter
6836
\csname\the\macname xxx\endcsname
6839
\noexpand\norecurse{\the\macname}%
6840
\noexpand\scanmacro{\temp}\egroup}%
7801
\noexpand\norecurse{\the\macname}%
7802
\noexpand\scanmacro{\temp}\egroup}%
7804
\expandafter\xdef\csname\the\macname\endcsname{%
7805
\noexpand\getargvals@{\the\macname}{\argl}%
7807
\global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
7808
\global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse
7813
\catcode `\@\texiatcatcode\relax
6844
7815
\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
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).
6850
7822
\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
6851
7823
\def\braceorlinexxx{%
6852
7824
\ifx\nchar\bgroup\else
6951
7946
\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
6952
7947
\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
6953
7948
\def\ref#1{\xrefX[#1,,,,,,,]}
7951
\newbox\printedrefnamebox
7952
\newbox\infofilenamebox
7953
\newbox\printedmanualbox
6954
7955
\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
7958
% Get args without leading/trailing spaces.
7959
\def\printedrefname{\ignorespaces #3}%
7960
\setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
7962
\def\infofilename{\ignorespaces #4}%
7963
\setbox\infofilenamebox = \hbox{\infofilename\unskip}%
6956
7965
\def\printedmanual{\ignorespaces #5}%
6957
\def\printedrefname{\ignorespaces #3}%
6958
\setbox1=\hbox{\printedmanual\unskip}%
6959
\setbox0=\hbox{\printedrefname\unskip}%
7966
\setbox\printedmanualbox = \hbox{\printedmanual\unskip}%
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}%
6966
% Use the actual chapter/section title appear inside
6967
% the square brackets. Use the real section title if we have it.
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}%
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}{}}%
6976
7986
% Otherwise just copy the Info node name.
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".
8037
\ifdim\wd\printedrefnamebox = 0pt
7021
8038
\refx{#1-snt}{}%
7023
8040
\printedrefname
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".
8045
\ifdim \wd\printedmanualbox > 0pt
7029
8046
\space \putwordin{} \cite{\printedmanual}%
7032
8049
% node/anchor (non-float) references.
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.
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.
8058
\ifdim \wd\printedmanualbox > 0pt
8059
% Cross-manual reference with a printed manual name.
8061
\crossmanualxref{\cite{\printedmanual\unskip}}%
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.
8068
\crossmanualxref{\code{\infofilename\unskip}}%
8071
% Reference within this manual.
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
7764
8836
\documentlanguagetrywithoutunderscore{#1_\finish}%
8838
\globaldefs = 1 % everything in the txi-LL files needs to persist
7766
8839
\input txi-#1.tex
8842
\endgroup % end raw TeX
7773
8845
% If they passed de_DE, and txi-de_DE.tex doesn't exist,
7774
8846
% try txi-de.tex.
7776
\def\documentlanguagetrywithoutunderscore#1_#2\finish{%
8848
\gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
7777
8849
\openin 1 txi-#1.tex
7779
8851
\errhelp = \nolanghelp
7780
8852
\errmessage{Cannot read language file txi-#1.tex}%
8854
\globaldefs = 1 % everything in the txi-LL files needs to persist
7782
8855
\input txi-#1.tex
8859
}% end of special _ catcode
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.}
8862
is empty. Maybe you need to install it? Putting it in the current
8863
directory should work if nowhere else does.}
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.
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.
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.)
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}%
8884
\global\language = \csname lang@#1\endcsname
8886
% but there is no harm in adjusting the hyphenmin values regardless.
8887
\global\lefthyphenmin = #2\relax
8888
\global\righthyphenmin = #3\relax
8891
% Helpers for encodings.
7791
8892
% Set the catcode of characters 128 through 255 to the specified number.
7793
8894
\def\setnonasciicharscatcode#1{%
8923
10038
% In texinfo, backslash is an active character; it prints the backslash
8924
10039
% in fixed width font.
8926
@def@normalbackslash{{@tt@backslashcurfont}}
10040
\catcode`\\=\active % @ for escape char from now on.
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.
8927
10053
% On startup, @fixbackslash assigns:
8928
10054
% @let \ = @normalbackslash
8930
10055
% \rawbackslash defines an active \ to do \backslashcurfont.
8931
10056
% \otherbackslash defines an active \ to be a literal `\' character with
10057
% catcode other. We switch back and forth between these.
8933
10058
@gdef@rawbackslash{@let\=@backslashcurfont}
8934
10059
@gdef@otherbackslash{@let\=@realbackslash}
8936
10061
% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
8937
% the literal character `\'.
8939
@def@normalturnoffactive{%
8940
@let\=@normalbackslash
8941
@let"=@normaldoublequote
8944
@let_=@normalunderscore
8945
@let|=@normalverticalbar
8947
@let>=@normalgreater
8949
@let$=@normaldollar %$ font-lock fix
10062
% the literal character `\'. Also revert - to its normal character, in
10063
% case the active - from code has slipped in.
10065
{@catcode`- = @active
10066
@gdef@normalturnoffactive{%
10068
@let"=@normaldoublequote
10069
@let$=@normaldollar %$ font-lock fix
10072
@let>=@normalgreater
10073
@let\=@normalbackslash
10075
@let_=@normalunderscore
10076
@let|=@normalverticalbar
10078
@markupsetuplqdefault
10079
@markupsetuprqdefault
8953
10084
% Make _ and + \other characters, temporarily.