Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
check-circle

GitHub Action

latex2pdf

1.0.2

latex2pdf

check-circle

latex2pdf

Convert LaTeX file into PDF file

Installation

Copy and paste the following snippet into your .yml file.

              

- name: latex2pdf

uses: thomas-chauvet/[email protected]

Learn more about this action in thomas-chauvet/latex2pdf-action

Choose a version

LateX CV to PDF

latex2pdf-action

GitHub action to convert LaTeX document in PDF file

Parameters

  • output_dir: use it to get the PDF file at a specific location at the end of the compilation.
  • main_latex_file: main latex file to convert (ex: main.tex).
  • ctan_packages: Extra package from CTAN to install. List of packages available here. Each package must be separated by a space (ex: "moderncv xargs")."

Use it in your pipeline

You can refer to the example attached in this repository.

In the example below we compile the document in PDF and upload as an artefact of the pipeline:

name: LateX to PDF

on:
  push:
    branches: 
      - master
      - develop
    tags:
       - '*'
  pull_request:
    branches: [ master ]

jobs:
  build_latex:
    runs-on: ubuntu-latest
    steps:
      - name: Set up Git repository
        uses: actions/checkout@v2
      - name: latex2pdf
        id: compile-latex-document
        uses: thomas-chauvet/[email protected]
        with:
          output_dir: output
          main_latex_file: test.tex
          ctan_packages: amssymb latexsym amsmath
      - name: Upload PDF to the workflow tab
        id: upload-workflow-tab
        uses: actions/upload-artifact@v2
        with:
          name: output
          path: output/test.pdf

You can find a more complete example in my CV repository with everything to release the PDF document.

Notes

The Docker images used to compile the document is based on Ubuntu and the excellent work of @Yihui for TinyTeX. It allows the image to stay relatively small and use only what is needed.