[tex-eplain] Putting two \definexref together
Rodolfo Medina
rodolfo.medina at gmail.com
Sat Sep 8 11:25:49 CEST 2007
Rodolfo Medina <rodolfo.medina at gmail.com> writes:
> For a particular purpose I'd need to put two `\definexref' items together
> sharing a same argument, although slightly different, in something like this:
>
> \def\mylabel#1#2{\definexref{#1.a}{#2}{}\definexref{#1.b}{#2}{}}
>
> , but over large files it produces a `TeX capacity exceeded, sorry' error
> message. Can anybody suggest a clever and polite way to achive what I want?
Oleg Katsitadze <olegkat at gmail.com> writes:
> Actually, there's no problem with your use of two \definexref's. The
> problem is with the way the .aux file is read by Eplain (and, well, by
> your doubling the number of xrefs :).
>
> You have a save stack overflow here. Eplain (actually, btxmac.tex)
> reads the .aux file inside a group. \@definelabel defines xref labels
> using the \csname...\endcsname construct. And although the definition
> itself is global, when an undefined macro is constructed using
> \csname...\endcsname, it is made equivalent to \relax, locally within
> the group. These local "definitions" intermixed with the global
> definitions cause save stack build-up. This can be reproduced with
> something like the following (adjust the number of interation of the
> loop and compile twice):
>
> [...]
>
> You can do something like the following to cure this, before you call
> the first xref macro (somewhere near the beginning of your document,
> but after \input eplain):
>
> ------------------------------>%------------------------------
> \makeatletter
> \global\@auxfiledonetrue
> \@testfileexistence{aux}%
> \if at fileexists
> \endlinechar = -1
> \input \jobname.aux
> \endlinechar = 13
> \else
> \message{\@undefinedmessage}%
> \global\@citewarningfalse
> \fi
> \immediate\openout\@auxfile = \jobname.aux
> \makeatother
>
> This is basically a rewrite of btxmac.tex's \@readauxfile, without the
> group around `\input \jobname.aux'.
According to my tests the problem seems to be worked out when I simply rename
eplain.tex myeplain.tex and there where it says `\input \jobname.aux' I comment
out the lines `\begingroup' and `\endgroup' and add the command `\endlinechar =
13' just after `\input \jobname.aux'. Please let me know if there's something
wrong in this.
Thanks indeed, cheers
Rodolfo
More information about the tex-eplain
mailing list