TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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).

share|improve this question
To use a configuration file per working directory you have to create one and place it in the working directory. The file must be named "latexmkrc" or ".latexmkrc". – N.N. Jan 14 '12 at 18:46
I have already done that and copied the answer from the above link into it and it wouldn't run. I thought their might be a latexmkrc file elsewhere. – Darling Jan 14 '12 at 18:49
It will be easier to answer your question if you clarify it by adding information about your TeX distribution and how you installed latexmk. – N.N. Jan 14 '12 at 18:54
Edited description. – Darling Jan 14 '12 at 18:55
You don't need a configuration file to run biber with latexmk. See tex.stackexchange.com/questions/8950/using-biber-with-latexmk – lockstep Jan 14 '12 at 18:56
up vote 8 down vote accepted

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 p. 21 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".
  2. The user’s RC file, "$HOME/.latexmkrc", if it exists. Here $HOME is the value of the environment variable HOME. On UNIX and clones (including LINUX), this variable is set by the system; on MS-Windows, the user may choose to set 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 latexmk documentation, p. 9f)

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.

share|improve this answer
I've had a look around for a latexmkrc file and can't see one. I've created one called latexmkrc in the directory of the document and added $pdf_previewer ="start acroread %O %S" to it. Running latexmk still causes the texworks pdf previewer to display the pdf. If I intentionally put a mistake into the line latexmk fails to work. So it is definitely reading the file but seems to be ignoring the instructions. :S – Darling Jan 15 '12 at 21:55
Run number 1 of rule 'cusdep acn acr Thesis v2' ------------ === Creating rule for 'cusdep acn acr Thesis v2' Latexmk: applying rule 'cusdep acn acr Thesis v2'... For rule 'cusdep acn acr Thesis v2', running '&do_cusdep( makeglo2gls )' ... makeglossaries: Need exactly one file argument. Use `makeglossaries --help' for help. C:\texlive\2011\bin\win32\runscript.tlu:577: command failed with exit code 255: cmd /c call c:/texlive/2011/texmf-dist/scripts/glossaries/makeglossaries.bat Thesis v2 Rule 'cusdep acn acr Thesis v2', function 'makeglo2gls' failed with return code = 65280 – Darling Jan 15 '12 at 22:25
I stumbled across this when looking through the console output. – Darling Jan 15 '12 at 22:26
Problem solved by removing the space from the filename of the .tex file.... Embarassed mode engaged. Thanks for your help. – Darling Jan 15 '12 at 23:13

LatexMk looks for a configuration file in different places. One place to put the file so that it's a systemwide install is.


NB: this isn't part of your home directory, which is why it just starts with a slash, rather than a tilde ~). And you'll probably have to make the directory LatexMk yourself (using sudo).

Then place the LatexMk file in there.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.