1

I am using latexmk and trying to get it to successfully compile the glossaries. I used the script in CTAN (http://ftp.acc.umu.se/mirror/CTAN/support/latexmk/example_rcfiles/glossary_latexmkrc) but it doesn't seem to work in Windows. Here is the error messages: enter image description here

It seems to try to use ./ as the directory but in windows that would be .\ so I believe that is why it is not working.

How can this be fixed?

  • At first glance it looks like makeglossaries is doing that chdir. – Herb Schulz Nov 10 '19 at 21:01
  • If I call make glossaries from shell it works, it only fails when it goes through latexmk – jagjordi Nov 10 '19 at 21:17
  • Latexmk maintainer here. Normally, using forward slashes as directory separators under Windows works as well as the standard backslashes. (However on a command line to cmd.exe, they need to be quoted, but that's not relevant here.) The error message from runscript.tlu shows that latexmk in fact passed ".\" not "./" to makeglosssaries. There's a line in makeglossaries that changes the backslash to forward slash. Let me see if I can reproduce this; I have a fix if need be. – John Collins Nov 12 '19 at 1:51
1

This turns out to be a problem with filename quoting in the arguments to makeglossaries. The simplest fix is to modify the code in the latexmkrc from what is given in the latexmk documentation to

add_cus_dep( 'acn', 'acr', 0, 'makeglossaries' );
add_cus_dep( 'glo', 'gls', 0, 'makeglossaries' );
$clean_ext .= " acr acn alg glo gls glg";
sub makeglossaries {
    my ($name, $path) = fileparse( $$Psource );
    return system "makeglossaries", "-d", $path, $name;
}

A better method is to use

add_cus_dep( 'acn', 'acr', 0, 'makeglossaries' );
add_cus_dep( 'glo', 'gls', 0, 'makeglossaries' );
$clean_ext .= " acr acn alg glo gls glg";
sub makeglossaries {
    my ($base_name, $path) = fileparse( $_[0] );
    pushd $path;
    my $return = system "makeglossaries", $base_name;
    popd;
    return $return;
}

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.