GitHub Action to compile LaTeX documents.
This actions runs on docker using a maximal TeXLive environment installed.
-
root_file
The root LaTeX file to be compiled. This input is required.
-
working_directory
The working directory for the latex compiler to be invoked.
-
compiler
The LaTeX engine to be used. By default,
latexmk
is used, which automates the process of generating LaTeX documents by issuing the appropriate sequence of commands to be run. -
args
The extra arguments to be passed to the compiler. By default, it is
-pdf -latexoption=-file-line-error -latexoption=-interaction=nonstopmode
. This tellslatexmk
to usepdflatex
. Refer tolatexmk
document for more information. -
extra_system_packages
The extra packages to be installed by
apt-get
separated by space.
name: Build LaTeX document
on: [push]
jobs:
build_latex:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v1
- name: Compile LaTeX document
uses: dante-ev/latex-action@master
with:
root_file: main.tex
By default, this action uses pdfLaTeX. If you want to use XeLaTeX or LuaLaTeX, you can set the args
to -xelatex -latexoption=-file-line-error -latexoption=-interaction=nonstopmode
or -lualatex -latexoption=-file-line-error -latexoption=-interaction=nonstopmode
respectively. Alternatively, you could create a .latexmkrc
file. Refer to the latexmk
document for more information.
To enable --shell-escape
, you should add it to args
. For example, set args
to -pdf -latexoption=-file-line-error -latexoption=-interaction=nonstopmode -latexoption=-shell-escape
when using pdfLaTeX.
The initial code is from xu-cheng/latex-action. The idea there is to initially provide all packages instead of using texliveonfly. Using a full installation, this action also offers to use packages such as pax, which require other tooling such as perl. More reasoning is given in ADR-0002.
MIT