# texindy does not run (ubuntu 20.04, texstudio)

I'm trying to run texindy on a document. I need it because I'm writing in french and makeindex doesn't understand how to sort some words with diacritics.

Unfortunately, after several tryings, I don't manage to have it run. Here is a MWE :

\documentclass{scrbook}

\usepackage[texindy]{imakeidx}
\makeindex

\begin{document}

Toto\index{tata}
\printindex

\end{document}


I get the message :

Processus en cours : texindy "mwe-xindy".idx

ERROR: EVAL: variable BINARY has no value

Processus terminé avec une ou plusieurs erreurs (= ended with one ore more errors)

I'm using TexStudio 2.12.22 under Ubuntu 20.04. I've checked the settings as you can see here :

Some things I've already tried :

• replacing texindy %.idx by various other things
• replacing \usepackage[texindy]{imakeidx} with various other options (xindy, truexindy, program=xindy, nothing, etc.)

A few other informations :

• a .idx file is created, which contains : \indexentry{tata}{1}, but no others (.ind, .ilg, .xdy...)
• at the end of the log file, I read this, which makes me think that there is a confusion between xindy and makeindex :

.

runsystem(makeindex mwe-xindy.idx)...executed safely (allowed).

(./mwe-xindy.ind) [2


I have checked in Synaptic (it's the software to manage the installed programs on ubuntu), and xindy and xindy-rules seem regularly installed.

Thanks in advance if you have some informations about the origin of the problem.

• the setting where it says "txs:///texindy" is labeled "par défaut"; is there maybe an override that is set locally for this particular document, somewhere? Jul 22 at 6:02
• Thanks for your answer. When texindy is set "par défaut" (=default), it will be running when I launch a generic "index" button, rather than makeindex, but I can also choose to run specifically texindy, and the problem is strictly the same. Something could override the generic "index" command, but note the texindy one, I guess.
– Malo
Jul 22 at 10:43

There seems to be a problem with the Ubuntu package that provides texindy and/or with texindy/xindy itself. The file /[relevant path]/xindy/tex/inputenc/latin.xdy contains the following content:

;; Generated from latin?.xdy

Binary file (standard input) matches


This is clearly a mistake caused by a grep run on stdin that contained binary data instead of text. When Clisp tries to load this file it leads to the error variable BINARY has no value because it thinks that this line of text is Lisp code and therefore Binary must be a variable.

As a workaround you can let texindy load a different file, for example utf8.xdy. This also has the obvious advantage that it handles utf-8.

You can do this manually by running texindy -C utf8 yourfile.idx in the terminal or from within TeXstudio. It is easier however to provide this option to \makeindex and run LaTeX with shell-escape. In this case imakeidx runs texindy for you with the appropriate option.

MWE:

\documentclass{scrbook}

\usepackage[texindy]{imakeidx}
\makeindex[options=-C utf8]

\begin{document}

Toto\index{tata}
\printindex

\end{document}


See https://tex.stackexchange.com/a/598924/ on how to enable shell escape in TeXstudio. In this case you should not press a separate button for the index, just compile the file itself and imakeidx will create the index.

• Thanks a lot ! I've solved the problem on the MWE, it was a bit more complicated on the real file because I was also using splintidex, but after a few tries it worked at the end. I don't really know what difference it makes between setting texindy -C utf8 %.idx in TexStudio settings, or writing \makeindex[options=-C] in the file, but it seems to work when I have both together. Thanks.
– Malo
Jul 24 at 12:30