I spent most of yesterday trying to get LaTeX
to create a list of abbreviations using the {nomencl}
package , and after a lot of research managed to succeed using latexmk
and creating a customised rule in a latexmkrc
file. (This was by copying examples, I have no idea what I'm actually doing!). However, it only works if I put the latexmkrc
file in the current document folder. The code in the latexmkrc
file, which was cloned from a post on another board by John Collins, is as follows:
add_cus_dep('nlo', 'nls', 0, 'makenlo2nls');
sub makenlo2nls {
my $cwd = cwd();
my $base = $_[0];
# Normalize the filenames to use / to separate the directory
# components, since both \ and / are allowed under MSWin:
$base =~ s(\\)(/)g;
$cwd =~ s(\\)(/)g;
# Remove any initial string equal to the name of current
# working directory (and the following separator):
$base =~ s(^$cwd/)();
# Normalize the filename back to standard MSWin:
$base =~ s(/)(\\)g;
# Quote the filenames in the command line
# (to give safety against special characters):
system("makeindex \"$base.nlo\" -s nomencl.ist -o \"$base.nls\"");
}
Is there a central location where I can put the latexmkrc
file so that it is available to all my documents? I have tried the obvious locations such as C:\Users\*username*
.
Best Answer
Try to name the file
LatexMK
and put it inC:\latexmk
.EDIT: Quoting the
latexmk
manual, section "Configuration/initialization (RC) files", p. 9--10: