28
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 ...
27
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 ...
26
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 ...
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
...
20
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-...
19
votes
Accepted
What is the meaning of option "t" in documentclass beamer?
Copy/pasting from the beamer manual:
Community wiki
18
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 ...
17
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. ...
15
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 '$...
15
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{...
14
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;
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 ...
14
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) ...
12
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 ...
11
votes
How to make Latexmk use makeglossaries?
The current version of the glossary/glossaries sample latexmkrc file on CTAN http://mirrors.ctan.org/support/latexmk/example_rcfiles/glossaries_latexmkrc contains
# This shows how to use the ...
11
votes
How to have latexmk always use -shell-escape?
To enable shell-escape for all *latex commands using a latexmkrc file:
set_tex_cmds( '--shell-escape %O %S' );
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-...
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 ...
10
votes
Accepted
Generating PDF from xelatex
The approaches are identical because xetex calls xdvipdfmx unless you specify -no-pdf.
xetex is not like pdftex or luatex that have a modified back end that generates pdf, it always generates (...
10
votes
Accepted
comparing tex4ht, lwarp and latexml on same document?
A substantial lwarp example is here: this is a 65 page set of lecture notes for a course I teach. It includes tikz graphics, cleveref references and a lot of maths. I had to supply some js and css ...
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 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
...
9
votes
What is makefile and when do I need to use it along with latexmk?
I would like to know what makefile is
The command make most often refers to GNU make or BSD make.
Each variant has its merits;
the differences are for advanced uses not discussed here.
Regardless of ...
9
votes
Accepted
Passing options to biber through latexmk
In ~/.latexmkrc, add $biber='biber --validate-datamodel %O %S' (or whatever options you like)
9
votes
Accepted
Is there a possibility to change compiler engine depending on presence of a package
I'm on windows too. My editor, Winedt, has macro capabilities and it would be easy to write a macro to start the compilation which does want you ask for.
It is also not every difficult to devise ...
9
votes
Accepted
Compiling using latexmk from a different directory?
As was already mentioned in a comment, the -cd option to latexmk does exactly what you request
latexmk -pdf -cd subfolder/subfolder/main.tex
9
votes
Accepted
Emacs/AUCTeX/LaTeXmk: Default compilation command only on first run?
Short answer: AUCTeX doesn't play very well with latexmk, by default.
Long answer: AUCTeX has its own system to decide what command to run next, when building a document. This is based on reading ...
9
votes
Vimtex: how to display error messages?
The best way is to use \le, and here is a full list of command of vimtex (from the official document)
---------------------------------------------------------------------~
LHS RHS ...
8
votes
Make latexmk ignore errors and finish compiling
Another simpler solution is:
latexmk -pvc -pdf foo.tex < /dev/null
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
latexmk × 604pdftex × 65
compiling × 52
xetex × 48
luatex × 41
texlive × 28
miktex × 24
biber × 23
bibtex × 22
errors × 21
glossaries × 21
auxiliary-files × 17
makefile × 17
biblatex × 16
overleaf × 15
automation × 14
compilation-error × 14
emacs × 13
vim × 13
tikz-pgf × 12
windows × 11
shell-escape × 11
texworks × 10
sublime-text × 10
pdf × 9