I am trying to get a document to print a list of urls, and I have the sample here that needs me to run makeindex
in between the invocations of pdflatex. latexmk -pdf
doesn't seem to do it automatically, although I thought it would convert .idx
files to .ind
files and re-run pdflatex
automatically.
Manually, this is how it works: I have a main.tex
file.
$ pdflatex main # produces main-url.idx and main-url.mst
$ makeindex main-url # produces main-url.ind
$ pdflatex main # produces a pdf with the index .ind file just created
As I understand it, latexmk
takes care of running makeindex
automatically, but when I run it on a clean directory (with only main.tex
), the .ind
file is never created, and the index doesn't end up in the pdf.
What I have tried: First, I tried adding the following dependency to a local latexmkrc
file, but that didn't work (I think because there is already a rule to turn .idx
files into .ind
files:
# support for the printing urls:
add_cus_dep('idx', 'ind', 0, 'makeurlindex');
sub makeurlindex {
return system("makeindex \"$_[0].idx\"");
}
Then I tried changing the output extension to .ndx
and having the custom dependency as follows, but again, no dice:
# support for the printing urls:
add_cus_dep('ndx', 'ind', 0, 'makeurlindex');
sub makeurlindex {
return system("makeindex \"$_[0].ndx\"");
}
Additionally, I tried changing the output file to main.idx
and updated the custom dependency accordingly, but it didn't work, either.
Finally, I tried making the dependency go from .mst
to .ind
, but that didn't work.
How can I make latexmk
act on this dependency?
add_cus_dep
.