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 http://tex.stackexchange.com/questions/251221/miktex-and-xindy-problems? for examples). Then you could avoid texindy. – Ulrike Fischer Jun 26 '15 at 07: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 07: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 07:34
  • Just gets complicated for the user – daleif Jun 26 '15 at 08:09
  • @daleif Imho with utf8 you need it anyway. – Ulrike Fischer Jun 26 '15 at 12:58
  • isn't that because there is missing development on xindy? – daleif Jun 26 '15 at 13:06
  • xindy -M texindy produces also an empty raw index file in WIndows command line (cmd) and the following error in Cygwin: /cygdrive/c/Users/Robert/Documents/tmp/xindy/minimal/C:/Program Files (x86)/MiKTeX 2.9/scripts/xindy/../../xindy/modules: No such file or directory at C:\Program Files (x86)\MiKTeX 2.9\scripts\xindy\xindy.pl line 402 – Robert Nyqvist Jun 26 '15 at 14:45
  • 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
  • I think that it is the best to reinstall MikTeX in a directory without spaces. xindy seems not to support paths with spaces. It is quite possible that there are other programs than xindy which do not fully support paths with spaces. – Akira Kakuto Jun 26 '15 at 22:34
  • @Ulrike Fischer: I have further updated texindy.pl and xindy.pl in the TeX Live in order to support spaces in paths (r37686). I hope that texindy ... and xindy -M texindy ... work in the case of Robert after a sync. – Akira Kakuto Jun 26 '15 at 23:35
  • @Ulrike Fischer: It was not necessary to change texindy.pl. See my answer below. – Akira Kakuto Jun 27 '15 at 01:39

1 Answers1

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;
}
Akira Kakuto
  • 2,652
  • 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 05: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 05:39