[Tex/LaTex] Latexmk: makeglossaries, Biber and pdfLaTeX / Where to put latexmkrc

biberglossarieslatexmk

I've got myself seriously confused with latexmk. I have been using latexmk on TeX Live 2011 and I have loved it for making my document with a ToC and references with Biber. I am trying to make it work with the glossaries package (makeglossaries) and I've hit a brick wall.

I've already looked at How to make Latexmk use makeglossaries? and have seen the suggestions of code to add but I can't find the latexmkrc file to save my life. I've searched in all the places that the latexmk manual suggests and I'm positive I'm viewing hidden files.

It would make my live much easier if the config file was in the directory with the document because I'm using a couple of different machines to do my writing.

In the end I would like latexmk to run pdfLaTeX, Biber and makeglossaries enough times to make my ToC, List of Tables, List of Figures, references and List of Abbreviations.

I'm running TeX Live 2011, which is fully updated. I'm using latexmk through TeXworks (it came ready configured).

Best Answer

First, let's make sure your latexmkrc file is working. If you're not sure if the glossaries part is working, you could try something simple, e.g. changing $pdf_previewer (see the "List of configuration variables…" section of the latexmk documentation). You can put the file in the following locations:

Latexmk can be customized using initialization files, which are read at startup in the following order:

  1. The system RC file, if it exists. On a UNIX system, latexmk searches for following places for its system RC file, in the following order, and reads the first it finds:

    • "/opt/local/share/latexmk/LatexMk",
    • "/usr/local/share/latexmk/LatexMk",
    • "/usr/local/lib/latexmk/LatexMk".

    On a MS-WINDOWS system it looks for "C:\latexmk\LatexMk".

    On a cygwin system (i.e., a MS-Windows system in which Perl is that of cygwin), latexmk reads for the first it finds of

    • "/cygdrive/c/latexmk/LatexMk",
    • "/opt/local/share/latexmk/LatexMk",
    • "/usr/local/share/latexmk/LatexMk",
    • "/usr/local/lib/latexmk/LatexMk".

    In addition, it then tries the same set of locations, but with the file name replaced "LatexMk" replaced by "latexmkrc".

  2. The user's RC file, if it exists. This can be in one of two places. The traditional one is ".latexmkrc" in the user's home directory. The other possibility is "latexmk/latexmkrc" in the user's XDG configuration home directory. > The actual file read is the first of "$XDG_CONFIG_HOME/latexmk/latexmkrc" or "$HOME/.latexmkrc" which exists. (See https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html for details on the XDG Base Directory Specification.)

    Here $HOME is the user's home directory. [Latexmk determines the user's home directory as follows: It is the value of the environment variable HOME, if this variable exists, which normally is the case on UNIX-like systems (including LINUX and OS-X). Otherwise the environment variable USERPROFILE is used, if it exists, which normally is the case on MS-Windows systems. Otherwise a blank string is used instead of $HOME, in which case latexmk does not look for an RC file in it.]

    $XDG_CONFIG_HOME is the value of the environment variable XDG_CONFIG_HOME if it exists. If this environment variable does not exist, but $HOME is non-blank, then $XDG_CONFIG_HOME is set to the default value of $HOME/.config. Otherwise $XDG_CONFIG_HOME is blank, and latexmk does not look for an RC file under it.

  3. The RC file in the current working directory. This file can be named either "latexmkrc" or ".latexmkrc", and the first of these to be found is used, if any.

  4. Any RC file(s) specified on the command line with the -r option.

(from the "Configuration/initialization (RC) files" section of the latexmk documentation)

So putting it in your working directory should work, just make sure there aren't any other latexmkrc files in the locations specified in 1 and 2. (On my Windows 7 machine, C:\latexmk\LatexMk works.)

Once you made sure latexmk finds your latexmkrc file, try putting the glossaries stuff back in.