All Projects → dante-ev → latex-action

dante-ev / latex-action

Licence: MIT License
GitHub Action to compile LaTeX documents

Programming Languages

TeX
3793 projects
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to latex-action

travis-ci-latex-pdf
Overview of different methods to build LaTeX with GitHub Actions or Travis-CI (idea by @jackolney but completely rewritten by @PHPirates and contributors).
Stars: ✭ 113 (-8.13%)
Mutual labels:  latexmk, pdflatex, lualatex, github-actions
action-ssh
GitHub Action for executing SSH commands on remote servers
Stars: ✭ 60 (-51.22%)
Mutual labels:  github-actions, github-action, github-actions-docker
intellij-platform-plugin-verifier-action
GitHub Action for executing the intellij-plugin-verifier
Stars: ✭ 20 (-83.74%)
Mutual labels:  github-actions, github-action, github-actions-docker
assign-one-project-github-action
Automatically add an issue or pull request to specific GitHub Project(s) when you create and/or label them.
Stars: ✭ 140 (+13.82%)
Mutual labels:  github-actions, github-action, github-actions-docker
Github-Android-Action
Android Github Action that builds Android project, runs unit tests and generates debug APK, builds for Github Actions hackathon
Stars: ✭ 29 (-76.42%)
Mutual labels:  github-actions, github-action, github-actions-docker
Setup-Nuget
Set up your GitHub Actions workflow with the latest version of Nuget.exe CLI tool
Stars: ✭ 27 (-78.05%)
Mutual labels:  github-actions, github-action
ssh2actions
Connect to GitHub Actions VM via SSH for interactive debugging
Stars: ✭ 62 (-49.59%)
Mutual labels:  github-actions, github-action
github-env-vars-action
🚀 GitHub Action for Environment Variables
Stars: ✭ 129 (+4.88%)
Mutual labels:  github-actions, github-action
misspell-fixer-action
📝Automatically fixes typos and mistakes in your source code and docs!
Stars: ✭ 123 (+0%)
Mutual labels:  github-actions, github-action
laravel-phpinsights-action
Run PHP Insights in Laravel in Github Actions
Stars: ✭ 17 (-86.18%)
Mutual labels:  github-actions, github-action
redis-github-action
Use Redis in GitHub Actions
Stars: ✭ 56 (-54.47%)
Mutual labels:  github-actions, github-actions-docker
bump-everywhere
🚀 Automate versioning, changelog creation, README updates and GitHub releases using GitHub Actions,npm, docker or bash.
Stars: ✭ 24 (-80.49%)
Mutual labels:  github-actions, github-action
git-actions
A GitHub Action to run arbitrary git commands
Stars: ✭ 72 (-41.46%)
Mutual labels:  github-actions, github-action
pr-reviews-reminder-action
A GitHub Action to send Slack/Teams notification for Pull Request that are waiting for reviewers.
Stars: ✭ 18 (-85.37%)
Mutual labels:  github-actions, github-action
hugo-action
Commands to help with building Hugo based static sites
Stars: ✭ 65 (-47.15%)
Mutual labels:  github-actions, github-action
lazylatex
Because LaTeX shouldn't be boring! 🐠 LaTeX package inspired by sphinx-rtd-theme. Build with tcolorbox, minted, tikz, etc,.
Stars: ✭ 16 (-86.99%)
Mutual labels:  latex, pdflatex
gajira
GitHub Actions for Jira
Stars: ✭ 100 (-18.7%)
Mutual labels:  github-actions, github-action
markdown
📔 A package for converting and rendering markdown documents in TeX
Stars: ✭ 219 (+78.05%)
Mutual labels:  latex, lualatex
qodana-action
⚙️ Scan your Java, Kotlin, PHP, Python, JavaScript, TypeScript projects at GitHub with Qodana
Stars: ✭ 112 (-8.94%)
Mutual labels:  github-actions, github-action
github-deploy-actions
This action will auto deploy to target branch when it get triggered
Stars: ✭ 24 (-80.49%)
Mutual labels:  github-actions, github-action

latex-action GitHub Actions Status

GitHub Action to compile LaTeX documents.

This actions runs on docker using a maximal TeXLive environment installed.

Inputs

  • 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. latexmk 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 tells latexmk to use pdflatex. Refer to latexmk document for more information.

  • extra_system_packages

    The extra packages to be installed by apt-get separated by space.

Examples

Build main.tex using latexmk

Note that by default latexmk is used. latexmk automates the process of generating LaTeX documents by issuing the appropriate sequence of commands to be run.

name: Build LaTeX document
on: [push]
jobs:
  build_latex:
    runs-on: ubuntu-latest
    steps:
      - name: Set up Git repository
        uses: actions/checkout@v2
      - name: Compile LaTeX document
        uses: dante-ev/latex-action@latest
        with:
          root_file: main.tex

Build example-class-relations--svg.tex using lualatex

This is required if one does not trust latexmk and wants to build "by hand"

name: Build LaTeX document
on: [push]
jobs:
  build_latex:
    runs-on: ubuntu-latest
    steps:
      - name: Set up Git repository
        uses: actions/checkout@v2
      - name: example-class-relations--svg
        uses: dante-ev/latex-action@latest
        with:
          root_file: example-class-relations--svg.tex
          compiler: lualatex
          args: -interaction=nonstopmode -shell-escape

"Real" document

In a "real" document, one would have to encode all steps one after another:

name: Build LaTeX document
on: [push]
jobs:
  build_latex:
    runs-on: ubuntu-latest
    steps:
      - name: Set up Git repository
        uses: actions/checkout@v2
      - name: pdflatex main
        uses: dante-ev/latex-action@latest
        with:
          root_file: main.tex
          compiler: pdflatex
          args: -interaction=nonstopmode -shell-escape
      - name: bibtex main
        uses: dante-ev/latex-action@latest
        with:
          root_file: main.aux
          compiler: bibtex
          args: 
      - name: pdflatex main
        uses: dante-ev/latex-action@latest
        with:
          root_file: main.tex
          compiler: pdflatex
          args: -interaction=nonstopmode -shell-escape

Custom build script

When using a custom shell script for building, one can pass this as follows:

name: Build LaTeX document
on: [push]
jobs:
  build_latex:
    runs-on: ubuntu-latest
    steps:
      - name: Set up Git repository
        uses: actions/checkout@v2
      - name: release.sh
        uses: dante-ev/latex-action@latest
        with:
          entrypoint: ./release.sh

Real life example: https://github.com/koppor/plantuml/blob/main/.github/workflows/build-and-publish.yml

FAQs

How to use XeLaTeX or LuaLaTeX instead of pdfLaTeX?

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. Please mind that it is not recommend to change the compiler parameter, as the by default used latexmk has the advantage of determinating the (re)compilation steps automatically and executes them.

How to enable --shell-escape?

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.

Where does the initial code come from?

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.

How can I speedup the build?

You can try to use caching, though be careful as sometimes a LaTeX document needs to be rebuilt completly in order to have a proper result.

Here is an example that rebuilds uses the cache at most once a day. The files to cache are taken from the well-known GitHub .gitignore templates:

      # https://github.com/actions/cache#creating-a-cache-key
      # http://man7.org/linux/man-pages/man1/date.1.html
      - name: Get Date
        id: get-date
        run: |
          echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")"
        shell: bash

      - name: Cache
        uses: actions/[email protected]
        with:
          # A list of files, directories, and wildcard patterns to cache and restore
          path: |
            *.aux
            *.lof
            *.lot
            *.fls
            *.out
            *.toc
            *.fmt
            *.fot
            *.cb
            *.cb2
            .*.lb
            *.bbl
            *.bcf
            *.blg
            *-blx.aux
            *-blx.bib
            *.run.xml
          key: ${{ runner.os }}-${{ steps.get-date.outputs.date }}

Where to find my PDF?

Please use an appropriate GitHub action. One option is upload-artifact, which collects the build artifacts and stores them into a GitHub space. Another option is to use rsync via action-rsyncer.

Available versions

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].