3

I try to use xindy in MiKTeX. When I compile

\documentclass[a4paper]{article}
\usepackage{makeidx}
\makeindex
\begin{document}
test\index{test}\index{text}
\printindex
\end{document}

with

latex test.tex
texindy test.idx

it prints

C:/Program is not an internal command, external command, program or batch file.
Opening logfile "nul" (done)
Reading indexstyle...
Loading module "r0Ri4_6RwG"...
Loading module "lang/general/latin9-lang.xdy"...
Loading module "lang/general/latin9.xdy"...
Finished loading module "lang/general/latin9.xdy".
Finished loading module "lang/general/latin9-lang.xdy".
Loading module "tex/inputenc/latin.xdy"...
Finished loading module "tex/inputenc/latin.xdy".
Loading module "texindy.xdy"...
Loading module "numeric-sort.xdy"...
Finished loading module "numeric-sort.xdy".
Loading module "latex.xdy"...
Loading module "tex.xdy"...
Finished loading module "tex.xdy".
Finished loading module "latex.xdy".
Loading module "latex-loc-fmts.xdy"...
Finished loading module "latex-loc-fmts.xdy".
Loading module "makeindex.xdy"...
Finished loading module "makeindex.xdy".
Loading module "latin-lettergroups.xdy"...
Finished loading module "latin-lettergroups.xdy".
Finished loading module "texindy.xdy".
Loading module "page-ranges.xdy"...
Finished loading module "page-ranges.xdy".
Loading module "word-order.xdy"...
Finished loading module "word-order.xdy".
Finished loading module "r0Ri4_6RwG".
Finished reading indexstyle.
Finalizing indexstyle... (done)

Reading raw-index "zBpYoFHjX4"...
Finished reading raw-index.

Processing index... [10%] [20%] [30%] [40%] [50%] [60%] [70%] [80%] [90%] [100%]

Finished processing index.

Writing markup... [10%] [20%] [30%] [40%] [50%] [60%] [70%] [80%] [90%] [100%]
Markup written into file "test.ind".

The problem is that text.ind contains an empty theindex environment. Also, with the option -d kepp_tmpfiles I can see that the raw-index file is empty (the file zBpYoFHjX4above).

Note, the error/warning message C:/Program is not an internal command, ... from texindy.

I don't know if the following is related. If I try to compile xindy in Cygwin I get the error:

C:\Program Files (x86)\MiKTeX 2.9\scripts\xindy\texindy.pl: not a symlink as required for
TeX Live at C:\Program Files (x86)\MiKTeX 2.9\scripts\xindy\texindy.pl  line 423.

How to solve this?

  • Seems a problem with the spaces in your installation directory. Can you run xindy? (See eg tex.stackexchange.com/questions/251221/…? for examples). Then you could avoid texindy. – Ulrike Fischer Jun 26 '15 at 7:06
  • That's also a very strange error message. Why is it mentioning TeX Live when this a MikTeX installation? – daleif Jun 26 '15 at 7:09
  • @daleif: It is quite possible that texindy.pl hasn't all the correct tests for miktex, or that is a cygwin problem. Imho texindy isn't really needed. You can always use a xindy -M texindy instead. – Ulrike Fischer Jun 26 '15 at 7:34
  • Just gets complicated for the user – daleif Jun 26 '15 at 8:09
  • 1
    Did you check for updates? One bug regarding spaces in the installation directory was corrected yesterday. (I have no idea regarding the cygwin error, I doubt that is a good idea to try ro run miktex in it). – Ulrike Fischer Jun 26 '15 at 22:11
2

It was not necessary to change texindy.pl. Please add a line

$filter=quotify($filter);

at the next line of line 719 of xindy.pl. After the change, sub filter_index becomes as follows:

sub filter_index ( $$ ) {
    my ($filter, $input) = @_;
    my $output = tmpnam();
    push (@temp_files, $output);
    $output=quotify($output);
    $filter=quotify($filter);
    print "Running filter: $filter <$input >$output\n"  if $verbose;
    system "$filter <$input >$output";
    print "filtered xindy input file: $output\n"  if $debug{script};
    return $output;
}
  • That solved the error message C:/Program is not an internal command .... It turns out that xindy couldn't run tex2xindy, which I think explain the empty raw index file. Still xindy couldn't find tex2xindy, since it searches in <path to MiKTeX>/xindy/../../miktex/bin/internal/. It works if I copy tex2xindy.exeto /miktex/bin/internal/.Thank you for the help! – Robert Nyqvist Jun 27 '15 at 5:11
  • tex2xindy.exe is used only by xindy and it should be in .../miktex/bin/internal in the case of 32bit MikTeX or in .../miktex/bin/x64/internal in the case of 64bit MikTeX. Please tell the MikTeX developer. – Akira Kakuto Jun 27 '15 at 5:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.