Book logo xindy

A Flexible Indexing System


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Package for writing raw-indices



inas@mib.harz.de (Andreas Schlechte) wrote on Fri, 14 Mar 1997 15:50:13 +0100 (MET):
: >    \usepackage{german}
: > results in something like
: >    (indexentry :tkey ( ( \active@dq \dq@prtct{E}uler\errhelp {Use `` for
: >    a simple double quote character.}\errmessage {german: The command ")

German-Style makes the " an active character which expands to a
serious of unexpandable tokens...  if in expand-only mode.  I.e., the
active " is a `fragile' command (to use LaTeX's words).

 
: You surley typed
: 
:    \usepackage{german}
:    \usepackage{xindy}
:  
: If you reverse the order, the output is correct. I don't know why,
: but xindy MUST be included before german is loaded. 

No, Andi, what should be done in your xindy.sty is to ensure that all
punctuation characters (think of `french.sty' for an active colon ":"
or `spanish.sty/.ldf' for activated single quotes), which are used as
part of the generated xindy raw index file, should be read using
category code `other' ...or should be prefixed by \string.

Mmmmh, you should look at the code of \index ("ltidxglo.dtx"), which
uses \@sanitize before reading its arguments to ensure that all
characters will have the expected category codes (and which fails each
time \index{...} is used inside a user-defined macro).

If the same is done in \indexindy, the currently used \mdqoff and
\ifx\@undefined\germanTeX switch isn't needed anymore (because
`german.sty' adds " to the list of characters to be \@sanitize'd).
I.e., \indexindy should be defined as

\def\indexindy{%
    \begingroup
    \toks@{}
    \ifx\@undefined\germanTeX%
        \catcode`\\=\active
        \expandafter\indexindy@%
    \else%
        \mdqoff\catcode`\\=\active
        \expandafter\indexindy@%
    \fi}

\newcommand{\indexindy}{%
  \@bsphack        %% to handle `space factor' etc.
  \begingroup
    \toks@{}%
    \@sanitize \catcode`\\=\active
    \indexindy@
}

and after the "\endgroup" of \indexindy@ a "\@esphack" should be added
for completion, read "ltspace.dtx" for comments about spacing and
\@bsphack/\@esphack.

Best wishes,
  -bernd