I have a problem with latexmk and the glossaries package. I have a large `scrbook' document organised with a main file and several chapter files. In my preamble I have a large quantity of acronyms defined (around 30 I believe). The problem is that when I add \gls{} entries to the document and then typeset with latexmk (I use TexShop on Mac OSX), it reaches maximum number of runs and returns an error. I wasn't able to recreate the error with a minimal document to post here unfortunately, but I was hoping that somebody could give me a hint on where to look at least, for example with known package conflicts or something like that. This is the last part of the log for the error:
Rule 'bibtex thesis': File changes, etc:
Changed files, or newly in use since previous run(s):
'thesis.aux'
------------
Run number 2 of rule 'bibtex thesis'
------------
------------
Running 'bibtex "thesis"'
------------
Latexmk: applying rule 'bibtex thesis'...
For rule 'bibtex thesis', running '&run_bibtex( )' ...
This is BibTeX, Version 0.99d (TeX Live 2015)
The top-level auxiliary file: thesis.aux
The style file: ieeetr.bst
Database file #1: thesis_references.bib
Warning--entry type for "goalwebsite" isn't style-file defined
--line 324 of file thesis_references.bib
(There was 1 warning)
Rule 'cusdep acr acn thesis': File changes, etc:
Changed files, or newly in use since previous run(s):
'thesis.acr'
------------
Run number 3 of rule 'cusdep acr acn thesis'
------------
Latexmk: applying rule 'cusdep acr acn thesis'...
For rule 'cusdep acr acn thesis', running '&do_cusdep( makeacr2acn )' ...
This is makeindex, version 2.15 [TeX Live 2015] (kpathsea + Thai support).
Scanning style file ./thesis.ist.............................done (29 attributes redefined, 0 ignored).
Scanning input file thesis.acr...done (0 entries accepted, 72 rejected).
Nothing written in thesis.acn.
Transcript written in thesis.alg.
Rule 'cusdep acn acr thesis': File changes, etc:
Changed files, or newly in use since previous run(s):
'thesis.acn'
------------
Run number 4 of rule 'cusdep acn acr thesis'
------------
Latexmk: applying rule 'cusdep acn acr thesis'...
For rule 'cusdep acn acr thesis', running '&do_cusdep( makeacn2acr )' ...
This is makeindex, version 2.15 [TeX Live 2015] (kpathsea + Thai support).
Scanning style file ./thesis.ist.............................done (29 attributes redefined, 0 ignored).
Scanning input file thesis.acn...done (0 entries accepted, 0 rejected).
Nothing written in thesis.acr.
Transcript written in thesis.alg.
Rule 'pdflatex': File changes, etc:
Changed files, or newly in use since previous run(s):
'thesis.acr'
'thesis.aux'
'thesis.toc'
Latexmk: Maximum runs of pdflatex reached without getting stable files
Latexmk: Did not finish processing file 'thesis.tex':
'pdflatex' needed too many passes
Latexmk: Use the -f option to force complete processing,
unless error was exceeding maximum runs of latex/pdflatex.
Latexmk: applying rule 'pdflatex'...
Latexmk: Errors, so I did not complete making targets
I am sure that glossaries are the problem because the `thesis.acr' file keeps updating with every run, also if I comment out the commands that prints the glossaries it manages to compile just fine. The weird thing is if I trash the aux files it manages to compile just fine as well.
This is what my `latexmkrcedit' file looks like, I see that it does acknowledge problems with the glossaries but I have no idea what to do about it:
# Don't edit this file IF it is named latexmkrcDONTedit directly since
# TeXShop may replace it on update.
# If you wish to edit or add to this file, copy it to ~/Library/TeXShop/bin
# and rename it latexmkrcedit if that file doesn't already exist.
# Edit this File to add/change dependencies and rules
# The following is used by ALL the latexmk engine files
# change the empty string ,'', to '--shell-escape' to add the shell-escape default
$TSUserCompileOptions = '';
#$TSUserCompileOptions = '--shell-escape';
# turn recorder option off (no .fls file generated)
#$recorder=0;
# turn off duplicated missing references
$silence_logfile_warnings = 1;
# Custom dependency for glossary/glossaries package
# if you make custom glossaries you may have to add items to the @cus_dep_list and corresponding sub-routines
add_cus_dep('glo', 'gls', 0, 'makeglo2gls');
sub makeglo2gls {
system("makeindex -s '$_[0]'.ist -t '$_[0]'.glg -o '$_[0]'.gls '$_[0]'.glo");
}
# The glossaries package, with the [acronym] option, produces a .acn file when processed with (xe/pdf)latex and
# then makeindex to process the .acn into .acr and finally runs of (xe/pdf)latex to read in the .acr file. Unfortunately
# the glossary package does just the reverse; i.e. (xe/pdf)latex processing produces a .acr files and makeindex then
# is used to convert the .acr file to a .acn file which is then ... . This dependency assumes the glossaries package.
add_cus_dep('acn', 'acr', 0, 'makeacn2acr');
sub makeacn2acr {
system("makeindex -s '$_[0]'.ist -t '$_[0]'.alg -o '$_[0]'.acr '$_[0]'.acn");
}
# for glossary package (Sigh...) --- they can co-exist!
add_cus_dep('acr', 'acn', 0, 'makeacr2acn');
sub makeacr2acn {
system("makeindex -s '$_[0]'.ist -t '$_[0]'.alg -o '$_[0]'.acn '$_[0]'.acr");
}
# example of an added custom glossary type that is used in some of the glossary/glossaries example files:
# this is for the new glossary type command \newglossary[nlg]{notation}{not}{ntn}{Notation} from the glossaries package
# NOTE: the glossary package uses a very different command: the <in-ext> and <out-ext>
# are reversed in the calling sequence :-(
add_cus_dep('ntn', 'not', 0, 'makentn2not');
sub makentn2not {
system("makeindex -s '$_[0]'.ist -t '$_[0]'.nlg -o '$_[0]'.not '$_[0]'.ntn");
}
# for the glossary package (Sigh...) --- they can co-exist!
add_cus_dep('not', 'ntn', 0, 'makenot2ntn');
sub makenot2ntn {
system("makeindex -s '$_[0]'.ist -t '$_[0]'.nlg -o '$_[0]'.ntn '$_[0]'.not");
}
# dependencies for custom indexes using the index package
# examples for sample.tex for index package:
add_cus_dep('adx', 'and', 0, 'makeadx2and');
sub makeadx2and {
system("makeindex -o '$_[0]'.and '$_[0]'.adx");
}
add_cus_dep('ndx', 'nnd', 0, 'makendx2nnd');
sub makendx2nnd {
system("makeindex -o '$_[0]'.nnd '$_[0]'.ndx");
}
add_cus_dep('ldx', 'lnd', 0, 'makeldx2lnd');
sub makeldx2lnd {
system("makeindex -o '$_[0]'.lnd '$_[0]'.ldx");
}
# Custom dependency and function for nomencl package
add_cus_dep('nlo', 'nls', 0, 'makenlo2nls');
sub makenlo2nls {
system("makeindex -s nomencl.ist -o '$_[0]'.nls '$_[0]'.nlo");
}
I would really appreciate the help, it's frustrating when you can't concentrate on the content because of random problems. Thanks.
Scanning input file thesis.acr...done (0 entries accepted, 72 rejected). The call tomakeindexhas failed for some reason and isn't creating thethesis.acnfile. Check the log filethesis.algfor error messages. – Nicola Talbot Apr 29 '16 at 12:07glossarypackage is obsolete, I recommend commenting out themakeacr2acndependency code. It's my fault for mixing up the file extensions when I replaced theglossarypackage with theglossariespackage, but sinceglossarywas deprecated years ago there doesn't seem any point in trying to support it inlatexmk. Themakeglossariesscript makes it much easier by reading the.auxfile to determine the files used byglossaries, but I don't know how to incorporate that intolatexmk(which is one of the reasons why I preferararatolatexmk) – Nicola Talbot Apr 29 '16 at 14:14