Git Product home page Git Product logo

latex2pdf-action's Introduction

LateX CV to PDF

latex2pdf-action

GitHub action to convert LaTeX document in PDF file with LuaTeX.

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")."
  • toc: boolean to add ToC or not. Default false. It will compile the document twice to generate the ToC with LuaTeX.

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: amsmath amsfonts lua-uni-algos
      - 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.

Development

Test locally

Build docker image:

docker build -t latex2pdf .

Run the example:

docker run \
  -e OUTPUT_DIR="output" \
  -e MAIN_LATEX_FILE="test.tex" \
  -e CTAN_PACKAGES="amssymb latexsym amsmath" \
  -v "${PWD}/resources/test.tex":"/test.tex" \
  -v "${PWD}/output":"/output" \
  latex2pdf

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.

latex2pdf-action's People

Contributors

thomas-chauvet avatar jbhv12 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.