texinfo.tex
上传用户:qaz666999
上传日期:2022-08-06
资源大小:2570k
文件大小:279k
- % By default, they are off at the start of a document,
- % and turned `on' after @end titlepage.
- defheadings #1 {csname HEADINGS#1endcsname}
- defHEADINGSoff{%
- globalevenheadline={hfil} globalevenfootline={hfil}
- globaloddheadline={hfil} globaloddfootline={hfil}}
- HEADINGSoff
- % When we turn headings on, set the page number to 1.
- % For double-sided printing, put current file name in lower left corner,
- % chapter name on inside top of right hand pages, document
- % title on inside top of left hand pages, and page numbers on outside top
- % edge of all pages.
- defHEADINGSdouble{%
- globalpageno=1
- globalevenfootline={hfil}
- globaloddfootline={hfil}
- globalevenheadline={line{foliohfilthistitle}}
- globaloddheadline={line{thischapterhfilfolio}}
- globalletcontentsalignmacro = chapoddpage
- }
- letcontentsalignmacro = chappager
- % For single-sided printing, chapter title goes across top left of page,
- % page number on top right.
- defHEADINGSsingle{%
- globalpageno=1
- globalevenfootline={hfil}
- globaloddfootline={hfil}
- globalevenheadline={line{thischapterhfilfolio}}
- globaloddheadline={line{thischapterhfilfolio}}
- globalletcontentsalignmacro = chappager
- }
- defHEADINGSon{HEADINGSdouble}
- defHEADINGSafter{letHEADINGShook=HEADINGSdoublex}
- letHEADINGSdoubleafter=HEADINGSafter
- defHEADINGSdoublex{%
- globalevenfootline={hfil}
- globaloddfootline={hfil}
- globalevenheadline={line{foliohfilthistitle}}
- globaloddheadline={line{thischapterhfilfolio}}
- globalletcontentsalignmacro = chapoddpage
- }
- defHEADINGSsingleafter{letHEADINGShook=HEADINGSsinglex}
- defHEADINGSsinglex{%
- globalevenfootline={hfil}
- globaloddfootline={hfil}
- globalevenheadline={line{thischapterhfilfolio}}
- globaloddheadline={line{thischapterhfilfolio}}
- globalletcontentsalignmacro = chappager
- }
- % Subroutines used in generating headings
- % This produces Day Month Year style of output.
- % Only define if not already defined, in case a txi-??.tex file has set
- % up a different format (e.g., txi-cs.tex does this).
- ifxtodayundefined
- deftoday{%
- numberdayspace
- ifcasemonth
- orputwordMJanorputwordMFeborputwordMMarorputwordMApr
- orputwordMMayorputwordMJunorputwordMJulorputwordMAug
- orputwordMSeporputwordMOctorputwordMNovorputwordMDec
- fi
- spacenumberyear}
- fi
- % @settitle line... specifies the title of the document, for headings.
- % It generates no output of its own.
- defthistitle{putwordNoTitle}
- defsettitle{parsearg{gdefthistitle}}
- message{tables,}
- % Tables -- @table, @ftable, @vtable, @item(x).
- % default indentation of table text
- newdimentableindent tableindent=.8in
- % default indentation of @itemize and @enumerate text
- newdimenitemindent itemindent=.3in
- % margin between end of table item and start of table text.
- newdimenitemmargin itemmargin=.1in
- % used internally for itemindent minus itemmargin
- newdimenitemmax
- % Note @table, @ftable, and @vtable define @item, @itemx, etc., with
- % these defs.
- % They also define itemindex
- % to index the item name in whatever manner is desired (perhaps none).
- newififitemxneedsnegativevskip
- defitemxpar{parifitemxneedsnegativevskipnobreakvskip-parskipnobreakfi}
- definternalBitem{smallbreak parseargitemzzz}
- definternalBitemx{itemxpar parseargitemzzz}
- defitemzzz #1{begingroup %
- advancehsize by -rightskip
- advancehsize by -tableindent
- setbox0=hbox{itemindicate{#1}}%
- itemindex{#1}%
- nobreak % This prevents a break before @itemx.
- %
- % If the item text does not fit in the space we have, put it on a line
- % by itself, and do not allow a page break either before or after that
- % line. We do not start a paragraph here because then if the next
- % command is, e.g., @kindex, the whatsit would get put into the
- % horizontal list on a line by itself, resulting in extra blank space.
- ifdim wd0>itemmax
- %
- % Make this a paragraph so we get the parskip glue and wrapping,
- % but leave it ragged-right.
- begingroup
- advanceleftskip by-tableindent
- advancehsize bytableindent
- advancerightskip by0pt plus1fil
- leavevmodeunhbox0par
- endgroup
- %
- % We're going to be starting a paragraph, but we don't want the
- % parskip glue -- logically it's part of the @item we just started.
- nobreak vskip-parskip
- %
- % Stop a page break at the parskip glue coming up. However, if
- % what follows is an environment such as @example, there will be no
- % parskip glue; then the negative vskip we just inserted would
- % cause the example and the item to crash together. So we use this
- % bizarre value of 10001 as a signal to aboveenvbreak to insert
- % parskip glue after all. Section titles are handled this way also.
- %
- penalty 10001
- endgroup
- itemxneedsnegativevskipfalse
- else
- % The item text fits into the space. Start a paragraph, so that the
- % following text (if any) will end up on the same line.
- noindent
- % Do this with kerns and unhbox so that if there is a footnote in
- % the item text, it can migrate to the main vertical list and
- % eventually be printed.
- nobreakkern-tableindent
- dimen0 = itemmax advancedimen0 by itemmargin advancedimen0 by -wd0
- unhbox0
- nobreakkerndimen0
- endgroup
- itemxneedsnegativevskiptrue
- fi
- }
- defitem{errmessage{@item while not in a list environment}}
- defitemx{errmessage{@itemx while not in a list environment}}
- % @table, @ftable, @vtable.
- envdeftable{%
- letitemindexgobble
- tablecheck{table}%
- }
- envdefftable{%
- defitemindex ##1{doind {fn}{code{##1}}}%
- tablecheck{ftable}%
- }
- envdefvtable{%
- defitemindex ##1{doind {vr}{code{##1}}}%
- tablecheck{vtable}%
- }
- deftablecheck#1{%
- ifnum thecatcode`^^M=active
- endgroup
- errmessage{This command won't work in this context; perhaps the problem is
- that we are inenvironmentthisenv}%
- defnext{doignore{#1}}%
- else
- letnexttablex
- fi
- next
- }
- deftablex#1{%
- defitemindicate{#1}%
- parseargtabley
- }
- deftabley#1{%
- {%
- makevalueexpandable
- edeftemp{noexpandtablez #1spacespacespace}%
- expandafter
- }temp endtablez
- }
- deftablez #1 #2 #3 #4endtablez{%
- aboveenvbreak
- ifnum 0#1>0 advance leftskip by #1mil fi
- ifnum 0#2>0 tableindent=#2mil fi
- ifnum 0#3>0 advance rightskip by #3mil fi
- itemmax=tableindent
- advance itemmax by -itemmargin
- advance leftskip by tableindent
- exdentamount=tableindent
- parindent = 0pt
- parskip = smallskipamount
- ifdim parskip=0pt parskip=2pt fi
- letitem = internalBitem
- letitemx = internalBitemx
- }
- defEtable{endgrafafterenvbreak}
- letEftableEtable
- letEvtableEtable
- letEitemizeEtable
- letEenumerateEtable
- % This is the counter used by @enumerate, which is really @itemize
- newcount itemno
- envdefitemize{parseargdoitemize}
- defdoitemize#1{%
- aboveenvbreak
- itemmax=itemindent
- advanceitemmax by -itemmargin
- advanceleftskip by itemindent
- exdentamount=itemindent
- parindent=0pt
- parskip=smallskipamount
- ifdimparskip=0pt parskip=2pt fi
- defitemcontents{#1}%
- % @itemize with no arg is equivalent to @itemize @bullet.
- ifxitemcontentsemptydefitemcontents{bullet}fi
- letitem=itemizeitem
- }
- % Definition of @item while inside @itemize and @enumerate.
- %
- defitemizeitem{%
- advanceitemno by 1 % for enumerations
- {letpar=endgraf smallbreak}% reasonable place to break
- {%
- % If the document has an @itemize directly after a section title, a
- % nobreak will be last on the list, and sectionheading will have
- % done a vskip-parskip. In that case, we don't want to zero
- % parskip, or the item text will crash with the heading. On the
- % other hand, when there is normal text preceding the item (as there
- % usually is), we do want to zero parskip, or there would be too much
- % space. In that case, we won't have a nobreak before. At least
- % that's the theory.
- ifnumlastpenalty<10000 parskip=0in fi
- noindent
- hbox to 0pt{hss itemcontents kernitemmargin}%
- vadjust{penalty 1200}}% not good to break after first line of item.
- flushcr
- }
- % splitoff TOKENSendmark defines first to be the first token in
- % TOKENS, and rest to be the remainder.
- %
- defsplitoff#1#2endmark{deffirst{#1}defrest{#2}}%
- % Allow an optional argument of an uppercase letter, lowercase letter,
- % or number, to specify the first label in the enumerated list. No
- % argument is the same as `1'.
- %
- envparseargdefenumerate{enumeratey #1 endenumeratey}
- defenumeratey #1 #2endenumeratey{%
- % If we were given no argument, pretend we were given `1'.
- defthearg{#1}%
- ifxtheargempty defthearg{1}fi
- %
- % Detect if the argument is a single token. If so, it might be a
- % letter. Otherwise, the only valid thing it can be is a number.
- % (We will always have one token, because of the test we just made.
- % This is a good thing, since splitoff doesn't work given nothing at
- % all -- the first parameter is undelimited.)
- expandaftersplitofftheargendmark
- ifxrestempty
- % Only one token in the argument. It could still be anything.
- % A ``lowercase letter'' is one whose lccode is nonzero.
- % An ``uppercase letter'' is one whose lccode is both nonzero, and
- % not equal to itself.
- % Otherwise, we assume it's a number.
- %
- % We need the relax at the end of the ifnum lines to stop TeX from
- % continuing to look for a <number>.
- %
- ifnumlccodeexpandafter`thearg=0relax
- numericenumerate % a number (we hope)
- else
- % It's a letter.
- ifnumlccodeexpandafter`thearg=expandafter`theargrelax
- lowercaseenumerate % lowercase letter
- else
- uppercaseenumerate % uppercase letter
- fi
- fi
- else
- % Multiple tokens in the argument. We hope it's a number.
- numericenumerate
- fi
- }
- % An @enumerate whose labels are integers. The starting integer is
- % given in thearg.
- %
- defnumericenumerate{%
- itemno = thearg
- startenumeration{theitemno}%
- }
- % The starting (lowercase) letter is in thearg.
- deflowercaseenumerate{%
- itemno = expandafter`thearg
- startenumeration{%
- % Be sure we're not beyond the end of the alphabet.
- ifnumitemno=0
- errmessage{No more lowercase letters in @enumerate; get a bigger
- alphabet}%
- fi
- charlccodeitemno
- }%
- }
- % The starting (uppercase) letter is in thearg.
- defuppercaseenumerate{%
- itemno = expandafter`thearg
- startenumeration{%
- % Be sure we're not beyond the end of the alphabet.
- ifnumitemno=0
- errmessage{No more uppercase letters in @enumerate; get a bigger
- alphabet}
- fi
- charuccodeitemno
- }%
- }
- % Call doitemize, adding a period to the first argument and supplying the
- % common last two arguments. Also subtract one from the initial value in
- % itemno, since @item increments itemno.
- %
- defstartenumeration#1{%
- advanceitemno by -1
- doitemize{#1.}flushcr
- }
- % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
- % to @enumerate.
- %
- defalphaenumerate{enumerate{a}}
- defcapsenumerate{enumerate{A}}
- defEalphaenumerate{Eenumerate}
- defEcapsenumerate{Eenumerate}
- % @multitable macros
- % Amy Hendrickson, 8/18/94, 3/6/96
- %
- % @multitable ... @end multitable will make as many columns as desired.
- % Contents of each column will wrap at width given in preamble. Width
- % can be specified either with sample text given in a template line,
- % or in percent of hsize, the current width of text on page.
- % Table can continue over pages but will only break between lines.
- % To make preamble:
- %
- % Either define widths of columns in terms of percent of hsize:
- % @multitable @columnfractions .25 .3 .45
- % @item ...
- %
- % Numbers following @columnfractions are the percent of the total
- % current hsize to be used for each column. You may use as many
- % columns as desired.
- % Or use a template:
- % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
- % @item ...
- % using the widest term desired in each column.
- % Each new table line starts with @item, each subsequent new column
- % starts with @tab. Empty columns may be produced by supplying @tab's
- % with nothing between them for as many times as empty columns are needed,
- % ie, @tab@tab@tab will produce two empty columns.
- % @item, @tab do not need to be on their own lines, but it will not hurt
- % if they are.
- % Sample multitable:
- % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
- % @item first col stuff @tab second col stuff @tab third col
- % @item
- % first col stuff
- % @tab
- % second col stuff
- % @tab
- % third col
- % @item first col stuff @tab second col stuff
- % @tab Many paragraphs of text may be used in any column.
- %
- % They will wrap at the width determined by the template.
- % @item@tab@tab This will be in third column.
- % @end multitable
- % Default dimensions may be reset by user.
- % @multitableparskip is vertical space between paragraphs in table.
- % @multitableparindent is paragraph indent in table.
- % @multitablecolmargin is horizontal space to be left between columns.
- % @multitablelinespace is space to leave between table items, baseline
- % to baseline.
- % 0pt means it depends on current normal line spacing.
- %
- newskipmultitableparskip
- newskipmultitableparindent
- newdimenmultitablecolspace
- newskipmultitablelinespace
- multitableparskip=0pt
- multitableparindent=6pt
- multitablecolspace=12pt
- multitablelinespace=0pt
- % Macros used to set up halign preamble:
- %
- letendsetuptablerelax
- defxendsetuptable{endsetuptable}
- letcolumnfractionsrelax
- defxcolumnfractions{columnfractions}
- newififsetpercent
- % #1 is the @columnfraction, usually a decimal number like .5, but might
- % be just 1. We just use it, whatever it is.
- %
- defpickupwholefraction#1 {%
- globaladvancecolcount by 1
- expandafterxdefcsname colthecolcountendcsname{#1hsize}%
- setuptable
- }
- newcountcolcount
- defsetuptable#1{%
- deffirstarg{#1}%
- ifxfirstargxendsetuptable
- letgo = relax
- else
- ifxfirstargxcolumnfractions
- globalsetpercenttrue
- else
- ifsetpercent
- letgopickupwholefraction
- else
- globaladvancecolcount by 1
- setbox0=hbox{#1unskipspace}% Add a normal word space as a
- % separator; typically that is always in the input, anyway.
- expandafterxdefcsname colthecolcountendcsname{thewd0}%
- fi
- fi
- ifxgopickupwholefraction
- % Put the argument back for the pickupwholefraction call, so
- % we'll always have a period there to be parsed.
- defgo{pickupwholefraction#1}%
- else
- letgo = setuptable
- fi%
- fi
- go
- }
- % multitable-only commands.
- %
- % @headitem starts a heading row, which we typeset in bold.
- % Assignments have to be global since we are inside the implicit group
- % of an alignment entry. Note that everycr resets everytab.
- defheaditem{checkenvmultitable crcr globaleverytab={bf}theeverytab}%
- %
- % A tab used to include hskip1sp. But then the space in a template
- % line is not enough. That is bad. So let's go back to just `&' until
- % we encounter the problem it was intended to solve again.
- % --karl, nathan@acm.org, 20apr99.
- deftab{checkenvmultitable &theeverytab}%
- % @multitable ... @end multitable definitions:
- %
- newtokseverytab % insert after every tab.
- %
- envdefmultitable{%
- vskipparskip
- startsavinginserts
- %
- % @item within a multitable starts a normal row.
- % We use def instead of let so that if one of the multitable entries
- % contains an @itemize, we don't choke on the item (seen as crcr aka
- % endtemplate) expanding doitemize.
- defitem{crcr}%
- %
- tolerance=9500
- hbadness=9500
- setmultitablespacing
- parskip=multitableparskip
- parindent=multitableparindent
- overfullrule=0pt
- globalcolcount=0
- %
- everycr = {%
- noalign{%
- globaleverytab={}%
- globalcolcount=0 % Reset the column counter.
- % Check for saved footnotes, etc.
- checkinserts
- % Keeps underfull box messages off when table breaks over pages.
- %filbreak
- % Maybe so, but it also creates really weird page breaks when the
- % table breaks over pages. Wouldn't vfil be better? Wait until the
- % problem manifests itself, so it can be fixed for real --karl.
- }%
- }%
- %
- parseargdomultitable
- }
- defdomultitable#1{%
- % To parse everything between @multitable and @item:
- setuptable#1 endsetuptable
- %
- % This preamble sets up a generic column definition, which will
- % be used as many times as user calls for columns.
- % vtop will set a single line and will also let text wrap and
- % continue for many paragraphs if desired.
- halignbgroup &%
- globaladvancecolcount by 1
- multistrut
- vtop{%
- % Use the current colcount to find the correct column width:
- hsize=expandaftercsname colthecolcountendcsname
- %
- % In order to keep entries from bumping into each other
- % we will add a leftskip of multitablecolspace to all columns after
- % the first one.
- %
- % If a template has been used, we will add multitablecolspace
- % to the width of each template entry.
- %
- % If the user has set preamble in terms of percent of hsize we will
- % use that dimension as the width of the column, and the leftskip
- % will keep entries from bumping into each other. Table will start at
- % left margin and final column will justify at right margin.
- %
- % Make sure we don't inherit rightskip from the outer environment.
- rightskip=0pt
- ifnumcolcount=1
- % The first column will be indented with the surrounding text.
- advancehsize byleftskip
- else
- ifsetpercent else
- % If user has not set preamble in terms of percent of hsize
- % we will advance hsize by multitablecolspace.
- advancehsize by multitablecolspace
- fi
- % In either case we will make leftskip=multitablecolspace:
- leftskip=multitablecolspace
- fi
- % Ignoring space at the beginning and end avoids an occasional spurious
- % blank line, when TeX decides to break the line at the space before the
- % box from the multistrut, so the strut ends up on a line by itself.
- % For example:
- % @multitable @columnfractions .11 .89
- % @item @code{#}
- % @tab Legal holiday which is valid in major parts of the whole country.
- % Is automatically provided with highlighting sequences respectively
- % marking characters.
- noindentignorespaces##unskipmultistrut
- }cr
- }
- defEmultitable{%
- crcr
- egroup % end the halign
- globalsetpercentfalse
- }
- defsetmultitablespacing{%
- defmultistrut{strut}% just use the standard line spacing
- %
- % Compute multitablelinespace (if not defined by user) for use in
- % multitableparskip calculation. We used define multistrut based on
- % this, but (ironically) that caused the spacing to be off.
- % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
- ifdimmultitablelinespace=0pt
- setbox0=vbox{X}globalmultitablelinespace=thebaselineskip
- globaladvancemultitablelinespace by-ht0
- fi
- %% Test to see if parskip is larger than space between lines of
- %% table. If not, do nothing.
- %% If so, set to same dimension as multitablelinespace.
- ifdimmultitableparskip>multitablelinespace
- globalmultitableparskip=multitablelinespace
- globaladvancemultitableparskip-7pt %% to keep parskip somewhat smaller
- %% than skip between lines in the table.
- fi%
- ifdimmultitableparskip=0pt
- globalmultitableparskip=multitablelinespace
- globaladvancemultitableparskip-7pt %% to keep parskip somewhat smaller
- %% than skip between lines in the table.
- fi}
- message{conditionals,}
- % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
- % @ifnotxml always succeed. They currently do nothing; we don't
- % attempt to check whether the conditionals are properly nested. But we
- % have to remember that they are conditionals, so that @end doesn't
- % attempt to close an environment group.
- %
- defmakecond#1{%
- expandafterletcsname #1endcsname = relax
- expandafterletcsname iscond.#1endcsname = 1
- }
- makecond{iftex}
- makecond{ifnotdocbook}
- makecond{ifnothtml}
- makecond{ifnotinfo}
- makecond{ifnotplaintext}
- makecond{ifnotxml}
- % Ignore @ignore, @ifhtml, @ifinfo, and the like.
- %
- defdirentry{doignore{direntry}}
- defdocumentdescription{doignore{documentdescription}}
- defdocbook{doignore{docbook}}
- defhtml{doignore{html}}
- defifdocbook{doignore{ifdocbook}}
- defifhtml{doignore{ifhtml}}
- defifinfo{doignore{ifinfo}}
- defifnottex{doignore{ifnottex}}
- defifplaintext{doignore{ifplaintext}}
- defifxml{doignore{ifxml}}
- defignore{doignore{ignore}}
- defmenu{doignore{menu}}
- defxml{doignore{xml}}
- % Ignore text until a line `@end #1', keeping track of nested conditionals.
- %
- % A count to remember the depth of nesting.
- newcountdoignorecount
- defdoignore#1{begingroup
- % Scan in ``verbatim'' mode:
- obeylines
- catcode`@ = other
- catcode`{ = other
- catcode`} = other
- %
- % Make sure that spaces turn into tokens that match what doignoretext wants.
- spaceisspace
- %
- % Count number of #1's that we've seen.
- doignorecount = 0
- %
- % Swallow text until we reach the matching `@end #1'.
- dodoignore{#1}%
- }
- { catcode`_=11 % We want to use _STOP_ which cannot appear in texinfo source.
- obeylines %
- %
- gdefdodoignore#1{%
- % #1 contains the command name as a string, e.g., `ifinfo'.
- %
- % Define a command to find the next `@end #1'.
- longdefdoignoretext##1^^M@end #1{%
- doignoretextyyy##1^^M@#1_STOP_}%
- %
- % And this command to find another #1 command, at the beginning of a
- % line. (Otherwise, we would consider a line `@c @ifset', for
- % example, to count as an @ifset for nesting.)
- longdefdoignoretextyyy##1^^M@#1##2_STOP_{doignoreyyy{##2}_STOP_}%
- %
- % And now expand that command.
- doignoretext ^^M%
- }%
- }
- defdoignoreyyy#1{%
- deftemp{#1}%
- ifxtempempty % Nothing found.
- letnextdoignoretextzzz
- else % Found a nested condition, ...
- advancedoignorecount by 1
- letnextdoignoretextyyy % ..., look for another.
- % If we're here, #1 ends with ^^Mifinfo (for example).
- fi
- next #1% the token _STOP_ is present just after this macro.
- }
- % We have to swallow the remaining "_STOP_".
- %
- defdoignoretextzzz#1{%
- ifnumdoignorecount = 0 % We have just found the outermost @end.
- letnextenddoignore
- else % Still inside a nested condition.
- advancedoignorecount by -1
- letnextdoignoretext % Look for the next @end.
- fi
- next
- }
- % Finish off ignored text.
- { obeylines%
- % Ignore anything after the last `@end #1'; this matters in verbatim
- % environments, where otherwise the newline after an ignored conditional
- % would result in a blank line in the output.
- gdefenddoignore#1^^M{endgroupignorespaces}%
- }
- % @set VAR sets the variable VAR to an empty value.
- % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
- %
- % Since we want to separate VAR from REST-OF-LINE (which might be
- % empty), we can't just use parsearg; we have to insert a space of our
- % own to delimit the rest of the line, and then take it out again if we
- % didn't need it.
- % We rely on the fact that parsearg sets catcode` =10.
- %
- parseargdefset{setyyy#1 endsetyyy}
- defsetyyy#1 #2endsetyyy{%
- {%
- makevalueexpandable
- deftemp{#2}%
- edefnext{gdefmakecsname{SET#1}}%
- ifxtempempty
- next{}%
- else
- setzzz#2endsetzzz
- fi
- }%
- }
- % Remove the trailing space setxxx inserted.
- defsetzzz#1 endsetzzz{next{#1}}
- % @clear VAR clears (i.e., unsets) the variable VAR.
- %
- parseargdefclear{%
- {%
- makevalueexpandable
- globalexpandafterletcsname SET#1endcsname=relax
- }%
- }
- % @value{foo} gets the text saved in variable foo.
- defvalue{begingroupmakevalueexpandablevaluexxx}
- defvaluexxx#1{expandablevalue{#1}endgroup}
- {
- catcode`- = active catcode`_ = active
- %
- gdefmakevalueexpandable{%
- letvalue = expandablevalue
- % We don't want these characters active, ...
- catcode`-=other catcode`_=other
- % ..., but we might end up with active ones in the argument if
- % we're called from @code, as @code{@value{foo-bar_}}, though.
- % So let them to their normal equivalents.
- let-realdash let_normalunderscore
- }
- }
- % We have this subroutine so that we can handle at least some @value's
- % properly in indexes (we call makevalueexpandable in indexdummies).
- % The command has to be fully expandable (if the variable is set), since
- % the result winds up in the index file. This means that if the
- % variable's value contains other Texinfo commands, it's almost certain
- % it will fail (although perhaps we could fix that with sufficient work
- % to do a one-level expansion on the result, instead of complete).
- %
- defexpandablevalue#1{%
- expandafterifxcsname SET#1endcsnamerelax
- {[No value for ``#1'']}%
- message{Variable `#1', used in @value, is not set.}%
- else
- csname SET#1endcsname
- fi
- }
- % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
- % with @set.
- %
- % To get special treatment of `@end ifset,' call makeond and the redefine.
- %
- makecond{ifset}
- defifset{parsearg{doifset{letnext=ifsetfail}}}
- defdoifset#1#2{%
- {%
- makevalueexpandable
- letnext=empty
- expandafterifxcsname SET#2endcsnamerelax
- #1% If not set, redefine next.
- fi
- expandafter
- }next
- }
- defifsetfail{doignore{ifset}}
- % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
- % defined with @set, or has been undefined with @clear.
- %
- % The `else' inside the `doifset' parameter is a trick to reuse the
- % above code: if the variable is not set, do nothing, if it is set,
- % then redefine next to ifclearfail.
- %
- makecond{ifclear}
- defifclear{parsearg{doifset{else letnext=ifclearfail}}}
- defifclearfail{doignore{ifclear}}
- % @dircategory CATEGORY -- specify a category of the dir file
- % which this file should belong to. Ignore this in TeX.
- letdircategory=comment
- % @defininfoenclose.
- letdefinfoenclose=comment
- message{indexing,}
- % Index generation facilities
- % Define newwrite to be identical to plain tex's newwrite
- % except not outer, so it can be used within macros and if's.
- edefnewwrite{makecsname{ptexnewwrite}}
- % newindex {foo} defines an index named foo.
- % It automatically defines fooindex such that
- % fooindex ...rest of line... puts an entry in the index foo.
- % It also defines fooindfile to be the number of the output channel for
- % the file that accumulates this index. The file's extension is foo.
- % The name of an index should be no more than 2 characters long
- % for the sake of vms.
- %
- defnewindex#1{%
- iflinks
- expandafternewwrite csname#1indfileendcsname
- openout csname#1indfileendcsname jobname.#1 % Open the file
- fi
- expandafterxdefcsname#1indexendcsname{% % Define @#1index
- noexpanddoindex{#1}}
- }
- % @defindex foo == newindex{foo}
- %
- defdefindex{parseargnewindex}
- % Define @defcodeindex, like @defindex except put all entries in @code.
- %
- defdefcodeindex{parseargnewcodeindex}
- %
- defnewcodeindex#1{%
- iflinks
- expandafternewwrite csname#1indfileendcsname
- openout csname#1indfileendcsname jobname.#1
- fi
- expandafterxdefcsname#1indexendcsname{%
- noexpanddocodeindex{#1}}%
- }
- % @synindex foo bar makes index foo feed into index bar.
- % Do this instead of @defindex foo if you don't want it as a separate index.
- %
- % @syncodeindex foo bar similar, but put all entries made for index foo
- % inside @code.
- %
- defsynindex#1 #2 {dosynindexdoindex{#1}{#2}}
- defsyncodeindex#1 #2 {dosynindexdocodeindex{#1}{#2}}
- % #1 is doindex or docodeindex, #2 the index getting redefined (foo),
- % #3 the target index (bar).
- defdosynindex#1#2#3{%
- % Only do closeout if we haven't already done it, else we'll end up
- % closing the target index.
- expandafter ifxcsname donesynindex#2endcsname undefined
- % The closeout helps reduce unnecessary open files; the limit on the
- % Acorn RISC OS is a mere 16 files.
- expandaftercloseoutcsname#2indfileendcsname
- expandafterletcsnamedonesynindex#2endcsname = 1
- fi
- % redefine fooindfile:
- expandafterletexpandaftertempexpandafter=csname#3indfileendcsname
- expandafterletcsname#2indfileendcsname=temp
- % redefine fooindex:
- expandafterxdefcsname#2indexendcsname{noexpand#1{#3}}%
- }
- % Define doindex, the driver for all fooindex macros.
- % Argument #1 is generated by the calling fooindex macro,
- % and it is "foo", the name of the index.
- % doindex just uses parsearg; it calls doind for the actual work.
- % This is because doind is more useful to call from other macros.
- % There is also dosubind {index}{topic}{subtopic}
- % which makes an entry in a two-level index such as the operation index.
- defdoindex#1{edefindexname{#1}parseargsingleindexer}
- defsingleindexer #1{doind{indexname}{#1}}
- % like the previous two, but they put @code around the argument.
- defdocodeindex#1{edefindexname{#1}parseargsinglecodeindexer}
- defsinglecodeindexer #1{doind{indexname}{code{#1}}}
- % Take care of Texinfo commands that can appear in an index entry.
- % Since there are some commands we want to expand, and others we don't,
- % we have to laboriously prevent expansion for those that we don't.
- %
- defindexdummies{%
- escapechar = `\ % use backslash in output files.
- def@{@}% change to @@ when we switch to @ as escape char in index files.
- def {realbackslashspace }%
- %
- % Need these in case tex is in effect and { is a delimiter again.
- % But can't use lbracecmd and rbracecmd because texindex assumes
- % braces and backslashes are used only as delimiters.
- let{ = mylbrace
- let} = myrbrace
- %
- % I don't entirely understand this, but when an index entry is
- % generated from a macro call, the endinput which scanmacro inserts
- % causes processing to be prematurely terminated. This is,
- % apparently, because indexsorttmp is fully expanded, and endinput
- % is an expandable command. The redefinition below makes endinput
- % disappear altogether for that purpose -- although logging shows that
- % processing continues to some further point. On the other hand, it
- % seems endinput does not hurt in the printed index arg, since that
- % is still getting written without apparent harm.
- %
- % Sample source (mac-idx3.tex, reported by Graham Percival to
- % help-texinfo, 22may06):
- % @macro funindex {WORD}
- % @findex xyz
- % @end macro
- % ...
- % @funindex commtest
- %
- % The above is not enough to reproduce the bug, but it gives the flavor.
- %
- % Sample whatsit resulting:
- % .@write3{entry{xyz}{@folio }{@code {xyz@endinput }}}
- %
- % So:
- letendinput = empty
- %
- % Do the redefinitions.
- commondummies
- }
- % For the aux and toc files, @ is the escape character. So we want to
- % redefine everything using @ as the escape character (instead of
- % realbackslash, still used for index files). When everything uses @,
- % this will be simpler.
- %
- defatdummies{%
- def@{@@}%
- def {@ }%
- let{ = lbraceatcmd
- let} = rbraceatcmd
- %
- % Do the redefinitions.
- commondummies
- otherbackslash
- }
- % Called from indexdummies and atdummies.
- %
- defcommondummies{%
- %
- % definedummyword defines #1 as string#1space, thus effectively
- % preventing its expansion. This is used only for control% words,
- % not control letters, because the space would be incorrect for
- % control characters, but is needed to separate the control word
- % from whatever follows.
- %
- % For control letters, we have definedummyletter, which omits the
- % space.
- %
- % These can be used both for control words that take an argument and
- % those that do not. If it is followed by {arg} in the input, then
- % that will dutifully get written to the index (or wherever).
- %
- defdefinedummyword ##1{def##1{string##1space}}%
- defdefinedummyletter##1{def##1{string##1}}%
- letdefinedummyaccentdefinedummyletter
- %
- commondummiesnofonts
- %
- definedummyletter_%
- %
- % Non-English letters.
- definedummywordAA
- definedummywordAE
- definedummywordL
- definedummywordOE
- definedummywordO
- definedummywordaa
- definedummywordae
- definedummywordl
- definedummywordoe
- definedummywordo
- definedummywordss
- definedummywordexclamdown
- definedummywordquestiondown
- definedummywordordf
- definedummywordordm
- %
- % Although these internal commands shouldn't show up, sometimes they do.
- definedummywordbf
- definedummywordgtr
- definedummywordhat
- definedummywordless
- definedummywordsf
- definedummywordsl
- definedummywordtclose
- definedummywordtt
- %
- definedummywordLaTeX
- definedummywordTeX
- %
- % Assorted special characters.
- definedummywordbullet
- definedummywordcomma
- definedummywordcopyright
- definedummywordregisteredsymbol
- definedummyworddots
- definedummywordenddots
- definedummywordequiv
- definedummyworderror
- definedummywordeuro
- definedummywordguillemetleft
- definedummywordguillemetright
- definedummywordguilsinglleft
- definedummywordguilsinglright
- definedummywordexpansion
- definedummywordminus
- definedummywordpounds
- definedummywordpoint
- definedummywordprint
- definedummywordquotedblbase
- definedummywordquotedblleft
- definedummywordquotedblright
- definedummywordquoteleft
- definedummywordquoteright
- definedummywordquotesinglbase
- definedummywordresult
- definedummywordtextdegree
- %
- % We want to disable all macros so that they are not expanded by write.
- macrolist
- %
- normalturnoffactive
- %
- % Handle some cases of @value -- where it does not contain any
- % (non-fully-expandable) commands.
- makevalueexpandable
- }
- % commondummiesnofonts: common to commondummies and indexnofonts.
- %
- defcommondummiesnofonts{%
- % Control letters and accents.
- definedummyletter!%
- definedummyaccent"%
- definedummyaccent'%
- definedummyletter*%
- definedummyaccent,%
- definedummyletter.%
- definedummyletter/%
- definedummyletter:%
- definedummyaccent=%
- definedummyletter?%
- definedummyaccent^%
- definedummyaccent`%
- definedummyaccent~%
- definedummywordu
- definedummywordv
- definedummywordH
- definedummyworddotaccent
- definedummywordringaccent
- definedummywordtieaccent
- definedummywordubaraccent
- definedummywordudotaccent
- definedummyworddotless
- %
- % Texinfo font commands.
- definedummywordb
- definedummywordi
- definedummywordr
- definedummywordsc
- definedummywordt
- %
- % Commands that take arguments.
- definedummywordacronym
- definedummywordcite
- definedummywordcode
- definedummywordcommand
- definedummyworddfn
- definedummywordemph
- definedummywordenv
- definedummywordfile
- definedummywordkbd
- definedummywordkey
- definedummywordmath
- definedummywordoption
- definedummywordpxref
- definedummywordref
- definedummywordsamp
- definedummywordstrong
- definedummywordtie
- definedummyworduref
- definedummywordurl
- definedummywordvar
- definedummywordverb
- definedummywordw
- definedummywordxref
- }
- % indexnofonts is used when outputting the strings to sort the index
- % by, and when constructing control sequence names. It eliminates all
- % control sequences and just writes whatever the best ASCII sort string
- % would be for a given command (usually its argument).
- %
- defindexnofonts{%
- % Accent commands should become @asis.
- defdefinedummyaccent##1{let##1asis}%
- % We can just ignore other control letters.
- defdefinedummyletter##1{let##1empty}%
- % Hopefully, all control words can become @asis.
- letdefinedummyworddefinedummyaccent
- %
- commondummiesnofonts
- %
- % Don't no-op tt, since it isn't a user-level command
- % and is used in the definitions of the active chars like <, >, |, etc.
- % Likewise with the other plain tex font commands.
- %lettt=asis
- %
- def { }%
- def@{@}%
- % how to handle braces?
- def_{normalunderscore}%
- %
- % Non-English letters.
- defAA{AA}%
- defAE{AE}%
- defL{L}%
- defOE{OE}%
- defO{O}%
- defaa{aa}%
- defae{ae}%
- defl{l}%
- defoe{oe}%
- defo{o}%
- defss{ss}%
- defexclamdown{!}%
- defquestiondown{?}%
- defordf{a}%
- defordm{o}%
- %
- defLaTeX{LaTeX}%
- defTeX{TeX}%
- %
- % Assorted special characters.
- % (The following {} will end up in the sort string, but that's ok.)
- defbullet{bullet}%
- defcomma{,}%
- defcopyright{copyright}%
- defregisteredsymbol{R}%
- defdots{...}%
- defenddots{...}%
- defequiv{==}%
- deferror{error}%
- defeuro{euro}%
- defguillemetleft{<<}%
- defguillemetright{>>}%
- defguilsinglleft{<}%
- defguilsinglright{>}%
- defexpansion{==>}%
- defminus{-}%
- defpounds{pounds}%
- defpoint{.}%
- defprint{-|}%
- defquotedblbase{"}%
- defquotedblleft{"}%
- defquotedblright{"}%
- defquoteleft{`}%
- defquoteright{'}%
- defquotesinglbase{,}%
- defresult{=>}%
- deftextdegree{degrees}%
- %
- % We need to get rid of all macros, leaving only the arguments (if present).
- % Of course this is not nearly correct, but it is the best we can do for now.
- % makeinfo does not expand macros in the argument to @deffn, which ends up
- % writing an index entry, and texindex isn't prepared for an index sort entry
- % that starts with .
- %
- % Since macro invocations are followed by braces, we can just redefine them
- % to take a single TeX argument. The case of a macro invocation that
- % goes to end-of-line is not handled.
- %
- macrolist
- }
- letindexbackslash=0 %overridden during printindex.
- letSETmarginindex=relax % put index entries in margin (undocumented)?
- % Most index entries go through here, but dosubind is the general case.
- % #1 is the index name, #2 is the entry text.
- defdoind#1#2{dosubind{#1}{#2}{}}
- % Workhorse for all fooindexes.
- % #1 is name of index, #2 is stuff to put there, #3 is subentry --
- % empty if called from doind, as we usually are (the main exception
- % is with most defuns, which call us directly).
- %
- defdosubind#1#2#3{%
- iflinks
- {%
- % Store the main index entry text (including the third arg).
- toks0 = {#2}%
- % If third arg is present, precede it with a space.
- defthirdarg{#3}%
- ifxthirdargempty else
- toks0 = expandafter{thetoks0 space #3}%
- fi
- %
- edefwriteto{csname#1indfileendcsname}%
- %
- safewhatsitdosubindwrite
- }%
- fi
- }
- % Write the entry in toks0 to the index file:
- %
- defdosubindwrite{%
- % Put the index entry in the margin if desired.
- ifxSETmarginindexrelaxelse
- insertmargin{hbox{vrule height8pt depth3pt width0pt thetoks0}}%
- fi
- %
- % Remember, we are within a group.
- indexdummies % Must do this here, since bf, etc expand at this stage
- defbackslashcurfont{indexbackslash}% indexbackslash isn't defined now
- % so it will be output as is; and it will print as backslash.
- %
- % Process the index entry with all font commands turned off, to
- % get the string to sort by.
- {indexnofonts
- edeftemp{thetoks0}% need full expansion
- xdefindexsorttmp{temp}%
- }%
- %
- % Set up the complete index entry, with both the sort key and
- % the original text, including any font commands. We write
- % three arguments to entry to the .?? file (four in the
- % subentry case), texindex reduces to two when writing the .??s
- % sorted result.
- edeftemp{%
- writewriteto{%
- stringentry{indexsorttmp}{noexpandfolio}{thetoks0}}%
- }%
- temp
- }
- % Take care of unwanted page breaks/skips around a whatsit:
- %
- % If a skip is the last thing on the list now, preserve it
- % by backing up by lastskip, doing the write, then inserting
- % the skip again. Otherwise, the whatsit generated by the
- % write or pdfdest will make lastskip zero. The result is that
- % sequences like this:
- % @end defun
- % @tindex whatever
- % @defun ...
- % will have extra space inserted, because the medbreak in the
- % start of the @defun won't see the skip inserted by the @end of
- % the previous defun.
- %
- % But don't do any of this if we're not in vertical mode. We
- % don't want to do a vskip and prematurely end a paragraph.
- %
- % Avoid page breaks due to these extra skips, too.
- %
- % But wait, there is a catch there:
- % We'll have to check whether lastskip is zero skip. ifdim is not
- % sufficient for this purpose, as it ignores stretch and shrink parts
- % of the skip. The only way seems to be to check the textual
- % representation of the skip.
- %
- % The following is almost like defzeroskipmacro{0.0pt} except that
- % the ``p'' and ``t'' characters have catcode other, not 11 (letter).
- %
- edefzeroskipmacro{expandafterthecsname z@skipendcsname}
- %
- newskipwhatsitskip
- newcountwhatsitpenalty
- %
- % ..., ready, GO:
- %
- defsafewhatsit#1{%
- ifhmode
- #1%
- else
- % lastskip and lastpenalty cannot both be nonzero simultaneously.
- whatsitskip = lastskip
- edeflastskipmacro{thelastskip}%
- whatsitpenalty = lastpenalty
- %
- % If lastskip is nonzero, that means the last item was a
- % skip. And since a skip is discardable, that means this
- % -whatsitskip glue we're inserting is preceded by a
- % non-discardable item, therefore it is not a potential
- % breakpoint, therefore no nobreak needed.
- ifxlastskipmacrozeroskipmacro
- else
- vskip-whatsitskip
- fi
- %
- #1%
- %
- ifxlastskipmacrozeroskipmacro
- % If lastskip was zero, perhaps the last item was a penalty, and
- % perhaps it was >=10000, e.g., a nobreak. In that case, we want
- % to re-insert the same penalty (values >10000 are used for various
- % signals); since we just inserted a non-discardable item, any
- % following glue (such as a parskip) would be a breakpoint. For example:
- %
- % @deffn deffn-whatever
- % @vindex index-whatever
- % Description.
- % would allow a break between the index-whatever whatsit
- % and the "Description." paragraph.
- ifnumwhatsitpenalty>9999 penaltywhatsitpenalty fi
- else
- % On the other hand, if we had a nonzero lastskip,
- % this make-up glue would be preceded by a non-discardable item
- % (the whatsit from the write), so we must insert a nobreak.
- nobreakvskipwhatsitskip
- fi
- fi
- }
- % The index entry written in the file actually looks like
- % entry {sortstring}{page}{topic}
- % or
- % entry {sortstring}{page}{topic}{subtopic}
- % The texindex program reads in these files and writes files
- % containing these kinds of lines:
- % initial {c}
- % before the first topic whose initial is c
- % entry {topic}{pagelist}
- % for a topic that is used without subtopics
- % primary {topic}
- % for the beginning of a topic that is used with subtopics
- % secondary {subtopic}{pagelist}
- % for each subtopic.
- % Define the user-accessible indexing commands
- % @findex, @vindex, @kindex, @cindex.
- deffindex {fnindex}
- defkindex {kyindex}
- defcindex {cpindex}
- defvindex {vrindex}
- deftindex {tpindex}
- defpindex {pgindex}
- defcindexsub {begingroupobeylinescindexsub}
- {obeylines %
- gdefcindexsub "#1" #2^^M{endgroup %
- dosubind{cp}{#2}{#1}}}
- % Define the macros used in formatting output of the sorted index material.
- % @printindex causes a particular index (the ??s file) to get printed.
- % It does not print any chapter heading (usually an @unnumbered).
- %
- parseargdefprintindex{begingroup
- dobreak chapheadingskip{10000}%
- %
- smallfonts rm
- tolerance = 9500
- plainfrenchspacing
- everypar = {}% don't want the kern-parindent from indentation suppression.
- %
- % See if the index file exists and is nonempty.
- % Change catcode of @ here so that if the index file contains
- % initial {@}
- % as its first line, TeX doesn't complain about mismatched braces
- % (because it thinks @} is a control sequence).
- catcode`@ = 11
- openin 1 jobname.#1s
- ifeof 1
- % enddoublecolumns gets confused if there is no text in the index,
- % and it loses the chapter title and the aux file entries for the
- % index. The easiest way to prevent this problem is to make sure
- % there is some text.
- putwordIndexNonexistent
- else
- %
- % If the index file exists but is empty, then openin leaves ifeof
- % false. We have to make TeX try to read something from the file, so
- % it can discover if there is anything in it.
- read 1 to temp
- ifeof 1
- putwordIndexIsEmpty
- else
- % Index files are almost Texinfo source, but we use as the escape
- % character. It would be better to use @, but that's too big a change
- % to make right now.
- defindexbackslash{backslashcurfont}%
- catcode`\ = 0
- escapechar = `\
- begindoublecolumns
- input jobname.#1s
- enddoublecolumns
- fi
- fi
- closein 1
- endgroup}
- % These macros are used by the sorted index file itself.
- % Change them to control the appearance of the index.
- definitial#1{{%
- % Some minor font changes for the special characters.
- lettentt=sectt lettt=sectt letsf=sectt
- %
- % Remove any glue we may have, we'll be inserting our own.
- removelastskip
- %
- % We like breaks before the index initials, so insert a bonus.
- nobreak
- vskip 0pt plus 3baselineskip
- penalty 0
- vskip 0pt plus -3baselineskip
- %
- % Typeset the initial. Making this add up to a whole number of
- % baselineskips increases the chance of the dots lining up from column
- % to column. It still won't often be perfect, because of the stretch
- % we need before each entry, but it's better.
- %
- % No shrink because it confuses balancecolumns.
- vskip 1.67baselineskip plus .5baselineskip
- leftline{secbf #1}%
- % Do our best not to break after the initial.
- nobreak
- vskip .33baselineskip plus .1baselineskip
- }}
- % entry typesets a paragraph consisting of the text (#1), dot leaders, and
- % then page number (#2) flushed to the right margin. It is used for index
- % and table of contents entries. The paragraph is indented by leftskip.
- %
- % A straightforward implementation would start like this:
- % defentry#1#2{...
- % But this freezes the catcodes in the argument, and can cause problems to
- % @code, which sets - active. This problem was fixed by a kludge---
- % ``-'' was active throughout whole index, but this isn't really right.
- %
- % The right solution is to prevent entry from swallowing the whole text.
- % --kasal, 21nov03
- defentry{%
- begingroup
- %
- % Start a new paragraph if necessary, so our assignments below can't
- % affect previous text.
- par
- %
- % Do not fill out the last line with white space.
- parfillskip = 0in
- %
- % No extra space above this paragraph.
- parskip = 0in
- %
- % Do not prefer a separate line ending with a hyphen to fewer lines.
- finalhyphendemerits = 0
- %
- % hangindent is only relevant when the entry text and page number
- % don't both fit on one line. In that case, bob suggests starting the
- % dots pretty far over on the line. Unfortunately, a large
- % indentation looks wrong when the entry text itself is broken across
- % lines. So we use a small indentation and put up with long leaders.
- %
- % hangafter is reset to 1 (which is the value we want) at the start
- % of each paragraph, so we need not do anything with that.
- hangindent = 2em
- %
- % When the entry text needs to be broken, just fill out the first line
- % with blank space.
- rightskip = 0pt plus1fil
- %
- % A bit of stretch before each entry for the benefit of balancing
- % columns.
- vskip 0pt plus1pt
- %
- % Swallow the left brace of the text (first parameter):
- afterassignmentdoentry
- lettemp =
- }
- defdoentry{%
- bgroup % Instead of the swallowed brace.
- noindent
- aftergroupfinishentry
- % And now comes the text of the entry.
- }
- deffinishentry#1{%
- % #1 is the page number.
- %
- % The following is kludged to not output a line of dots in the index if
- % there are no page numbers. The next person who breaks this will be
- % cursed by a Unix daemon.
- setboxboxA = hbox{#1}%
- ifdimwdboxA = 0pt
- %
- else
- %
- % If we must, put the page number on a line of its own, and fill out
- % this line with blank space. (The hfil is overwhelmed with the
- % fill leaders glue in indexdotfill if the page number does fit.)
- hfilpenalty50
- nullnobreakindexdotfill % Have leaders before the page number.
- %
- % The ` ' here is removed by the implicit unskip that TeX does as
- % part of (the primitive) par. Without it, a spurious underfull
- % hbox ensues.
- ifpdf
- pdfgettoks#1.%
- thetoksA
- else
- #1%
- fi
- fi
- par
- endgroup
- }
- % Like plain.tex's dotfill, except uses up at least 1 em.
- defindexdotfill{cleaders
- hbox{$mathsurround=0pt mkern1.5mu.mkern1.5mu$}hskip 1em plus 1fill}
- defprimary #1{line{#1hfil}}
- newskipsecondaryindent secondaryindent=0.5cm
- defsecondary#1#2{{%
- parfillskip=0in
- parskip=0in
- hangindent=1in
- hangafter=1
- noindenthskipsecondaryindenthbox{#1}indexdotfill
- ifpdf
- pdfgettoks#2. thetoksA % The page number ends the paragraph.
- else
- #2
- fi
- par
- }}
- % Define two-column mode, which we use to typeset indexes.
- % Adapted from the TeXbook, page 416, which is to say,
- % the manmac.tex format used to print the TeXbook itself.
- catcode`@=11
- newboxpartialpage
- newdimendoublecolumnhsize
- defbegindoublecolumns{begingroup % ended by enddoublecolumns
- % Grab any single-column material above us.
- output = {%
- %
- % Here is a possibility not foreseen in manmac: if we accumulate a
- % whole lot of material, we might end up calling this output
- % routine twice in a row (see the doublecol-lose test, which is
- % essentially a couple of indexes with @setchapternewpage off). In
- % that case we just ship out what is in partialpage with the normal
- % output routine. Generally, partialpage will be empty when this
- % runs and this will be a no-op. See the indexspread.tex test case.
- ifvoidpartialpage else
- onepageout{pagecontentspartialpage}%
- fi
- %
- globalsetboxpartialpage = vbox{%
- % Unvbox the main output page.
- unvboxPAGE
- kern-topskip kernbaselineskip
- }%
- }%
- eject % run that output routine to set partialpage
- %
- % Use the double-column output routine for subsequent pages.
- output = {doublecolumnout}%
- %
- % Change the page size parameters. We could do this once outside this
- % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
- % format, but then we repeat the same computation. Repeating a couple
- % of assignments once per index is clearly meaningless for the
- % execution time, so we may as well do it in one place.
- %
- % First we halve the line length, less a little for the gutter between
- % the columns. We compute the gutter based on the line length, so it
- % changes automatically with the paper format. The magic constant
- % below is chosen so that the gutter has the same value (well, +-<1pt)
- % as it did when we hard-coded it.
- %
- % We put the result in a separate register, doublecolumhsize, so we
- % can restore it in pagesofar, after hsize itself has (potentially)
- % been clobbered.
- %
- doublecolumnhsize = hsize
- advancedoublecolumnhsize by -.04154hsize
- dividedoublecolumnhsize by 2
- hsize = doublecolumnhsize
- %
- % Double the vsize as well. (We don't need a separate register here,
- % since nobody clobbers vsize.)
- vsize = 2vsize
- }
- % The double-column output routine for all double-column pages except
- % the last.
- %
- defdoublecolumnout{%
- splittopskip=topskip splitmaxdepth=maxdepth
- % Get the available space for the double columns -- the normal
- % (undoubled) page height minus any material left over from the
- % previous page.
- dimen@ = vsize
- dividedimen@ by 2
- advancedimen@ by -htpartialpage
- %
- % box0 will be the left-hand column, box2 the right.
- setbox0=vsplit255 todimen@ setbox2=vsplit255 todimen@
- onepageoutpagesofar
- unvbox255
- penaltyoutputpenalty
- }
- %
- % Re-output the contents of the output page -- any previous material,
- % followed by the two boxes we just split, in box0 and box2.
- defpagesofar{%
- unvboxpartialpage
- %
- hsize = doublecolumnhsize
- wd0=hsize wd2=hsize
- hbox topagewidth{box0hfilbox2}%
- }
- %
- % All done with double columns.
- defenddoublecolumns{%
- % The following penalty ensures that the page builder is exercised
- % _before_ we change the output routine. This is necessary in the
- % following situation:
- %
- % The last section of the index consists only of a single entry.
- % Before this section, pagetotal is less than pagegoal, so no
- % break occurs before the last section starts. However, the last
- % section, consisting of initial and the single entry, does not
- % fit on the page and has to be broken off. Without the following
- % penalty the page builder will not be exercised until eject
- % below, and by that time we'll already have changed the output
- % routine to the balancecolumns version, so the next-to-last
- % double-column page will be processed with balancecolumns, which
- % is wrong: The two columns will go to the main vertical list, with
- % the broken-off section in the recent contributions. As soon as
- % the output routine finishes, TeX starts reconsidering the page
- % break. The two columns and the broken-off section both fit on the
- % page, because the two columns now take up only half of the page
- % goal. When TeX sees eject from below which follows the final
- % section, it invokes the new output routine that we've set after
- % balancecolumns below; onepageout will try to fit the two columns
- % and the final section into the vbox of pageheight (see
- % pagebody), causing an overfull box.
- %
- % Note that glue won't work here, because glue does not exercise the
- % page builder, unlike penalties (see The TeXbook, pp. 280-281).
- penalty0
- %
- output = {%
- % Split the last of the double-column material. Leave it on the
- % current page, no automatic page break.
- balancecolumns
- %
- % If we end up splitting too much material for the current page,
- % though, there will be another page break right after this output
- % invocation ends. Having called balancecolumns once, we do not
- % want to call it again. Therefore, reset output to its normal
- % definition right away. (We hope balancecolumns will never be
- % called on to balance too much material, but if it is, this makes
- % the output somewhat more palatable.)
- globaloutput = {onepageout{pagecontentsPAGE}}%
- }%
- eject
- endgroup % started in begindoublecolumns
- %
- % pagegoal was set to the doubled vsize above, since we restarted
- % the current page. We're now back to normal single-column
- % typesetting, so reset pagegoal to the normal vsize (after the
- % endgroup where vsize got restored).
- pagegoal = vsize
- }
- %
- % Called at the end of the double column material.
- defbalancecolumns{%
- setbox0 = vbox{unvbox255}% like box255 but more efficient, see p.120.
- dimen@ = ht0
- advancedimen@ by topskip
- advancedimen@ by-baselineskip
- dividedimen@ by 2 % target to split to
- %debugmessage{final 2-column material height=theht0, target=thedimen@.}%
- splittopskip = topskip
- % Loop until we get a decent breakpoint.
- {%
- vbadness = 10000
- loop
- globalsetbox3 = copy0
- globalsetbox1 = vsplit3 to dimen@
- ifdimht3>dimen@
- globaladvancedimen@ by 1pt
- repeat
- }%
- %debugmessage{split to thedimen@, column heights: theht1, theht3.}%
- setbox0=vbox todimen@{unvbox1}%
- setbox2=vbox todimen@{unvbox3}%
- %
- pagesofar
- }
- catcode`@ = other
- message{sectioning,}
- % Chapters, sections, etc.
- % unnumberedno is an oxymoron, of course. But we count the unnumbered
- % sections so that we can refer to them unambiguously in the pdf
- % outlines by their "section number". We avoid collisions with chapter
- % numbers by starting them at 10000. (If a document ever has 10000
- % chapters, we're in trouble anyway, I'm sure.)
- newcountunnumberedno unnumberedno = 10000
- newcountchapno
- newcountsecno secno=0
- newcountsubsecno subsecno=0
- newcountsubsubsecno subsubsecno=0
- % This counter is funny since it counts through charcodes of letters A, B, ...
- newcountappendixno appendixno = `@
- %
- % defappendixletter{chartheappendixno}
- % We do the following ugly conditional instead of the above simple
- % construct for the sake of pdftex, which needs the actual
- % letter in the expansion, not just typeset.
- %
- defappendixletter{%
- ifnumappendixno=`A A%
- elseifnumappendixno=`B B%
- elseifnumappendixno=`C C%
- elseifnumappendixno=`D D%
- elseifnumappendixno=`E E%
- elseifnumappendixno=`F F%
- elseifnumappendixno=`G G%
- elseifnumappendixno=`H H%
- elseifnumappendixno=`I I%
- elseifnumappendixno=`J J%
- elseifnumappendixno=`K K%
- elseifnumappendixno=`L L%
- elseifnumappendixno=`M M%
- elseifnumappendixno=`N N%
- elseifnumappendixno=`O O%
- elseifnumappendixno=`P P%
- elseifnumappendixno=`Q Q%
- elseifnumappendixno=`R R%
- elseifnumappendixno=`S S%
- elseifnumappendixno=`T T%
- elseifnumappendixno=`U U%
- elseifnumappendixno=`V V%
- elseifnumappendixno=`W W%
- elseifnumappendixno=`X X%
- elseifnumappendixno=`Y Y%
- elseifnumappendixno=`Z Z%
- % The the is necessary, despite appearances, because appendixletter is
- % expanded while writing the .toc file. charappendixno is not
- % expandable, thus it is written literally, thus all appendixes come out
- % with the same letter (or @) in the toc without it.
- elsechartheappendixno
- fififififififififififififi
- fififififififififififififi}
- % Each @chapter defines these (using marks) as the number+name, number
- % and name of the chapter. Page headings and footings can use
- % these. @section does likewise.
- defthischapter{}
- defthischapternum{}
- defthischaptername{}
- defthissection{}
- defthissectionnum{}
- defthissectionname{}
- newcountabsseclevel % used to calculate proper heading level
- newcountsecbasesecbase=0 % @raisesections/@lowersections modify this count
- % @raisesections: treat @section as chapter, @subsection as section, etc.
- defraisesections{globaladvancesecbase by -1}
- letup=raisesections % original BFox name
- % @lowersections: treat @chapter as section, @section as subsection, etc.
- deflowersections{globaladvancesecbase by 1}
- letdown=lowersections % original BFox name
- % we only have subsub.
- chardefmaxseclevel = 3
- %
- % A numbered section within an unnumbered changes to unnumbered too.
- % To achieve this, remember the "biggest" unnum. sec. we are currently in:
- chardefunmlevel = maxseclevel
- %
- % Trace whether the current chapter is an appendix or not:
- % chapheadtype is "N" or "A", unnumbered chapters are ignored.
- defchapheadtype{N}
- % Choose a heading macro
- % #1 is heading type
- % #2 is heading level
- % #3 is text for heading
- defgenhead#1#2#3{%
- % Compute the abs. sec. level:
- absseclevel=#2
- advanceabsseclevel by secbase
- % Make sure absseclevel doesn't fall outside the range:
- ifnum absseclevel < 0
- absseclevel = 0
- else
- ifnum absseclevel > 3
- absseclevel = 3
- fi
- fi
- % The heading type:
- defheadtype{#1}%
- if headtype U%
- ifnum absseclevel < unmlevel
- chardefunmlevel = absseclevel
- fi
- else
- % Check for appendix sections:
- ifnum absseclevel = 0
- edefchapheadtype{headtype}%
- else
- if headtype Aif chapheadtype N%
- errmessage{@appendix... within a non-appendix chapter}%
- fifi
- fi
- % Check for numbered within unnumbered:
- ifnum absseclevel > unmlevel
- defheadtype{U}%
- else
- chardefunmlevel = 3
- fi
- fi
- % Now print the heading:
- if headtype U%
- ifcaseabsseclevel
- unnumberedzzz{#3}%
- or unnumberedseczzz{#3}%
- or unnumberedsubseczzz{#3}%
- or unnumberedsubsubseczzz{#3}%
- fi
- else
- if headtype A%
- ifcaseabsseclevel
- appendixzzz{#3}%
- or appendixsectionzzz{#3}%
- or appendixsubseczzz{#3}%
- or appendixsubsubseczzz{#3}%
- fi
- else
- ifcaseabsseclevel
- chapterzzz{#3}%
- or seczzz{#3}%
- or numberedsubseczzz{#3}%
- or numberedsubsubseczzz{#3}%
- fi
- fi
- fi
- suppressfirstparagraphindent
- }
- % an interface:
- defnumhead{genhead N}
- defapphead{genhead A}
- defunnmhead{genhead U}
- % @chapter, @appendix, @unnumbered. Increment top-level counter, reset
- % all lower-level sectioning counters to zero.
- %
- % Also set chaplevelprefix, which we prepend to @float sequence numbers
- % (e.g., figures), q.v. By default (before any chapter), that is empty.
- letchaplevelprefix = empty
- %
- outerparseargdefchapter{numhead0{#1}} % normally numhead0 calls chapterzzz
- defchapterzzz#1{%
- % section resetting is global in case the chapter is in a group, such
- % as an @include file.
- globalsecno=0 globalsubsecno=0 globalsubsubsecno=0
- globaladvancechapno by 1
- %
- % Used for float.
- gdefchaplevelprefix{thechapno.}%
- resetallfloatnos
- %
- message{putwordChapterspace thechapno}%
- %
- % Write the actual heading.
- chapmacro{#1}{Ynumbered}{thechapno}%
- %
- % So @section and the like are numbered underneath this chapter.
- globalletsection = numberedsec
- globalletsubsection = numberedsubsec
- globalletsubsubsection = numberedsubsubsec
- }
- outerparseargdefappendix{apphead0{#1}} % normally apphead0 calls appendixzzz
- defappendixzzz#1{%
- globalsecno=0 globalsubsecno=0 globalsubsubsecno=0
- globaladvanceappendixno by 1
- gdefchaplevelprefix{appendixletter.}%
- resetallfloatnos
- %
- defappendixnum{putwordAppendixspace appendixletter}%
- message{appendixnum}%
- %
- chapmacro{#1}{Yappendix}{appendixletter}%
- %
- globalletsection = appendixsec
- globalletsubsection = appendixsubsec
- globalletsubsubsection = appendixsubsubsec
- }
- outerparseargdefunnumbered{unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
- defunnumberedzzz#1{%
- globalsecno=0 globalsubsecno=0 globalsubsubsecno=0
- globaladvanceunnumberedno by 1
- %
- % Since an unnumbered has no number, no prefix for figures.
- globalletchaplevelprefix = empty
- resetallfloatnos
- %
- % This used to be simply message{#1}, but TeX fully expands the
- % argument to message. Therefore, if #1 contained @-commands, TeX
- % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
- % expanded @cite (which turns out to cause errors because cite is meant
- % to be executed, not expanded).
- %
- % Anyway, we don't want the fully-expanded definition of @cite to appear
- % as a result of the message, we just want `@cite' itself. We use
- % the<toks register> to achieve this: TeX expands the<toks> only once,
- % simply yielding the contents of <toks register>. (We also do this for
- % the toc entries.)
- toks0 = {#1}%
- message{(thetoks0)}%
- %
- chapmacro{#1}{Ynothing}{theunnumberedno}%
- %
- globalletsection = unnumberedsec
- globalletsubsection = unnumberedsubsec
- globalletsubsubsection = unnumberedsubsubsec
- }
- % @centerchap is like @unnumbered, but the heading is centered.
- outerparseargdefcenterchap{%
- % Well, we could do the following in a group, but that would break
- % an assumption that chapmacro is called at the outermost level.
- % Thus we are safer this way: --kasal, 24feb04
- letcenterparametersmaybe = centerparameters
- unnmhead0{#1}%
- letcenterparametersmaybe = relax
- }
- % @top is like @unnumbered.
- lettopunnumbered
- % Sections.
- outerparseargdefnumberedsec{numhead1{#1}} % normally calls seczzz
- defseczzz#1{%
- globalsubsecno=0 globalsubsubsecno=0 globaladvancesecno by 1
- sectionheading{#1}{sec}{Ynumbered}{thechapno.thesecno}%
- }
- outerparseargdefappendixsection{apphead1{#1}} % normally calls appendixsectionzzz
- defappendixsectionzzz#1{%
- globalsubsecno=0 globalsubsubsecno=0 globaladvancesecno by 1
- sectionheading{#1}{sec}{Yappendix}{appendixletter.thesecno}%
- }
- letappendixsecappendixsection
- outerparseargdefunnumberedsec{unnmhead1{#1}} % normally calls unnumberedseczzz
- defunnumberedseczzz#1{%
- globalsubsecno=0 globalsubsubsecno=0 globaladvancesecno by 1
- sectionheading{#1}{sec}{Ynothing}{theunnumberedno.thesecno}%
- }
- % Subsections.
- outerparseargdefnumberedsubsec{numhead2{#1}} % normally calls numberedsubseczzz
- defnumberedsubseczzz#1{%
- globalsubsubsecno=0 globaladvancesubsecno by 1
- sectionheading{#1}{subsec}{Ynumbered}{thechapno.thesecno.thesubsecno}%
- }
- outerparseargdefappendixsubsec{apphead2{#1}} % normally calls appendixsubseczzz
- defappendixsubseczzz#1{%
- globalsubsubsecno=0 globaladvancesubsecno by 1
- sectionheading{#1}{subsec}{Yappendix}%
- {appendixletter.thesecno.thesubsecno}%
- }
- outerparseargdefunnumberedsubsec{unnmhead2{#1}} %normally calls unnumberedsubseczzz
- defunnumberedsubseczzz#1{%
- globalsubsubsecno=0 globaladvancesubsecno by 1
- sectionheading{#1}{subsec}{Ynothing}%
- {theunnumberedno.thesecno.thesubsecno}%
- }
- % Subsubsections.
- outerparseargdefnumberedsubsubsec{numhead3{#1}} % normally numberedsubsubseczzz
- defnumberedsubsubseczzz#1{%
- globaladvancesubsubsecno by 1
- sectionheading{#1}{subsubsec}{Ynumbered}%
- {thechapno.thesecno.thesubsecno.thesubsubsecno}%
- }
- outerparseargdefappendixsubsubsec{apphead3{#1}} % normally appendixsubsubseczzz
- defappendixsubsubseczzz#1{%
- globaladvancesubsubsecno by 1
- sectionheading{#1}{subsubsec}{Yappendix}%
- {appendixletter.thesecno.thesubsecno.thesubsubsecno}%
- }
- outerparseargdefunnumberedsubsubsec{unnmhead3{#1}} %normally unnumberedsubsubseczzz
- defunnumberedsubsubseczzz#1{%
- globaladvancesubsubsecno by 1
- sectionheading{#1}{subsubsec}{Ynothing}%
- {theunnumberedno.thesecno.thesubsecno.thesubsubsecno}%
- }
- % These macros control what the section commands do, according
- % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
- % Define them by default for a numbered chapter.
- letsection = numberedsec
- letsubsection = numberedsubsec
- letsubsubsection = numberedsubsubsec
- % Define @majorheading, @heading and @subheading
- % NOTE on use of vbox for chapter headings, section headings, and such:
- % 1) We use vbox rather than the earlier line to permit
- % overlong headings to fold.
- % 2) hyphenpenalty is set to 10000 because hyphenation in a
- % heading is obnoxious; this forbids it.
- % 3) Likewise, headings look best if no parindent is used, and
- % if justification is not attempted. Hence raggedright.
- defmajorheading{%
- {advancechapheadingskip by 10pt chapbreak }%
- parseargchapheadingzzz
- }
- defchapheading{chapbreak parseargchapheadingzzz}
- defchapheadingzzz#1{%
- {chapfonts vbox{hyphenpenalty=10000tolerance=5000
- parindent=0ptraggedright
- rm #1hfill}}%
- bigskip parpenalty 200relax
- suppressfirstparagraphindent
- }
- % @heading, @subheading, @subsubheading.
- parseargdefheading{sectionheading{#1}{sec}{Yomitfromtoc}{}
- suppressfirstparagraphindent}
- parseargdefsubheading{sectionheading{#1}{subsec}{Yomitfromtoc}{}
- suppressfirstparagraphindent}
- parseargdefsubsubheading{sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
- suppressfirstparagraphindent}
- % These macros generate a chapter, section, etc. heading only
- % (including whitespace, linebreaking, etc. around it),
- % given all the information in convenient, parsed form.
- %%% Args are the skip and penalty (usually negative)
- defdobreak#1#2{parifdimlastskip<#1removelastskippenalty#2vskip#1fi}
- %%% Define plain chapter starts, and page on/off switching for it
- % Parameter controlling skip before chapter headings (if needed)
- newskipchapheadingskip
- defchapbreak{dobreak chapheadingskip {-4000}}
- defchappager{parvfillsupereject}
- % Because domark is called before chapoddpage, the filler page will
- % get the headings for the next chapter, which is wrong. But we don't
- % care -- we just disable all headings on the filler page.
- defchapoddpage{%
- chappager
- ifoddpageno else
- begingroup
- evenheadline={hfil}evenfootline={hfil}%
- oddheadline={hfil}oddfootline={hfil}%
- hbox to 0pt{}%
- chappager
- endgroup
- fi
- }
- defsetchapternewpage #1 {csname CHAPPAG#1endcsname}
- defCHAPPAGoff{%
- globalletcontentsalignmacro = chappager
- globalletpchapsepmacro=chapbreak
- globalletpagealignmacro=chappager}
- defCHAPPAGon{%
- globalletcontentsalignmacro = chappager
- globalletpchapsepmacro=chappager
- globalletpagealignmacro=chappager
- globaldefHEADINGSon{HEADINGSsingle}}
- defCHAPPAGodd{%
- globalletcontentsalignmacro = chapoddpage
- globalletpchapsepmacro=chapoddpage
- globalletpagealignmacro=chapoddpage
- globaldefHEADINGSon{HEADINGSdouble}}
- CHAPPAGon
- % Chapter opening.
- %
- % #1 is the text, #2 is the section type (Ynumbered, Ynothing,
- % Yappendix, Yomitfromtoc), #3 the chapter number.
- %
- % To test against our argument.
- defYnothingkeyword{Ynothing}
- defYomitfromtockeyword{Yomitfromtoc}
- defYappendixkeyword{Yappendix}
- %
- defchapmacro#1#2#3{%
- % Insert the first mark before the heading break (see notes for domark).
- letprevchapterdefs=lastchapterdefs
- letprevsectiondefs=lastsectiondefs
- gdeflastsectiondefs{gdefthissectionname{}gdefthissectionnum{}%
- gdefthissection{}}%
- %
- deftemptype{#2}%
- ifxtemptypeYnothingkeyword
- gdeflastchapterdefs{gdefthischaptername{#1}gdefthischapternum{}%
- gdefthischapter{thischaptername}}%
- elseifxtemptypeYomitfromtockeyword
- gdeflastchapterdefs{gdefthischaptername{#1}gdefthischapternum{}%
- gdefthischapter{}}%
- elseifxtemptypeYappendixkeyword
- toks0={#1}%
- xdeflastchapterdefs{%
- gdefnoexpandthischaptername{thetoks0}%
- gdefnoexpandthischapternum{appendixletter}%
- gdefnoexpandthischapter{putwordAppendix{} noexpandthischapternum:
- noexpandthischaptername}%
- }%
- else
- toks0={#1}%
- xdeflastchapterdefs{%
- gdefnoexpandthischaptername{thetoks0}%
- gdefnoexpandthischapternum{thechapno}%
- gdefnoexpandthischapter{putwordChapter{} noexpandthischapternum:
- noexpandthischaptername}%
- }%
- fififi
- %
- % Output the mark. Pass it through safewhatsit, to take care of
- % the preceding space.
- safewhatsitdomark
- %
- % Insert the chapter heading break.
- pchapsepmacro
- %
- % Now the second mark, after the heading break. No break points
- % between here and the heading.
- letprevchapterdefs=lastchapterdefs
- letprevsectiondefs=lastsectiondefs
- domark
- %
- {%
- chapfonts rm
- %
- % Have to define lastsection before calling donoderef, because the
- % xref code eventually uses it. On the other hand, it has to be called
- % after pchapsepmacro, or the headline will change too soon.
- gdeflastsection{#1}%
- %
- % Only insert the separating space if we have a chapter/appendix
- % number, and don't print the unnumbered ``number''.
- ifxtemptypeYnothingkeyword
- setbox0 = hbox{}%
- deftoctype{unnchap}%
- elseifxtemptypeYomitfromtockeyword
- setbox0 = hbox{}% contents like unnumbered, but no toc entry
- deftoctype{omit}%
- elseifxtemptypeYappendixkeyword
- setbox0 = hbox{putwordAppendix{} #3enspace}%
- deftoctype{app}%
- else
- setbox0 = hbox{#3enspace}%
- deftoctype{numchap}%
- fififi
- %
- % Write the toc entry for this chapter. Must come before the
- % donoderef, because we include the current node name in the toc
- % entry, and donoderef resets it to empty.
- writetocentry{toctype}{#1}{#3}%
- %
- % For pdftex, we have to write out the node definition (aka, make
- % the pdfdest) after any page break, but before the actual text has
- % been typeset. If the destination for the pdf outline is after the
- % text, then jumping from the outline may wind up with the text not
- % being visible, for instance under high magnification.
- donoderef{#2}%
- %
- % Typeset the actual heading.
- nobreak % Avoid page breaks at the interline glue.
- vbox{hyphenpenalty=10000 tolerance=5000 parindent=0pt raggedright
- hangindent=wd0 centerparametersmaybe
- unhbox0 #1par}%
- }%
- nobreakbigskip % no page break after a chapter title
- nobreak
- }
- % @centerchap -- centered and unnumbered.
- letcenterparametersmaybe = relax
- defcenterparameters{%
- advancerightskip by 3rightskip
- leftskip = rightskip
- parfillskip = 0pt
- }
- % I don't think this chapter style is supported any more, so I'm not
- % updating it with the new noderef stuff. We'll see. --karl, 11aug03.
- %
- defsetchapterstyle #1 {csname CHAPF#1endcsname}
- %
- defunnchfopen #1{%
- chapoddpage {chapfonts vbox{hyphenpenalty=10000tolerance=5000
- parindent=0ptraggedright
- rm #1hfill}}bigskip parnobreak
- }
- defchfopen #1#2{chapoddpage {chapfonts
- vbox to 3in{vfil hbox tohsize{hfil #2} hbox tohsize{hfil #1} vfil}}%
- parpenalty 5000 %
- }
- defcenterchfopen #1{%
- chapoddpage {chapfonts vbox{hyphenpenalty=10000tolerance=5000
- parindent=0pt
- hfill {rm #1}hfill}}bigskip parnobreak
- }
- defCHAPFopen{%
- globalletchapmacro=chfopen
- globalletcenterchapmacro=centerchfopen}
- % Section titles. These macros combine the section number parts and
- % call the generic sectionheading to do the printing.
- %
- newskipsecheadingskip
- defsecheadingbreak{dobreak secheadingskip{-1000}}
- % Subsection titles.
- newskipsubsecheadingskip
- defsubsecheadingbreak{dobreak subsecheadingskip{-500}}
- % Subsubsection titles.
- defsubsubsecheadingskip{subsecheadingskip}
- defsubsubsecheadingbreak{subsecheadingbreak}
- % Print any size, any type, section title.
- %
- % #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is
- % the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the
- % section number.
- %
- defseckeyword{sec}
- %
- defsectionheading#1#2#3#4{%
- {%
- % Switch to the right set of fonts.
- csname #2fontsendcsname rm
- %
- defsectionlevel{#2}%
- deftemptype{#3}%
- %
- % Insert first mark before the heading break (see notes for domark).
- letprevsectiondefs=lastsectiondefs
- ifxtemptypeYnothingkeyword
- ifxsectionlevelseckeyword
- gdeflastsectiondefs{gdefthissectionname{#1}gdefthissectionnum{}%
- gdefthissection{thissectionname}}%
- fi
- elseifxtemptypeYomitfromtockeyword
- % Don't redefine thissection.
- elseifxtemptypeYappendixkeyword
- ifxsectionlevelseckeyword
- toks0={#1}%
- xdeflastsectiondefs{%
- gdefnoexpandthissectionname{thetoks0}%
- gdefnoexpandthissectionnum{#4}%
- gdefnoexpandthissection{putwordSection{} noexpandthissectionnum:
- noexpandthissectionname}%
- }%
- fi
- else
- ifxsectionlevelseckeyword
- toks0={#1}%
- xdeflastsectiondefs{%
- gdefnoexpandthissectionname{thetoks0}%
- gdefnoexpandthissectionnum{#4}%
- gdefnoexpandthissection{putwordSection{} noexpandthissectionnum:
- noexpandthissectionname}%
- }%
- fi
- fififi
- %
- % Output the mark. Pass it through safewhatsit, to take care of
- % the preceding space.
- safewhatsitdomark
- %
- % Insert space above the heading.
- csname #2headingbreakendcsname
- %
- % Now the second mark, after the heading break. No break points
- % between here and the heading.
- letprevsectiondefs=lastsectiondefs
- domark
- %
- % Only insert the space after the number if we have a section number.
- ifxtemptypeYnothingkeyword
- setbox0 = hbox{}%
- deftoctype{unn}%
- gdeflastsection{#1}%
- elseifxtemptypeYomitfromtockeyword
- % for @headings -- no section number, don't include in toc,
- % and don't redefine lastsection.
- setbox0 = hbox{}%
- deftoctype{omit}%
- letsectionlevel=empty
- elseifxtemptypeYappendixkeyword
- setbox0 = hbox{#4enspace}%
- deftoctype{app}%
- gdeflastsection{#1}%
- else
- setbox0 = hbox{#4enspace}%
- deftoctype{num}%
- gdeflastsection{#1}%
- fififi
- %
- % Write the toc entry (before donoderef). See comments in chapmacro.
- writetocentry{toctypesectionlevel}{#1}{#4}%
- %
- % Write the node reference (= pdf destination for pdftex).
- % Again, see comments in chapmacro.
- donoderef{#3}%
- %
- % Interline glue will be inserted when the vbox is completed.
- % That glue will be a valid breakpoint for the page, since it'll be
- % preceded by a whatsit (usually from the donoderef, or from the
- % writetocentry if there was no node). We don't want to allow that
- % break, since then the whatsits could end up on page n while the
- % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000.
- nobreak
- %
- % Output the actual section heading.
- vbox{hyphenpenalty=10000 tolerance=5000 parindent=0pt raggedright
- hangindent=wd0 % zero if no section number
- unhbox0 #1}%
- }%
- % Add extra space after the heading -- half of whatever came above it.
- % Don't allow stretch, though.
- kern .5 csname #2headingskipendcsname
- %
- % Do not let the kern be a potential breakpoint, as it would be if it
- % was followed by glue.
- nobreak
- %
- % We'll almost certainly start a paragraph next, so don't let that
- % glue accumulate. (Not a breakpoint because it's preceded by a
- % discardable item.)
- vskip-parskip
- %
- % This is purely so the last item on the list is a known penalty >
- % 10000. This is so startdefun can avoid allowing breakpoints after
- % section headings. Otherwise, it would insert a valid breakpoint between:
- %
- % @section sec-whatever
- % @deffn def-whatever
- penalty 10001
- }
- message{toc,}
- % Table of contents.
- newwritetocfile
- % Write an entry to the toc file, opening it if necessary.
- % Called from @chapter, etc.
- %
- % Example usage: writetocentry{sec}{Section Name}{thechapno.thesecno}
- % We append the current node name (if any) and page number as additional
- % arguments for the {chap,sec,...}entry macros which will eventually
- % read this. The node name is used in the pdf outlines as the
- % destination to jump to.
- %
- % We open the .toc file for writing here instead of at @setfilename (or
- % any other fixed time) so that @contents can be anywhere in the document.
- % But if #1 is `omit', then we don't do anything. This is used for the
- % table of contents chapter openings themselves.
- %
- newififtocfileopened
- defomitkeyword{omit}%
- %
- defwritetocentry#1#2#3{%
- edefwritetoctype{#1}%
- ifxwritetoctypeomitkeyword else
- iftocfileopenedelse
- immediateopenouttocfile = jobname.toc
- globaltocfileopenedtrue
- fi
- %
- iflinks
- {atdummies
- edeftemp{%
- writetocfile{@#1entry{#2}{#3}{lastnode}{noexpandfolio}}}%
- temp
- }%
- fi
- fi
- %
- % Tell shipout to create a pdf destination on each page, if we're
- % writing pdf. These are used in the table of contents. We can't
- % just write one on every page because the title pages are numbered
- % 1 and 2 (the page numbers aren't printed), and so are the first
- % two pages of the document. Thus, we'd have two destinations named
- % `1', and two named `2'.
- ifpdf globalpdfmakepagedesttrue fi
- }
- % These characters do not print properly in the Computer Modern roman
- % fonts, so we must take special care. This is more or less redundant
- % with the Texinfo input format setup at the end of this file.
- %
- defactivecatcodes{%
- catcode`"=active
- catcode`$=active
- catcode`<=active
- catcode`>=active
- catcode`\=active
- catcode`^=active
- catcode`_=active
- catcode`|=active
- catcode`~=active
- }
- % Read the toc file, which is essentially Texinfo input.
- defreadtocfile{%
- setupdatafile
- activecatcodes
- input tocreadfilename
- }
- newskipcontentsrightmargin contentsrightmargin=1in
- newcountsavepageno
- newcountlastnegativepageno lastnegativepageno = -1
- % Prepare to read what we've written to tocfile.
- %
- defstartcontents#1{%
- % If @setchapternewpage on, and @headings double, the contents should
- % start on an odd page, unlike chapters. Thus, we maintain
- % contentsalignmacro in parallel with pagealignmacro.
- % From: Torbjorn Granlund <tege@matematik.su.se>
- contentsalignmacro
- immediatecloseouttocfile
- %
- % Don't need to put `Contents' or `Short Contents' in the headline.
- % It is abundantly clear what they are.
- chapmacro{#1}{Yomitfromtoc}{}%
- %
- savepageno = pageno
- begingroup % Set up to handle contents files properly.
- raggedbottom % Worry more about breakpoints than the bottom.
- advancehsize by -contentsrightmargin % Don't use the full line length.
- %
- % Roman numerals for page numbers.
- ifnum pageno>0 globalpageno = lastnegativepageno fi
- }
- % redefined for the two-volume lispref. We always output on
- % jobname.toc even if this is redefined.
- %
- deftocreadfilename{jobname.toc}
- % Normal (long) toc.
- %
- defcontents{%
- startcontents{putwordTOC}%
- openin 1 tocreadfilenamespace
- ifeof 1 else
- readtocfile
- fi
- vfill eject
- contentsalignmacro % in case @setchapternewpage odd is in effect
- ifeof 1 else
- pdfmakeoutlines
- fi
- closein 1
- endgroup
- lastnegativepageno = pageno
- globalpageno = savepageno
- }
- % And just the chapters.
- defsummarycontents{%
- startcontents{putwordShortTOC}%
- %
- letnumchapentry = shortchapentry
- letappentry = shortchapentry
- letunnchapentry = shortunnchapentry
- % We want a true roman here for the page numbers.
- secfonts
- letrm=shortcontrm letbf=shortcontbf
- letsl=shortcontsl lettt=shortconttt
- rm
- hyphenpenalty = 10000
- advancebaselineskip by 1pt % Open it up a little.
- defnumsecentry##1##2##3##4{}
- letappsecentry = numsecentry
- letunnsecentry = numsecentry
- letnumsubsecentry = numsecentry
- letappsubsecentry = numsecentry
- letunnsubsecentry = numsecentry
- letnumsubsubsecentry = numsecentry
- letappsubsubsecentry = numsecentry
- letunnsubsubsecentry = numsecentry
- openin 1 tocreadfilenamespace
- ifeof 1 else
- readtocfile
- fi
- closein 1
- vfill eject
- contentsalignmacro % in case @setchapternewpage odd is in effect
- endgroup
- lastnegativepageno = pageno
- globalpageno = savepageno
- }
- letshortcontents = summarycontents
- % Typeset the label for a chapter or appendix for the short contents.
- % The arg is, e.g., `A' for an appendix, or `3' for a chapter.
- %
- defshortchaplabel#1{%
- % This space should be enough, since a single number is .5em, and the
- % widest letter (M) is 1em, at least in the Computer Modern fonts.
- % But use hss just in case.
- % (This space doesn't include the extra space that gets added after
- % the label; that gets put in by shortchapentry above.)
- %
- % We'd like to right-justify chapter numbers, but that looks strange
- % with appendix letters. And right-justifying numbers and
- % left-justifying letters looks strange when there is less than 10
- % chapters. Have to read the whole toc once to know how many chapters
- % there are before deciding ...
- hbox to 1em{#1hss}%
- }
- % These macros generate individual entries in the table of contents.
- % The first argument is the chapter or section name.
- % The last argument is the page number.
- % The arguments in between are the chapter number, section number, ...
- % Chapters, in the main contents.
- defnumchapentry#1#2#3#4{dochapentry{#2labelspace#1}{#4}}
- %
- % Chapters, in the short toc.
- % See comments in dochapentry re vbox and related settings.
- defshortchapentry#1#2#3#4{%
- tocentry{shortchaplabel{#2}labelspace #1}{doshortpagenobgroup#4egroup}%
- }
- % Appendices, in the main contents.
- % Need the word Appendix, and a fixed-size box.
- %
- defappendixbox#1{%
- % We use M since it's probably the widest letter.
- setbox0 = hbox{putwordAppendix{} M}%
- hbox to wd0{putwordAppendix{} #1hss}}
- %
- defappentry#1#2#3#4{dochapentry{appendixbox{#2}labelspace#1}{#4}}
- % Unnumbered chapters.
- defunnchapentry#1#2#3#4{dochapentry{#1}{#4}}
- defshortunnchapentry#1#2#3#4{tocentry{#1}{doshortpagenobgroup#4egroup}}
- % Sections.
- defnumsecentry#1#2#3#4{dosecentry{#2labelspace#1}{#4}}
- letappsecentry=numsecentry
- defunnsecentry#1#2#3#4{dosecentry{#1}{#4}}
- % Subsections.
- defnumsubsecentry#1#2#3#4{dosubsecentry{#2labelspace#1}{#4}}
- letappsubsecentry=numsubsecentry
- defunnsubsecentry#1#2#3#4{dosubsecentry{#1}{#4}}
- % And subsubsections.
- defnumsubsubsecentry#1#2#3#4{dosubsubsecentry{#2labelspace#1}{#4}}
- letappsubsubsecentry=numsubsubsecentry
- defunnsubsubsecentry#1#2#3#4{dosubsubsecentry{#1}{#4}}
- % This parameter controls the indentation of the various levels.
- % Same as defaultparindent.
- newdimentocindent tocindent = 15pt
- % Now for the actual typesetting. In all these, #1 is the text and #2 is the
- % page number.
- %
- % If the toc has to be broken over pages, we want it to be at chapters
- % if at all possible; hence the penalty.
- defdochapentry#1#2{%
- penalty-300 vskip1baselineskip plus.33baselineskip minus.25baselineskip
- begingroup
- chapentryfonts
- tocentry{#1}{dopagenobgroup#2egroup}%
- endgroup
- nobreakvskip .25baselineskip plus.1baselineskip
- }
- defdosecentry#1#2{begingroup
- secentryfonts leftskip=tocindent
- tocentry{#1}{dopagenobgroup#2egroup}%
- endgroup}
- defdosubsecentry#1#2{begingroup
- subsecentryfonts leftskip=2tocindent
- tocentry{#1}{dopagenobgroup#2egroup}%
- endgroup}
- defdosubsubsecentry#1#2{begingroup
- subsubsecentryfonts leftskip=3tocindent
- tocentry{#1}{dopagenobgroup#2egroup}%
- endgroup}
- % We use the same entry macro as for the index entries.
- lettocentry = entry
- % Space between chapter (or whatever) number and the title.
- deflabelspace{hskip1em relax}
- defdopageno#1{{rm #1}}
- defdoshortpageno#1{{rm #1}}
- defchapentryfonts{secfonts rm}
- defsecentryfonts{textfonts}
- defsubsecentryfonts{textfonts}
- defsubsubsecentryfonts{textfonts}
- message{environments,}
- % @foo ... @end foo.
- % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
- %
- % Since these characters are used in examples, they should be an even number of
- % tt widths. Each tt character is 1en, so two makes it 1em.
- %
- defpoint{$star$}
- defarrow{leavevmoderaise.05exhbox to 1em{hfil$rightarrow$hfil}}
- defresult{leavevmoderaise.05exhbox to 1em{hfil$Rightarrow$hfil}}
- defexpansion{leavevmodehbox to 1em{hfil$mapsto$hfil}}
- defprint{leavevmodelower.1exhbox to 1em{hfil$dashv$hfil}}
- defequiv{leavevmodehbox to 1em{hfil$ptexequiv$hfil}}
- % The @error{} command.
- % Adapted from the TeXbook's boxit.
- %
- newboxerrorbox
- %
- {tentt globaldimen0 = 3em}% Width of the box.
- dimen2 = .55pt % Thickness of rules
- % The text. (`r' is open on the right, `e' somewhat less so on the left.)
- setbox0 = hbox{kern-.75pt reducedsf errorkern-1.5pt}
- %
- setboxerrorbox=hbox to dimen0{hfil
- hsize = dimen0 advancehsize by -5.8pt % Space to left+right.
- advancehsize by -2dimen2 % Rules.
- vbox{%
- hrule heightdimen2
- hbox{vrule widthdimen2 kern3pt % Space to left of text.
- vtop{kern2.4pt box0 kern2.4pt}% Space above/below.
- kern3ptvrule widthdimen2}% Space to right.
- hrule heightdimen2}
- hfil}
- %
- deferror{leavevmodelower.7excopyerrorbox}
- % @tex ... @end tex escapes into raw Tex temporarily.
- % One exception: @ is still an escape character, so that @end tex works.
- % But @ or @@ will get a plain tex @ character.
- envdeftex{%
- catcode `\=0 catcode `{=1 catcode `}=2
- catcode `$=3 catcode `&=4 catcode `#=6
- catcode `^=7 catcode `_=8 catcode `~=active let~=tie
- catcode `%=14
- catcode `+=other
- catcode `"=other
- catcode `|=other
- catcode `<=other
- catcode `>=other
- escapechar=`\
- %
- letb=ptexb
- letbullet=ptexbullet
- letc=ptexc
- let,=ptexcomma
- let.=ptexdot
- letdots=ptexdots
- letequiv=ptexequiv
- let!=ptexexclam
- leti=ptexi
- letindent=ptexindent
- letnoindent=ptexnoindent
- let{=ptexlbrace
- let+=tabalign
- let}=ptexrbrace
- let/=ptexslash
- let*=ptexstar
- lett=ptext
- expandafter letcsname topendcsname=ptextop % outer
- letfrenchspacing=plainfrenchspacing
- %
- defendldots{mathinner{ldotsldotsldotsldots}}%
- defenddots{relaxifmmodeendldotselse$mathsurround=0pt endldots,$fi}%
- def@{@}%
- }
- % There is no need to define Etex.
- % Define @lisp ... @end lisp.
- % @lisp environment forms a group so it can rebind things,
- % including the definition of @end lisp (which normally is erroneous).
- % Amount to narrow the margins by for @lisp.
- newskiplispnarrowing lispnarrowing=0.4in
- % This is the definition that ^^M gets inside @lisp, @example, and other
- % such environments. null is better than a space, since it doesn't
- % have any width.
- deflisppar{nullendgraf}
- % This space is always present above and below environments.
- newskipenvskipamount envskipamount = 0pt
- % Make spacing and below environment symmetrical. We use parskip here
- % to help in doing that, since in @example-like environments parskip
- % is reset to zero; thus the afterenvbreak inserts no space -- but the
- % start of the next paragraph will insert parskip.
- %
- defaboveenvbreak{{%
- % =10000 instead of <10000 because of a special case in itemzzz and
- % sectionheading, q.v.
- ifnum lastpenalty=10000 else
- advanceenvskipamount by parskip
- endgraf
- ifdimlastskip<envskipamount
- removelastskip
- % it's not a good place to break if the last penalty was nobreak
- % or better ...
- ifnumlastpenalty<10000 penalty-50 fi
- vskipenvskipamount
- fi
- fi
- }}
- letafterenvbreak = aboveenvbreak
- % nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will
- % also clear it, so that its embedded environments do the narrowing again.
- letnonarrowing=relax
- % @cartouche ... @end cartouche: draw rectangle w/rounded corners around
- % environment contents.
- fontcircle=lcircle10
- newdimencircthick
- newdimencartouternewdimencartinner
- newskipnormbskipnewskipnormpskipnewskipnormlskip
- circthick=fontdimen8circle
- %
- defctl{{circlechar'013hskip -6pt}}% 6pt from pl file: 1/2charwidth
- defctr{{hskip 6ptcirclechar'010}}
- defcbl{{circlechar'012hskip -6pt}}
- defcbr{{hskip 6ptcirclechar'011}}
- defcarttop{hbox to cartouter{hskiplskip
- ctlleadershrule heightcircthickhfilctr
- hskiprskip}}
- defcartbot{hbox to cartouter{hskiplskip
- cblleadershrule heightcircthickhfilcbr
- hskiprskip}}
- %
- newskiplskipnewskiprskip
- envdefcartouche{%
- ifhmodeparfi % can't be in the midst of a paragraph.
- startsavinginserts
- lskip=leftskip rskip=rightskip
- leftskip=0ptrightskip=0pt % we want these *outside*.
- cartinner=hsize advancecartinner by-lskip
- advancecartinner by-rskip
- cartouter=hsize
- advancecartouter by 18.4pt % allow for 3pt kerns on either
- % side, and for 6pt waste from
- % each corner char, and rule thickness
- normbskip=baselineskip normpskip=parskip normlskip=lineskip
- % Flag to tell @lisp, etc., not to narrow margin.
- letnonarrowing = t%
- vboxbgroup
- baselineskip=0ptparskip=0ptlineskip=0pt
- carttop
- hboxbgroup
- hskiplskip
- vrulekern3pt
- vboxbgroup
- kern3pt
- hsize=cartinner
- baselineskip=normbskip
- lineskip=normlskip
- parskip=normpskip
- vskip -parskip
- comment % For explanation, see the end of defgroup.
- }
- defEcartouche{%
- ifhmodeparfi
- kern3pt
- egroup
- kern3ptvrule
- hskiprskip
- egroup
- cartbot
- egroup
- checkinserts
- }
- % This macro is called at the beginning of all the @example variants,
- % inside a group.
- defnonfillstart{%
- aboveenvbreak
- hfuzz = 12pt % Don't be fussy
- sepspaces % Make spaces be word-separators rather than space tokens.
- letpar = lisppar % don't ignore blank lines
- obeylines % each line of input is a line of output
- parskip = 0pt
- parindent = 0pt
- emergencystretch = 0pt % don't try to avoid overfull boxes
- ifxnonarrowingrelax
- advance leftskip by lispnarrowing
- exdentamount=lispnarrowing
- else
- letnonarrowing = relax
- fi
- letexdent=nofillexdent
- }
- % If you want all examples etc. small: @set dispenvsize small.
- % If you want even small examples the full size: @set dispenvsize nosmall.
- % This affects the following displayed environments:
- % @example, @display, @format, @lisp
- %
- defsmallword{small}
- defnosmallword{nosmall}
- letSETdispenvsizerelax
- defsetnormaldispenv{%
- ifxSETdispenvsizesmallword
- % end paragraph for sake of leading, in case document has no blank
- % line. This is redundant with what happens in aboveenvbreak, but
- % we need to do it before changing the fonts, and it's inconvenient
- % to change the fonts afterward.
- ifnum lastpenalty=10000 else endgraf fi
- smallexamplefonts rm
- fi
- }
- defsetsmalldispenv{%
- ifxSETdispenvsizenosmallword
- else
- ifnum lastpenalty=10000 else endgraf fi
- smallexamplefonts rm
- fi
- }
- % We often define two environments, @foo and @smallfoo.
- % Let's do it by one command:
- defmakedispenv #1#2{
- expandafterenvdefcsname#1endcsname {setnormaldispenv #2}
- expandafterenvdefcsname small#1endcsname {setsmalldispenv #2}
- expandafterletcsname E#1endcsname afterenvbreak
- expandafterletcsname Esmall#1endcsname afterenvbreak
- }
- % Define two synonyms:
- defmaketwodispenvs #1#2#3{
- makedispenv{#1}{#3}
- makedispenv{#2}{#3}
- }
- % @lisp: indented, narrowed, typewriter font; @example: same as @lisp.
- %
- % @smallexample and @smalllisp: use smaller fonts.
- % Originally contributed by Pavel@xerox.
- %
- maketwodispenvs {lisp}{example}{%
- nonfillstart
- ttquoteexpand
- letkbdfont = kbdexamplefont % Allow @kbd to do something special.
- gobble % eat return
- }
- % @display/@smalldisplay: same as @lisp except keep current font.
- %
- makedispenv {display}{%
- nonfillstart
- gobble
- }
- % @format/@smallformat: same as @display except don't narrow margins.
- %
- makedispenv{format}{%
- letnonarrowing = t%
- nonfillstart
- gobble
- }
- % @flushleft: same as @format, but doesn't obey SETdispenvsize.
- envdefflushleft{%
- letnonarrowing = t%
- nonfillstart
- gobble
- }
- letEflushleft = afterenvbreak
- % @flushright.
- %
- envdefflushright{%
- letnonarrowing = t%
- nonfillstart
- advanceleftskip by 0pt plus 1fill
- gobble
- }
- letEflushright = afterenvbreak
- % @quotation does normal linebreaking (hence we can't use nonfillstart)
- % and narrows the margins. We keep parskip nonzero in general, since
- % we're doing normal filling. So, when using aboveenvbreak and
- % afterenvbreak, temporarily make parskip 0.
- %
- envdefquotation{%
- {parskip=0pt aboveenvbreak}% because aboveenvbreak inserts parskip
- parindent=0pt
- %
- % @cartouche defines nonarrowing to inhibit narrowing at next level down.
- ifxnonarrowingrelax
- advanceleftskip by lispnarrowing
- advancerightskip by lispnarrowing
- exdentamount = lispnarrowing
- else
- letnonarrowing = relax
- fi
- parseargquotationlabel
- }
- % We have retained a nonzero parskip for the environment, since we're
- % doing normal filling.
- %
- defEquotation{%
- par
- ifxquotationauthorundefinedelse
- % indent a bit.
- leftline{kern 2leftskip sl ---quotationauthor}%
- fi
- {parskip=0pt afterenvbreak}%
- }
- % If we're given an argument, typeset it in bold with a colon after.