[tex-eplain] \sidx not catcode-clean

Oleg Katsitadze olegkat at gmail.com
Sun Apr 23 11:58:14 CEST 2006


(I've mailed this to Karl and forgot to CC: tex-eplain. Sorry.)

On Sat, Apr 22, 2006 at 06:24:04PM -0500, Karl Berry wrote:
>       2) leave \?idx* macros alone by default but give the user
>          an option to convert them into `verbatim argument'
>          macros.
>
> Doesn't this also have the hyperlink problem?

It shouldn't, because the only difference will be in the way
the TERM and SUBTERM arguments are read.  If the user wants
a page number encapsulator, (s)he says so in the optional
argument (`pagemarkup=cs').  Eplain then makes `cs' a
parameter to it's own page number encapsulator, \hlidx or
\hlidxpage, which takes care of the hyperlink and then calls
\cs.  The problem with \index would have been that the user
would embed `|cs' inside the string, and Eplain wouldn't
know if it's there or not, and not be able to insert its
`|hlidx' or `|hlidxpage'.

Of course, we can make \index accept the optional argument,
`pagemarkup=cs', so the user does not embed `|cs'.  But
there are also ranges, `see' and `see also', so it seems
like it is best to just reuse the macros from Eplain instead
of reinventing the wheel.

> makeindex to be concerned about, which has a ton of special characters
> itself.  I don't think it's feasible to really be able to handle index
> entries with anything.

You are right, I haven't thought of that.  I guess we'll
just have to leave that to the user.  It would be possible,
for example, to redefine Makeindex's special chars so that
they don't overlap with chars used in the indexing commands,
so that the latter don't have to be escaped.  Another
alternative would be for the user to define his/her own
\verb which, after calling \verbatim, would turn `"' (the
default escape char of Makeindex) into TeX's escape char and
define, e.g., \@ to produce the verbatim `@'.  Thus the
escaping will work the same way in TeX (inside the
\verb...\endverb) and in Makeindex.  But of course, Eplain
can't do all this generically as each user's setup is
different.  Maybe we can put a note in the manual and give
an example of how to achieve this.

> I guess it is good to have a switch to make the index parsing be
> verbatim/non-verbatim, rather than defining more commands.

I agree, new commands would be too much.

Thanks,
Oleg


More information about the tex-eplain mailing list