GithubHelp home page GithubHelp logo

wagberg / latex-action Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xu-cheng/latex-action

0.0 0.0 0.0 45 KB

:octocat: GitHub Action to compile LaTeX documents

Home Page: https://github.com/xu-cheng/latex-action

License: MIT License

Dockerfile 4.71% Shell 37.39% TeX 42.92% PostScript 14.98%

latex-action's Introduction

latex-action

GitHub Actions Status

GitHub Action to compile LaTeX documents.

It runs in a docker image with a full 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 engine.

  • compiler

    The LaTeX engine to be invoked. 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 LaTeX engine. By default, it is -pdf -file-line-error -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 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

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 -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.

How to enable --shell-escape?

To enable --shell-escape, you should add it to args. For example, set args to -pdf -file-line-error -interaction=nonstopmode -shell-escape when using pdfLaTeX.

Where is the PDF file? How to upload it?

The PDF file will be in the same folder as that of the LaTeX source in the CI environment. It is up to you on whether to upload it to some places. Here are some example.

  • You can use @actions/upload-artifact to upload PDF file to the workflow tab.
  • You can use @actions/upload-release-asset to upload PDF file to the Github Release.
  • You can use normal shell tools such as scp/git/rsync to upload PDF file anywhere. For example, you can git push to the gh-pages branch in your repo, so you can view the document using Github Pages.

It fails to build the document, how to solve it?

  • Try to solve the problem by examining the build log.
  • Try to build the document locally.
  • You can also try to narrow the problem by creating a minimal working example to reproduce the problem.
  • Open an issue if you need help.

License

MIT

latex-action's People

Contributors

jeff-tian avatar wagberg avatar xu-cheng 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.