Skip to content

:octocat: GitHub Action to compile LaTeX documents

License

Notifications You must be signed in to change notification settings

whiter462/latex-action

 
 

Repository files navigation

latex-action

GitHub Actions Status

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.

Inputs

  • 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 tells latexmk to use pdflatex. If you want to use xelatex or lualatex, you can set the args to -xelatex -file-line-error -interaction=nonstopmode or -lualatex --file-line-error --interaction=nonstopmode respectively. Alternatively, you could create a .latexmkrc file. Refer to the latexmk 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 to texliveonfly failing to install the missing packages. In this case, you can pass them explicitly. For example, extra_packages: "cm-super biblatex-ieee" will install packages cm-super and biblatex-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 package py-pygments to be used by the minted for code highlights.

Example

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

License

MIT

About

:octocat: GitHub Action to compile LaTeX documents

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 60.6%
  • TeX 25.8%
  • Dockerfile 13.6%