[tex-eplain] Indexing and numberedlist

Adam Fenn acwfenn at hotmail.com
Sat Jul 28 16:11:26 CEST 2007


>You probably don't need all the complexity of the indexing macros for
>this, you can write out index entries directly, like this:
>
>------------------------------%<------------------------------
>\input eplain
>
>\newwrite\listidxfile
>\immediate\openout\listidxfile = \jobname.ldx
>
>\def\MyMacro#1#2#3{%
>   \li
>   {#1, }%                      surname
>   {#2: }%                      forename
>   {#3}%                        stuff
>   \begingroup
>     % \li has advanced the numbers, so restore this item's number.
>     \advance\itemnumber by -1
>     \advance\itemletter by -1
>     \advance\itemromannumeral by -1
>     % Pass arguments through a \toks register, to avoid unneeded
>     % expansion during \write.
>     \toks0={#1, #2}%
>     % Write immediately, as opposed to writing during page shipout,
>     % otherwise item numbers and \the\toks0 will be all wrong.
>     \immediate\write\listidxfile{\string\indexentry{\the\toks0}{\marker}}
>   \endgroup
>}

That's great but I cannot typeset the index. I tried \readindexfile{l} but 
that did not work even though the file jobname.ldx exists. What am I doing 
wrong?

Adam.

_________________________________________________________________
Got a favourite clothes shop, bar or restaurant? Share your local knowledge  
http://www.backofmyhand.com



More information about the tex-eplain mailing list