Questions tagged [latexmk]

{latexmk} is a Perl script to automatically run latex and related commands as many times as needed to build the final document.

The latexmk program allows to automatically run latex and related commands as many times as needed to build the final document. It is an alternative or complement to Makefiles or similar functionality of integrated LaTeX editors.

It is available on CTAN and on its project site by the maintainer, John Collins.

See the manpage for more information.

There is a similar tool named LaTeX-Mk, which yet is distinct from latexmk.

595 questions
102
votes
1 answer

How sensible is it to use latexmk?

Until recently I always compiled my documents via the steps, pdflatex -> makeindex/biber -> pdflatex -> pdflatex (and the intermediate steps only if necessary). Latexmk does all the necessary steps in one command for me but I suspect that comes with…
Philipp
  • 5,078
  • 10
  • 30
  • 32
34
votes
2 answers

How do I set up my config file to have latexmk default to making a pdf?

I can't see any situation where I would want to compile a dvi file. Therefore I'd like to have latexmk default to giving me a pdf via pdflatex, so I don't have to type -pdf every time. I've tried adding the following to my latexmkrc file without…
Canageek
  • 17,935
18
votes
2 answers

latexmk with external references

Is there a way to make latexmk aware of external references as they are imported via the xr package? My Problem is that I have several files for weekly exercise sheets. Sometimes I have references to earlier exercises which I include via the xr…
14
votes
1 answer

Errors in latexmk with use of auto-pst-pdf and hyperref

If we…
user2265
12
votes
1 answer

How to know that latexmk picks up my configuration file?

I've put .latexmkrc file into my working directory, but it doesn't seem to be doing anything. Is there a way to check that latexmk picks up my configuration file?
12
votes
2 answers

latexmk: Multiple custom-generated files and \input

Referring to this question, I found that having multiple custom-generated files in a document generated by latexmk doesn't really work for me. The modus operandi is that latexmk runs pdflatex, checking that noteable's output for missing file errors,…
DevSolar
  • 7,857
12
votes
2 answers

How to ignore .latexmkrc

I usually love my .latexmkrc settings. However I am trying to play with Template Toolkit to build a LaTeX file, then compile it with latexmk (all of this inside a perl script) and thus I would like to use the default latexmk settings (i.e. no…
Joel Berger
  • 1,831
  • 1
  • 12
  • 16
9
votes
3 answers

Latexmk using -jobname and a command line \def

I am having a problem converting this pdflatex command to use latexmk: pdflatex --file-line-error --shell-escape --synctex=1 \ -jobname=foobar "\def\MyCustomDef{} \input{file-name.tex}" I attempt to use this with latexmk as: latexmk -pdf…
Peter Grill
  • 223,288
9
votes
0 answers

Latexmk After TexLive Installation

I am trying to compile some LaTeX using VSCode on linux. I just did the basic installation scheme of TexLive ( < 300 MB). When I try to compile some code though I get an error about latexmk not being found. When I try to run latexmk from the…
Nukesub
  • 607
9
votes
1 answer

latexmk clean (-c): some Beamer-related files are not deleted

I'm trying to use latexmk -c (or latexmk -C) to clean a directory, but when I run any of these two commands, I get the following: Latexmk: This is Latexmk, John Collins, 21 May 2019, version: 4.64a. Latexmk: Disallowing switch of output file as…
anol
  • 539
9
votes
2 answers

latexmk cleanup

When I do latexmk -c foo.tex, latexmk cleans up as expected. I tried to configure latexmkrc so that this would happen automatically. Here's my latexmkrc file: $pdf_mode = 1; $silent = 1; $cleanup_mode = 2; However, when I run latexmk, all of the…
jchun
  • 195
8
votes
2 answers

How to change latexmk's number of maximum runs

I'm compiling my .tex file using latexmk, because it's the easiest way to have my code compiled multiple times until the final document is stable. The issue is that such code needs to be executed several times - actually, a random amount of times -…
il mietitore
  • 702
  • 1
  • 5
  • 19
8
votes
0 answers

Using LaTeXmk with mylatexformat

I looked at many posts about the use of latexmk, but wasn't able to find what to write in order to satisfy my requirements. Yet I'm sure it is possible, but my skills in Perl amounts to about nothing. What I would like to do with a file, say…
Bernard
  • 271,350
7
votes
1 answer

latexmk option -c not working

I try to use latexmk, version: 4.39, with the -c option, but it does not give any output. \documentclass{article} \begin{document} Hello, world! \end{document} There is no output when I use latexmk -c -pdf test.tex. But it works fine when I use…
gwo
  • 73
7
votes
1 answer

Running latexmk on tex-file with errors does not report any errors on second run

I am using latexmk for compiling a large number of tex-files to PDF's on a Jenkins server, some of the tex-files are known to have errors in them. I would like to reduce build time as much as possible, to achieve this I have tried not to have…
JoeCed
  • 71
1
2 3 4 5 6 7