%mm.index file for indexing with plain %cgl@rc.service.rug.nl, April 1995 %Consists of parts from manmac, indexing in blue, and blue.tex %From manmac the writing to index % Indexing macros \catcode`\@=11 \newif\ifproofmode \proofmodetrue % this should be false when % making camera-ready copy \newwrite\inx \immediate\openout\inx=index % file for % index reminders \newif\ifsilent \def\specialhat{\ifmmode\def\next{^}\else \let\next=\beginxref\fi\next} \def\beginxref{\futurelet\next \beginxrefswitch} \def\beginxrefswitch{\ifx\next\specialhat \let\next=\silentxref\else \silentfalse\let\next=\xref\fi \next} \catcode`\^=\active \let ^=\specialhat \def\silentxref^{\silenttrue\xref} \def\marginstyle{\vrule height6pt depth2pt width\z@ \sevenrm} \chardef\bslash=`\\ \def\xref{\futurelet\next\xrefswitch} \def\xrefswitch{\begingroup \ifx\next|\aftergroup\vxref % case 1 or 2, |arg| or |\arg| \else\ifx\next\<\aftergroup\anglexref % case 3, "\" means angle brackets \else\aftergroup\normalxref \fi\fi\endgroup} % case 0, "{arg}" \def\vxref|{\catcode`\\=\active \futurelet\next\vxrefswitch} \def\vxrefswitch#1|{\catcode`\\=0 \ifx\next\empty\def\xreftype{2}% \def\next{{\tt\bslash\text}}%type2 \else\def\xreftype{1}\def\next{% {\tt\text}}\fi %type1 \edef\text{#1}\makexref} {\catcode`\|=0 \catcode`\\=\active |gdef\{}} \def\anglexref\<#1>{\def\xreftype{3}% \def\text{#1}\def\next{\<\text>}\makexref} \def\normalxref#1{\def\xreftype{0}% \def\text{#1}\let\next=\text\makexref} \def\makexref{\ifproofmode\insert\margin {\hbox{\marginstyle\text}}% \xdef\writeit{\write\inx{\text\space!% \xreftype\space\noexpand\number\pageno.% }}\writeit \else\ifhmode\kern0pt\fi\fi \ifsilent\ignorespaces\else\next\fi} \def\pagesofar{\unvbox\partialpage \wd0=\hsize \wd2=\hsize \hbox to \pagewidth{\box0\hfil\box2}} %To handle \<...> \def\<#1>{\leavevmode\hbox{$\langle$#1% \/$\rangle$}} {\catcode`<=13 \global\let<=\< } % \newbox\partialpage \def\balancecolumns{\setbox0=\vbox{\unvbox255} \dimen@=\ht0 \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip \divide\dimen@ by2 \splittopskip=\topskip {\vbadness=10000 \loop \global\setbox3=\copy0 \global\setbox1=\vsplit3 to\dimen@ \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt \repeat} \setbox0=\vbox to\dimen@{\unvbox1} \setbox2=\vbox to\dimen@{\unvbox3} \pagesofar} \catcode`\@=12 %end from manmac % % % %From blue.tex Use is made of tools.dat. \let\ea\expandafter \let\nx\noexpand %From index \newif\ifcontinue%controls loops \newif\iffound%locating accent cs \newif\ifproof\prooftrue \newif\ifcontinue \newtoks\indword \newcount\n \newcount\lc \newcount\r \newcount\ic \newcount\uone \newcount\jc \newcount\jj \newcount\jjone %Counters \newcount\n \newcount\m \newcount\k \newcount\kk\n=0 \newcount\kzero\kzero0 %Bias value \newcount\pk \newcount\pkone%Used in sortcs \newcount\frst%First value of range \newcount\last %Last value of range \newcount\slast%Successor \last \newcount\dif %Difference \last-\frst \newcount\nw %Number of words \newcount\nc %Number of characters/comp \newcount\numex %Number of exchanges \newcount\rndval%Random number \newcount\rndnum%Seed random generator \newcount\rndtmp%Temporary value \newcount\status%Status comparison \newcount\low \newcount\up \newif\ifgoon \newcount\low \newcount\up \newcount\m \newread\inxin \newtoks\indword \newtoks\indexfile \indexfile{index.elm} %To parameterize the resulting index \newtoks\irfile %To parameterize the IRs \newtoks\indexname \newtoks\preindex \newtoks\postindex \newtoks\ignores \newtoks\conseqs \newtoks\consyms \newtoks\srtkeys \newtoks\srtkeypairs %To process FIFO \def\fifo#1{\ifx\ofif#1\ofif\fi \process{#1}\fifo} \def\ofif#1\fifo{\fi} \def\newpage{\vfill\eject} \def\cs#1{{\tt\char92#1}} \def\chapterhead#1{\centerline{\bf Index}\medskip} % %Indextool \def\gobbletool#1\endinput{\egroup} \long\def\tool#1{\ifx#1\undefined \bgroup\unouterdefs \ea\gobbletool\fi} \def\unouterdefs{%List of defs which %have to be neglected \ea\let\csname+\endcsname\relax \catcode`\^12 %more to come } % \newcount\indexloadcnt \def\loadindexmacros{% \ifx\undefined\indextool \let\indextool=x\fi \ifnum\indexloadcnt=0 \ea\loadtool\fi \advance\indexloadcnt1 \let\indextool\undefined} \def\loadtool{\input tools.dat\relax} % \newdimen\pagewidth \newdimen\pagewd \newdimen\pageheight %Test %Next 1-col page size pars, adjust \hsize=16cm\pagewd\hsize \vsize=25cm \loadindexmacros %Now follows copy proper This is a ^{test}. Indexing in ^{plain} as such, i.e. with own macros for layout. %From TUG the definitions \newcount\TestCount \def\La{\TestCount=\the\fam \leavevmode L\raise.42ex\hbox{$\fam\TestCount \scriptstyle\kern-.3em A$}} \def\LaTeX{\La\kern-.15em\TeX}%To typset it, it must be known. Next more advanced reminders: ^{\'el\`eve!}^|verbatim text|^|\controlsequence|^\ ^^\ %for silent ones, double the ^ {\sl^{ligatures}} |'$|^|\,||$''|%from the TeX book script ^^{markup commands, see control sequences} ^{Lamport and \LaTeX} %text and control sequences with sort keys %Next indexing \sortindex\pasteupindex \bye