texinfo.tex
上传用户:qaz666999
上传日期:2022-08-06
资源大小:2570k
文件大小:279k
- % texinfo.tex -- TeX macros to handle Texinfo files.
- %
- % Load plain if necessary, i.e., if running under initex.
- expandafterifxcsname fmtnameendcsnamerelaxinput plainfi
- %
- deftexinfoversion{2009-11-15.11}
- %
- % Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
- % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- % 2007, 2008 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 3 of the
- % License, 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 program. If not, see <http://www.gnu.org/licenses/>.
- %
- % 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}
- chardefother=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.
- letptexb=b
- letptexbullet=bullet
- letptexc=c
- letptexcomma=,
- letptexdot=.
- letptexdots=dots
- letptexend=end
- letptexequiv=equiv
- letptexexclam=!
- letptexfootnote=footnote
- letptexgtr=>
- letptexhat=^
- letptexi=i
- letptexindent=indent
- letptexinsert=insert
- letptexlbrace={
- letptexless=<
- letptexnewwritenewwrite
- letptexnoindent=noindent
- letptexplus=+
- letptexrbrace=}
- letptexslash=/
- letptexstar=*
- letptext=t
- letptextop=top
- % 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.
- %
- ifxinputlinenothisisundefined
- letlinenumber = empty % Pre-3.0.
- else
- deflinenumber{l.theinputlineno:space}
- fi
- % Set up fixed words for English if not already set.
- ifxputwordAppendixundefined gdefputwordAppendix{Appendix}fi
- ifxputwordChapterundefined gdefputwordChapter{Chapter}fi
- ifxputwordfileundefined gdefputwordfile{file}fi
- ifxputwordinundefined gdefputwordin{in}fi
- ifxputwordIndexIsEmptyundefined gdefputwordIndexIsEmpty{(Index is empty)}fi
- ifxputwordIndexNonexistentundefined gdefputwordIndexNonexistent{(Index is nonexistent)}fi
- ifxputwordInfoundefined gdefputwordInfo{Info}fi
- ifxputwordInstanceVariableofundefined gdefputwordInstanceVariableof{Instance Variable of}fi
- ifxputwordMethodonundefined gdefputwordMethodon{Method on}fi
- ifxputwordNoTitleundefined gdefputwordNoTitle{No Title}fi
- ifxputwordofundefined gdefputwordof{of}fi
- ifxputwordonundefined gdefputwordon{on}fi
- ifxputwordpageundefined gdefputwordpage{page}fi
- ifxputwordsectionundefined gdefputwordsection{section}fi
- ifxputwordSectionundefined gdefputwordSection{Section}fi
- ifxputwordseeundefined gdefputwordsee{see}fi
- ifxputwordSeeundefined gdefputwordSee{See}fi
- ifxputwordShortTOCundefined gdefputwordShortTOC{Short Contents}fi
- ifxputwordTOCundefined gdefputwordTOC{Table of Contents}fi
- %
- ifxputwordMJanundefined gdefputwordMJan{January}fi
- ifxputwordMFebundefined gdefputwordMFeb{February}fi
- ifxputwordMMarundefined gdefputwordMMar{March}fi
- ifxputwordMAprundefined gdefputwordMApr{April}fi
- ifxputwordMMayundefined gdefputwordMMay{May}fi
- ifxputwordMJunundefined gdefputwordMJun{June}fi
- ifxputwordMJulundefined gdefputwordMJul{July}fi
- ifxputwordMAugundefined gdefputwordMAug{August}fi
- ifxputwordMSepundefined gdefputwordMSep{September}fi
- ifxputwordMOctundefined gdefputwordMOct{October}fi
- ifxputwordMNovundefined gdefputwordMNov{November}fi
- ifxputwordMDecundefined gdefputwordMDec{December}fi
- %
- ifxputwordDefmacundefined gdefputwordDefmac{Macro}fi
- ifxputwordDefspecundefined gdefputwordDefspec{Special Form}fi
- ifxputwordDefvarundefined gdefputwordDefvar{Variable}fi
- ifxputwordDefoptundefined gdefputwordDefopt{User Option}fi
- ifxputwordDeffuncundefined gdefputwordDeffunc{Function}fi
- % Since the category of space is not known, we have to be careful.
- chardefspacecat = 10
- defspaceisspace{catcode` =spacecat}
- % sometimes characters are active, so we need control sequences.
- chardefcolonChar = `:
- chardefcommaChar = `,
- chardefdashChar = `-
- chardefdotChar = `.
- chardefexclamChar= `!
- chardeflquoteChar= ``
- chardefquestChar = `?
- chardefrquoteChar= `'
- chardefsemiChar = `;
- chardefunderChar = `_
- % Ignore a token.
- %
- defgobble#1{}
- % The following is used inside several edef's.
- defmakecsname#1{expandafternoexpandcsname#1endcsname}
- % 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.
- newdimenbindingoffset
- newdimennormaloffset
- newdimenpagewidth newdimenpageheight
- % 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).
- %
- deffinalout{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 heightbaselineskip 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.
- %
- defgloggingall{begingroup globaldefs = 1 loggingall endgroup}%
- defloggingall{%
- tracingstats2
- tracingpages1
- tracinglostchars2 % 2 gives us more in etex
- tracingparagraphs1
- tracingoutput1
- tracingmacros2
- tracingrestores1
- showboxbreadthmaxdimen showboxdepthmaxdimen
- ifxeTeXversionundefinedelse % 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.
- %
- defsmallbreak{ifnumlastpenalty<10000parifdimlastskip<smallskipamount
- removelastskippenalty-50smallskipfifi}
- defmedbreak{ifnumlastpenalty<10000parifdimlastskip<medskipamount
- removelastskippenalty-100medskipfifi}
- defbigbreak{ifnumlastpenalty<10000parifdimlastskip<bigskipamount
- removelastskippenalty-200bigskipfifi}
- % For @cropmarks command.
- % Do @cropmarks to get crop marks.
- %
- newififcropmarks
- letcropmarks = cropmarkstrue
- %
- % Dimensions to add cropmarks at corners.
- % Added by P. A. MacKay, 12 Nov. 1986
- %
- newdimenouterhsize newdimenoutervsize % set by the paper size routines
- newdimencornerlong cornerlong=1pc
- newdimencornerthick cornerthick=.3pt
- newdimentopandbottommargin topandbottommargin=.75in
- % Output a mark which sets thischapter, thissection and thiscolor.
- % We dump everything together because we only have one kind of mark.
- % This works because we only use botmark / topmark, not firstmark.
- %
- % A mark contains a subexpression of the ifcase ... fi construct.
- % get*marks macros below extract the needed part using ifcase.
- %
- % Another complication is to let the user choose whether thischapter
- % (thissection) refers to the chapter (section) in effect at the top
- % of a page, or that at the bottom of a page. The solution is
- % described on page 260 of The TeXbook. It involves outputting two
- % marks for the sectioning macros, one before the section break, and
- % one after. I won't pretend I can describe this better than DEK...
- defdomark{%
- toks0=expandafter{lastchapterdefs}%
- toks2=expandafter{lastsectiondefs}%
- toks4=expandafter{prevchapterdefs}%
- toks6=expandafter{prevsectiondefs}%
- toks8=expandafter{lastcolordefs}%
- mark{%
- thetoks0 thetoks2
- noexpandor thetoks4 thetoks6
- noexpandelse thetoks8
- }%
- }
- % topmark doesn't work for the very first chapter (after the title
- % page or the contents), so we use firstmark there -- this gets us
- % the mark with the chapter defs, unless the user sneaks in, e.g.,
- % @setcolor (or @url, or @link, etc.) between @contents and the very
- % first @chapter.
- defgettopheadingmarks{%
- ifcase0topmarkfi
- ifxthischapterempty ifcase0firstmarkfi fi
- }
- defgetbottomheadingmarks{ifcase1botmarkfi}
- defgetcolormarks{ifcase2topmarkfi}
- % Avoid "undefined control sequence" errors.
- deflastchapterdefs{}
- deflastsectiondefs{}
- defprevchapterdefs{}
- defprevsectiondefs{}
- deflastcolordefs{}
- % Main output routine.
- chardefPAGE = 255
- output = {onepageout{pagecontentsPAGE}}
- newboxheadlinebox
- newboxfootlinebox
- % onepageout takes a vbox as an argument. Note that pagecontents
- % does insertions, but you have to call it yourself.
- defonepageout#1{%
- ifcropmarks hoffset=0pt else hoffset=normaloffset fi
- %
- ifoddpageno advancehoffset by bindingoffset
- else advancehoffset by -bindingoffsetfi
- %
- % Do this outside of the shipout so @code etc. will be expanded in
- % the headline as they should be, not taken literally (outputting ''code).
- ifoddpageno getoddheadingmarks else getevenheadingmarks fi
- setboxheadlinebox = vbox{lethsize=pagewidth makeheadline}%
- ifoddpageno getoddfootingmarks else getevenfootingmarks fi
- setboxfootlinebox = vbox{lethsize=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.
- %
- 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.
- % We don't want .vr (or whatever) entries like this:
- % entry{{tt indexbackslash }acronym}{32}{code {acronym}}
- % "acronym" won't work when it's read back in;
- % it needs to be
- % {code {{tt backslashcurfont }acronym}
- shipoutvbox{%
- % Do this early so pdf references go to the beginning of the page.
- ifpdfmakepagedest pdfdest name{thepageno} xyzfi
- %
- ifcropmarks vbox to outervsizebgroup
- hsize = outerhsize
- vskip-topandbottommargin
- vtop to0pt{%
- line{ewtophfilewtop}%
- nointerlineskip
- line{%
- vbox{moveleftcornerthicknstop}%
- hfill
- vbox{moverightcornerthicknstop}%
- }%
- vss}%
- vskiptopandbottommargin
- linebgroup
- hfil % center the page within the outer (page) hsize.
- ifoddpagenohskipbindingoffsetfi
- vboxbgroup
- fi
- %
- unvboxheadlinebox
- pagebody{#1}%
- ifdimhtfootlinebox > 0pt
- % Only leave this space if the footline is nonempty.
- % (We lessened vsize for it in oddfootingyyy.)
- % The baselineskip=24pt in plain's makefootline has no effect.
- vskip 24pt
- unvboxfootlinebox
- fi
- %
- ifcropmarks
- egroup % end of vboxbgroup
- hfilegroup % end of (centering) linebgroup
- vskiptopandbottommargin plus1fill minus1fill
- boxmaxdepth = cornerthick
- vbox to0pt{vss
- line{%
- vbox{moveleftcornerthicknsbot}%
- hfill
- vbox{moverightcornerthicknsbot}%
- }%
- nointerlineskip
- line{ewbothfilewbot}%
- }%
- egroup % vbox from first cropmarks clause
- fi
- }% end of shipoutvbox
- }% end of group with indexdummies
- advancepageno
- ifnumoutputpenalty>-20000 elsedosuperejectfi
- }
- newinsertmargin dimenmargin=maxdimen
- defpagebody#1{vbox topageheight{boxmaxdepth=maxdepth #1}}
- {catcode`@ =11
- gdefpagecontents#1{ifvoidtopinselseunvboxtopinsfi
- % marginal hacks, juha@viisa.uucp (Juha Takala)
- ifvoidmarginelse % marginal info is present
- rlap{kernhsizevbox toz@{kern1ptboxmargin vss}}fi
- dimen@=dp#1relax unvbox#1relax
- ifvoidfootinselsevskipskipfootinsfootnoterule unvboxfootinsfi
- 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)
- %
- defewtop{vrule heightcornerthick depth0pt widthcornerlong}
- defnstop{vbox
- {hrule heightcornerthick depthcornerlong widthcornerthick}}
- defewbot{vrule height0pt depthcornerthick widthcornerlong}
- defnsbot{vbox
- {hrule heightcornerlong depthcornerthick widthcornerthick}}
- % 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.
- %
- defparsearg{parseargusing{}}
- defparseargusing#1#2{%
- defargtorun{#2}%
- begingroup
- obeylines
- spaceisspace
- #1%
- parsearglineempty% Insert the empty token, see finishparsearg below.
- }
- {obeylines %
- gdefparseargline#1^^M{%
- endgroup % End of the group started in parsearg.
- argremovecomment #1commentArgTerm%
- }%
- }
- % First remove any @comment, then any @c comment.
- defargremovecomment#1comment#2ArgTerm{argremovec #1cArgTerm}
- defargremovec#1c#2ArgTerm{argcheckspaces#1^^MArgTerm}
- % Each occurrence 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.
- %
- defargcheckspaces#1^^M{argcheckspacesX#1^^M ^^M}
- defargcheckspacesX#1 ^^M{argcheckspacesY#1^^M}
- defargcheckspacesY#1^^M#2^^M#3ArgTerm{%
- deftemp{#3}%
- ifxtempempty
- % Do not use next, perhaps the caller of parsearg uses it; reuse temp:
- lettempfinishparsearg
- else
- lettempargcheckspaces
- fi
- % Put the space token in:
- temp#1 #3ArgTerm
- }
- % 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 argtorun.
- % (Similarly, 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.
- %
- deffinishparsearg#1 ArgTerm{expandafterargtorunexpandafter{#1}}
- % parseargdeffoo{...}
- % is roughly equivalent to
- % deffoo{parseargXfoo}
- % defXfoo#1{...}
- %
- % Actually, I use csnamestringfooendcsname, ie. \foo, as it is my
- % favourite TeX trick. --kasal, 16nov03
- defparseargdef#1{%
- expandafter doparseargdef csnamestring#1endcsname #1%
- }
- defdoparseargdef#1#2{%
- def#2{parsearg#1}%
- def#1##1%
- }
- % Several utility definitions with active space:
- {
- obeyspaces
- gdefobeyedspace{ }
- % 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.
- %
- gdefsepspaces{obeyspaceslet =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 ).
- gdefunsepspaces{let =space}
- }
- defflushcr{ifxparlisppar defnext##1{}else letnext=relax fi next}
- % Define the framework for environments in texinfo.tex. It's used like this:
- %
- % envdeffoo{...}
- % defEfoo{...}
- %
- % 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 environments; they don't open a group. (The
- % implementation of @end takes care not to call endgroup in this
- % special case.)
- % At run-time, environments start with this:
- defstartenvironment#1{begingroupdefthisenv{#1}}
- % initialize
- letthisenvempty
- % ... but they get defined via ``envdeffoo{...}'':
- longdefenvdef#1#2{def#1{startenvironment#1#2}}
- defenvparseargdef#1#2{parseargdef#1{startenvironment#1#2}}
- % Check whether we're in the right environment:
- defcheckenv#1{%
- deftemp{#1}%
- ifxthisenvtemp
- else
- badenverr
- fi
- }
- % Environment mismatch, #1 expected:
- defbadenverr{%
- errhelp = EMsimple
- errmessage{This command can appear only inenvironmenttemp,
- not inenvironmentthisenv}%
- }
- definenvironment#1{%
- ifx#1empty
- out of any environment%
- else
- in environment expandafterstring#1%
- fi
- }
- % @end foo executes the definition of Efoo.
- % But first, it executes a specialized version of checkenv
- %
- parseargdefend{%
- if 1csname iscond.#1endcsname
- else
- % The general wording of badenverr may not be ideal, but... --kasal, 06nov03
- expandaftercheckenvcsname#1endcsname
- csname E#1endcsname
- endgroup
- fi
- }
- newhelpEMsimple{Press RETURN to continue.}
- %% Simple single-character @ commands
- % @@ prints an @
- % Kludge this until the fonts are right (grr).
- def@{{ttchar64}}
- % 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.
- defmylbrace {{ttchar123}}
- defmyrbrace {{ttchar125}}
- let{=mylbrace
- let}=myrbrace
- begingroup
- % Definitions to produce { and } commands for indices,
- % and @{ and @} for the aux/toc files.
- 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.
- letcomma = ,
- % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
- % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
- let, = c
- letdotaccent = .
- defringaccent#1{{accent23 #1}}
- lettieaccent = t
- letubaraccent = b
- letudotaccent = d
- % Other special characters: @questiondown @exclamdown @ordf @ordm
- % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
- defquestiondown{?`}
- defexclamdown{!`}
- defordf{leavevmoderaise1exhbox{selectfontslllsize underbar{a}}}
- defordm{leavevmoderaise1exhbox{selectfontslllsize underbar{o}}}
- % Dotless i and dotless j, used for accents.
- defimacro{i}
- defjmacro{j}
- defdotless#1{%
- deftemp{#1}%
- ifxtempimacro ifmmodeimath elseptexi fi
- elseifxtempjmacro ifmmodejmath elsej fi
- else errmessage{@dotless can be used only with i or j}%
- fifi
- }
- % The TeX{} logo, as in plain, but resetting the spacing so that a
- % period following counts as ending a sentence. (Idea found in latex.)
- %
- edefTeX{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).
- %
- defLaTeX{%
- Lkern-.36em
- {setbox0=hbox{T}%
- vbox to ht0{hbox{selectfontslllsize 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.
- globallettiepenalty = @M
- gdeftie{leavevmodepenaltytiepenalty }
- }
- % @: forces normal size whitespace following.
- def:{spacefactor=1000 }
- % @* forces a line break.
- def*{hfilbreakhbox{}ignorespaces}
- % @/ allows a line break.
- let/=allowbreak
- % @. is an end-of-sentence period.
- def.{.spacefactor=endofsentencespacefactorspace}
- % @! is an end-of-sentence bang.
- def!{!spacefactor=endofsentencespacefactorspace}
- % @? is an end-of-sentence query.
- def?{?spacefactor=endofsentencespacefactorspace}
- % @frenchspacing on|off says whether to put extra space after punctuation.
- %
- defonword{on}
- defoffword{off}
- %
- parseargdeffrenchspacing{%
- deftemp{#1}%
- ifxtemponword plainfrenchspacing
- elseifxtempoffword plainnonfrenchspacing
- else
- errhelp = EMsimple
- errmessage{Unknown @frenchspacing option `temp', must be on/off}%
- fifi
- }
- % @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.
- defw#1{leavevmodehbox{#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).
- %
- newboxgroupbox
- defvfilllimit{0.7}
- %
- envdefgroup{%
- ifnumcatcode`^^M=active else
- errhelp = groupinvalidhelp
- errmessage{@group invalid in context where filling is enabled}%
- fi
- startsavinginserts
- %
- setboxgroupbox = vtopbgroup
- % 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.
- defEgroup{%
- % 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.
- globaldimen1 = prevdepth
- egroup % End the vtop.
- % dimen0 is the vertical size of the group's box.
- dimen0 = htgroupbox advancedimen0 by dpgroupbox
- % dimen2 is how much space is left on the page (more or less).
- dimen2 = pageheight advancedimen2 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 < vfilllimitpageheight
- page
- fi
- fi
- boxgroupbox
- 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 ...'.
- %
- newhelpgroupinvalidhelp{%
- 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.
- newdimenmil mil=0.001in
- % Old definition--didn't work.
- %parseargdefneed{par %
- %% This method tries to make TeX break the page naturally
- %% if the depth of the box does not fit.
- %{baselineskip=0pt%
- %vtop to #1mil{vfil}kern -#1milnobreak
- %prevdepth=-1000pt
- %}}
- parseargdefneed{%
- % 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 = #1mil
- dimen2 = htstrutbox
- advancedimen2 by dpstrutbox
- ifdimdimen0 > 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 #1mil{strutvfil}%
- %
- % 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 -#1mil
- %
- % Do not allow a page break right after this kern.
- nobreak
- fi
- }
- % @br forces paragraph break (and is undocumented).
- letbr = par
- % @page forces the start of a new page.
- %
- defpage{parvfillsupereject}
- % @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.
- newskipexdentamount
- % This defn is used inside fill environments such as @defun.
- parseargdefexdent{hfilbreakhbox{kern -exdentamount{rm#1}}hfilbreak}
- % This defn is used inside nofill environments such as @example.
- parseargdefnofillexdent{{advance leftskip by -exdentamount
- leftline{hskipleftskip{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'.
- %
- newskipinmarginspacing inmarginspacing=1cm
- defstrutdepth{dpstrutbox}
- %
- defdoinmargin#1#2{strutvadjust{%
- 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 #2hskipinmarginspacing}%
- else
- rlap{hskiphsize hskipinmarginspacing ignorespaces #2}%
- fi
- null
- }%
- }}
- definleftmargin{doinmargin l}
- definrightmargin{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).
- %
- definmargin#1{parseinmargin #1,,finish}
- defparseinmargin#1,#2,#3finish{% not perfect, but better than nothing.
- setbox0 = hbox{ignorespaces #2}%
- ifdimwd0 > 0pt
- deflefttext{#1}% have both texts
- defrighttext{#2}%
- else
- deflefttext{#1}% have only one text
- defrighttext{#1}%
- fi
- %
- ifoddpageno
- deftemp{inrightmarginrighttext}% odd page -> outside is right margin
- else
- deftemp{inleftmarginlefttext}%
- fi
- temp
- }
- % @include FILE -- input text of FILE.
- %
- definclude{parseargusingfilenamecatcodesincludezzz}
- defincludezzz#1{%
- pushthisfilestack
- defthisfile{#1}%
- {%
- makevalueexpandable % we want to expand any @value in FILE.
- turnoffactive % and allow special characters in the expansion
- edeftemp{noexpandinput #1 }%
- %
- % This trickery is to read FILE outside of a group, in case it makes
- % definitions, etc.
- expandafter
- }temp
- popthisfilestack
- }
- deffilenamecatcodes{%
- catcode`\=other
- catcode`~=other
- catcode`^=other
- catcode`_=other
- catcode`|=other
- catcode`<=other
- catcode`>=other
- catcode`+=other
- catcode`-=other
- }
- defpushthisfilestack{%
- expandafterpushthisfilestackXpopthisfilestackStackTerm
- }
- defpushthisfilestackX{%
- expandafterpushthisfilestackYthisfileStackTerm
- }
- defpushthisfilestackY #1StackTerm #2StackTerm {%
- gdefpopthisfilestack{gdefthisfile{#1}gdefpopthisfilestack{#2}}%
- }
- defpopthisfilestack{errthisfilestackempty}
- deferrthisfilestackempty{errmessage{Internal error:
- the stack of filenames is empty.}}
- defthisfile{}
- % @center line
- % outputs that line, centered.
- %
- parseargdefcenter{%
- ifhmode
- letnextcenterH
- else
- letnextcenterV
- fi
- next{hfil ignorespaces#1unskip hfil}%
- }
- defcenterH#1{%
- {%
- hfilbreak
- advancehsize by -leftskip
- advancehsize by -rightskip
- line{#1}%
- break
- }%
- }
- defcenterV#1{line{kernleftskip #1kernrightskip}}
- % @sp n outputs n lines of vertical space
- parseargdefsp{vskip #1baselineskip}
- % @comment ...line which is ignored...
- % @c is the same as @comment
- % @ignore ... @end ignore is another way to write a comment
- defcomment{begingroup catcode`^^M=other%
- catcode`@=other catcode`{=other catcode`}=other%
- commentxxx}
- {catcode`^^M=other gdefcommentxxx#1^^M{endgroup}}
- letc=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.
- %
- defasisword{asis} % no translation, these are keywords
- defnoneword{none}
- %
- parseargdefparagraphindent{%
- deftemp{#1}%
- ifxtempasisword
- else
- ifxtempnoneword
- 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.
- parseargdefexampleindent{%
- deftemp{#1}%
- ifxtempasisword
- else
- ifxtempnoneword
- 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.
- %
- defsuppressfirstparagraphindent{dosuppressfirstparagraphindent}
- definsertword{insert}
- %
- parseargdeffirstparagraphindent{%
- deftemp{#1}%
- ifxtempnoneword
- letsuppressfirstparagraphindent = dosuppressfirstparagraphindent
- elseifxtempinsertword
- letsuppressfirstparagraphindent = relax
- else
- errhelp = EMsimple
- errmessage{Unknown @firstparagraphindent option `temp'}%
- fifi
- }
- % 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.
- %
- gdefdosuppressfirstparagraphindent{%
- gdefindent{%
- restorefirstparagraphindent
- indent
- }%
- gdefnoindent{%
- restorefirstparagraphindent
- noindent
- }%
- globaleverypar = {%
- kern -parindent
- restorefirstparagraphindent
- }%
- }
- gdefrestorefirstparagraphindent{%
- global let indent = ptexindent
- global let noindent = ptexnoindent
- global everypar = {}%
- }
- % @asis just yields its argument. Used with @table, for example.
- %
- defasis#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`_ = active
- gdefmathunderscore{%
- catcode`_=active
- def_{ifnumfam=slfam _elsesbfi}%
- }
- }
- % 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=.
- defmathbackslash{ifnumfam=ttfam mathchar"075C elsebackslash fi}
- %
- defmath{%
- tex
- mathunderscore
- let\ = mathbackslash
- mathactive
- % make the texinfo accent commands work in math mode
- let"=ddot
- let'=acute
- let==bar
- let^=hat
- let`=grave
- letu=breve
- letv=check
- let~=tilde
- letdotaccent=dot
- $finishmath
- }
- deffinishmath#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
- gdefmathactive{%
- let^ = ptexhat
- let< = ptexless
- let> = ptexgtr
- let+ = ptexplus
- }
- }
- % Some math mode symbols.
- defbullet{$ptexbullet$}
- defgeq{ifmmode geelse $ge$fi}
- defleq{ifmmode leelse $le$fi}
- defminus{ifmmode -else $-$fi}
- % @dots{} outputs an ellipsis using the current font.
- % We do .5em per period so that it has the same spacing in the cm
- % typewriter fonts as three actual period characters; on the other hand,
- % in other typewriter fonts three periods are wider than 1.5em. So do
- % whichever is larger.
- %
- defdots{%
- leavevmode
- setbox0=hbox{...}% get width of three periods
- ifdimwd0 > 1.5em
- dimen0 = wd0
- else
- dimen0 = 1.5em
- fi
- hbox to dimen0{%
- hskip 0pt plus.25fil
- .hskip 0pt plus1fil
- .hskip 0pt plus1fil
- .hskip 0pt plus.5fil
- }%
- }
- % @enddots{} is an end-of-sentence ellipsis.
- %
- defenddots{%
- dots
- spacefactor=endofsentencespacefactor
- }
- % @comma{} is so commas can be inserted into text without messing up
- % Texinfo's parsing.
- %
- letcomma = ,
- % @refill is a no-op.
- letrefill=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).
- %
- newififlinks linkstrue % by default we want the aux files.
- letnovalidate = 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.
- defsetfilename{%
- fixbackslash % Turn off hack to swallow `input texinfo'.
- iflinks
- tryauxfile
- % Open the new aux file. TeX will close it automatically at exit.
- immediateopenoutauxfile=jobname.aux
- fi % openindices needs to do some work in any case.
- openindices
- letsetfilename=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.
- %
- defopenindices{%
- newindex{cp}%
- newcodeindex{fn}%
- newcodeindex{vr}%
- newcodeindex{tp}%
- newcodeindex{ky}%
- newcodeindex{pg}%
- }
- % @bye.
- outerdefbye{pagealignmacrotracingstats=1ptexend}
- message{pdf,}
- % adobe `portable' document format
- newcounttempnum
- newcountlnkcount
- newtoksfilename
- newcountfilenamelength
- newcountpgn
- newtokstoksA
- newtokstoksB
- newtokstoksC
- newtokstoksD
- newboxboxA
- newcountcountA
- newififpdf
- newififpdfmakepagedest
- % 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.
- ifxpdfoutputundefined
- else
- ifxpdfoutputrelax
- else
- ifcasepdfoutput
- else
- pdftrue
- fi
- fi
- fi
- % PDF uses PostScript string constants for the names of xref targets,
- % for display in the outlines, and in other places. Thus, we have to
- % double any backslashes. Otherwise, a name like "node" will be
- % interpreted as a newline (n), followed by o, d, e. Not good.
- % http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html
- % (and related messages, the final outcome is that it is up to the TeX
- % user to double the backslashes and otherwise make the string valid, so
- % that's what we do).
- % double active backslashes.
- %
- {catcode`@=0 catcode`\=active
- @gdef@activebackslashdouble{%
- @catcode`@=@active
- @let=@doublebackslash}
- }
- % To handle parens, we must adopt a different approach, since parens are
- % not active characters. hyperref.dtx (which has the same problem as
- % us) handles it with this amazing macro to replace tokens, with minor
- % changes for Texinfo. It is included here under the GPL by permission
- % from the author, Heiko Oberdiek.
- %
- % #1 is the tokens to replace.
- % #2 is the replacement.
- % #3 is the control sequence with the string.
- %
- defHyPsdSubst#1#2#3{%
- defHyPsdReplace##1#1##2END{%
- ##1%
- ifx\##2\%
- else
- #2%
- HyReturnAfterFi{%
- HyPsdReplace##2END
- }%
- fi
- }%
- xdef#3{expandafterHyPsdReplace#3#1END}%
- }
- longdefHyReturnAfterFi#1fi{fi#1}
- % #1 is a control sequence in which to do the replacements.
- defbackslashparens#1{%
- xdef#1{#1}% redefine it as its expansion; the definition is simply
- % lastnode when called from setref -> pdfmkdest.
- HyPsdSubst{(}{realbackslash(}{#1}%
- HyPsdSubst{)}{realbackslash)}{#1}%
- }
- newhelpnopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
- with PDF output, and none of those formats could be found. (.eps cannot
- be supported due to the design of the PDF format; use regular TeX (DVI
- output) for that.)}
- ifpdf
- %
- % Color manipulation macros based on pdfcolor.tex.
- defcmykDarkRed{0.28 1 1 0.35}
- defcmykBlack{0 0 0 1}
- %
- defpdfsetcolor#1{pdfliteral{#1 k}}
- % Set color, and create a mark which defines thiscolor accordingly,
- % so that makeheadline knows which color to restore.
- defsetcolor#1{%
- xdeflastcolordefs{gdefnoexpandthiscolor{#1}}%
- domark
- pdfsetcolor{#1}%
- }
- %
- defmaincolor{cmykBlack}
- pdfsetcolor{maincolor}
- edefthiscolor{maincolor}
- deflastcolordefs{}
- %
- defmakefootline{%
- baselineskip24pt
- line{pdfsetcolor{maincolor}thefootline}%
- }
- %
- defmakeheadline{%
- vbox to 0pt{%
- vskip-22.5pt
- line{%
- vbox to8.5pt{}%
- % Extract thiscolor definition from the marks.
- getcolormarks
- % Typeset the headline with maincolor, then restore the color.
- pdfsetcolor{maincolor}theheadlinepdfsetcolor{thiscolor}%
- }%
- vss
- }%
- nointerlineskip
- }
- %
- %
- pdfcatalog{/PageMode /UseOutlines}
- %
- % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
- defdopdfimage#1#2#3{%
- defimagewidth{#2}setbox0 = hbox{ignorespaces #2}%
- defimageheight{#3}setbox2 = hbox{ignorespaces #3}%
- %
- % pdftex (and the PDF format) support .png, .jpg, .pdf (among
- % others). Let's try in that order.
- letpdfimgext=empty
- begingroup
- openin 1 #1.png ifeof 1
- openin 1 #1.jpg ifeof 1
- openin 1 #1.jpeg ifeof 1
- openin 1 #1.JPG ifeof 1
- openin 1 #1.pdf ifeof 1
- openin 1 #1.PDF ifeof 1
- errhelp = nopdfimagehelp
- errmessage{Could not find image file #1 for pdf}%
- else gdefpdfimgext{PDF}%
- fi
- else gdefpdfimgext{pdf}%
- fi
- else gdefpdfimgext{JPG}%
- fi
- else gdefpdfimgext{jpeg}%
- fi
- else gdefpdfimgext{jpg}%
- fi
- else gdefpdfimgext{png}%
- fi
- closein 1
- endgroup
- %
- % without immediate, ancient pdftex seg faults when the same image is
- % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
- ifnumpdftexversion < 14
- immediatepdfimage
- else
- immediatepdfximage
- fi
- ifdim wd0 >0pt width imagewidth fi
- ifdim wd2 >0pt height imageheight fi
- ifnumpdftexversion<13
- #1.pdfimgext
- else
- {#1.pdfimgext}%
- fi
- ifnumpdftexversion < 14 else
- pdfrefximage pdflastximage
- fi}
- %
- defpdfmkdest#1{{%
- % We have to set dummies so commands such as @code, and characters
- % such as , aren't expanded when present in a section title.
- indexnofonts
- turnoffactive
- activebackslashdouble
- makevalueexpandable
- defpdfdestname{#1}%
- backslashparenspdfdestname
- safewhatsit{pdfdest name{pdfdestname} xyz}%
- }}
- %
- % used to mark target names; must be expandable.
- defpdfmkpgn#1{#1}
- %
- % by default, use a color that is dark enough to print on paper as
- % nearly black, but still distinguishable for online viewing.
- defurlcolor{cmykDarkRed}
- deflinkcolor{cmykDarkRed}
- defendlink{setcolor{maincolor}pdfendlink}
- %
- % Adding outlines to PDF; macros for calculating structure of outlines
- % come from Petr Olsak
- defexpnumber#1{expandafterifxcsname#1endcsnamerelax 0%
- else csname#1endcsname fi}
- defadvancenumber#1{tempnum=expnumber{#1}relax
- advancetempnum by 1
- expandafterxdefcsname#1endcsname{thetempnum}}
- %
- % #1 is the section text, which is what will be displayed in the
- % outline by the pdf viewer. #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
- %
- defdopdfoutline#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 worth the trouble, since most documents are normally structured.
- defpdfoutlinedest{#3}%
- ifxpdfoutlinedestempty
- defpdfoutlinedest{#4}%
- else
- % Doubled backslashes in the name.
- {activebackslashdouble xdefpdfoutlinedest{#3}%
- backslashparenspdfoutlinedest}%
- fi
- %
- % Also double the backslashes in the display string.
- {activebackslashdouble xdefpdfoutlinetext{#1}%
- backslashparenspdfoutlinetext}%
- %
- pdfoutline goto name{pdfmkpgn{pdfoutlinedest}}#2{pdfoutlinetext}%
- }
- %
- defpdfmakeoutlines{%
- begingroup
- % Thanh's hack / proper braces in bookmarks
- edefmylbrace{iftrue string{else}fi}let{=mylbrace
- edefmyrbrace{iffalse{elsestring}fi}let}=myrbrace
- %
- % Read toc silently, to get counts of subentries for pdfoutline.
- defnumchapentry##1##2##3##4{%
- defthischapnum{##2}%
- defthissecnum{0}%
- defthissubsecnum{0}%
- }%
- defnumsecentry##1##2##3##4{%
- advancenumber{chapthischapnum}%
- defthissecnum{##2}%
- defthissubsecnum{0}%
- }%
- defnumsubsecentry##1##2##3##4{%
- advancenumber{secthissecnum}%
- defthissubsecnum{##2}%
- }%
- defnumsubsubsecentry##1##2##3##4{%
- advancenumber{subsecthissubsecnum}%
- }%
- defthischapnum{0}%
- defthissecnum{0}%
- defthissubsecnum{0}%
- %
- % use def rather than let here because we redefine chapentry et
- % al. a second time, below.
- defappentry{numchapentry}%
- defappsecentry{numsecentry}%
- defappsubsecentry{numsubsecentry}%
- defappsubsubsecentry{numsubsubsecentry}%
- defunnchapentry{numchapentry}%
- defunnsecentry{numsecentry}%
- defunnsubsecentry{numsubsecentry}%
- defunnsubsubsecentry{numsubsubsecentry}%
- readdatafile{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.
- defnumchapentry##1##2##3##4{%
- dopdfoutline{##1}{count-expnumber{chap##2}}{##3}{##4}}%
- defnumsecentry##1##2##3##4{%
- dopdfoutline{##1}{count-expnumber{sec##2}}{##3}{##4}}%
- defnumsubsecentry##1##2##3##4{%
- dopdfoutline{##1}{count-expnumber{subsec##2}}{##3}{##4}}%
- defnumsubsubsecentry##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
- setupdatafile
- catcode`\=active otherbackslash
- input tocreadfilename
- endgroup
- }
- %
- defskipspaces#1{defPP{#1}defD{|}%
- ifxPPDletnextsprelax
- elseletnextspskipspaces
- ifxpspaceelseaddtokens{filename}{PP}%
- advancefilenamelength by 1
- fi
- fi
- nextsp}
- defgetfilename#1{filenamelength=0expandafterskipspaces#1|relax}
- ifnumpdftexversion < 14
- let startlink pdfannotlink
- else
- let startlink pdfstartlink
- fi
- % make a live url in pdf output.
- defpdfurl#1{%
- begingroup
- % it seems we really need yet another set of dummies; have not
- % tried to figure out what each command should do in the context
- % of @url. for now, just make @/ a no-op, that's the only one
- % people have actually reported a problem with.
- %
- normalturnoffactive
- def@{@}%
- let/=empty
- makevalueexpandable
- leavevmodesetcolor{urlcolor}%
- startlink attr{/Border [0 0 0]}%
- user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
- endgroup}
- defpdfgettoks#1.{setboxboxA=hbox{toksA={#1.}toksB={}maketoks}}
- defaddtokens#1#2{edefaddtoks{noexpand#1={the#1#2}}addtoks}
- defadn#1{addtokens{toksC}{#1}globalcountA=1letnext=maketoks}
- defpoptoks#1#2|ENDTOKS|{letfirst=#1toksD={#1}toksA={#2}}
- defmaketoks{%
- expandafterpoptoksthetoksA|ENDTOKS|relax
- ifxfirst0adn0
- elseifxfirst1adn1 elseifxfirst2adn2 elseifxfirst3adn3
- elseifxfirst4adn4 elseifxfirst5adn5 elseifxfirst6adn6
- elseifxfirst7adn7 elseifxfirst8adn8 elseifxfirst9adn9
- else
- ifnum0=countAelsemakelinkfi
- ifxfirst.letnext=doneelse
- letnext=maketoks
- addtokens{toksB}{thetoksD}
- ifxfirst,addtokens{toksB}{space}fi
- fi
- fifififififififififi
- next}
- defmakelink{addtokens{toksB}%
- {noexpandpdflink{thetoksC}}toksC={}globalcountA=0}
- defpdflink#1{%
- startlink attr{/Border [0 0 0]} goto name{pdfmkpgn{#1}}
- setcolor{linkcolor}#1endlink}
- defdone{edefst{globalnoexpandtoksA={thetoksB}}st}
- else
- letpdfmkdest = gobble
- letpdfurl = gobble
- letendlink = relax
- letsetcolor = gobble
- letpdfsetcolor = gobble
- letpdfmakeoutlines = relax
- fi % ifxpdfoutput
- 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.
- %
- defsetfontstyle#1{%
- defcurfontstyle{#1}% not as a control sequence, because we are edef'd.
- csname ten#1endcsname % change the current font
- }
- % Select #1 fonts with the current style.
- %
- defselectfonts#1{csname #1fontsendcsname csnamecurfontstyleendcsname}
- defrm{fam=0 setfontstyle{rm}}
- defit{fam=itfam setfontstyle{it}}
- defsl{fam=slfam setfontstyle{sl}}
- defbf{fam=bffam setfontstyle{bf}}defbfstylename{bf}
- deftt{fam=ttfam setfontstyle{tt}}
- % Texinfo sort of supports the sans serif font style, which plain TeX does not.
- % So we set up a sf.
- newfamsffam
- defsf{fam=sffam setfontstyle{sf}}
- letli = sf % Sometimes we call it li, not sf.
- % We don't need math for this font style.
- defttsl{setfontstyle{ttsl}}
- % Default leading.
- newdimentextleading 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.
- %
- deflineskipfactor{.08333}
- defstrutheightpercent{.70833}
- defstrutdepthpercent {.29167}
- %
- % can get a sort of poor man's double spacing by redefining this.
- defbaselinefactor{1}
- %
- defsetleading#1{%
- dimen0 = #1relax
- normalbaselineskip = baselinefactordimen0
- normallineskip = lineskipfactornormalbaselineskip
- normalbaselines
- setboxstrutbox =hbox{%
- vrule width0pt heightstrutheightpercentbaselineskip
- depth strutdepthpercent baselineskip
- }%
- }
- % PDF CMaps. See also LaTeX's t1.cmap.
- %
- % do nothing with this by default.
- expandafterletcsname cmapOT1endcsnamegobble
- expandafterletcsname cmapOT1ITendcsnamegobble
- expandafterletcsname cmapOT1TTendcsnamegobble
- % if we are producing pdf, and we have pdffontattr, then define cmaps.
- % (pdffontattr was introduced many years ago, but people still run
- % older pdftex's; it's easy to conditionalize, so we do.)
- ifpdf ifxpdffontattrundefined else
- begingroup
- catcode`^^M=active def^^M{^^J}% Output line endings as the ^^J char.
- catcode`%=12 immediatepdfobj stream {%!PS-Adobe-3.0 Resource-CMap
- %%DocumentNeededResources: ProcSet (CIDInit)
- %%IncludeResource: ProcSet (CIDInit)
- %%BeginResource: CMap (TeX-OT1-0)
- %%Title: (TeX-OT1-0 TeX OT1 0)
- %%Version: 1.000
- %%EndComments
- /CIDInit /ProcSet findresource begin
- 12 dict begin
- begincmap
- /CIDSystemInfo
- << /Registry (TeX)
- /Ordering (OT1)
- /Supplement 0
- >> def
- /CMapName /TeX-OT1-0 def
- /CMapType 2 def
- 1 begincodespacerange
- <00> <7F>
- endcodespacerange
- 8 beginbfrange
- <00> <01> <0393>
- <09> <0A> <03A8>
- <23> <26> <0023>
- <28> <3B> <0028>
- <3F> <5B> <003F>
- <5D> <5E> <005D>
- <61> <7A> <0061>
- <7B> <7C> <2013>
- endbfrange
- 40 beginbfchar
- <02> <0398>
- <03> <039B>
- <04> <039E>
- <05> <03A0>
- <06> <03A3>
- <07> <03D2>
- <08> <03A6>
- <0B> <00660066>
- <0C> <00660069>
- <0D> <0066006C>
- <0E> <006600660069>
- <0F> <00660066006C>
- <10> <0131>
- <11> <0237>
- <12> <0060>
- <13> <00B4>
- <14> <02C7>
- <15> <02D8>
- <16> <00AF>
- <17> <02DA>
- <18> <00B8>
- <19> <00DF>
- <1A> <00E6>
- <1B> <0153>
- <1C> <00F8>
- <1D> <00C6>
- <1E> <0152>
- <1F> <00D8>
- <21> <0021>
- <22> <201D>
- <27> <2019>
- <3C> <00A1>
- <3D> <003D>
- <3E> <00BF>
- <5C> <201C>
- <5F> <02D9>
- <60> <2018>
- <7D> <02DD>
- <7E> <007E>
- <7F> <00A8>
- endbfchar
- endcmap
- CMapName currentdict /CMap defineresource pop
- end
- end
- %%EndResource
- %%EOF
- }endgroup
- expandafteredefcsname cmapOT1endcsname#1{%
- pdffontattr#1{/ToUnicode thepdflastobjspace 0 R}%
- }%
- %
- % cmapOT1IT
- begingroup
- catcode`^^M=active def^^M{^^J}% Output line endings as the ^^J char.
- catcode`%=12 immediatepdfobj stream {%!PS-Adobe-3.0 Resource-CMap
- %%DocumentNeededResources: ProcSet (CIDInit)
- %%IncludeResource: ProcSet (CIDInit)
- %%BeginResource: CMap (TeX-OT1IT-0)
- %%Title: (TeX-OT1IT-0 TeX OT1IT 0)
- %%Version: 1.000
- %%EndComments
- /CIDInit /ProcSet findresource begin
- 12 dict begin
- begincmap
- /CIDSystemInfo
- << /Registry (TeX)
- /Ordering (OT1IT)
- /Supplement 0
- >> def
- /CMapName /TeX-OT1IT-0 def
- /CMapType 2 def
- 1 begincodespacerange
- <00> <7F>
- endcodespacerange
- 8 beginbfrange
- <00> <01> <0393>
- <09> <0A> <03A8>
- <25> <26> <0025>
- <28> <3B> <0028>
- <3F> <5B> <003F>
- <5D> <5E> <005D>
- <61> <7A> <0061>
- <7B> <7C> <2013>
- endbfrange
- 42 beginbfchar
- <02> <0398>
- <03> <039B>
- <04> <039E>
- <05> <03A0>
- <06> <03A3>
- <07> <03D2>
- <08> <03A6>
- <0B> <00660066>
- <0C> <00660069>
- <0D> <0066006C>
- <0E> <006600660069>
- <0F> <00660066006C>
- <10> <0131>
- <11> <0237>
- <12> <0060>
- <13> <00B4>
- <14> <02C7>
- <15> <02D8>
- <16> <00AF>
- <17> <02DA>
- <18> <00B8>
- <19> <00DF>
- <1A> <00E6>
- <1B> <0153>
- <1C> <00F8>
- <1D> <00C6>
- <1E> <0152>
- <1F> <00D8>
- <21> <0021>
- <22> <201D>
- <23> <0023>
- <24> <00A3>
- <27> <2019>
- <3C> <00A1>
- <3D> <003D>
- <3E> <00BF>
- <5C> <201C>
- <5F> <02D9>
- <60> <2018>
- <7D> <02DD>
- <7E> <007E>
- <7F> <00A8>
- endbfchar
- endcmap
- CMapName currentdict /CMap defineresource pop
- end
- end
- %%EndResource
- %%EOF
- }endgroup
- expandafteredefcsname cmapOT1ITendcsname#1{%
- pdffontattr#1{/ToUnicode thepdflastobjspace 0 R}%
- }%
- %
- % cmapOT1TT
- begingroup
- catcode`^^M=active def^^M{^^J}% Output line endings as the ^^J char.
- catcode`%=12 immediatepdfobj stream {%!PS-Adobe-3.0 Resource-CMap
- %%DocumentNeededResources: ProcSet (CIDInit)
- %%IncludeResource: ProcSet (CIDInit)
- %%BeginResource: CMap (TeX-OT1TT-0)
- %%Title: (TeX-OT1TT-0 TeX OT1TT 0)
- %%Version: 1.000
- %%EndComments
- /CIDInit /ProcSet findresource begin
- 12 dict begin
- begincmap
- /CIDSystemInfo
- << /Registry (TeX)
- /Ordering (OT1TT)
- /Supplement 0
- >> def
- /CMapName /TeX-OT1TT-0 def
- /CMapType 2 def
- 1 begincodespacerange
- <00> <7F>
- endcodespacerange
- 5 beginbfrange
- <00> <01> <0393>
- <09> <0A> <03A8>
- <21> <26> <0021>
- <28> <5F> <0028>
- <61> <7E> <0061>
- endbfrange
- 32 beginbfchar
- <02> <0398>
- <03> <039B>
- <04> <039E>
- <05> <03A0>
- <06> <03A3>
- <07> <03D2>
- <08> <03A6>
- <0B> <2191>
- <0C> <2193>
- <0D> <0027>
- <0E> <00A1>
- <0F> <00BF>
- <10> <0131>
- <11> <0237>
- <12> <0060>
- <13> <00B4>
- <14> <02C7>
- <15> <02D8>
- <16> <00AF>
- <17> <02DA>
- <18> <00B8>
- <19> <00DF>
- <1A> <00E6>
- <1B> <0153>
- <1C> <00F8>
- <1D> <00C6>
- <1E> <0152>
- <1F> <00D8>
- <20> <2423>
- <27> <2019>
- <60> <2018>
- <7F> <00A8>
- endbfchar
- endcmap
- CMapName currentdict /CMap defineresource pop
- end
- end
- %%EndResource
- %%EOF
- }endgroup
- expandafteredefcsname cmapOT1TTendcsname#1{%
- pdffontattr#1{/ToUnicode thepdflastobjspace 0 R}%
- }%
- fifi
- % 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, #5 is the CMap
- % encoding (currently only OT1, OT1IT and OT1TT are allowed, pass
- % empty to omit).
- defsetfont#1#2#3#4#5{%
- font#1=fontprefix#2#3 scaled #4
- csname cmap#5endcsname#1%
- }
- % This is what gets called when #5 of setfont is empty.
- letcmapgobble
- % emacs-page end of cmaps
- % Use cm as the default font prefix.
- % To specify the font prefix, you must define fontprefix
- % before you read in texinfo.tex.
- ifxfontprefixundefined
- deffontprefix{cm}
- fi
- % Support font families that don't use the same naming scheme as CM.
- defrmshape{r}
- defrmbshape{bx} %where the normal face is bold
- defbfshape{b}
- defbxshape{bx}
- defttshape{tt}
- defttbshape{tt}
- defttslshape{sltt}
- defitshape{ti}
- defitbshape{bxti}
- defslshape{sl}
- defslbshape{bxsl}
- defsfshape{ss}
- defsfbshape{ss}
- defscshape{csc}
- defscbshape{csc}
- % Definitions for a main text size of 11pt. This is the default in
- % Texinfo.
- %
- defdefinetextfontsizexi{%
- % Text fonts (11.2pt, magstep1).
- deftextnominalsize{11pt}
- edefmainmagstep{magstephalf}
- setfonttextrmrmshape{10}{mainmagstep}{OT1}
- setfonttextttttshape{10}{mainmagstep}{OT1TT}
- setfonttextbfbfshape{10}{mainmagstep}{OT1}
- setfonttextititshape{10}{mainmagstep}{OT1IT}
- setfonttextslslshape{10}{mainmagstep}{OT1}
- setfonttextsfsfshape{10}{mainmagstep}{OT1}
- setfonttextscscshape{10}{mainmagstep}{OT1}
- setfonttextttslttslshape{10}{mainmagstep}{OT1TT}
- fonttexti=cmmi10 scaled mainmagstep
- fonttextsy=cmsy10 scaled mainmagstep
- deftextecsize{1095}
- % A few fonts for @defun names and args.
- setfontdefbfbfshape{10}{magstep1}{OT1}
- setfontdefttttshape{10}{magstep1}{OT1TT}
- setfontdefttslttslshape{10}{magstep1}{OT1TT}
- defdf{lettentt=deftt lettenbf = defbf lettenttsl=defttsl bf}
- % Fonts for indices, footnotes, small examples (9pt).
- defsmallnominalsize{9pt}
- setfontsmallrmrmshape{9}{1000}{OT1}
- setfontsmallttttshape{9}{1000}{OT1TT}
- setfontsmallbfbfshape{10}{900}{OT1}
- setfontsmallititshape{9}{1000}{OT1IT}
- setfontsmallslslshape{9}{1000}{OT1}
- setfontsmallsfsfshape{9}{1000}{OT1}
- setfontsmallscscshape{10}{900}{OT1}
- setfontsmallttslttslshape{10}{900}{OT1TT}
- fontsmalli=cmmi9
- fontsmallsy=cmsy9
- defsmallecsize{0900}
- % Fonts for small examples (8pt).
- defsmallernominalsize{8pt}
- setfontsmallerrmrmshape{8}{1000}{OT1}
- setfontsmallerttttshape{8}{1000}{OT1TT}
- setfontsmallerbfbfshape{10}{800}{OT1}
- setfontsmallerititshape{8}{1000}{OT1IT}
- setfontsmallerslslshape{8}{1000}{OT1}
- setfontsmallersfsfshape{8}{1000}{OT1}
- setfontsmallerscscshape{10}{800}{OT1}
- setfontsmallerttslttslshape{10}{800}{OT1TT}
- fontsmalleri=cmmi8
- fontsmallersy=cmsy8
- defsmallerecsize{0800}
- % Fonts for title page (20.4pt):
- deftitlenominalsize{20pt}
- setfonttitlermrmbshape{12}{magstep3}{OT1}
- setfonttitleititbshape{10}{magstep4}{OT1IT}
- setfonttitleslslbshape{10}{magstep4}{OT1}
- setfonttitlettttbshape{12}{magstep3}{OT1TT}
- setfonttitlettslttslshape{10}{magstep4}{OT1TT}
- setfonttitlesfsfbshape{17}{magstep1}{OT1}
- lettitlebf=titlerm
- setfonttitlescscbshape{10}{magstep4}{OT1}
- fonttitlei=cmmi12 scaled magstep3
- fonttitlesy=cmsy10 scaled magstep4
- defauthorrm{secrm}
- defauthortt{sectt}
- deftitleecsize{2074}
- % Chapter (and unnumbered) fonts (17.28pt).
- defchapnominalsize{17pt}
- setfontchaprmrmbshape{12}{magstep2}{OT1}
- setfontchapititbshape{10}{magstep3}{OT1IT}
- setfontchapslslbshape{10}{magstep3}{OT1}
- setfontchapttttbshape{12}{magstep2}{OT1TT}
- setfontchapttslttslshape{10}{magstep3}{OT1TT}
- setfontchapsfsfbshape{17}{1000}{OT1}
- letchapbf=chaprm
- setfontchapscscbshape{10}{magstep3}{OT1}
- fontchapi=cmmi12 scaled magstep2
- fontchapsy=cmsy10 scaled magstep3
- defchapecsize{1728}
- % Section fonts (14.4pt).
- defsecnominalsize{14pt}
- setfontsecrmrmbshape{12}{magstep1}{OT1}
- setfontsecititbshape{10}{magstep2}{OT1IT}
- setfontsecslslbshape{10}{magstep2}{OT1}
- setfontsecttttbshape{12}{magstep1}{OT1TT}
- setfontsecttslttslshape{10}{magstep2}{OT1TT}
- setfontsecsfsfbshape{12}{magstep1}{OT1}
- letsecbfsecrm
- setfontsecscscbshape{10}{magstep2}{OT1}
- fontseci=cmmi12 scaled magstep1
- fontsecsy=cmsy10 scaled magstep2
- defsececsize{1440}
- % Subsection fonts (13.15pt).
- defssecnominalsize{13pt}
- setfontssecrmrmbshape{12}{magstephalf}{OT1}
- setfontssecititbshape{10}{1315}{OT1IT}
- setfontssecslslbshape{10}{1315}{OT1}
- setfontssecttttbshape{12}{magstephalf}{OT1TT}
- setfontssecttslttslshape{10}{1315}{OT1TT}
- setfontssecsfsfbshape{12}{magstephalf}{OT1}
- letssecbfssecrm
- setfontssecscscbshape{10}{1315}{OT1}
- fontsseci=cmmi12 scaled magstephalf
- fontssecsy=cmsy10 scaled 1315
- defssececsize{1200}
- % Reduced fonts for @acro in text (10pt).
- defreducednominalsize{10pt}
- setfontreducedrmrmshape{10}{1000}{OT1}
- setfontreducedttttshape{10}{1000}{OT1TT}
- setfontreducedbfbfshape{10}{1000}{OT1}
- setfontreducedititshape{10}{1000}{OT1IT}
- setfontreducedslslshape{10}{1000}{OT1}
- setfontreducedsfsfshape{10}{1000}{OT1}
- setfontreducedscscshape{10}{1000}{OT1}
- setfontreducedttslttslshape{10}{1000}{OT1TT}
- fontreducedi=cmmi10
- fontreducedsy=cmsy10
- defreducedecsize{1000}
- % reset the current fonts
- textfonts
- rm
- } % end of 11pt text font size definitions
- % Definitions to make the main text be 10pt Computer Modern, with
- % section, chapter, etc., sizes following suit. This is for the GNU
- % Press printing of the Emacs 22 manual. Maybe other manuals in the
- % future. Used with @smallbook, which sets the leading to 12pt.
- %
- defdefinetextfontsizex{%
- % Text fonts (10pt).
- deftextnominalsize{10pt}
- edefmainmagstep{1000}
- setfonttextrmrmshape{10}{mainmagstep}{OT1}
- setfonttextttttshape{10}{mainmagstep}{OT1TT}
- setfonttextbfbfshape{10}{mainmagstep}{OT1}
- setfonttextititshape{10}{mainmagstep}{OT1IT}
- setfonttextslslshape{10}{mainmagstep}{OT1}
- setfonttextsfsfshape{10}{mainmagstep}{OT1}
- setfonttextscscshape{10}{mainmagstep}{OT1}
- setfonttextttslttslshape{10}{mainmagstep}{OT1TT}
- fonttexti=cmmi10 scaled mainmagstep
- fonttextsy=cmsy10 scaled mainmagstep
- deftextecsize{1000}
- % A few fonts for @defun names and args.
- setfontdefbfbfshape{10}{magstephalf}{OT1}
- setfontdefttttshape{10}{magstephalf}{OT1TT}
- setfontdefttslttslshape{10}{magstephalf}{OT1TT}
- defdf{lettentt=deftt lettenbf = defbf lettenttsl=defttsl bf}
- % Fonts for indices, footnotes, small examples (9pt).
- defsmallnominalsize{9pt}
- setfontsmallrmrmshape{9}{1000}{OT1}
- setfontsmallttttshape{9}{1000}{OT1TT}
- setfontsmallbfbfshape{10}{900}{OT1}
- setfontsmallititshape{9}{1000}{OT1IT}
- setfontsmallslslshape{9}{1000}{OT1}
- setfontsmallsfsfshape{9}{1000}{OT1}
- setfontsmallscscshape{10}{900}{OT1}
- setfontsmallttslttslshape{10}{900}{OT1TT}
- fontsmalli=cmmi9
- fontsmallsy=cmsy9
- defsmallecsize{0900}
- % Fonts for small examples (8pt).
- defsmallernominalsize{8pt}
- setfontsmallerrmrmshape{8}{1000}{OT1}
- setfontsmallerttttshape{8}{1000}{OT1TT}
- setfontsmallerbfbfshape{10}{800}{OT1}
- setfontsmallerititshape{8}{1000}{OT1IT}
- setfontsmallerslslshape{8}{1000}{OT1}
- setfontsmallersfsfshape{8}{1000}{OT1}
- setfontsmallerscscshape{10}{800}{OT1}
- setfontsmallerttslttslshape{10}{800}{OT1TT}
- fontsmalleri=cmmi8
- fontsmallersy=cmsy8
- defsmallerecsize{0800}
- % Fonts for title page (20.4pt):
- deftitlenominalsize{20pt}
- setfonttitlermrmbshape{12}{magstep3}{OT1}
- setfonttitleititbshape{10}{magstep4}{OT1IT}
- setfonttitleslslbshape{10}{magstep4}{OT1}
- setfonttitlettttbshape{12}{magstep3}{OT1TT}
- setfonttitlettslttslshape{10}{magstep4}{OT1TT}
- setfonttitlesfsfbshape{17}{magstep1}{OT1}
- lettitlebf=titlerm
- setfonttitlescscbshape{10}{magstep4}{OT1}
- fonttitlei=cmmi12 scaled magstep3
- fonttitlesy=cmsy10 scaled magstep4
- defauthorrm{secrm}
- defauthortt{sectt}
- deftitleecsize{2074}
- % Chapter fonts (14.4pt).
- defchapnominalsize{14pt}
- setfontchaprmrmbshape{12}{magstep1}{OT1}
- setfontchapititbshape{10}{magstep2}{OT1IT}
- setfontchapslslbshape{10}{magstep2}{OT1}
- setfontchapttttbshape{12}{magstep1}{OT1TT}
- setfontchapttslttslshape{10}{magstep2}{OT1TT}
- setfontchapsfsfbshape{12}{magstep1}{OT1}
- letchapbfchaprm
- setfontchapscscbshape{10}{magstep2}{OT1}
- fontchapi=cmmi12 scaled magstep1
- fontchapsy=cmsy10 scaled magstep2
- defchapecsize{1440}
- % Section fonts (12pt).
- defsecnominalsize{12pt}
- setfontsecrmrmbshape{12}{1000}{OT1}
- setfontsecititbshape{10}{magstep1}{OT1IT}
- setfontsecslslbshape{10}{magstep1}{OT1}
- setfontsecttttbshape{12}{1000}{OT1TT}
- setfontsecttslttslshape{10}{magstep1}{OT1TT}
- setfontsecsfsfbshape{12}{1000}{OT1}
- letsecbfsecrm
- setfontsecscscbshape{10}{magstep1}{OT1}
- fontseci=cmmi12
- fontsecsy=cmsy10 scaled magstep1
- defsececsize{1200}
- % Subsection fonts (10pt).
- defssecnominalsize{10pt}
- setfontssecrmrmbshape{10}{1000}{OT1}
- setfontssecititbshape{10}{1000}{OT1IT}
- setfontssecslslbshape{10}{1000}{OT1}
- setfontssecttttbshape{10}{1000}{OT1TT}
- setfontssecttslttslshape{10}{1000}{OT1TT}
- setfontssecsfsfbshape{10}{1000}{OT1}
- letssecbfssecrm
- setfontssecscscbshape{10}{1000}{OT1}
- fontsseci=cmmi10
- fontssecsy=cmsy10
- defssececsize{1000}
- % Reduced fonts for @acro in text (9pt).
- defreducednominalsize{9pt}
- setfontreducedrmrmshape{9}{1000}{OT1}
- setfontreducedttttshape{9}{1000}{OT1TT}
- setfontreducedbfbfshape{10}{900}{OT1}
- setfontreducedititshape{9}{1000}{OT1IT}
- setfontreducedslslshape{9}{1000}{OT1}
- setfontreducedsfsfshape{9}{1000}{OT1}
- setfontreducedscscshape{10}{900}{OT1}
- setfontreducedttslttslshape{10}{900}{OT1TT}
- fontreducedi=cmmi9
- fontreducedsy=cmsy9
- defreducedecsize{0900}
- % reduce space between paragraphs
- divideparskip by 2
- % reset the current fonts
- textfonts
- rm
- } % end of 10pt text font size definitions
- % We provide the user-level command
- % @fonttextsize 10
- % (or 11) to redefine the text font size. pt is assumed.
- %
- defxword{10}
- defxiword{11}
- %
- parseargdeffonttextsize{%
- deftextsizearg{#1}%
- wlog{doing @fonttextsize textsizearg}%
- %
- % Set globaldefs so that documents can use this inside @tex, since
- % makeinfo 4.8 does not support it, but we need it nonetheless.
- %
- begingroup globaldefs=1
- ifxtextsizeargxword definetextfontsizex
- else ifxtextsizeargxiword definetextfontsizexi
- else
- errhelp=EMsimple
- errmessage{@fonttextsize only supports `10' or `11', not `textsizearg'}
- fifi
- endgroup
- }
- % In order for the font changes to affect most math symbols and letters,
- % we have to define the textfont of the standard families. Since
- % texinfo doesn't allow for producing subscripts and superscripts except
- % in the main text, we don't bother to reset scriptfont and
- % scriptscriptfont (which would also require loading a lot more fonts).
- %
- defresetmathfonts{%
- textfont0=tenrm textfont1=teni textfont2=tensy
- textfontitfam=tenit textfontslfam=tensl textfontbffam=tenbf
- textfontttfam=tentt textfontsffam=tensf
- }
- % The font-changing commands redefine the meanings of tenSTYLE, instead
- % of just STYLE. We do this because STYLE needs to also set the
- % current fam for math mode. Our STYLE (e.g., rm) commands hardwire
- % tenSTYLE to set the current font.
- %
- % Each font-changing command also sets the names lsize (one size lower)
- % and lllsize (three sizes lower). These relative commands are used in
- % the LaTeX logo and acronyms.
- %
- % This all needs generalizing, badly.
- %
- deftextfonts{%
- lettenrm=textrm lettenit=textit lettensl=textsl
- lettenbf=textbf lettentt=texttt letsmallcaps=textsc
- lettensf=textsf letteni=texti lettensy=textsy
- lettenttsl=textttsl
- defcurfontsize{text}%
- deflsize{reduced}deflllsize{smaller}%
- resetmathfonts setleading{textleading}}
- deftitlefonts{%
- lettenrm=titlerm lettenit=titleit lettensl=titlesl
- lettenbf=titlebf lettentt=titlett letsmallcaps=titlesc
- lettensf=titlesf letteni=titlei lettensy=titlesy
- lettenttsl=titlettsl
- defcurfontsize{title}%
- deflsize{chap}deflllsize{subsec}%
- resetmathfonts setleading{25pt}}
- deftitlefont#1{{titlefontsrm #1}}
- defchapfonts{%
- lettenrm=chaprm lettenit=chapit lettensl=chapsl
- lettenbf=chapbf lettentt=chaptt letsmallcaps=chapsc
- lettensf=chapsf letteni=chapi lettensy=chapsy
- lettenttsl=chapttsl
- defcurfontsize{chap}%
- deflsize{sec}deflllsize{text}%
- resetmathfonts setleading{19pt}}
- defsecfonts{%
- lettenrm=secrm lettenit=secit lettensl=secsl
- lettenbf=secbf lettentt=sectt letsmallcaps=secsc
- lettensf=secsf letteni=seci lettensy=secsy
- lettenttsl=secttsl
- defcurfontsize{sec}%
- deflsize{subsec}deflllsize{reduced}%
- resetmathfonts setleading{16pt}}
- defsubsecfonts{%
- lettenrm=ssecrm lettenit=ssecit lettensl=ssecsl
- lettenbf=ssecbf lettentt=ssectt letsmallcaps=ssecsc
- lettensf=ssecsf letteni=sseci lettensy=ssecsy
- lettenttsl=ssecttsl
- defcurfontsize{ssec}%
- deflsize{text}deflllsize{small}%
- resetmathfonts setleading{15pt}}
- letsubsubsecfonts = subsecfonts
- defreducedfonts{%
- lettenrm=reducedrm lettenit=reducedit lettensl=reducedsl
- lettenbf=reducedbf lettentt=reducedtt letreducedcaps=reducedsc
- lettensf=reducedsf letteni=reducedi lettensy=reducedsy
- lettenttsl=reducedttsl
- defcurfontsize{reduced}%
- deflsize{small}deflllsize{smaller}%
- resetmathfonts setleading{10.5pt}}
- defsmallfonts{%
- lettenrm=smallrm lettenit=smallit lettensl=smallsl
- lettenbf=smallbf lettentt=smalltt letsmallcaps=smallsc
- lettensf=smallsf letteni=smalli lettensy=smallsy
- lettenttsl=smallttsl
- defcurfontsize{small}%
- deflsize{smaller}deflllsize{smaller}%
- resetmathfonts setleading{10.5pt}}
- defsmallerfonts{%
- lettenrm=smallerrm lettenit=smallerit lettensl=smallersl
- lettenbf=smallerbf lettentt=smallertt letsmallcaps=smallersc
- lettensf=smallersf letteni=smalleri lettensy=smallersy
- lettenttsl=smallerttsl
- defcurfontsize{smaller}%
- deflsize{smaller}deflllsize{smaller}%
- resetmathfonts setleading{9.5pt}}
- % Set the fonts to use with the @small... environments.
- letsmallexamplefonts = smallfonts
- % About smallexamplefonts. If we use smallfonts (9pt), @smallexample
- % can fit this many characters:
- % 8.5x11=86 smallbook=72 a4=90 a5=69
- % If we use scriptfonts (8pt), then we can fit this many characters:
- % 8.5x11=90+ smallbook=80 a4=90+ a5=77
- % For me, subjectively, the few extra characters that fit aren't worth
- % the additional smallness of 8pt. So I'm making the default 9pt.
- %
- % By the way, for comparison, here's what fits with @example (10pt):
- % 8.5x11=71 smallbook=60 a4=75 a5=58
- %
- % I wish the USA used A4 paper.
- % --karl, 24jan03.
- % Set up the default fonts, so we can use them for creating boxes.
- %
- definetextfontsizexi
- % Define these so they can be easily changed for other fonts.
- defangleleft{$langle$}
- defangleright{$rangle$}
- % Count depth in font-changes, for error checks
- newcountfontdepth fontdepth=0
- % Fonts for short table of contents.
- setfontshortcontrmrmshape{12}{1000}{OT1}
- setfontshortcontbfbfshape{10}{magstep1}{OT1} % no cmb12
- setfontshortcontslslshape{12}{1000}{OT1}
- setfontshortcontttttshape{12}{1000}{OT1TT}
- %% Add scribe-like font environments, plus @l for inline lisp (usually sans
- %% serif) and @ii for TeX italic
- % smartitalic{ARG} outputs arg in italics, followed by an italic correction
- % unless the following character is such as not to need one.
- defsmartitalicx{ifxnext,elseifxnext-elseifxnext.else
- ptexslashfififi}
- defsmartslanted#1{{ifusingttttslsl #1}futureletnextsmartitalicx}
- defsmartitalic#1{{ifusingttttslit #1}futureletnextsmartitalicx}
- % like smartslanted except unconditionally uses ttsl.
- % @var is set to this for defun arguments.
- defttslanted#1{{ttsl #1}futureletnextsmartitalicx}
- % like smartslanted except unconditionally use sl. We never want
- % ttsl for book titles, do we?
- defcite#1{{sl #1}futureletnextsmartitalicx}
- leti=smartitalic
- letslanted=smartslanted
- letvar=smartslanted
- letdfn=smartslanted
- letemph=smartitalic
- % @b, explicit bold.
- defb#1{{bf #1}}
- letstrong=b
- % @sansserif, explicit sans.
- defsansserif#1{{sf #1}}
- % We can't just use exhyphenpenalty, because that only has effect at
- % the end of a paragraph. Restore normal hyphenation at the end of the
- % group within which nohyphenation is presumably called.
- %
- defnohyphenation{hyphencharfont = -1 aftergrouprestorehyphenation}
- defrestorehyphenation{hyphencharfont = `- }
- % Set sfcode to normal for the chars that usually have another value.
- % Can't use plain's frenchspacing because it uses the `x notation, and
- % sometimes x has an active definition that messes things up.
- %
- catcode`@=11
- defplainfrenchspacing{%
- sfcodedotChar =@m sfcodequestChar=@m sfcodeexclamChar=@m
- sfcodecolonChar=@m sfcodesemiChar =@m sfcodecommaChar =@m
- defendofsentencespacefactor{1000}% for @. and friends
- }
- defplainnonfrenchspacing{%
- sfcode`.3000sfcode`?3000sfcode`!3000
- sfcode`:2000sfcode`;1500sfcode`,1250
- defendofsentencespacefactor{3000}% for @. and friends
- }
- catcode`@=other
- defendofsentencespacefactor{3000}% default
- deft#1{%
- {tt rawbackslash plainfrenchspacing #1}%
- null
- }
- defsamp#1{`tclose{#1}'null}
- setfontkeyrmrmshape{8}{1000}{OT1}
- fontkeysy=cmsy9
- defkey#1{{keyrmtextfont2=keysy leavevmodehbox{%
- raise0.4pthbox{angleleft}kern-.08emvtop{%
- vbox{hrulekern-0.4pt
- hbox{raise0.4pthbox{vphantom{angleleft}}#1}}%
- kern-0.4pthrule}%
- kern-.06emraise0.4pthbox{angleright}}}}
- defkey #1{{nohyphenation uppercase{#1}}null}
- % The old definition, with no lozenge:
- %defkey #1{{ttsl nohyphenation uppercase{#1}}null}
- defctrl #1{{tt rawbackslash hat}#1}
- % @file, @option are the same as @samp.
- letfile=samp
- letoption=samp
- % @code is a modification of @t,
- % which makes spaces the same size as normal in the surrounding text.
- deftclose#1{%
- {%
- % Change normal interword space to be same as for the current font.
- spaceskip = fontdimen2font
- %
- % Switch to typewriter.
- tt
- %
- % But ` ' produces the large typewriter interword space.
- def {{spaceskip = 0pt{} }}%
- %
- % Turn off hyphenation.
- nohyphenation
- %
- rawbackslash
- plainfrenchspacing
- #1%
- }%
- null
- }
- % We *must* turn on hyphenation at `-' and `_' in @code.
- % Otherwise, it is too hard to avoid overfull hboxes
- % in the Emacs manual, the Library manual, etc.
- % Unfortunately, TeX uses one parameter (hyphenchar) to control
- % both hyphenation at - and hyphenation within words.
- % We must therefore turn them both off (tclose does that)
- % and arrange explicitly to hyphenate at a dash.
- % -- rms.
- {
- catcode`-=active catcode`_=active
- catcode`'=active catcode``=active
- %
- globaldefcode{begingroup
- catcoderquoteChar=active catcodelquoteChar=active
- let'codequoteright let`codequoteleft
- %
- catcodedashChar=active catcodeunderChar=active
- ifallowcodebreaks
- let-codedash
- let_codeunder
- else
- let-realdash
- let_realunder
- fi
- codex
- }
- }
- defrealdash{-}
- defcodedash{-discretionary{}{}{}}
- defcodeunder{%
- % this is all so @math{@code{var_name}+1} can work. In math mode, _
- % is "active" (mathcode"8000) and normalunderscore (or char95, etc.)
- % will therefore expand the active definition of _, which is us
- % (inside @code that is), therefore an endless loop.
- ifusingtt{ifmmode
- mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
- elsenormalunderscore fi
- discretionary{}{}{}}%
- {_}%
- }
- defcodex #1{tclose{#1}endgroup}
- % An additional complication: the above will allow breaks after, e.g.,
- % each of the four underscores in __typeof__. This is undesirable in
- % some manuals, especially if they don't have long identifiers in
- % general. @allowcodebreaks provides a way to control this.
- %
- newififallowcodebreaks allowcodebreakstrue
- defkeywordtrue{true}
- defkeywordfalse{false}
- parseargdefallowcodebreaks{%
- deftxiarg{#1}%
- ifxtxiargkeywordtrue
- allowcodebreakstrue
- elseifxtxiargkeywordfalse
- allowcodebreaksfalse
- else
- errhelp = EMsimple
- errmessage{Unknown @allowcodebreaks option `txiarg'}%
- fifi
- }
- % @kbd is like @code, except that if the argument is just one @key command,
- % then @kbd has no effect.
- % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
- % `example' (@kbd uses ttsl only inside of @example and friends),
- % or `code' (@kbd uses normal tty font always).
- parseargdefkbdinputstyle{%
- deftxiarg{#1}%
- ifxtxiargworddistinct
- gdefkbdexamplefont{ttsl}gdefkbdfont{ttsl}%
- elseifxtxiargwordexample
- gdefkbdexamplefont{ttsl}gdefkbdfont{tt}%
- elseifxtxiargwordcode
- gdefkbdexamplefont{tt}gdefkbdfont{tt}%
- else
- errhelp = EMsimple
- errmessage{Unknown @kbdinputstyle option `txiarg'}%
- fififi
- }
- defworddistinct{distinct}
- defwordexample{example}
- defwordcode{code}
- % Default is `distinct.'
- kbdinputstyle distinct
- defxkey{key}
- defkbdfoo#1#2#3par{defone{#1}defthree{#3}defthreex{??}%
- ifxonexkeyifxthreexthree key{#2}%
- else{tclose{kbdfontlook}}fi
- else{tclose{kbdfontlook}}fi}
- % For @indicateurl, @env, @command quotes seem unnecessary, so use code.
- letindicateurl=code
- letenv=code
- letcommand=code
- % @clicksequence{File @click{} Open ...}
- defclicksequence#1{begingroup #1endgroup}
- % @clickstyle @arrow (by default)
- parseargdefclickstyle{defclick{#1}}
- defclick{arrow}
- % @uref (abbreviation for `urlref') takes an optional (comma-separated)
- % second argument specifying the text to display and an optional third
- % arg as text to display instead of (rather than in addition to) the url
- % itself. First (mandatory) arg is the url. Perhaps eventually put in
- % a hypertex special here.
- %
- defuref#1{douref #1,,,finish}
- defdouref#1,#2,#3,#4finish{begingroup
- unsepspaces
- pdfurl{#1}%
- setbox0 = hbox{ignorespaces #3}%
- ifdimwd0 > 0pt
- unhbox0 % third arg given, show only that
- else
- setbox0 = hbox{ignorespaces #2}%
- ifdimwd0 > 0pt
- ifpdf
- unhbox0 % PDF: 2nd arg given, show only it
- else
- unhbox0 (code{#1})% DVI: 2nd arg given, show both it and url
- fi
- else
- code{#1}% only url given, so show it
- fi
- fi
- endlink
- endgroup}
- % @url synonym for @uref, since that's how everyone uses it.
- %
- leturl=uref
- % rms does not like angle brackets --karl, 17may97.
- % So now @email is just like @uref, unless we are pdf.
- %
- %defemail#1{angleleft{tt #1}angleright}
- ifpdf
- defemail#1{doemail#1,,finish}
- defdoemail#1,#2,#3finish{begingroup
- unsepspaces
- pdfurl{mailto:#1}%
- setbox0 = hbox{ignorespaces #2}%
- ifdimwd0>0ptunhbox0elsecode{#1}fi
- endlink
- endgroup}
- else
- letemail=uref
- fi
- % Check if we are currently using a typewriter font. Since all the
- % Computer Modern typewriter fonts have zero interword stretch (and
- % shrink), and it is reasonable to expect all typewriter fonts to have
- % this property, we can check that font parameter.
- %
- defifmonospace{ifdimfontdimen3font=0pt }
- % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
- % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
- %
- defdmn#1{thinspace #1}
- defkbd#1{deflook{#1}expandafterkbdfoolook??par}
- % @l was never documented to mean ``switch to the Lisp font'',
- % and it is not used as such in any manual I can find. We need it for
- % Polish suppressed-l. --karl, 22sep96.
- %defl#1{{li #1}null}
- % Explicit font changes: @r, @sc, undocumented @ii.
- defr#1{{rm #1}} % roman font
- defsc#1{{smallcaps#1}} % smallcaps font
- defii#1{{it #1}} % italic font
- % @acronym for "FBI", "NATO", and the like.
- % We print this one point size smaller, since it's intended for
- % all-uppercase.
- %
- defacronym#1{doacronym #1,,finish}
- defdoacronym#1,#2,#3finish{%
- {selectfontslsize #1}%
- deftemp{#2}%
- ifxtempempty else
- space ({unsepspaces ignorespaces temp unskip})%
- fi
- }
- % @abbr for "Comput. J." and the like.
- % No font change, but don't do end-of-sentence spacing.
- %
- defabbr#1{doabbr #1,,finish}
- defdoabbr#1,#2,#3finish{%
- {plainfrenchspacing #1}%
- deftemp{#2}%
- ifxtempempty else
- space ({unsepspaces ignorespaces temp unskip})%
- fi
- }
- % @pounds{} is a sterling sign, which Knuth put in the CM italic font.
- %
- defpounds{{it$}}
- % @euro{} comes from a separate font, depending on the current style.
- % We use the free feym* fonts from the eurosym package by Henrik
- % Theiling, which support regular, slanted, bold and bold slanted (and
- % "outlined" (blackboard board, sort of) versions, which we don't need).
- % It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
- %
- % Although only regular is the truly official Euro symbol, we ignore
- % that. The Euro is designed to be slightly taller than the regular
- % font height.
- %
- % feymr - regular
- % feymo - slanted
- % feybr - bold
- % feybo - bold slanted
- %
- % There is no good (free) typewriter version, to my knowledge.
- % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
- % Hmm.
- %
- % Also doesn't work in math. Do we need to do math with euro symbols?
- % Hope not.
- %
- %
- defeuro{{eurofont e}}
- defeurofont{%
- % We set the font at each command, rather than predefining it in
- % textfonts and the other font-switching commands, so that
- % installations which never need the symbol don't have to have the
- % font installed.
- %
- % There is only one designed size (nominal 10pt), so we always scale
- % that to the current nominal size.
- %
- % By the way, simply using "at 1em" works for cmr10 and the like, but
- % does not work for cmbx10 and other extended/shrunken fonts.
- %
- defeurosize{csnamecurfontsize nominalsizeendcsname}%
- %
- ifxcurfontstylebfstylename
- % bold:
- fontthiseurofont = ifusingit{feybo10}{feybr10} at eurosize
- else
- % regular:
- fontthiseurofont = ifusingit{feymo10}{feymr10} at eurosize
- fi
- thiseurofont
- }
- % Hacks for glyphs from the EC fonts similar to euro. We don't
- % use let for the aliases, because sometimes we redefine the original
- % macro, and the alias should reflect the redefinition.
- defguillemetleft{{ecfont char"13}}
- defguillemotleft{guillemetleft}
- defguillemetright{{ecfont char"14}}
- defguillemotright{guillemetright}
- defguilsinglleft{{ecfont char"0E}}
- defguilsinglright{{ecfont char"0F}}
- defquotedblbase{{ecfont char"12}}
- defquotesinglbase{{ecfont char"0D}}
- %
- defecfont{%
- % We can't distinguish serif/sanserif and italic/slanted, but this
- % is used for crude hacks anyway (like adding French and German
- % quotes to documents typeset with CM, where we lose kerning), so
- % hopefully nobody will notice/care.
- edefecsize{csnamecurfontsize ecsizeendcsname}%
- edefnominalsize{csnamecurfontsize nominalsizeendcsname}%
- ifxcurfontstylebfstylename
- % bold:
- fontthisecfont = ecbifusingit{i}{x}ecsize space at nominalsize
- else
- % regular:
- fontthisecfont = ecifusingit{ti}{rm}ecsize space at nominalsize
- fi
- thisecfont
- }
- % @registeredsymbol - R in a circle. The font for the R should really
- % be smaller yet, but lllsize is the best we can do for now.
- % Adapted from the plain.tex definition of copyright.
- %
- defregisteredsymbol{%
- $^{{ooalign{hfilraise.07exhbox{selectfontslllsize R}%
- hfilcrcrOrb}}%
- }$%
- }
- % @textdegree - the normal degrees sign.
- %
- deftextdegree{$^circ$}
- % Laurent Siebenmann reports Orb undefined with:
- % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
- % so we'll define it if necessary.
- %
- ifxOrbundefined
- defOrb{mathhexbox20D}
- fi
- % Quotes.
- chardefquotedblleft="5C
- chardefquotedblright=`"
- chardefquoteleft=``
- chardefquoteright=`'
- message{page headings,}
- newskiptitlepagetopglue titlepagetopglue = 1.5in
- newskiptitlepagebottomglue titlepagebottomglue = 2pc
- % First the title page. Must do @settitle before @titlepage.
- newififseenauthor
- newififfinishedtitlepage
- % Do an implicit @contents or @shortcontents after @end titlepage if the
- % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
- %
- newififsetcontentsaftertitlepage
- letsetcontentsaftertitlepage = setcontentsaftertitlepagetrue
- newififsetshortcontentsaftertitlepage
- letsetshortcontentsaftertitlepage = setshortcontentsaftertitlepagetrue
- parseargdefshorttitlepage{begingrouphbox{}vskip 1.5in chaprm centerline{#1}%
- endgrouppagehbox{}page}
- envdeftitlepage{%
- % Open one extra group, as we want to close it in the middle of Etitlepage.
- begingroup
- parindent=0pt textfonts
- % Leave some space at the very top of the page.
- vgluetitlepagetopglue
- % No rule at page bottom unless we print one at the top with @title.
- finishedtitlepagetrue
- %
- % Most title ``pages'' are actually two pages long, with space
- % at the top of the second. We don't want the ragged left on the second.
- letoldpage = page
- defpage{%
- iffinishedtitlepageelse
- finishtitlepage
- fi
- letpage = oldpage
- page
- null
- }%
- }
- defEtitlepage{%
- iffinishedtitlepageelse
- finishtitlepage
- fi
- % It is important to do the page break before ending the group,
- % because the headline and footline are only empty inside the group.
- % If we use the new definition of page, we always get a blank page
- % after the title page, which we certainly don't want.
- oldpage
- endgroup
- %
- % Need this before the ...aftertitlepage checks so that if they are
- % in effect the toc pages will come out with page numbers.
- HEADINGSon
- %
- % If they want short, they certainly want long too.
- ifsetshortcontentsaftertitlepage
- shortcontents
- contents
- globalletshortcontents = relax
- globalletcontents = relax
- fi
- %
- ifsetcontentsaftertitlepage
- contents
- globalletcontents = relax
- globalletshortcontents = relax
- fi
- }
- deffinishtitlepage{%
- vskip4pt hrule height 2pt width hsize
- vskiptitlepagebottomglue
- finishedtitlepagetrue
- }
- %%% Macros to be used within @titlepage:
- letsubtitlerm=tenrm
- defsubtitlefont{subtitlerm normalbaselineskip = 13pt normalbaselines}
- defauthorfont{authorrm normalbaselineskip = 16pt normalbaselines
- lettt=authortt}
- parseargdeftitle{%
- checkenvtitlepage
- leftline{titlefontsrm #1}
- % print a rule at the page bottom also.
- finishedtitlepagefalse
- vskip4pt hrule height 4pt width hsize vskip4pt
- }
- parseargdefsubtitle{%
- checkenvtitlepage
- {subtitlefont rightline{#1}}%
- }
- % @author should come last, but may come many times.
- % It can also be used inside @quotation.
- %
- parseargdefauthor{%
- deftemp{quotation}%
- ifxthisenvtemp
- defquotationauthor{#1}% printed in Equotation.
- else
- checkenvtitlepage
- ifseenauthorelse vskip 0pt plus 1filll seenauthortrue fi
- {authorfont leftline{#1}}%
- fi
- }
- %%% Set up page headings and footings.
- letthispage=folio
- newtoksevenheadline % headline on even pages
- newtoksoddheadline % headline on odd pages
- newtoksevenfootline % footline on even pages
- newtoksoddfootline % footline on odd pages
- % Now make TeX use those variables
- headline={{textfontsrm ifoddpageno theoddheadline
- else theevenheadline fi}}
- footline={{textfontsrm ifoddpageno theoddfootline
- else theevenfootline fi}HEADINGShook}
- letHEADINGShook=relax
- % Commands to set those variables.
- % For example, this is what @headings on does
- % @evenheading @thistitle|@thispage|@thischapter
- % @oddheading @thischapter|@thispage|@thistitle
- % @evenfooting @thisfile||
- % @oddfooting ||@thisfile
- defevenheading{parseargevenheadingxxx}
- defevenheadingxxx #1{evenheadingyyy #1||||finish}
- defevenheadingyyy #1|#2|#3|#4finish{%
- globalevenheadline={rlap{centerline{#2}}line{#1hfil#3}}}
- defoddheading{parseargoddheadingxxx}
- defoddheadingxxx #1{oddheadingyyy #1||||finish}
- defoddheadingyyy #1|#2|#3|#4finish{%
- globaloddheadline={rlap{centerline{#2}}line{#1hfil#3}}}
- parseargdefeveryheading{oddheadingxxx{#1}evenheadingxxx{#1}}%
- defevenfooting{parseargevenfootingxxx}
- defevenfootingxxx #1{evenfootingyyy #1||||finish}
- defevenfootingyyy #1|#2|#3|#4finish{%
- globalevenfootline={rlap{centerline{#2}}line{#1hfil#3}}}
- defoddfooting{parseargoddfootingxxx}
- defoddfootingxxx #1{oddfootingyyy #1||||finish}
- defoddfootingyyy #1|#2|#3|#4finish{%
- globaloddfootline = {rlap{centerline{#2}}line{#1hfil#3}}%
- %
- % Leave some space for the footline. Hopefully ok to assume
- % @evenfooting will not be used by itself.
- globaladvancepageheight by -12pt
- globaladvancevsize by -12pt
- }
- parseargdefeveryfooting{oddfootingxxx{#1}evenfootingxxx{#1}}
- % @evenheadingmarks top thischapter <- chapter at the top of a page
- % @evenheadingmarks bottom thischapter <- chapter at the bottom of a page
- %
- % The same set of arguments for:
- %
- % @oddheadingmarks
- % @evenfootingmarks
- % @oddfootingmarks
- % @everyheadingmarks
- % @everyfootingmarks
- defevenheadingmarks{headingmarks{even}{heading}}
- defoddheadingmarks{headingmarks{odd}{heading}}
- defevenfootingmarks{headingmarks{even}{footing}}
- defoddfootingmarks{headingmarks{odd}{footing}}
- defeveryheadingmarks#1 {headingmarks{even}{heading}{#1}
- headingmarks{odd}{heading}{#1} }
- defeveryfootingmarks#1 {headingmarks{even}{footing}{#1}
- headingmarks{odd}{footing}{#1} }
- % #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
- defheadingmarks#1#2#3 {%
- expandafterletexpandaftertemp csname get#3headingmarksendcsname
- globalexpandafterletcsname get#1#2marksendcsname temp
- }
- everyheadingmarks bottom
- everyfootingmarks bottom
- % @headings double turns headings on for double-sided printing.
- % @headings single turns headings on for single-sided printing.
- % @headings off turns them off.
- % @headings on same as @headings double, retained for compatibility.
- % @headings after turns on double-sided headings after this page.
- % @headings doubleafter turns on double-sided headings after this page.
- % @headings singleafter turns on single-sided headings after this page.