latexmk

0th

Percentile

Compile a LaTeX document to PDF

The function latexmk() uses the system command latexmk to compile a LaTeX document to PDF; if latexmk is not available, use a simple emulation. The functions pdflatex(), xelatex(), and lualatex() are wrappers of latexmk(engine =, emulation = TRUE).

Usage
latexmk(file, engine = c("pdflatex", "xelatex", "lualatex"), bib_engine = c("bibtex", 
    "biber"), emulation = TRUE, times = 2, install_packages = emulation && 
    tlmgr_available())

pdflatex(...)

xelatex(...)

lualatex(...)

Arguments
file

A LaTeX file path.

engine

A LaTeX engine.

bib_engine

A bibliography engine.

emulation

Whether to use latexmk emulation (by default, TRUE if the command latexmk is not available). You can set the global option options(tinytex.latexmk.emulation = TRUE) to always use emulation.

times

The number of times to run the LaTeX engine when using emulation. You can set the global option tinytex.compile.times, e.g., options(tinytex.compile.times = 3).

install_packages

Whether to automatically install missing LaTeX packages found by find_packages() from the LaTeX log. This argument is only for the emulation mode and TeX Live.

...

Arguments to be passed to latexmk() (other than engine and emulation).

Details

The latexmk emulation works like this: run the LaTeX engine once (e.g., pdflatex), run makeindex to make the index if necessary (the *.idx file exists), run the bibliography engine bibtex or biber to make the bibliography if necessary (the *.aux or *.bcf file exists), and finally run the LaTeX engine a number of times (twice by default).

Aliases
  • latexmk
  • pdflatex
  • xelatex
  • lualatex
Documentation reproduced from package tinytex, version 0.0.2, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.