GitHub Action to compile LaTeX documents.
It runs in the docker with a minimal TeXLive environment installed. Further, it uses texliveonfly
to find and install the missing packages.
-
root_file
The root LaTeX file to be compiled. This input is required.
-
working_directory
The working directory for
texliveonfly
to be invoked. -
compiler
The LaTeX engine to used by
texliveonfly
. 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
texliveonfly
. By default, it is-pdf -file-line-error -interaction=nonstopmode
. This tellslatexmk
to usepdflatex
. If you want to usexelatex
orlualatex
, you can set theargs
to-xelatex -file-line-error -interaction=nonstopmode
or-lualatex --file-line-error --interaction=nonstopmode
respectively. Alternatively, you could create a.latexmkrc
file. Refer to thelatexmk
document for more information. -
extra_packages
The extra packages to be installed by
tlmgr
separated by space. If this Github action fails to build the document, it is likely due totexliveonfly
failing to install the missing packages. In this case, you can pass them explicitly. For example,extra_packages: "cm-super biblatex-ieee"
will install packagescm-super
andbiblatex-ieee
. -
extra_system_packages
The extra packages to be installed by
apk
separated by space. For example,extra_system_packages: "py-pygments"
will install the packagepy-pygments
to be used by theminted
for code highlights.
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: xu-cheng/latex-action@master
with:
root_file: main.tex
MIT