diff options
author | Karl Berry <karl@freefriends.org> | 2006-12-08 00:25:19 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-12-08 00:25:19 +0000 |
commit | 7ff51640e2fd3e968488d312879dee70458f2926 (patch) | |
tree | 6b9ede61598bd09a713892640d2d41da6913e509 /Master/texmf-dist/tex/eplain | |
parent | 8291b74ec6f858e3536a5919b74386a7df1dcc24 (diff) |
eplain 3.1 (5dec06)
git-svn-id: svn://tug.org/texlive/trunk@2630 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/eplain')
-rw-r--r-- | Master/texmf-dist/tex/eplain/arrow.tex (renamed from Master/texmf-dist/tex/eplain/base/arrow.tex) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/tex/eplain/btxmac.tex (renamed from Master/texmf-dist/tex/eplain/base/btxmac.tex) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/tex/eplain/config/xeplain.ini | 39 | ||||
-rw-r--r-- | Master/texmf-dist/tex/eplain/eplain.aux | 0 | ||||
-rw-r--r-- | Master/texmf-dist/tex/eplain/eplain.ini (renamed from Master/texmf-dist/tex/eplain/config/eplain.ini) | 0 | ||||
-rw-r--r-- | Master/texmf-dist/tex/eplain/eplain.tex (renamed from Master/texmf-dist/tex/eplain/base/eplain.tex) | 537 |
6 files changed, 434 insertions, 142 deletions
diff --git a/Master/texmf-dist/tex/eplain/base/arrow.tex b/Master/texmf-dist/tex/eplain/arrow.tex index 9c43c2fe3cc..9c43c2fe3cc 100644 --- a/Master/texmf-dist/tex/eplain/base/arrow.tex +++ b/Master/texmf-dist/tex/eplain/arrow.tex diff --git a/Master/texmf-dist/tex/eplain/base/btxmac.tex b/Master/texmf-dist/tex/eplain/btxmac.tex index 4b7fda7c61e..4b7fda7c61e 100644 --- a/Master/texmf-dist/tex/eplain/base/btxmac.tex +++ b/Master/texmf-dist/tex/eplain/btxmac.tex diff --git a/Master/texmf-dist/tex/eplain/config/xeplain.ini b/Master/texmf-dist/tex/eplain/config/xeplain.ini deleted file mode 100644 index 969e7081ee7..00000000000 --- a/Master/texmf-dist/tex/eplain/config/xeplain.ini +++ /dev/null @@ -1,39 +0,0 @@ -% Jonathan Kew -% 2006-09-15 -% Public domain -% hyphenation is set up in language.dat -% based on eplain.ini ("xeplain" = the eplain macros with xetex) - -\input unicode-letters % required before patterns are loaded - -%% Disable the \font\preloaded=... entries from plain.tex -%% as xetex is primarily intended for use with other fonts -\catcode`\{=1 \catcode`\}=2 \catcode`\#=6 \catcode`\^=7 \catcode`\@=11 -\let\s@vef@nt=\font -\let\preloaded=2 -\def\font{\futurelet\next\d@ntpreload} -\def\d@ntpreload{\ifx\next\preloaded - \let\next\sk@pf@nt - \begingroup \catcode`\%=12 \catcode13=12 - \else - \let\next\s@vef@nt - \fi \next} -\lccode1=13 -\lowercase{\def\sk@pf@nt\preloaded=#1^^A{\endgroup}} - -\input bplain - -% restore the \font command and undefine other stuff -\catcode`\@=11 -\let\font=\s@vef@nt -\let\d@ntpreload=\und@fined -\let\sk@pf@nt=\und@fined -\let\s@vef@nt=\und@fined -\catcode`\@=12 - -\input eplain - -\XeTeXuseglyphmetrics=1 - -\dump -\endinput diff --git a/Master/texmf-dist/tex/eplain/eplain.aux b/Master/texmf-dist/tex/eplain/eplain.aux new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/Master/texmf-dist/tex/eplain/eplain.aux diff --git a/Master/texmf-dist/tex/eplain/config/eplain.ini b/Master/texmf-dist/tex/eplain/eplain.ini index 0df42edf053..0df42edf053 100644 --- a/Master/texmf-dist/tex/eplain/config/eplain.ini +++ b/Master/texmf-dist/tex/eplain/eplain.ini diff --git a/Master/texmf-dist/tex/eplain/base/eplain.tex b/Master/texmf-dist/tex/eplain/eplain.tex index 7ee9282e9b9..ae0685ca781 100644 --- a/Master/texmf-dist/tex/eplain/base/eplain.tex +++ b/Master/texmf-dist/tex/eplain/eplain.tex @@ -1,10 +1,10 @@ %% @texfile{ %% author = "Karl Berry, Steven Smith, Oleg Katsitadze, and others", -%% version = "3.0", -%% date = "Tue Sep 20 20:33:53 EEST 2005", +%% version = "3.1", +%% date = "Sun Dec 3 14:39:31 EET 2006", %% filename = "eplain.tex", %% email = "bug-eplain@tug.org", -%% checksum = "3670 8000 118413", +%% checksum = "4001 8638 128661", %% codetable = "ASCII", %% supported = "yes", %% docstring = "This file defines macros that extend and expand on @@ -137,6 +137,9 @@ \def\@emptymarkA{\@emptymarkB} \def\ifempty#1{\@@ifempty #1\@emptymarkA\@emptymarkB}% \def\@@ifempty#1#2\@emptymarkB{\ifx #1\@emptymarkA}% +\def\@gobbleminus#1{\ifx-#1\else#1\fi}% +\def\ifinteger#1{\ifcat_\ifnum9<1\@gobbleminus#1 _\else A\fi}% +\def\isinteger{TT\fi\ifinteger}% \def\@gobblemeaning#1:->{}% \def\sanitize{\expandafter\@gobblemeaning\meaning}% \def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax}% @@ -598,6 +601,44 @@ \fi \printcitepreitem{#1}% }% +\def\@Nnil{\@Nil}% +\def\@Fornoop#1\@@#2#3{}% +\def\For#1:=#2\do#3{% + \edef\@Fortmp{#2}% + \ifx\@Fortmp\empty \else + \expandafter\@Forloop#2,\@Nil,\@Nil\@@#1{#3}% + \fi +}% +\def\@Forloop#1,#2,#3\@@#4#5{\@Fordef#1\@@#4\ifx #4\@Nnil \else + #5\@Fordef#2\@@#4\ifx #4\@Nnil \else#5\@iForloop #3\@@#4{#5}\fi\fi +}% +\def\@iForloop#1,#2\@@#3#4{\@Fordef#1\@@#3\ifx #3\@Nnil + \let\@Nextwhile=\@Fornoop \else + #4\relax\let\@Nextwhile=\@iForloop\fi\@Nextwhile#2\@@#3{#4}% +}% +\def\@Forspc{ }% +\def\@Fordef{\futurelet\@Fortmp\@@Fordef}% Peep at the next token. +\def\@@Fordef{% + \expandafter\ifx\@Forspc\@Fortmp % Next token is a space. + \expandafter\@Fortrim + \else + \expandafter\@@@Fordef + \fi +}% +\expandafter\def\expandafter\@Fortrim\@Forspc#1\@@{\@Fordef#1\@@}% +\def\@@@Fordef#1\@@#2{\def#2{#1}}% +\def\tmpfileextension{.tmp}% +\let\tmpfilebasename = \jobname +\ifx\eTeXversion\undefined + \innernewwrite\eplain@tmpfile + \def\scantokens#1{% + \toks@={#1}% + \immediate\openout\eplain@tmpfile=\tmpfilebasename\tmpfileextension + \immediate\write\eplain@tmpfile{\the\toks@}% + \immediate\closeout\eplain@tmpfile + \input \tmpfilebasename\tmpfileextension\relax + }% +\fi \begingroup \makeactive\^^M \makeactive\ % No spaces or ^^M's from here on. \gdef\obeywhitespace{% @@ -622,11 +663,11 @@ \ifhmode \setbox0 = \lastbox \ifdim\wd0=\parindent - \setbox2 = \hbox{\unhbox0}% + \setbox2 = \hbox{\unhcopy0}% Preserve \box0 so we can put it back. \ifdim\wd2=0pt \ignorespaces \else - \box2 % Put it back: it wasn't empty. + \box0 % Put it back: it wasn't empty. \fi \else \box0 % Put it back: it wasn't the right width. @@ -1683,6 +1724,15 @@ \everypar = {\advance\lineno by 1 \printlistinglineno}% }% \def\printlistinglineno{\llap{[\the\lineno]\quad}}% +\def\nolastlinelisting{\aftergroup\@removeboxes}% +\def\@removeboxes{% + \setbox0 = \lastbox + \ifvoid0 + \ignorespaces % Ignore spaces after the \obeywhitespace's group. + \else + \expandafter\@removeboxes + \fi +}% {% \makeactive\^^L \let^^L = \relax @@ -1732,6 +1782,7 @@ \ece\def{open#1file}{\opencontentsfile{#1}}% \ece\def{write#1entry}{\writecontentsentry{#1}}% \ece\def{writenumbered#1entry}{\writenumberedcontentsentry{#1}}% + \ece\def{writenumbered#1line}{\writenumberedcontentsline{#1}}% \ece\innernewif{ifrewrite#1file} \csname rewrite#1filetrue\endcsname \ece\def{read#1file}{\readcontentsfile{#1}}% }% @@ -1745,16 +1796,15 @@ \def\writecontentsentry#1#2#3{\writenumberedcontentsentry{#1}{#2}{#3}{}}% \def\writenumberedcontentsentry#1#2#3#4{% \csname ifrewrite#1file\endcsname - \csname open#1file\endcsname - \toks0 = {\expandafter\noexpand \csname #1#2entry\endcsname}% - \def\temp{#3}% + \writenumberedcontents@cmdname{#1}{#2}% + \def\temp{#3}% the text \toks2 = \expandafter{#4}% \edef\cs{\the\toks2}% \edef\@wr{% \write\csname #1file\endcsname{% \the\toks0 % the \toc...entry control sequence {\sanitize\temp}% the text - \ifx\empty\cs\else {\sanitize\cs}\fi % A secondary number, or nothing: + \ifx\empty\cs\else {\sanitize\cs}\fi % a secondary number, or nothing {\noexpand\folio}% the page number }% }% @@ -1762,6 +1812,35 @@ \fi \ignorespaces }% +\def\writenumberedcontentsline#1#2#3#4{% + \csname ifrewrite#1file\endcsname + \writenumberedcontents@cmdname{#1}{#2}% + \def\temp{#4}% the text + \toks2 = \expandafter{#3}% + \edef\cs{\the\toks2}% + \edef\@wr{% + \write\csname #1file\endcsname{% + \the\toks0 % the \toc...entry control sequence + \ifx\empty\cs\else {\sanitize\cs}\fi % a secondary number, or nothing + {\sanitize\temp}% the text + {\noexpand\folio}% the page number + }% + }% + \@wr + \fi + \ignorespaces +}% +\def\writenumberedcontents@cmdname#1#2{% + \csname open#1file\endcsname + \edef\temp{#2}% Expand PART fully and see if this produced an integer. + \expandafter\if\expandafter\isinteger\expandafter{\temp}% + \toks0 = {\expandafter\noexpand \csname #1entry\endcsname}% + \edef\temp{\the\toks0{\temp}}% + \toks0 = \expandafter{\temp}% + \else + \toks0 = {\expandafter\noexpand \csname #1#2entry\endcsname}% + \fi +}% \def\readcontentsfile#1{% \edef\temp{% \noexpand\testfileexistence[\csname #1filebasename\endcsname]{#1}% @@ -1773,6 +1852,7 @@ \def\tocchapterentry#1#2{\line{\bf #1 \dotfill\ #2}}% \def\tocsectionentry#1#2{\line{\quad\sl #1 \dotfill\ \rm #2}}% \def\tocsubsectionentry#1#2{\line{\qquad\rm #1 \dotfill\ #2}}% +\def\tocentry#1#2#3{\line{\rm\hskip#1em #2 \dotfill\ #3}}% \let\ifxrefwarning = \iftrue \def\xrefwarningtrue{\@citewarningtrue \let\ifxrefwarning = \iftrue}% \def\xrefwarningfalse{\@citewarningfalse \let\ifxrefwarning = \iffalse}% @@ -1788,6 +1868,7 @@ \definexref{#1}{\noexpand\folio}{page}% \endgroup \endgroup + \ignorespaces }% \def\definexref#1#2#3{% \hldest@impl{definexref}{#1}% @@ -1797,10 +1878,25 @@ \@wr \ignorespaces }% -\def\@definelabel#1#2#3{% +\def\@definelabel#1{% #2 and #3 will be read later. + \expandafter\ifx\csname\xrlabel{#1}\endcsname \relax + \let\next\@definelabel@nocheck + \else + \let\next\@definelabel@warn + \fi + \next{#1}% +}% +\def\@definelabel@nocheck#1#2#3{% \expandafter\gdef\csname\xrlabel{#1}\endcsname{#2}% \setpropertyglobal{\xrlabel{#1}}{class}{#3}% }% +\def\@definelabel@warn#1#2#3{% + \message{^^J\linenumber Label `#1' multiply defined, + value `#2' of class `#3' overwriting value + `\csname\xrlabel{#1}\endcsname' of class + `\getproperty{\xrlabel{#1}}{class}'.}% + \@definelabel@nocheck{#1}{#2}{#3}% +}% \def\reftie{\penalty\@M \ }% Do not rely on `~' being defined as a tie. \let\refspace\ \def\xrefn{\@getoptionalarg\@finxrefn}% @@ -1858,14 +1954,14 @@ \let\@generalrefoptarg\@optionalarg \readauxfile \ifcase#1 \else \hlstart@impl{ref}{#3}\fi - \edef\temp{\getproperty{\xrlabel{#3}}{class}}% - \expandafter\ifx\csname \temp word\endcsname\relax + \edef\@generalref@class{\getproperty{\xrlabel{#3}}{class}}% + \expandafter\ifx\csname \@generalref@class word\endcsname\relax \ifx\@generalrefoptarg\empty \else {\@@hloff\@generalrefoptarg\reftie}\fi \else \begingroup \@@hloff \ifx\@generalrefoptarg\empty \else \@generalrefoptarg \refspace \fi - \csname \temp word\endcsname + \csname \@generalref@class word\endcsname #2\reftie \endgroup \fi @@ -1909,14 +2005,19 @@ \temp \endgroup }% +\newcount\phantomeqnumber +\def\phantomeqlabel{PHEQ\the\phantomeqnumber}% \def\@eqdefn#1#2{% - \hl@define@eqlabel{#1}% + \ifempty{#1}% + \global\advance\phantomeqnumber by 1 + \edef\hl@eqlabel{\phantomeqlabel}% + \readauxfile + \else + \def\hl@eqlabel{#1}% + {\@@hldestoff \definexref{#1}{#2}{eq}}% + \fi \hldest@impl{eq}{\hl@eqlabel}% - \begingroup - \@@hldestoff - \definexref{#1}{#2}{eq}% - \endgroup - \@definelabel{#1}{#2}{eq}% + \@definelabel@nocheck{#1}{#2}{eq}% }% \def\eqdef{\@getoptionalarg\@fineqdef}% \def\@fineqdef{% @@ -1926,15 +2027,10 @@ }% \def\eqsubdef{\@eqdef\eqsubdefn}% \def\@eqdef#1#2{% - \begingroup - \@@hldestoff - #1{#2}% - \endgroup \@maybedisableeqno - \eqno % \hl@define@eqlabel already called in \@eqdefn. - \hldest@impl{eq}{\hl@eqlabel}% + \eqno #1{#2}% Define the label and hyperlink destination. \let\@optionalarg\empty % \@fineqref will examine \@optionalarg. - {\@@hloff\@fineqref{#2}}% No hyperlink here. + {\@@hloff\@fineqref{#2}}% Print the text without a hyperlink. \@mayberestoreeqno \ignorespaces }% @@ -1954,7 +2050,7 @@ \def\@fineqrefn#1{% \eqref@start{#1}% \plain@xrefn{#1}% - \hlend + \hlend@impl{eq}% }% \def\eqref{\@getoptionalarg\@fineqref}% \def\@fineqref#1{% @@ -2036,7 +2132,7 @@ \def\indexproofterm#1{\hbox{\strut \indexprooffont #1}}% \let\@plainmakeheadline = \makeheadline \def\makeheadline{% - \expandafter\ifx\csname\xrlabel{\idxpagexref{\folio}}\endcsname\relax \else + \expandafter\ifx\csname\idxpageanchor{\folio}\endcsname\relax \else {\@@hldeston \hldest@impl{idx}{\hlidxpagelabel{\folio}}}% \fi \indexproofunbox @@ -2074,11 +2170,15 @@ \def\@idxgetrange#1{% \let\@idxrangestr = \empty \let\@afteridxgetrange = #1% - \@getoptionalarg\@finidxgetopt + \begingroup + \catcode\idxargopen=1 + \@getoptionalarg\@finidxgetopt }% \def\@finidxgetopt{% + \global\let\@idxgetrange@arg\@optionalarg + \endgroup \@hlidxencaptrue - \for\@idxarg:=\@optionalarg\do{% + \for\@idxarg:=\@idxgetrange@arg\do{% \expandafter\@idxcheckpagemarkup\@idxarg=,% \ifx\@idxarg\idxrangebeginword \def\@idxrangestr{\idxencapoperator\idxbeginrangemark}% @@ -2112,7 +2212,7 @@ \fi \ifcase\hldest@place@idx \relax \edef\@idxpagemarkup{hlidxpage{\@idxpagemarkup}}% - {\@@hldestoff \definexref{\idxpagexref{\folio}}{}{}}% + \definepageanchor{\noexpand\folio}% \else \global\advance\hlidxlabelnumber by 1 \edef\@idxpagemarkup{hlidx{\hlidxlabel}{\@idxpagemarkup}}% @@ -2134,18 +2234,39 @@ \fi }% \def\hldest@place@idx{-1}% -\def\idxpagexref#1{@@IDXPG@@#1}% +\begingroup + \catcode`\_ = 8 + \gdef\idxpageanchor#1{#1_p}% +\endgroup +\def\definepageanchor#1{% + \readauxfile + \edef\@wr{\noexpand\writeaux{\string\@definepageanchor{#1}}}% + \@wr + \ignorespaces +}% +\def\@definepageanchor#1{% + \expandafter\gdef\csname\idxpageanchor{#1}\endcsname{}% +}% \newcount\hlidxlabelnumber \def\hlidxlabel{IDX\the\hlidxlabelnumber}% \def\hlidxpagelabel#1{IDXPG#1}% \def\hlidx#1#2#3{% + \ifempty{#2}% + \let\@idxpageencap\relax + \else + \expandafter\let\expandafter\@idxpageencap\csname #2\endcsname + \fi \hlstart@impl{idx}{#1}% - \csname #2\endcsname{#3}% + \@idxpageencap{#3}% \hlend@impl{idx}% }% \def\hlidxpage#1#2{% \@hlidxgetpages{#2}% - \expandafter\let\expandafter\@idxpageencap\csname #1\endcsname + \ifempty{#1}% + \let\@idxpageencap\relax + \else + \expandafter\let\expandafter\@idxpageencap\csname #1\endcsname + \fi \hlstart@impl{idx}{\hlidxpagelabel{\@idxpageiref}}% \expandafter\@idxpageencap\expandafter{\@idxpagei}% \hlend@impl{idx}% @@ -2217,7 +2338,8 @@ }% \if@idxsee \@idxseefalse % Reset so the next term won't be a `see'. - \edef\temp{\noexpand\@finidxtokscollect{\idxmaxpagenum}}% + \edef\temp{\noexpand\idx@getverbatimarg + {\noexpand\@finidxtokscollect{\idxmaxpagenum}}}% \else \def\temp{\@finfinidxtokscollect\folio}% \fi @@ -2249,12 +2371,61 @@ \@idxsubtoks = {#2}% \@idxtokscollect }% -\def\@idx#1{% - #1% Produce TERM as output. +\def\idxargopen{`\{}% +\def\idxargclose{`\}}% +\def\idx@getverbatimarg#1{% + \def\idx@getverbatimarg@cmd{#1}% Save the command, allowing it to be + \begingroup + \uncatcodespecials + \catcode\idxargopen=1 + \catcode\idxargclose=2 + \catcode`\ =10 % Swallow multiple consequent spaces. + \catcode`\^^I=10 % Just in case, to avoid dependence on + \catcode`\^^M=5 % current meanings of tabs and newlines. + \idx@fingetverbatimarg +}% +\def\idx@fingetverbatimarg#1{\endgroup\idx@getverbatimarg@cmd{#1}}% +\def\idx@getverboptarg#1{% + \def\idx@optionaltemp{#1}% Save the command, allowing it to be more + \let\idx@optionalnext = \relax + \begingroup + \if@idxsee \catcode\idxargopen=1 \fi + \@futurenonspacelet\idx@optionalnext\idx@bracketcheck +}% +\def\idx@bracketcheck{% + \ifx [\idx@optionalnext + \endgroup % Cancel \catcode\idxargopen=1. + \expandafter\idx@finbracketcheck + \else + \endgroup % Cancel \catcode\idxargopen=1. + \let\@optionalarg = \empty + \expandafter\idx@optionaltemp + \fi +}% +\def\idx@finbracketcheck{% + \begingroup + \uncatcodespecials + \catcode`\ =10 % Swallow multiple consequent spaces. + \catcode`\^^I=10 % Just in case, to avoid dependence on + \catcode`\^^M=5 % current meanings of tabs and newlines. + \idx@@getoptionalarg +}% +\def\idx@@getoptionalarg[#1]{% + \endgroup + \def\@optionalarg{#1}% + \idx@optionaltemp +}% +{\catcode`\&=0 +\gdef\idx@scanterm#1{\scantokens{#1&endinput}}% +}% +\def\@idx{\idx@getverbatimarg\@finidx}% +\def\@finidx#1{% + \idx@scanterm{#1}% Produce TERM as output. \@idxcollect{#1}{}% }% -\def\@sidx#1{\@idxmaintoks = {#1}\@getoptionalarg\@finsidx}% -\def\@finsidx{% +\def\@sidx{\idx@getverbatimarg\@finsidx}% +\def\@finsidx#1{\@idxmaintoks = {#1}\idx@getverboptarg\@finfinsidx}% +\def\@finfinsidx{% \@idxsubtoks = \expandafter{\@optionalarg}% \@idxtokscollect }% @@ -2265,24 +2436,34 @@ \edef\temp{\the\toks2 \idxsortkeysep \the\toks@{\the\toks2}}% #1 = \expandafter{\temp}% }% -\def\@idxmarked#1#2{% - #1{#2}% Produce \CS{TERM} as output. +\def\@idxmarked#1{\idx@getverbatimarg{\@finidxmarked{#1}}}% +\def\@finidxmarked#1#2{% + \idx@scanterm{#1{#2}}% Produce \CS{TERM} as output. \@idxconstructmarked\@idxmaintoks{#1}{#2}% \@idxsubtoks = {}% \@idxtokscollect }% -\def\@sidxmarked#1#2{% +\def\@sidxmarked#1{\idx@getverbatimarg{\@finsidxmarked{#1}}}% +\def\@finsidxmarked#1#2{% \@idxconstructmarked\toks@{#1}{#2}% \edef\temp{{\the\toks@}}% - \expandafter\@sidx\temp -}% -\def\@idxsubmarked#1#2#3{% - #1 #2{#3}% produce `TERM \CS{SUBTERM} as output. - \@sidxsubmarked{#1}{#2}{#3}% -}% -\def\@sidxsubmarked#1#2#3{% - \@idxmaintoks = {#1}% - \@idxconstructmarked\@idxsubtoks{#2}{#3}% + \expandafter\@finsidx\temp +}% +\def\@idxsubmarked{% + \let\sidxsubmarked@print\idxsubmarked@print + \idx@getverbatimarg\@finsidxsubmarked +}% +\def\idxsubmarked@print{\expandafter\idx@scanterm\expandafter}% +\def\@sidxsubmarked{% + \let\sidxsubmarked@print\gobble + \idx@getverbatimarg\@finsidxsubmarked +}% +\def\@finsidxsubmarked#1{\@idxmaintoks = {#1}\@@finsidxsubmarked}% Reads TERM. +\def\@@finsidxsubmarked#1{\idx@getverbatimarg{\@@@finsidxsubmarked{#1}}}% Reads \CS. +\def\@@@finsidxsubmarked#1#2{% Reads {\CS}{SUBTERM}. + \sidxsubmarked@print % Prints for \@idxsubmarked, gobbles for \@sidxsubmarked. + {\the\@idxmaintoks\space #1{#2}}% Maybe produce `TERM \CS{SUBTERM}' as output. + \@idxconstructmarked\@idxsubtoks{#1}{#2}% \@idxtokscollect }% \def\idxnameseparator{, }% as in `Tachikawa, Elizabeth' @@ -2296,14 +2477,18 @@ \toks2 = {#2}% \edef\temp{\the\toks2 \the\toks@}% }% -\def\@idxname#1#2{% - #1 #2% Separate the names by a space in the output. +\def\@idxname{\idx@getverbatimarg\@finidxname}% +\def\@finidxname#1{\idx@getverbatimarg{\@finfinidxname{#1}}}% +\def\@finfinidxname#1#2{% + \idx@scanterm{#1 #2}% Separate the names by a space in the output. \@idxcollectname{#1}{#2}% \expandafter\@idxcollect\expandafter{\temp}{}% }% -\def\@sidxname#1#2{% +\def\@sidxname{\idx@getverbatimarg\@finsidxname}% +\def\@finsidxname#1{\idx@getverbatimarg{\@finfinsidxname{#1}}}% +\def\@finfinsidxname#1#2{% \@idxcollectname{#1}{#2}% - \expandafter\@sidx\expandafter{\temp}% + \expandafter\@finsidx\expandafter{\temp}% }% \let\indexfonts = \relax \def\readindexfile#1{% @@ -2358,9 +2543,11 @@ }% \def\seevariant{\it}% \def\indexseeword{see}% -\def\indexsee#1#2{{\seevariant \indexseeword\/ }#1}% +\def\indexsee{\idx@getverbatimarg\@finindexsee}% +\def\@finindexsee#1#2{{\seevariant \indexseeword\/ }\idx@scanterm{#1}}% \def\indexseealsowords{see also}% -\def\indexseealso#1#2{{\seevariant \indexseealsowords\/ }#1}% +\def\indexseealso{\idx@getverbatimarg\@finindexseealso}% +\def\@finindexseealso#1#2{{\seevariant \indexseealsowords\/ }\idx@scanterm{#1}}% \defineindex{i}% \begingroup \catcode `\^^M = \active % @@ -2784,27 +2971,34 @@ \fi \hl@driver }% -\def\hl@getparam#1#2#3{% +\def\hl@getparam#1#2{% We'll read #3 (LABEL) later. \edef\@hltype{#1}% \ifx\@hltype\empty \expandafter\let\expandafter\@hltype \csname \hl@prefix @type\endcsname \fi \expandafter\ifx\csname \hl@prefix @typeh@\@hltype\endcsname \relax - \errmessage{Invalid type `\@hltype'}% + \errmessage{Invalid hyperlink type `\@hltype'}% \fi - \for\hl@arg:=#2\do{% + \For\hl@arg:=#2\do{% \ifx\hl@arg\empty \else \expandafter\hl@set@opt\hl@arg=,% \fi }% - \edef\@hllabel{#3}% + \bgroup + \uncatcodespecials + \catcode`\{=1 \catcode`\}=2 + \@hl@getparam +}% +\def\@hl@getparam#1{% + \egroup + \edef\@hllabel{#1}% \after@hl@getparam \ignorespaces }% \def\hl@set@opt#1=#2,{% \expandafter\ifx\csname \hl@prefix @opt@#1\endcsname \relax - \errmessage{Invalid option `#1'}% + \errmessage{Invalid hyperlink option `#1'}% \fi \if ,#2, % if #2 is empty, complain. \errmessage{Missing value for option `#1'}% @@ -2843,7 +3037,7 @@ \def\hl@opts@word{opts}% \newif\if@params@override \def\hldest@groups{definexref,xrdef,li,eq,bib,foot,footback,idx}% -\def\hl@groups{ref,xref,eq,cite,foot,footback,idx,url}% +\def\hl@groups{ref,xref,eq,cite,foot,footback,idx,url,hrefint,hrefext}% \def\hldesttype{% \def\hl@prefix{hldest}% \def\hl@param{type}% @@ -2881,12 +3075,12 @@ \def\hl@param@read@opt@arg#1{% #1 is the `!', ignore it. \@getoptionalarg\hl@setparam }% -\def\hl@setparam#1{% +\def\@hl@setparam#1{% \ifx\@optionalarg\empty \hl@setparam@default{#1}% Set default. \else \let\hl@do@all@groups\gobble - \for\hl@group:=\@optionalarg\do{% + \For\hl@group:=\@optionalarg\do{% \ifx\hl@group\hl@asterisk@word \def\hl@do@all@groups{\let\@optionalarg\hl@all@groups \hl@setparam}% \else @@ -2901,15 +3095,13 @@ \hl@setparam@default{#1}% \else \expandafter\ifx\csname\hl@prefix @\hl@param @\hl@group\endcsname\relax - \errmessage{Hyperlink group parameter `\hl@prefix:\hl@param:\hl@group' is not defined}% + \errmessage{Hyperlink group `\hl@prefix:\hl@param:\hl@group' is not defined}% \fi \ifx\hl@param\hl@opts@word \if@params@override - \toks@=\expandafter{#1}% - \ece\edef{\hl@prefix @\hl@param @\hl@group}{\the\toks@}% - \else - \hl@update@opts@with@list{#1}% #1 will be used in the \for + \expandafter\let\csname\hl@prefix @\hl@param @\hl@group\endcsname\empty \fi + \hl@update@opts@with@list{#1}% #1 will be used in the \for \else \ece\def{\hl@prefix @\hl@param @\hl@group}{#1}% \fi @@ -2917,14 +3109,14 @@ }% \def\hl@setparam@default#1{% \ifx\hl@param\hl@opts@word - \for\hl@opt:=#1\do{% + \For\hl@opt:=#1\do{% \ifx\hl@opt\empty \else \expandafter\hl@set@opt\hl@opt=,% \fi }% \else \expandafter\ifx\csname\hl@prefix @\hl@param\endcsname\relax - \message{Default parameter `\hl@prefix:\hl@param' is not defined}% + \message{Default hyperlink parameter `\hl@prefix:\hl@param' is not defined}% \fi \ece\def{\hl@prefix @\hl@param}{#1}% \fi @@ -2933,7 +3125,7 @@ \global\expandafter\let\expandafter\hl@update@new@list \csname \hl@prefix @opts@\hl@group\endcsname \begingroup - \for\hl@opt:=#1\do{% + \For\hl@opt:=#1\do{% \hl@update@opts@with@opt }% \endgroup @@ -3008,6 +3200,8 @@ \def\hl@on@footback{0}% back-reference for \footnote / \numberedfootnote \def\hl@on@idx{0}% \def\hl@on@url{0}% \url from url.sty +\def\hl@on@hrefint{0}% \href with internal #labels +\def\hl@on@hrefext{0}% \href with external labels (URLs) \let\hl@type@ref\empty % \refn and \xrefn, \ref, \refs \let\hl@type@xref\empty \let\hl@type@eq\empty % \eqref and \eqrefn @@ -3016,6 +3210,8 @@ \let\hl@type@footback\empty % back-reference for \footnote / \numberedfootnote \let\hl@type@idx\empty \let\hl@type@url\empty % \url from url.sty (this will be set to `url' by +\let\hl@type@hrefint\empty % \href with internal #labels +\let\hl@type@hrefext\empty % \href with external labels (URLs) (this \let\hl@opts@ref\empty % \refn and \xrefn, \ref, \refs \let\hl@opts@xref\empty \let\hl@opts@eq\empty % \eqref and \eqrefn @@ -3024,6 +3220,8 @@ \let\hl@opts@footback\empty % back-reference for \footnote / \numberedfootnote \let\hl@opts@idx\empty \let\hl@opts@url\empty % \url from url.sty +\let\hl@opts@hrefint\empty % \href with internal #labels +\let\hl@opts@hrefext\empty % \href with external labels (URLs) \def\@hlon{\@hlonoff@value@stub{hl}\@@hlon1 }% \def\@hloff{\@hlonoff@value@stub{hl}\@@hloff0 }% \def\@hldeston{\@hlonoff@value@stub{hldest}\@@hldeston1 }% @@ -3041,7 +3239,7 @@ \hl@on@empty \fi \let\hl@do@all@groups\relax - \for\hl@group:=\@optionalarg\do{% + \For\hl@group:=\@optionalarg\do{% \ifx\hl@group\hl@asterisk@word \let\@optionalarg\hl@all@groups \let\hl@do@all@groups\@finhlswitch @@ -3076,6 +3274,7 @@ \def\hl@idxexact@word{idxexact}% \def\hl@idxpage@word{idxpage}% \def\hl@idxnone@word{idxnone}% +\def\hl@raw@word{raw}% \def\enablehyperlinks{\@getoptionalarg\@finenablehyperlinks}% \def\@finenablehyperlinks{% \let\hl@selecteddriver\empty @@ -3098,36 +3297,39 @@ \ifx\hl@selecteddriver\empty \ifpdf \def\hl@selecteddriver{pdftex}% - \message{^^JUsing `pdftex' hyperlink driver.}% + \message{^^JEplain: using `pdftex' hyperlink driver.}% \else - \def\hl@selecteddriver{dvipdfm}% - \message{^^JUsing `dvipdfm' hyperlink driver.}% + \def\hl@selecteddriver{hypertex}% + \message{^^JEplain: using `hypertex' hyperlink driver.}% \fi \else \expandafter\ifx\csname hldriver@\hl@selecteddriver\endcsname \relax \errmessage{No hyperlink driver `\hl@selecteddriver' available}% \fi \fi + \let\hl@setparam\@hl@setparam \csname hldriver@\hl@selecteddriver\endcsname \def\@finenablehyperlinks{\errmessage{Hyperlink driver `\hl@selecteddriver' already selected}}% \let\hldriver@nolinks\undefined + \let\hldriver@hypertex\undefined \let\hldriver@pdftex \undefined \let\hldriver@dvipdfm\undefined \let\hloff\@hloff \let\hlon\@hlon \let\hldestoff\@hldestoff \let\hldeston\@hldeston - \hlon[*,]% - \hldeston[*,]% + \hlon[*,]\hloff[foot,footback]% + \hldeston[*,]\hldestoff[foot,footback]% }% \def\hldriver@nolinks{% \def\@hldest##1##2##3{% + \edef\temp{\write-1{hldest: ##3}}% \ifvmode - \write-1{\string\hldest: ##3}% + \temp \else \allowhyphens - \smash{\write-1{\string\hldest: ##3}}% + \expandafter\smash\expandafter{\temp}% \allowhyphens \fi \ignorespaces @@ -3135,14 +3337,70 @@ \def\@hlstart##1##2##3{% \leavevmode \begingroup % Start the color group. - \write-1{\string\hlstart: ##3}% + \edef\temp{\write-1{hlstart: ##3}}% + \temp \ignorespaces }% - \def\@hlend{\write-1{\string\hlend}\endgroup}% End the group from \@hlstart. + \def\@hlend{% + \edef\temp{\write-1{hlend}}% + \temp + \endgroup % End the color group from \@hlstart. + }% + \let\hl@setparam\gobble +}% +{\catcode`\#=\other +\gdef\hlhash{#}}% +\def\hldriver@hypertex{% + \def\hldest@type{xyz}% + \let\hldest@opt@cmd \empty + \def\hldest@driver{% + \ifx\@hltype\hl@raw@word + \csname \hldest@opt@cmd \endcsname + \else + \special{html:<a name="\@hllabel">}\special{html:</a>}% + \fi + }% + \let\hldest@typeh@raw \empty + \let\hldest@typeh@xyz \empty + \def\hl@type{name}% + \ifx\hl@type@url\empty + \def\hl@type@url{url}% + \fi + \ifx\hl@type@hrefext\empty + \def\hl@type@hrefext{url}% + \fi + \let\hl@opt@cmd \empty + \let\hl@opt@ext \empty + \let\hl@opt@file \empty + \def\hl@driver{% + \ifx\@hltype\hl@raw@word + \csname \hl@opt@cmd \endcsname + \else + \def\hlstart@preamble{html:<a href="}% + \csname hl@typeh@\@hltype\endcsname + \fi + }% + \let\hl@typeh@raw \empty + \def\hl@typeh@name{\special{\hlstart@preamble \hlhash\@hllabel">}}% + \def\hl@typeh@filename{% + \special{% + \hlstart@preamble + file:\hl@opt@file\hl@opt@ext + \ifempty\@hllabel \else \hlhash\@hllabel\fi + ">% + }% + }% + \def\hl@typeh@url{% + \special{% + \hlstart@preamble + \@hllabel + ">% + }% + }% + \def\@hlend{\special{html:</a>}\endgroup}% End the group from \@hlstart. }% \def\hldriver@pdftex{% \ifpdf % PDF output is enabled. - \def\hl@raw@word{raw}% \def\hldest@type{xyz}% \let\hldest@opt@width \empty \let\hldest@opt@height \empty @@ -3176,6 +3434,9 @@ \ifx\hl@type@url\empty \def\hl@type@url{url}% \fi + \ifx\hl@type@hrefext\empty + \def\hl@type@hrefext{url}% + \fi \let\hl@opt@width \empty \let\hl@opt@height \empty \let\hl@opt@depth \empty @@ -3263,7 +3524,7 @@ user{% /Subtype/Link% /A<<% - /Type/Action + /Type/Action% /S/URI% /URI(\@hllabel)% >>% @@ -3271,13 +3532,12 @@ }% \def\@hlend{\pdfendlink\endgroup}% End the group from the \@hlstart. \else % PDF output is not enabled. - \message{Warning: `pdftex' hyperlink driver: PDF output is - not enabled, falling back on `nolinks' driver.}% + \message{Eplain warning: `pdftex' hyperlink driver: PDF output is^^J + \space not enabled, falling back on `nolinks' driver.}% \hldriver@nolinks \fi }% \def\hldriver@dvipdfm{% - \def\hl@raw@word{raw}% \def\hldest@type{xyz}% \let\hldest@opt@left \empty \let\hldest@opt@top \empty @@ -3345,6 +3605,9 @@ \ifx\hl@type@url\empty \def\hl@type@url{url}% \fi + \ifx\hl@type@hrefext\empty + \def\hl@type@hrefext{url}% + \fi \def\hl@opt@bstyle {S}% \def\hl@opt@bwidth {1}% \let\hl@opt@bcolor \empty @@ -3424,7 +3687,7 @@ \special{% \hlstart@preamble /A<<% - /Type/Action + /Type/Action% /S/URI% /URI(\@hllabel)% >>% @@ -3433,20 +3696,51 @@ }% \def\@hlend{\special{pdf: endann}\endgroup}% End the group from \@hlstart. }% -\newcount\phantomeqnumber -\def\phantomeqlabel{PHEQ\the\phantomeqnumber}% -\def\hl@define@eqlabel#1{% - \ifempty{#1}% - \global\advance\phantomeqnumber by1 - \xdef\hl@eqlabel{\phantomeqlabel}% +\def\href{% + \bgroup + \uncatcodespecials + \catcode`\{=1 \catcode`\}=2 + \@href +}% +\def\@href#1{% We'll read #2 (TEXT) later. + \egroup + \edef\@hreftmp{\ifempty{#1}{}\fi}% Parameter stuffing for \@@href. + \expandafter\@@href\@hreftmp#1\@@ +}% +\def\href@end@int{\hlend@impl{hrefint}}% +\def\href@end@ext{\hlend@impl{hrefext}}% +\def\@@href#1#2\@@{% + \def\@hreftmp{#1}% + \ifx\@hreftmp\hlhash + \let\href@end\href@end@int + \hlstart@impl{hrefint}{#2}% \else - \gdef\hl@eqlabel{#1}% + \let\href@end\href@end@ext + \hlstart@impl{hrefext}{#1#2}% \fi + \@@@href +}% +\def\@@@href{% + \futurelet\@hreftmp\href@ }% -\let\hldeston\relax \let\hldestoff\relax -\let\hlon\relax \let\hloff\relax -\@@hloff -\@@hldestoff +\def\href@{% + \ifcat\bgroup\noexpand\@hreftmp + \let\@hreftmp\href@@ + \else + \let\@hreftmp\href@@@ + \fi + \@hreftmp +}% +\def\href@@{\bgroup\aftergroup\href@end \let\@hreftmp}% +\def\href@@@#1{#1\href@end}% +\def\hldeston{\errmessage{Please enable hyperlinks with + \string\enablehyperlinks\space before using hyperlink commands + (consider selecting the `nolinks' driver to ignore all hyperlink + commands in your document)}}% +\let\hldestoff\hldeston \let\hlon\hldeston \let\hloff\hldeston +\let\hlstart\hldeston \let\hlend\hldeston \let\hldest\hldeston +\let\hl@setparam\hldeston +\@hloff[*]\@hldestoff[*]% \newif\ifusepkg@miniltx@loaded \newcount\usepkg@recursion@level \def\usepkg@rcrs{\the\usepkg@recursion@level}% @@ -3456,10 +3750,13 @@ \def\usepkg@word@psfrag{psfrag}% \long\def\beginpackages#1\endpackages{% \let\usepackage\real@usepackage + \let\eplaininput=\input #1% \usepkg@at@begin@document \global\let\usepkg@at@begin@document\empty \global\let\usepackage\fake@usepackage + \let\packageinput=\input + \let\input=\eplaininput }% \def\fake@usepackage{\errmessage{You should not use \string\usepackage\space outside of^^J \@spaces\string\beginpackages...\string\endpackages\space environment}% @@ -3539,9 +3836,14 @@ \fi \fi \fi - \ifundefined{ver@\usepkg@pkg.sty}\else - \errmessage{Package `\usepkg@pkg' already loaded}% + \ifundefined{ver@\usepkg@pkg.sty}% + \expandafter\@finusepkg@load@pkg + \else + \message{^^J\linenumber Eplain: package `\usepkg@pkg' already + loaded, skipping reloading}% \fi +}% +\def\@finusepkg@load@pkg{% \testfileexistence[\usepkg@pkg]{sty}% \if@fileexists \else \errmessage{Package `\usepkg@pkg' not found}% @@ -3654,6 +3956,34 @@ \fi }% \def\@parse@version#1/#2/#3#4#5\@nil{#1#2#3#4 }% +\let\ttfamily\tt +\def\strip@prefix#1>{}% +\def\@ifpackageloaded#1{% + \expandafter\ifx\csname ver@#1.sty\endcsname\relax + \expandafter\@secondoftwo + \else + \expandafter\@firstoftwo + \fi +}% +\long\def\g@addto@macro#1#2{% + \begingroup + \toks@\expandafter{#1#2}% + \xdef#1{\the\toks@}% + \endgroup +}% +\def\PackageWarning#1#2{% + \begingroup + \newlinechar=10 % + \def\MessageBreak{% + ^^J(#1)\@spaces\@spaces\@spaces\@spaces + }% + \immediate\write16{^^JPackage #1 Warning: #2\on@line.^^J}% + \endgroup +}% +\def\PackageWarningNoLine#1#2{% + \PackageWarning{#1}{#2\@gobble}% +}% +\def\on@line{ on input line \the\inputlineno}% \def\@spaces{\space\space\space\space}% \def\@inmatherr#1{% \relax @@ -3661,10 +3991,11 @@ \errmessage{The command is invalid in math mode}% \fi }% +\let\protected@edef\edef \let\wlog = \@plainwlog \catcode`@ = \@eplainoldatcode \def\fmtname{eplain}% \def\eplain{t}% {\edef\plainversion{\fmtversion}% - \xdef\fmtversion{3.0: 20 September 2005 (and plain \plainversion)}% + \xdef\fmtversion{3.1: 3 December 2006 (and plain \plainversion)}% }% |