/contrib/groff/doc/texinfo.tex
https://bitbucket.org/freebsd/freebsd-head/ · TeX · 7086 lines · 4032 code · 590 blank · 2464 comment · 6 complexity · 134d44e7458e72b57c3cd4812ecd6b98 MD5 · raw file
Large files are truncated click here to view the full file
- % texinfo.tex -- TeX macros to handle Texinfo files.
- %
- % Load plain if necessary, i.e., if running under initex.
- \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
- %
- \def\texinfoversion{2004-11-25.16}
- %
- % Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
- % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
- % Foundation, Inc.
- %
- % This texinfo.tex file is free software; you can redistribute it and/or
- % modify it under the terms of the GNU General Public License as
- % published by the Free Software Foundation; either version 2, or (at
- % your option) any later version.
- %
- % This texinfo.tex file is distributed in the hope that it will be
- % useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- % General Public License for more details.
- %
- % You should have received a copy of the GNU General Public License
- % along with this texinfo.tex file; see the file COPYING. If not, write
- % to the Free Software Foundation, Inc., 51 Franklin St - Fifth Floor,
- % Boston, MA 02110-1301, USA.
- %
- % As a special exception, when this file is read by TeX when processing
- % a Texinfo source document, you may use the result without
- % restriction. (This has been our intent since Texinfo was invented.)
- %
- % Please try the latest version of texinfo.tex before submitting bug
- % reports; you can get the latest version from:
- % http://www.gnu.org/software/texinfo/ (the Texinfo home page), or
- % ftp://tug.org/tex/texinfo.tex
- % (and all CTAN mirrors, see http://www.ctan.org).
- % The texinfo.tex in any given distribution could well be out
- % of date, so if that's what you're using, please check.
- %
- % Send bug reports to bug-texinfo@gnu.org. Please include including a
- % complete document in each bug report with which we can reproduce the
- % problem. Patches are, of course, greatly appreciated.
- %
- % To process a Texinfo manual with TeX, it's most reliable to use the
- % texi2dvi shell script that comes with the distribution. For a simple
- % manual foo.texi, however, you can get away with this:
- % tex foo.texi
- % texindex foo.??
- % tex foo.texi
- % tex foo.texi
- % dvips foo.dvi -o # or whatever; this makes foo.ps.
- % The extra TeX runs get the cross-reference information correct.
- % Sometimes one run after texindex suffices, and sometimes you need more
- % than two; texi2dvi does it as many times as necessary.
- %
- % It is possible to adapt texinfo.tex for other languages, to some
- % extent. You can get the existing language-specific files from the
- % full Texinfo distribution.
- %
- % The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
- \message{Loading texinfo [version \texinfoversion]:}
- % If in a .fmt file, print the version number
- % and turn on active characters that we couldn't do earlier because
- % they might have appeared in the input file name.
- \everyjob{\message{[Texinfo version \texinfoversion]}%
- \catcode`+=\active \catcode`\_=\active}
- \message{Basics,}
- \chardef\other=12
- % We never want plain's \outer definition of \+ in Texinfo.
- % For @tex, we can use \tabalign.
- \let\+ = \relax
- % Save some plain tex macros whose names we will redefine.
- \let\ptexb=\b
- \let\ptexbullet=\bullet
- \let\ptexc=\c
- \let\ptexcomma=\,
- \let\ptexdot=\.
- \let\ptexdots=\dots
- \let\ptexend=\end
- \let\ptexequiv=\equiv
- \let\ptexexclam=\!
- \let\ptexfootnote=\footnote
- \let\ptexgtr=>
- \let\ptexhat=^
- \let\ptexi=\i
- \let\ptexindent=\indent
- \let\ptexinsert=\insert
- \let\ptexlbrace=\{
- \let\ptexless=<
- \let\ptexnewwrite\newwrite
- \let\ptexnoindent=\noindent
- \let\ptexplus=+
- \let\ptexrbrace=\}
- \let\ptexslash=\/
- \let\ptexstar=\*
- \let\ptext=\t
- % If this character appears in an error message or help string, it
- % starts a new line in the output.
- \newlinechar = `^^J
- % Use TeX 3.0's \inputlineno to get the line number, for better error
- % messages, but if we're using an old version of TeX, don't do anything.
- %
- \ifx\inputlineno\thisisundefined
- \let\linenumber = \empty % Pre-3.0.
- \else
- \def\linenumber{l.\the\inputlineno:\space}
- \fi
- % Set up fixed words for English if not already set.
- \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
- \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
- \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
- \ifx\putwordin\undefined \gdef\putwordin{in}\fi
- \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
- \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
- \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
- \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
- \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
- \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
- \ifx\putwordof\undefined \gdef\putwordof{of}\fi
- \ifx\putwordon\undefined \gdef\putwordon{on}\fi
- \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
- \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
- \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
- \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
- \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
- \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
- \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
- %
- \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
- \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
- \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
- \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
- \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
- \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
- \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
- \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
- \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
- \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
- \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
- \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
- %
- \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
- \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
- \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
- \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
- \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
- % In some macros, we cannot use the `\? notation---the left quote is
- % in some cases the escape char.
- \chardef\colonChar = `\:
- \chardef\commaChar = `\,
- \chardef\dotChar = `\.
- \chardef\exclamChar= `\!
- \chardef\questChar = `\?
- \chardef\semiChar = `\;
- \chardef\underChar = `\_
- \chardef\spaceChar = `\ %
- \chardef\spacecat = 10
- \def\spaceisspace{\catcode\spaceChar=\spacecat}
- % Ignore a token.
- %
- \def\gobble#1{}
- % The following is used inside several \edef's.
- \def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
- % Hyphenation fixes.
- \hyphenation{
- Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
- ap-pen-dix bit-map bit-maps
- data-base data-bases eshell fall-ing half-way long-est man-u-script
- man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
- par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
- spell-ing spell-ings
- stand-alone strong-est time-stamp time-stamps which-ever white-space
- wide-spread wrap-around
- }
- % Margin to add to right of even pages, to left of odd pages.
- \newdimen\bindingoffset
- \newdimen\normaloffset
- \newdimen\pagewidth \newdimen\pageheight
- % For a final copy, take out the rectangles
- % that mark overfull boxes (in case you have decided
- % that the text looks ok even though it passes the margin).
- %
- \def\finalout{\overfullrule=0pt}
- % @| inserts a changebar to the left of the current line. It should
- % surround any changed text. This approach does *not* work if the
- % change spans more than two lines of output. To handle that, we would
- % have adopt a much more difficult approach (putting marks into the main
- % vertical list for the beginning and end of each change).
- %
- \def\|{%
- % \vadjust can only be used in horizontal mode.
- \leavevmode
- %
- % Append this vertical mode material after the current line in the output.
- \vadjust{%
- % We want to insert a rule with the height and depth of the current
- % leading; that is exactly what \strutbox is supposed to record.
- \vskip-\baselineskip
- %
- % \vadjust-items are inserted at the left edge of the type. So
- % the \llap here moves out into the left-hand margin.
- \llap{%
- %
- % For a thicker or thinner bar, change the `1pt'.
- \vrule height\baselineskip width1pt
- %
- % This is the space between the bar and the text.
- \hskip 12pt
- }%
- }%
- }
- % Sometimes it is convenient to have everything in the transcript file
- % and nothing on the terminal. We don't just call \tracingall here,
- % since that produces some useless output on the terminal. We also make
- % some effort to order the tracing commands to reduce output in the log
- % file; cf. trace.sty in LaTeX.
- %
- \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
- \def\loggingall{%
- \tracingstats2
- \tracingpages1
- \tracinglostchars2 % 2 gives us more in etex
- \tracingparagraphs1
- \tracingoutput1
- \tracingmacros2
- \tracingrestores1
- \showboxbreadth\maxdimen \showboxdepth\maxdimen
- \ifx\eTeXversion\undefined\else % etex gives us more logging
- \tracingscantokens1
- \tracingifs1
- \tracinggroups1
- \tracingnesting2
- \tracingassigns1
- \fi
- \tracingcommands3 % 3 gives us more in etex
- \errorcontextlines16
- }%
- % add check for \lastpenalty to plain's definitions. If the last thing
- % we did was a \nobreak, we don't want to insert more space.
- %
- \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
- \removelastskip\penalty-50\smallskip\fi\fi}
- \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
- \removelastskip\penalty-100\medskip\fi\fi}
- \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
- \removelastskip\penalty-200\bigskip\fi\fi}
- % For @cropmarks command.
- % Do @cropmarks to get crop marks.
- %
- \newif\ifcropmarks
- \let\cropmarks = \cropmarkstrue
- %
- % Dimensions to add cropmarks at corners.
- % Added by P. A. MacKay, 12 Nov. 1986
- %
- \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
- \newdimen\cornerlong \cornerlong=1pc
- \newdimen\cornerthick \cornerthick=.3pt
- \newdimen\topandbottommargin \topandbottommargin=.75in
- % Main output routine.
- \chardef\PAGE = 255
- \output = {\onepageout{\pagecontents\PAGE}}
- \newbox\headlinebox
- \newbox\footlinebox
- % \onepageout takes a vbox as an argument. Note that \pagecontents
- % does insertions, but you have to call it yourself.
- \def\onepageout#1{%
- \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
- %
- \ifodd\pageno \advance\hoffset by \bindingoffset
- \else \advance\hoffset by -\bindingoffset\fi
- %
- % Do this outside of the \shipout so @code etc. will be expanded in
- % the headline as they should be, not taken literally (outputting ''code).
- \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
- \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
- %
- {%
- % Have to do this stuff outside the \shipout because we want it to
- % take effect in \write's, yet the group defined by the \vbox ends
- % before the \shipout runs.
- %
- \escapechar = `\\ % use backslash in output files.
- \indexdummies % don't expand commands in the output.
- \normalturnoffactive % \ in index entries must not stay \, e.g., if
- % the page break happens to be in the middle of an example.
- \shipout\vbox{%
- % Do this early so pdf references go to the beginning of the page.
- \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
- %
- \ifcropmarks \vbox to \outervsize\bgroup
- \hsize = \outerhsize
- \vskip-\topandbottommargin
- \vtop to0pt{%
- \line{\ewtop\hfil\ewtop}%
- \nointerlineskip
- \line{%
- \vbox{\moveleft\cornerthick\nstop}%
- \hfill
- \vbox{\moveright\cornerthick\nstop}%
- }%
- \vss}%
- \vskip\topandbottommargin
- \line\bgroup
- \hfil % center the page within the outer (page) hsize.
- \ifodd\pageno\hskip\bindingoffset\fi
- \vbox\bgroup
- \fi
- %
- \unvbox\headlinebox
- \pagebody{#1}%
- \ifdim\ht\footlinebox > 0pt
- % Only leave this space if the footline is nonempty.
- % (We lessened \vsize for it in \oddfootingxxx.)
- % The \baselineskip=24pt in plain's \makefootline has no effect.
- \vskip 2\baselineskip
- \unvbox\footlinebox
- \fi
- %
- \ifcropmarks
- \egroup % end of \vbox\bgroup
- \hfil\egroup % end of (centering) \line\bgroup
- \vskip\topandbottommargin plus1fill minus1fill
- \boxmaxdepth = \cornerthick
- \vbox to0pt{\vss
- \line{%
- \vbox{\moveleft\cornerthick\nsbot}%
- \hfill
- \vbox{\moveright\cornerthick\nsbot}%
- }%
- \nointerlineskip
- \line{\ewbot\hfil\ewbot}%
- }%
- \egroup % \vbox from first cropmarks clause
- \fi
- }% end of \shipout\vbox
- }% end of group with \normalturnoffactive
- \advancepageno
- \ifnum\outputpenalty>-20000 \else\dosupereject\fi
- }
- \newinsert\margin \dimen\margin=\maxdimen
- \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
- {\catcode`\@ =11
- \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
- % marginal hacks, juha@viisa.uucp (Juha Takala)
- \ifvoid\margin\else % marginal info is present
- \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
- \dimen@=\dp#1 \unvbox#1
- \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
- \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
- }
- % Here are the rules for the cropmarks. Note that they are
- % offset so that the space between them is truly \outerhsize or \outervsize
- % (P. A. MacKay, 12 November, 1986)
- %
- \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
- \def\nstop{\vbox
- {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
- \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
- \def\nsbot{\vbox
- {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
- % Parse an argument, then pass it to #1. The argument is the rest of
- % the input line (except we remove a trailing comment). #1 should be a
- % macro which expects an ordinary undelimited TeX argument.
- %
- \def\parsearg{\parseargusing{}}
- \def\parseargusing#1#2{%
- \def\next{#2}%
- \begingroup
- \obeylines
- \spaceisspace
- #1%
- \parseargline\empty% Insert the \empty token, see \finishparsearg below.
- }
- {\obeylines %
- \gdef\parseargline#1^^M{%
- \endgroup % End of the group started in \parsearg.
- \argremovecomment #1\comment\ArgTerm%
- }%
- }
- % First remove any @comment, then any @c comment.
- \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
- \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
- % Each occurence of `\^^M' or `<space>\^^M' is replaced by a single space.
- %
- % \argremovec might leave us with trailing space, e.g.,
- % @end itemize @c foo
- % This space token undergoes the same procedure and is eventually removed
- % by \finishparsearg.
- %
- \def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
- \def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
- \def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
- \def\temp{#3}%
- \ifx\temp\empty
- % We cannot use \next here, as it holds the macro to run;
- % thus we reuse \temp.
- \let\temp\finishparsearg
- \else
- \let\temp\argcheckspaces
- \fi
- % Put the space token in:
- \temp#1 #3\ArgTerm
- }
- % If a _delimited_ argument is enclosed in braces, they get stripped; so
- % to get _exactly_ the rest of the line, we had to prevent such situation.
- % We prepended an \empty token at the very beginning and we expand it now,
- % just before passing the control to \next.
- % (Similarily, we have to think about #3 of \argcheckspacesY above: it is
- % either the null string, or it ends with \^^M---thus there is no danger
- % that a pair of braces would be stripped.
- %
- % But first, we have to remove the trailing space token.
- %
- \def\finishparsearg#1 \ArgTerm{\expandafter\next\expandafter{#1}}
- % \parseargdef\foo{...}
- % is roughly equivalent to
- % \def\foo{\parsearg\Xfoo}
- % \def\Xfoo#1{...}
- %
- % Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
- % favourite TeX trick. --kasal, 16nov03
- \def\parseargdef#1{%
- \expandafter \doparseargdef \csname\string#1\endcsname #1%
- }
- \def\doparseargdef#1#2{%
- \def#2{\parsearg#1}%
- \def#1##1%
- }
- % Several utility definitions with active space:
- {
- \obeyspaces
- \gdef\obeyedspace{ }
- % Make each space character in the input produce a normal interword
- % space in the output. Don't allow a line break at this space, as this
- % is used only in environments like @example, where each line of input
- % should produce a line of output anyway.
- %
- \gdef\sepspaces{\obeyspaces\let =\tie}
- % If an index command is used in an @example environment, any spaces
- % therein should become regular spaces in the raw index file, not the
- % expansion of \tie (\leavevmode \penalty \@M \ ).
- \gdef\unsepspaces{\let =\space}
- }
- \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
- % Define the framework for environments in texinfo.tex. It's used like this:
- %
- % \envdef\foo{...}
- % \def\Efoo{...}
- %
- % It's the responsibility of \envdef to insert \begingroup before the
- % actual body; @end closes the group after calling \Efoo. \envdef also
- % defines \thisenv, so the current environment is known; @end checks
- % whether the environment name matches. The \checkenv macro can also be
- % used to check whether the current environment is the one expected.
- %
- % Non-false conditionals (@iftex, @ifset) don't fit into this, so they
- % are not treated as enviroments; they don't open a group. (The
- % implementation of @end takes care not to call \endgroup in this
- % special case.)
- % At runtime, environments start with this:
- \def\startenvironment#1{\begingroup\def\thisenv{#1}}
- % initialize
- \let\thisenv\empty
- % ... but they get defined via ``\envdef\foo{...}'':
- \long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
- \def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
- % Check whether we're in the right environment:
- \def\checkenv#1{%
- \def\temp{#1}%
- \ifx\thisenv\temp
- \else
- \badenverr
- \fi
- }
- % Evironment mismatch, #1 expected:
- \def\badenverr{%
- \errhelp = \EMsimple
- \errmessage{This command can appear only \inenvironment\temp,
- not \inenvironment\thisenv}%
- }
- \def\inenvironment#1{%
- \ifx#1\empty
- out of any environment%
- \else
- in environment \expandafter\string#1%
- \fi
- }
- % @end foo executes the definition of \Efoo.
- % But first, it executes a specialized version of \checkenv
- %
- \parseargdef\end{%
- \if 1\csname iscond.#1\endcsname
- \else
- % The general wording of \badenverr may not be ideal, but... --kasal, 06nov03
- \expandafter\checkenv\csname#1\endcsname
- \csname E#1\endcsname
- \endgroup
- \fi
- }
- \newhelp\EMsimple{Press RETURN to continue.}
- %% Simple single-character @ commands
- % @@ prints an @
- % Kludge this until the fonts are right (grr).
- \def\@{{\tt\char64}}
- % This is turned off because it was never documented
- % and you can use @w{...} around a quote to suppress ligatures.
- %% Define @` and @' to be the same as ` and '
- %% but suppressing ligatures.
- %\def\`{{`}}
- %\def\'{{'}}
- % Used to generate quoted braces.
- \def\mylbrace {{\tt\char123}}
- \def\myrbrace {{\tt\char125}}
- \let\{=\mylbrace
- \let\}=\myrbrace
- \begingroup
- % Definitions to produce \{ and \} commands for indices,
- % and @{ and @} for the aux file.
- \catcode`\{ = \other \catcode`\} = \other
- \catcode`\[ = 1 \catcode`\] = 2
- \catcode`\! = 0 \catcode`\\ = \other
- !gdef!lbracecmd[\{]%
- !gdef!rbracecmd[\}]%
- !gdef!lbraceatcmd[@{]%
- !gdef!rbraceatcmd[@}]%
- !endgroup
- % @comma{} to avoid , parsing problems.
- \let\comma = ,
- % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
- % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
- \let\, = \c
- \let\dotaccent = \.
- \def\ringaccent#1{{\accent23 #1}}
- \let\tieaccent = \t
- \let\ubaraccent = \b
- \let\udotaccent = \d
- % Other special characters: @questiondown @exclamdown @ordf @ordm
- % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
- \def\questiondown{?`}
- \def\exclamdown{!`}
- \def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
- \def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
- % Dotless i and dotless j, used for accents.
- \def\imacro{i}
- \def\jmacro{j}
- \def\dotless#1{%
- \def\temp{#1}%
- \ifx\temp\imacro \ptexi
- \else\ifx\temp\jmacro \j
- \else \errmessage{@dotless can be used only with i or j}%
- \fi\fi
- }
- % The \TeX{} logo, as in plain, but resetting the spacing so that a
- % period following counts as ending a sentence. (Idea found in latex.)
- %
- \edef\TeX{\TeX \spacefactor=1000 }
- % @LaTeX{} logo. Not quite the same results as the definition in
- % latex.ltx, since we use a different font for the raised A; it's most
- % convenient for us to use an explicitly smaller font, rather than using
- % the \scriptstyle font (since we don't reset \scriptstyle and
- % \scriptscriptstyle).
- %
- \def\LaTeX{%
- L\kern-.36em
- {\setbox0=\hbox{T}%
- \vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}%
- \kern-.15em
- \TeX
- }
- % Be sure we're in horizontal mode when doing a tie, since we make space
- % equivalent to this in @example-like environments. Otherwise, a space
- % at the beginning of a line will start with \penalty -- and
- % since \penalty is valid in vertical mode, we'd end up putting the
- % penalty on the vertical list instead of in the new paragraph.
- {\catcode`@ = 11
- % Avoid using \@M directly, because that causes trouble
- % if the definition is written into an index file.
- \global\let\tiepenalty = \@M
- \gdef\tie{\leavevmode\penalty\tiepenalty\ }
- }
- % @: forces normal size whitespace following.
- \def\:{\spacefactor=1000 }
- % @* forces a line break.
- \def\*{\hfil\break\hbox{}\ignorespaces}
- % @/ allows a line break.
- \let\/=\allowbreak
- % @. is an end-of-sentence period.
- \def\.{.\spacefactor=3000 }
- % @! is an end-of-sentence bang.
- \def\!{!\spacefactor=3000 }
- % @? is an end-of-sentence query.
- \def\?{?\spacefactor=3000 }
- % @w prevents a word break. Without the \leavevmode, @w at the
- % beginning of a paragraph, when TeX is still in vertical mode, would
- % produce a whole line of output instead of starting the paragraph.
- \def\w#1{\leavevmode\hbox{#1}}
- % @group ... @end group forces ... to be all on one page, by enclosing
- % it in a TeX vbox. We use \vtop instead of \vbox to construct the box
- % to keep its height that of a normal line. According to the rules for
- % \topskip (p.114 of the TeXbook), the glue inserted is
- % max (\topskip - \ht (first item), 0). If that height is large,
- % therefore, no glue is inserted, and the space between the headline and
- % the text is small, which looks bad.
- %
- % Another complication is that the group might be very large. This can
- % cause the glue on the previous page to be unduly stretched, because it
- % does not have much material. In this case, it's better to add an
- % explicit \vfill so that the extra space is at the bottom. The
- % threshold for doing this is if the group is more than \vfilllimit
- % percent of a page (\vfilllimit can be changed inside of @tex).
- %
- \newbox\groupbox
- \def\vfilllimit{0.7}
- %
- \envdef\group{%
- \ifnum\catcode`\^^M=\active \else
- \errhelp = \groupinvalidhelp
- \errmessage{@group invalid in context where filling is enabled}%
- \fi
- \startsavinginserts
- %
- \setbox\groupbox = \vtop\bgroup
- % Do @comment since we are called inside an environment such as
- % @example, where each end-of-line in the input causes an
- % end-of-line in the output. We don't want the end-of-line after
- % the `@group' to put extra space in the output. Since @group
- % should appear on a line by itself (according to the Texinfo
- % manual), we don't worry about eating any user text.
- \comment
- }
- %
- % The \vtop produces a box with normal height and large depth; thus, TeX puts
- % \baselineskip glue before it, and (when the next line of text is done)
- % \lineskip glue after it. Thus, space below is not quite equal to space
- % above. But it's pretty close.
- \def\Egroup{%
- % To get correct interline space between the last line of the group
- % and the first line afterwards, we have to propagate \prevdepth.
- \endgraf % Not \par, as it may have been set to \lisppar.
- \global\dimen1 = \prevdepth
- \egroup % End the \vtop.
- % \dimen0 is the vertical size of the group's box.
- \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
- % \dimen2 is how much space is left on the page (more or less).
- \dimen2 = \pageheight \advance\dimen2 by -\pagetotal
- % if the group doesn't fit on the current page, and it's a big big
- % group, force a page break.
- \ifdim \dimen0 > \dimen2
- \ifdim \pagetotal < \vfilllimit\pageheight
- \page
- \fi
- \fi
- \box\groupbox
- \prevdepth = \dimen1
- \checkinserts
- }
- %
- % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
- % message, so this ends up printing `@group can only ...'.
- %
- \newhelp\groupinvalidhelp{%
- group can only be used in environments such as @example,^^J%
- where each line of input produces a line of output.}
- % @need space-in-mils
- % forces a page break if there is not space-in-mils remaining.
- \newdimen\mil \mil=0.001in
- % Old definition--didn't work.
- %\parseargdef\need{\par %
- %% This method tries to make TeX break the page naturally
- %% if the depth of the box does not fit.
- %{\baselineskip=0pt%
- %\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
- %\prevdepth=-1000pt
- %}}
- \parseargdef\need{%
- % Ensure vertical mode, so we don't make a big box in the middle of a
- % paragraph.
- \par
- %
- % If the @need value is less than one line space, it's useless.
- \dimen0 = #1\mil
- \dimen2 = \ht\strutbox
- \advance\dimen2 by \dp\strutbox
- \ifdim\dimen0 > \dimen2
- %
- % Do a \strut just to make the height of this box be normal, so the
- % normal leading is inserted relative to the preceding line.
- % And a page break here is fine.
- \vtop to #1\mil{\strut\vfil}%
- %
- % TeX does not even consider page breaks if a penalty added to the
- % main vertical list is 10000 or more. But in order to see if the
- % empty box we just added fits on the page, we must make it consider
- % page breaks. On the other hand, we don't want to actually break the
- % page after the empty box. So we use a penalty of 9999.
- %
- % There is an extremely small chance that TeX will actually break the
- % page at this \penalty, if there are no other feasible breakpoints in
- % sight. (If the user is using lots of big @group commands, which
- % almost-but-not-quite fill up a page, TeX will have a hard time doing
- % good page breaking, for example.) However, I could not construct an
- % example where a page broke at this \penalty; if it happens in a real
- % document, then we can reconsider our strategy.
- \penalty9999
- %
- % Back up by the size of the box, whether we did a page break or not.
- \kern -#1\mil
- %
- % Do not allow a page break right after this kern.
- \nobreak
- \fi
- }
- % @br forces paragraph break (and is undocumented).
- \let\br = \par
- % @page forces the start of a new page.
- %
- \def\page{\par\vfill\supereject}
- % @exdent text....
- % outputs text on separate line in roman font, starting at standard page margin
- % This records the amount of indent in the innermost environment.
- % That's how much \exdent should take out.
- \newskip\exdentamount
- % This defn is used inside fill environments such as @defun.
- \parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
- % This defn is used inside nofill environments such as @example.
- \parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
- \leftline{\hskip\leftskip{\rm#1}}}}
- % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
- % paragraph. For more general purposes, use the \margin insertion
- % class. WHICH is `l' or `r'.
- %
- \newskip\inmarginspacing \inmarginspacing=1cm
- \def\strutdepth{\dp\strutbox}
- %
- \def\doinmargin#1#2{\strut\vadjust{%
- \nobreak
- \kern-\strutdepth
- \vtop to \strutdepth{%
- \baselineskip=\strutdepth
- \vss
- % if you have multiple lines of stuff to put here, you'll need to
- % make the vbox yourself of the appropriate size.
- \ifx#1l%
- \llap{\ignorespaces #2\hskip\inmarginspacing}%
- \else
- \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
- \fi
- \null
- }%
- }}
- \def\inleftmargin{\doinmargin l}
- \def\inrightmargin{\doinmargin r}
- %
- % @inmargin{TEXT [, RIGHT-TEXT]}
- % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
- % else use TEXT for both).
- %
- \def\inmargin#1{\parseinmargin #1,,\finish}
- \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
- \setbox0 = \hbox{\ignorespaces #2}%
- \ifdim\wd0 > 0pt
- \def\lefttext{#1}% have both texts
- \def\righttext{#2}%
- \else
- \def\lefttext{#1}% have only one text
- \def\righttext{#1}%
- \fi
- %
- \ifodd\pageno
- \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
- \else
- \def\temp{\inleftmargin\lefttext}%
- \fi
- \temp
- }
- % @include file insert text of that file as input.
- %
- \def\include{\parseargusing\filenamecatcodes\includezzz}
- \def\includezzz#1{%
- \pushthisfilestack
- \def\thisfile{#1}%
- {%
- \makevalueexpandable
- \def\temp{\input #1 }%
- \expandafter
- }\temp
- \popthisfilestack
- }
- \def\filenamecatcodes{%
- \catcode`\\=\other
- \catcode`~=\other
- \catcode`^=\other
- \catcode`_=\other
- \catcode`|=\other
- \catcode`<=\other
- \catcode`>=\other
- \catcode`+=\other
- \catcode`-=\other
- }
- \def\pushthisfilestack{%
- \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
- }
- \def\pushthisfilestackX{%
- \expandafter\pushthisfilestackY\thisfile\StackTerm
- }
- \def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
- \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
- }
- \def\popthisfilestack{\errthisfilestackempty}
- \def\errthisfilestackempty{\errmessage{Internal error:
- the stack of filenames is empty.}}
- \def\thisfile{}
- % @center line
- % outputs that line, centered.
- %
- \parseargdef\center{%
- \ifhmode
- \let\next\centerH
- \else
- \let\next\centerV
- \fi
- \next{\hfil \ignorespaces#1\unskip \hfil}%
- }
- \def\centerH#1{%
- {%
- \hfil\break
- \advance\hsize by -\leftskip
- \advance\hsize by -\rightskip
- \line{#1}%
- \break
- }%
- }
- \def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}}
- % @sp n outputs n lines of vertical space
- \parseargdef\sp{\vskip #1\baselineskip}
- % @comment ...line which is ignored...
- % @c is the same as @comment
- % @ignore ... @end ignore is another way to write a comment
- \def\comment{\begingroup \catcode`\^^M=\other%
- \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
- \commentxxx}
- {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
- \let\c=\comment
- % @paragraphindent NCHARS
- % We'll use ems for NCHARS, close enough.
- % NCHARS can also be the word `asis' or `none'.
- % We cannot feasibly implement @paragraphindent asis, though.
- %
- \def\asisword{asis} % no translation, these are keywords
- \def\noneword{none}
- %
- \parseargdef\paragraphindent{%
- \def\temp{#1}%
- \ifx\temp\asisword
- \else
- \ifx\temp\noneword
- \defaultparindent = 0pt
- \else
- \defaultparindent = #1em
- \fi
- \fi
- \parindent = \defaultparindent
- }
- % @exampleindent NCHARS
- % We'll use ems for NCHARS like @paragraphindent.
- % It seems @exampleindent asis isn't necessary, but
- % I preserve it to make it similar to @paragraphindent.
- \parseargdef\exampleindent{%
- \def\temp{#1}%
- \ifx\temp\asisword
- \else
- \ifx\temp\noneword
- \lispnarrowing = 0pt
- \else
- \lispnarrowing = #1em
- \fi
- \fi
- }
- % @firstparagraphindent WORD
- % If WORD is `none', then suppress indentation of the first paragraph
- % after a section heading. If WORD is `insert', then do indent at such
- % paragraphs.
- %
- % The paragraph indentation is suppressed or not by calling
- % \suppressfirstparagraphindent, which the sectioning commands do.
- % We switch the definition of this back and forth according to WORD.
- % By default, we suppress indentation.
- %
- \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
- \def\insertword{insert}
- %
- \parseargdef\firstparagraphindent{%
- \def\temp{#1}%
- \ifx\temp\noneword
- \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
- \else\ifx\temp\insertword
- \let\suppressfirstparagraphindent = \relax
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @firstparagraphindent option `\temp'}%
- \fi\fi
- }
- % Here is how we actually suppress indentation. Redefine \everypar to
- % \kern backwards by \parindent, and then reset itself to empty.
- %
- % We also make \indent itself not actually do anything until the next
- % paragraph.
- %
- \gdef\dosuppressfirstparagraphindent{%
- \gdef\indent{%
- \restorefirstparagraphindent
- \indent
- }%
- \gdef\noindent{%
- \restorefirstparagraphindent
- \noindent
- }%
- \global\everypar = {%
- \kern -\parindent
- \restorefirstparagraphindent
- }%
- }
- \gdef\restorefirstparagraphindent{%
- \global \let \indent = \ptexindent
- \global \let \noindent = \ptexnoindent
- \global \everypar = {}%
- }
- % @asis just yields its argument. Used with @table, for example.
- %
- \def\asis#1{#1}
- % @math outputs its argument in math mode.
- %
- % One complication: _ usually means subscripts, but it could also mean
- % an actual _ character, as in @math{@var{some_variable} + 1}. So make
- % _ active, and distinguish by seeing if the current family is \slfam,
- % which is what @var uses.
- {
- \catcode\underChar = \active
- \gdef\mathunderscore{%
- \catcode\underChar=\active
- \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
- }
- }
- % Another complication: we want \\ (and @\) to output a \ character.
- % FYI, plain.tex uses \\ as a temporary control sequence (why?), but
- % this is not advertised and we don't care. Texinfo does not
- % otherwise define @\.
- %
- % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
- \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
- %
- \def\math{%
- \tex
- \mathunderscore
- \let\\ = \mathbackslash
- \mathactive
- $\finishmath
- }
- \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
- % Some active characters (such as <) are spaced differently in math.
- % We have to reset their definitions in case the @math was an argument
- % to a command which sets the catcodes (such as @item or @section).
- %
- {
- \catcode`^ = \active
- \catcode`< = \active
- \catcode`> = \active
- \catcode`+ = \active
- \gdef\mathactive{%
- \let^ = \ptexhat
- \let< = \ptexless
- \let> = \ptexgtr
- \let+ = \ptexplus
- }
- }
- % @bullet and @minus need the same treatment as @math, just above.
- \def\bullet{$\ptexbullet$}
- \def\minus{$-$}
- % @dots{} outputs an ellipsis using the current font.
- % We do .5em per period so that it has the same spacing in a typewriter
- % font as three actual period characters.
- %
- \def\dots{%
- \leavevmode
- \hbox to 1.5em{%
- \hskip 0pt plus 0.25fil
- .\hfil.\hfil.%
- \hskip 0pt plus 0.5fil
- }%
- }
- % @enddots{} is an end-of-sentence ellipsis.
- %
- \def\enddots{%
- \dots
- \spacefactor=3000
- }
- % @comma{} is so commas can be inserted into text without messing up
- % Texinfo's parsing.
- %
- \let\comma = ,
- % @refill is a no-op.
- \let\refill=\relax
- % If working on a large document in chapters, it is convenient to
- % be able to disable indexing, cross-referencing, and contents, for test runs.
- % This is done with @novalidate (before @setfilename).
- %
- \newif\iflinks \linkstrue % by default we want the aux files.
- \let\novalidate = \linksfalse
- % @setfilename is done at the beginning of every texinfo file.
- % So open here the files we need to have open while reading the input.
- % This makes it possible to make a .fmt file for texinfo.
- \def\setfilename{%
- \fixbackslash % Turn off hack to swallow `\input texinfo'.
- \iflinks
- \tryauxfile
- % Open the new aux file. TeX will close it automatically at exit.
- \immediate\openout\auxfile=\jobname.aux
- \fi % \openindices needs to do some work in any case.
- \openindices
- \let\setfilename=\comment % Ignore extra @setfilename cmds.
- %
- % If texinfo.cnf is present on the system, read it.
- % Useful for site-wide @afourpaper, etc.
- \openin 1 texinfo.cnf
- \ifeof 1 \else \input texinfo.cnf \fi
- \closein 1
- %
- \comment % Ignore the actual filename.
- }
- % Called from \setfilename.
- %
- \def\openindices{%
- \newindex{cp}%
- \newcodeindex{fn}%
- \newcodeindex{vr}%
- \newcodeindex{tp}%
- \newcodeindex{ky}%
- \newcodeindex{pg}%
- }
- % @bye.
- \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
- \message{pdf,}
- % adobe `portable' document format
- \newcount\tempnum
- \newcount\lnkcount
- \newtoks\filename
- \newcount\filenamelength
- \newcount\pgn
- \newtoks\toksA
- \newtoks\toksB
- \newtoks\toksC
- \newtoks\toksD
- \newbox\boxA
- \newcount\countA
- \newif\ifpdf
- \newif\ifpdfmakepagedest
- % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
- % can be set). So we test for \relax and 0 as well as \undefined,
- % borrowed from ifpdf.sty.
- \ifx\pdfoutput\undefined
- \else
- \ifx\pdfoutput\relax
- \else
- \ifcase\pdfoutput
- \else
- \pdftrue
- \fi
- \fi
- \fi
- %
- \ifpdf
- \input pdfcolor
- \pdfcatalog{/PageMode /UseOutlines}%
- \def\dopdfimage#1#2#3{%
- \def\imagewidth{#2}%
- \def\imageheight{#3}%
- % without \immediate, pdftex seg faults when the same image is
- % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
- \ifnum\pdftexversion < 14
- \immediate\pdfimage
- \else
- \immediate\pdfximage
- \fi
- \ifx\empty\imagewidth\else width \imagewidth \fi
- \ifx\empty\imageheight\else height \imageheight \fi
- \ifnum\pdftexversion<13
- #1.pdf%
- \else
- {#1.pdf}%
- \fi
- \ifnum\pdftexversion < 14 \else
- \pdfrefximage \pdflastximage
- \fi}
- \def\pdfmkdest#1{{%
- % We have to set dummies so commands such as @code in a section title
- % aren't expanded.
- \atdummies
- \normalturnoffactive
- \pdfdest name{#1} xyz%
- }}
- \def\pdfmkpgn#1{#1}
- \let\linkcolor = \Blue % was Cyan, but that seems light?
- \def\endlink{\Black\pdfendlink}
- % Adding outlines to PDF; macros for calculating structure of outlines
- % come from Petr Olsak
- \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
- \else \csname#1\endcsname \fi}
- \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
- \advance\tempnum by 1
- \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
- %
- % #1 is the section text. #2 is the pdf expression for the number
- % of subentries (or empty, for subsubsections). #3 is the node
- % text, which might be empty if this toc entry had no
- % corresponding node. #4 is the page number.
- %
- \def\dopdfoutline#1#2#3#4{%
- % Generate a link to the node text if that exists; else, use the
- % page number. We could generate a destination for the section
- % text in the case where a section has no node, but it doesn't
- % seem worthwhile, since most documents are normally structured.
- \def\pdfoutlinedest{#3}%
- \ifx\pdfoutlinedest\empty \def\pdfoutlinedest{#4}\fi
- %
- \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{#1}%
- }
- %
- \def\pdfmakeoutlines{%
- \begingroup
- % Thanh's hack / proper braces in bookmarks
- \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
- \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
- %
- % Read toc silently, to get counts of subentries for \pdfoutline.
- \def\numchapentry##1##2##3##4{%
- \def\thischapnum{##2}%
- \def\thissecnum{0}%
- \def\thissubsecnum{0}%
- }%
- \def\numsecentry##1##2##3##4{%
- \advancenumber{chap\thischapnum}%
- \def\thissecnum{##2}%
- \def\thissubsecnum{0}%
- }%
- \def\numsubsecentry##1##2##3##4{%
- \advancenumber{sec\thissecnum}%
- \def\thissubsecnum{##2}%
- }%
- \def\numsubsubsecentry##1##2##3##4{%
- \advancenumber{subsec\thissubsecnum}%
- }%
- \def\thischapnum{0}%
- \def\thissecnum{0}%
- \def\thissubsecnum{0}%
- %
- % use \def rather than \let here because we redefine \chapentry et
- % al. a second time, below.
- \def\appentry{\numchapentry}%
- \def\appsecentry{\numsecentry}%
- \def\appsubsecentry{\numsubsecentry}%
- \def\appsubsubsecentry{\numsubsubsecentry}%
- \def\unnchapentry{\numchapentry}%
- \def\unnsecentry{\numsecentry}%
- \def\unnsubsecentry{\numsubsecentry}%
- \def\unnsubsubsecentry{\numsubsubsecentry}%
- \input \jobname.toc
- %
- % Read toc second time, this time actually producing the outlines.
- % The `-' means take the \expnumber as the absolute number of
- % subentries, which we calculated on our first read of the .toc above.
- %
- % We use the node names as the destinations.
- \def\numchapentry##1##2##3##4{%
- \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
- \def\numsecentry##1##2##3##4{%
- \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
- \def\numsubsecentry##1##2##3##4{%
- \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
- \def\numsubsubsecentry##1##2##3##4{% count is always zero
- \dopdfoutline{##1}{}{##3}{##4}}%
- %
- % PDF outlines are displayed using system fonts, instead of
- % document fonts. Therefore we cannot use special characters,
- % since the encoding is unknown. For example, the eogonek from
- % Latin 2 (0xea) gets translated to a | character. Info from
- % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
- %
- % xx to do this right, we have to translate 8-bit characters to
- % their "best" equivalent, based on the @documentencoding. Right
- % now, I guess we'll just let the pdf reader have its way.
- \indexnofonts
- \turnoffactive
- \input \jobname.toc
- \endgroup
- }
- %
- \def\makelinks #1,{%
- \def\params{#1}\def\E{END}%
- \ifx\params\E
- \let\nextmakelinks=\relax
- \else
- \let\nextmakelinks=\makelinks
- \ifnum\lnkcount>0,\fi
- \picknum{#1}%
- \startlink attr{/Border [0 0 0]}
- goto name{\pdfmkpgn{\the\pgn}}%
- \linkcolor #1%
- \advance\lnkcount by 1%
- \endlink
- \fi
- \nextmakelinks
- }
- \def\picknum#1{\expandafter\pn#1}
- \def\pn#1{%
- \def\p{#1}%
- \ifx\p\lbrace
- \let\nextpn=\ppn
- \else
- \let\nextpn=\ppnn
- \def\first{#1}
- \fi
- \nextpn
- }
- \def\ppn#1{\pgn=#1\gobble}
- \def\ppnn{\pgn=\first}
- \def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,}
- \def\skipspaces#1{\def\PP{#1}\def\D{|}%
- \ifx\PP\D\let\nextsp\relax
- \else\let\nextsp\skipspaces
- \ifx\p\space\else\addtokens{\filename}{\PP}%
- \advance\filenamelength by 1
- \fi
- \fi
- \nextsp}
- \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
- \ifnum\pdftexversion < 14
- \let \startlink \pdfannotlink
- \else
- \let \startlink \pdfstartlink
- \fi
- \def\pdfurl#1{%
- \begingroup
- \normalturnoffactive\def\@{@}%
- \makevalueexpandable
- \leavevmode\Red
- \startlink attr{/Border [0 0 0]}%
- user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
- \endgroup}
- \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
- \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
- \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
- \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
- \def\maketoks{%
- \expandafter\poptoks\the\toksA|ENDTOKS|\relax
- \ifx\first0\adn0
- \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
- \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
- \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
- \else
- \ifnum0=\countA\else\makelink\fi
- \ifx\first.\let\next=\done\else
- \let\next=\maketoks
- \addtokens{\toksB}{\the\toksD}
- \ifx\first,\addtokens{\toksB}{\space}\fi
- \fi
- \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
- \next}
- \def\makelink{\addtokens{\toksB}%
- {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
- \def\pdflink#1{%
- \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
- \linkcolor #1\endlink}
- \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
- \else
- \let\pdfmkdest = \gobble
- \let\pdfurl = \gobble
- \let\endlink = \relax
- \let\linkcolor = \relax
- \let\pdfmakeoutlines = \relax
- \fi % \ifx\pdfoutput
- \message{fonts,}
- % Change the current font style to #1, remembering it in \curfontstyle.
- % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
- % italics, not bold italics.
- %
- \def\setfontstyle#1{%
- \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
- \csname ten#1\endcsname % change the current font
- }
- % Select #1 fonts with the current style.
- %
- \def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
- \def\rm{\fam=0 \setfontstyle{rm}}
- \def\it{\fam=\itfam \setfontstyle{it}}
- \def\sl{\fam=\slfam \setfontstyle{sl}}
- \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
- \def\tt{\fam=\ttfam \setfontstyle{tt}}
- % Texinfo sort of supports the sans serif font style, which plain TeX does not.
- % So we set up a \sf.
- \newfam\sffam
- \def\sf{\fam=\sffam \setfontstyle{sf}}
- \let\li = \sf % Sometimes we call it \li, not \sf.
- % We don't need math for this font style.
- \def\ttsl{\setfontstyle{ttsl}}
- % Default leading.
- \newdimen\textleading \textleading = 13.2pt
- % Set the baselineskip to #1, and the lineskip and strut size
- % correspondingly. There is no deep meaning behind these magic numbers
- % used as factors; they just match (closely enough) what Knuth defined.
- %
- \def\lineskipfactor{.08333}
- \def\strutheightpercent{.70833}
- \def\strutdepthpercent {.29167}
- %
- \def\setleading#1{%
- \normalbaselineskip = #1\relax
- \normallineskip = \lineskipfactor\normalbaselineskip
- \normalbaselines
- \setbox\strutbox =\hbox{%
- \vrule width0pt height\strutheightpercent\baselineskip
- depth \strutdepthpercent \baselineskip
- }%
- }
- % Set the font macro #1 to the font named #2, adding on the
- % specified font prefix (normally `cm').
- % #3 is the font's design size, #4 is a scale factor
- \def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}
- % Use cm as the default font prefix.
- % To specify the font prefix, you must define \fontprefix
- % before you read in texinfo.tex.
- \ifx\fontprefix\undefined
- \def\fontprefix{cm}
- \fi
- % Support font families that don't use the same naming scheme as CM.
- \def\rmshape{r}
- \def\rmbshape{bx} %where the normal face is bold
- \def\bfshape{b}
- \def\bxshape{bx}
- \def\ttshape{tt}
- \def\ttbshape{tt}
- \def\ttslshape{sltt}
- \def\itshape{ti}
- \def\itbshape{bxti}
- \def\slshape{sl}
- \def\slbshape{bxsl}
- \def\sfshape{ss}
- \def\sfbshape{ss}
- \def\scshape{csc}
- \def\scbshape{csc}
- % Text fonts (11.2pt, magstep1).
- \def\textnominalsize{11pt}
- \edef\mainmagstep{\magstephalf}
- \setfont\textrm\rmshape{10}{\mainmagstep}
- \setfont\texttt\ttshape{10}{\mainmagstep}
- \setfont\textbf\bfshape{10}{\mainmagstep}
- \setfont\textit\itshape{10}{\mainmagstep}
- \setfont\textsl\slshape{10}{\mainmagstep}
- \setfont\textsf\sfshape{10}{\mainmagstep}
- \setfont\textsc\scshape{10}{\mainmagstep}
- \setfont\textttsl\ttslshape{10}{\mainmagstep}
- \font\texti=cmmi10 scaled \mainmagstep
- \font\textsy=cmsy10 scaled \mainmagstep
- % A few fonts for @defun names and args.
- \setfont\defbf\bfshape{10}{\magstep1}
- \setfont\deftt\ttshape{10}{\magstep1}
- \setfont\defttsl\ttslshape{10}{\magstep1}
- \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
- % Fonts for indices, footnotes, small examples (9pt).
- \def\smallnominalsize{9pt}
- \setfont\smallrm\rmshape{9}{1000}
- \setfont\smalltt\ttshape{9}{1000}
- \setfont\smallbf\bfshape{10}{900}
- \setfont\smallit\itshape{9}{1000}
- \setfont\smallsl\slshape{9}{1000}
- \setfont\smallsf\sfshape{9}{1000}
- \setfont\smallsc\scshape{10}{900}
- \setfont\smallttsl\ttslshape{10}{900}
- \font\smalli=cmmi9
- \font\smallsy=cmsy9
- % Fonts for small examples (8pt).
- \def\smallernominalsize{8pt}
- \setfont\smallerrm\rmshape{8}{1000}
- \setfont\smallertt\ttshape{8}{1000}
- \setfont\smallerbf\bfshape{10}{800}
- \setfont\smallerit\itshape{8}{1000}
- \setfont\smallersl\slshape{8}{1000}
- \setfont\smallersf\sfshape{8}{1000}
- \setfont\smallersc\scshape{10}{800}
- \setfont\smallerttsl\ttslshape{10}{800}
- \font\smalleri=cmmi8
- \font\smallersy=cmsy8
- % Fonts for title page (20.4pt):
- \def\titlenominalsize{20pt}
- \setfont\titlerm\rmbshape{12}{\magstep3}
- \setfont\titleit\itbshape{10}{\magstep4}
- \setfont\titlesl\slbshape{10}{\magstep4}
- \setfont\titlett\ttbshape{12}{\magstep3}
- \setfont\titlettsl\ttslshape{10}{\magstep4}
- \setfont\titlesf\sfbshape{17}{\magstep1}
- \let\titlebf=\titlerm
- \setfont\titlesc\scbshape{10}{\magstep4}
- \font\titlei=cmmi12 scaled \magstep3
- \font\titlesy=cmsy10 scaled \magstep4
- \def\authorrm{\secrm}
- \def\authortt{\sectt}
- % Chapter (and unnumbered) fonts (17.28pt).
- \def\chapnominalsize{17pt}
- \setfont\chaprm\rmbshape{12}{\magstep2}
- \setfont\chapit\itbshape{10}{\magstep3}
- \setfont\chapsl\slbshape{10}{\magstep3}
- \setfont\chaptt\ttbshape{12}{\magstep2}
- \setfont\chapttsl\ttslshape{10}{\magstep3}
- \setfont\chapsf\sfbshape{17}{1000}
- \let\chapbf=\chaprm
- \setfont\chapsc\scbshape{10}{\magstep3}
- \font\chapi=cmmi12 scaled \magstep2
- \font\chapsy=cmsy10 scaled \magstep3
- % Section fonts (14.4pt).
- \def\secnominalsize{14pt}
- \setfont\secrm\rmbshape{12}{\magstep1}
- \setfont\secit\itbshape{10}{\magstep2}
- \setfont\secsl\slbshape{10}{\magstep2}
- \setfont\sectt\ttbshape{12}{\magstep1}
- \setfont\secttsl\ttslshape{10}{\magstep2}
- \setfont\secsf\sfbshape{12}{\magstep1}
- \let\secbf\secrm
- \setfont\secsc\scbshape{10}{\magstep2}
- \font\seci=cmmi12 scaled \magste…