Book logo xindy

A Flexible Indexing System


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

Re: problem with \




Hi Denis,

when you use latin1 characters like â instead of the more
TeX-like notation \^a in your TeX source to produce diacritical signs
there seems to be a problem with xindy.sty. The contents of your
raw index (.idx) is not properly quoted c.

You get

(indexentry :tkey (("b\^ateau"))
            :locref "1")

instead of

(indexentry :tkey (("b\\\^ateau"))
            :locref "1")

which would be correct.

In my opinion there are three possible solutions to get out of that
pitfall:

1. Fix xindy.sty to get the correct quoting.

   I must admit, that I do not really know how to do that. The
   style xindy.sty contains to much low-level-TeX-voodoo. That's
   far beyond my personal knowledge.

2. Use the clumsy TeX-notation for your diacrites.

3. Adjust the quoting in your raw index.

   To do that, I wrote a little C program 'quote.c' a long time ago. 
   I've appended the source. Usage:

   - compile the source: cc -o quote quote.c

   - start xindy with the command line:
     xindy -f quote -o foo.ind fmakeidx.xdy foo.idx

   Warning: There is a bug in the xindy Perl script. Please change
            $rawindex to $Rawidx.


bye,

Joerg Diederich


<--- cut here --->

/* Program quote.c to adjust quoting in raw indices */

#include <stdio.h>
#include <fcntl.h>

main ()
{ 
  int c;
  int doubleSlash;
  doubleSlash = 0;
  while (!((c = getchar()) == EOF))
    { 
      if( doubleSlash )
        {
	  switch( c ) {
	  case '\\' : break;
	  case '"'  : break;
	  default   : putchar('\\');
	  }
        }
      putchar(c);
      if( c == '\\' && !doubleSlash ) { doubleSlash = 1; } else { doubleSlash = 0; }
    }
  if (ferror(stdin) || ferror(stdout))
    { exit(1); }
  else
    { exit(0); }
}


<--- cut here --->   




"Denis B. Roegel" <Denis.Roegel@loria.fr> writes:

> Hello,
> 
> I want to start using xindy and I am running into basic alphabet
> problems. I am using xindy with xindy.sty and the example style makeidx.sty
> where I added (require "tex/isolatin1m.xdy"). I have also set the variable
> XINDY_SEARCHPATH to .:/usr/local/tex/texmf/xindy.
>  
> Now, with the input file
>  
> \documentclass[12pt]{article}
> \usepackage[latin1]{inputenc}
> \usepackage{makeidx}
> \usepackage{xindy}
>  
> \makeindex
>  
> \begin{document}
>  
> xx
>  
> \indexindy{avion}
> \indexindy{bâteau}
> \indexindy{barre}
> \indexindy{camelot}
> \indexindy{éthiopien}
> \indexindy{envie}
> \indexindy{exact}
> \indexindy{métrique}
>  
> \printindex
>  
> \end{document}
>  
> I get an .idx file looking like
>  
> (indexentry :tkey (("avion"))
>             :locref "1")
> (indexentry :tkey (("b\^ateau"))
>             :locref "1")
> (indexentry :tkey (("barre"))
>             :locref "1")
> (indexentry :tkey (("camelot"))
>             :locref "1")
> (indexentry :tkey (("\'ethiopien"))
>             :locref "1")
> (indexentry :tkey (("envie"))
>             :locref "1")
> (indexentry :tkey (("exact"))
>             :locref "1")
> (indexentry :tkey (("m\'etrique"))
>             :locref "1")
>  
>  
> which when processed with fmakeidx.xdy (makeidx.xdy + (require "tex/isolatin1m.xd
> y"))
> gives
>  
>  
> \begin{theindex}
>  
>   \item 'ethiopien, 1
>  
>   \indexspace
>  
>   \item avion, 1
>  
>   \indexspace
>  
>   \item b^ateau, 1
>   \item barre, 1
>  
>   \indexspace
>  
>   \item camelot, 1
>  
>   \indexspace
>  
>   \item envie, 1
>   \item exact, 1
>  
>   \indexspace
>  
>   \item m'etrique, 1
>  
> \end{theindex}
>  
>  
> and this is not good, since I want at least to have \'ethiopien, b\^ateau, etc.,
> not to speak about the sorting order which I have not yet included.
>  
> There are no errors when processing the file with xindy.
>  
> What did I do wrong or forget?
>  
> Thanks,
>  
> Denis Roegel