GitHub Action to compile LaTeX documents.
This actions runs on docker using a maximal TeXLive environment installed.
-
root_fileThe root LaTeX file to be compiled. This input is required.
-
working_directoryThe working directory for the latex compiler to be invoked.
-
compilerThe LaTeX engine to be used. By default,
latexmkis used, which automates the process of generating LaTeX documents by issuing the appropriate sequence of commands to be run. -
argsThe extra arguments to be passed to the compiler. By default, it is
-pdf -latexoption=-file-line-error -latexoption=-interaction=nonstopmode. This tellslatexmkto usepdflatex. Refer tolatexmkdocument for more information. -
extra_system_packagesThe extra packages to be installed by
apt-getseparated 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.texBy 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