Hot answers tagged

154 votes
Accepted

How sensible is it to use latexmk?

(As the author of latexmk, I am naturally partial to my own program, but here's my 2-cents' worth anyway.) The fundamental problem that latexmk solves is that the number of runs of (pdf)latex needed ...
  • 9,969
74 votes

How to make LaTeXmk work with XeLaTeX and biber

LatexMk (since 4.31) supports the -xelatex option and auto-detects biber. Therefore, in the fabulous world of 2015: $ latexmk -xelatex biberedtexfile.tex This is equivalent to: $ latexmk -pdfxe -dvi- ...
  • 853
26 votes
Accepted

What is the role of the different entities (TexLive, pdlatex, latexmk) in the LaTeX ecosystem?

To use TeX you need: An implementation of TeX "a tex engine" in modern terminology that converts your source file into PDF (or DVI). pdftex the most used variant at present. An editor to ...
24 votes

Ultrafast PDFLaTeX with precompiling

For the benefit of people using a search engine arriving here looking for how to convert a never-changing but slow-loading preamble into a super-quick "precompiled" format. The instructions here take ...
  • 3,862
24 votes

How to have latexmk always use -shell-escape?

If you need to do this just once, run: latexmk -e '$latex=q/latex %O -shell-escape %S/' or latexmk -e '$pdflatex=q/pdflatex %O -shell-escape %S/' -pdf for PDF output. If you want latexmk to ...
  • 11.8k
21 votes
Accepted

LaTeX \newcommand recursion gets very slow

Let's see what happens when you do \gcdab{377}{233}. The first expansion becomes \ifnum233=0 \else\gcdab{233}{\modab{#1}{#2}}\fi The conditional is false, so you get \gcdab{233}{\modab{377}{233}}\fi ...
  • 1.0m
17 votes
Accepted

What is the meaning of option "t" in documentclass beamer?

Copy/pasting from the beamer manual:
16 votes
Accepted

Error "latexmk: The script engine could not be found" in VS Code using MikTeX 2.9

Quick summary: Install Perl from The Perl Programming Language. ActiveState Perl is recommended for beginners. Make sure to add the Perl local directory to your system Path. Install the latexmk ...
  • 1,018
16 votes
Accepted

How to suitably configure the TEXINPUTS variable in latexmkrc for detecting the sty and cls files present in a custom folder in the project directory?

Latexmk actually has a subroutine for adding items to search paths. You can write ensure_path( 'TEXINPUTS', './custom_cls_sty_files//' ); This takes care of using the correct operating-system-...
  • 9,969
15 votes
Accepted

Can I pass LaTeX commands to latexmk instead of a filename?

You could use the -latex or -pdflatex options. I'll use pdflatex for the examples but it should work with latex as well. latexmk -pdf article will look for article.tex, invoke the command associated ...
  • 14.8k
15 votes
Accepted

Latexmk not using pdflatex

If you run latexmk with the argument -pdf, it will compile with pdflatex. In TeXWorks: On Linux, change the `~/.latexmkrc' file as per this SE answer.
  • 20k
15 votes
Accepted

How to have latexmk always use -shell-escape?

You can pass the parameter directly to latexmk as such: latexmk -shell-escape This option is not mentioned in the manpage. The manpage suggests the -e option which is also used in the first answer. ...
  • 520
14 votes

Is there latexmk functionality for LuaTeX?

Instead of adding the -lualatex flag to each application of latexmk, you could place the following $pdflatex = 'lualatex -file-line-error %O %S'; $pdf_mode = 1; in an '.latexmkrc' file. This file ...
  • 15.5k
14 votes
Accepted

What is makefile and when do I need to use it along with latexmk?

This is a quite general question, and so it'll be hard to write down a complete answer. I'll talk about when I use Make and when I use latexmk. latexmk is a tool for compiling .tex files, and not ...
  • 6,956
14 votes

arXiv: post supplementary files using external document and xr

You can workaround a problem. Take your file.aux, create xx.tex and upload it to arxiv along with your latex file. the xx.tex is: \begin{filecontents}{file.aux} The content of file.aux \end{...
13 votes
Accepted

Latexmk: Stop processing on pdflatex error

I have this in my .latexmkrc: $pdflatex = "pdflatex -synctex=1 -halt-on-error %O %S"; In my case I tend to use -pvc all the time, so here it just stops the compilation if there is an error and go ...
  • 50.3k
13 votes
Accepted

Unicode -(U+301) error in biblatex, but not in main text: {\'{\i}}

With biblatex and Biber the best solution™ is of course to use the correct Unicode characters (and ideally the precomposed characters: Åström, not a combination of the combining characters: Åström) ...
  • 165k
12 votes
Accepted

latexmk: how to continuously update the output pdf but not invoking the pdf viewer?

Just use latexmk -pvc -view=none.
  • 9,969
12 votes

How to change latexmk's number of maximum runs

You can change the $max_repeat variable with a command line option or in a configuration file. latexmk -e "$max_repeat=2" test or perhaps on other OS/shells with a single quote latexmk -e '$...
11 votes

How to make Latexmk use makeglossaries?

My sources and generated files are in separated directories. Running mhp's solution I got the error: (require "doc.xdy") ERROR: Could not find file "doc.xdy". Then I extended the solution to: file: ...
  • 211
11 votes
Accepted

How to enable shell escape when building with latexmk and xelatex

There are multiple options: latexmk -xelatex -latexoption="-shell-escape" document latexmk -xelatex -shell-escape document (this option is not listed in the normal latexmk -help menu, but you have to ...
11 votes
Accepted

Why is pdflatex outing itself as pdftex?

In a Linux terminal on /usr/local/texlive/2018/bin/x86_64-linux directory: $ file pdflatex pdflatex: symbolic link to pdftex But with pdftex: $ file pdftex pdftex: ELF 64-bit LSB executable, x86-...
  • 75.2k
11 votes
Accepted

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

latexmk has an internal list of extensions that are known to be safe to delete. But it does not know all extensions used by all LaTeX packages or which of them are safe to delete. latexmk can read ...
  • 50.3k
10 votes

Is there latexmk functionality for LuaTeX?

Since version 4.51 of latexmk, you can use the following .latexmkrc: $pdf_mode = 4; $postscript_mode = $dvi_mode = 0;
  • 809
10 votes
Accepted

How can one manually add a line to the pdflatex -recorder .fls file?

Here are three solutions: Since latexmk also examines the .log file for dependencies, you can persuade latexmk that there is a dependency on file.a by writing a suitable line to the .log file. The ...
  • 9,969
10 votes

latexmk - command not found on OS X

I am using OX X Yosemite and I encountered exactly the same problem as you. I solved it by following steps: Launch TeX Live Utility Search for latexmk in the filter Check whether latexmk is installed ...
  • 101
10 votes
Accepted

TexStudio with LuaLatex and latexmk - is this possible?

Yes it is possible and also quite easy.: Go to Configurate TexStudio and then choose Commands, scroll down and insert in latexmk latexmk -lualatex -silent -latexoption="-synctex=1" % Be carefull with ...
  • 673
10 votes

LaTeX \newcommand recursion gets very slow

In the first version you want to evaluate \modab earlier \documentclass{article} \usepackage{amsmath} \usepackage{amssymb} \usepackage{etoolbox} \makeatletter \newcommand*{\programmerdiv}[2]{% \...
9 votes

latexmk -outdir with \include

Actually, this isn't a latexmk problem. If you look at the .log file or at the actual screen output, you'll see that it is pdflatex that had a problem. If you run pdflatex from the command line with ...
  • 9,969
9 votes

Latexmk says the file is up-to-date, while it's not

An option could be to add the -g flag when using latexmk: latexmk -pdf -g main.tex From the latexmkdocumentation for -g Force latexmk to process document fully, even under situations ...
  • 91

Only top scored, non community-wiki answers of a minimum length are eligible