{"id":13668040,"url":"https://github.com/dante-ev/latex-action","last_synced_at":"2025-04-26T18:31:02.745Z","repository":{"id":48276940,"uuid":"210929017","full_name":"dante-ev/latex-action","owner":"dante-ev","description":":octocat: GitHub Action to compile LaTeX documents","archived":false,"fork":true,"pushed_at":"2025-02-13T13:11:04.000Z","size":57,"stargazers_count":180,"open_issues_count":5,"forks_count":25,"subscribers_count":1,"default_branch":"edge","last_synced_at":"2025-03-27T22:44:16.524Z","etag":null,"topics":["github-action","github-actions","github-actions-docker","latex","latexmk","lualatex","pdflatex"],"latest_commit_sha":null,"homepage":"","language":"TeX","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"xu-cheng/latex-action","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dante-ev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-25T19:56:11.000Z","updated_at":"2025-03-22T00:07:48.000Z","dependencies_parsed_at":"2023-01-06T17:46:39.613Z","dependency_job_id":null,"html_url":"https://github.com/dante-ev/latex-action","commit_stats":{"total_commits":61,"total_committers":6,"mean_commits":"10.166666666666666","dds":0.5245901639344263,"last_synced_commit":"41d4afbc3619e44534ddbd4e2d9367dd5ea78968"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dante-ev%2Flatex-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dante-ev%2Flatex-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dante-ev%2Flatex-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dante-ev%2Flatex-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dante-ev","download_url":"https://codeload.github.com/dante-ev/latex-action/tar.gz/refs/heads/edge","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251035330,"owners_count":21526348,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-action","github-actions","github-actions-docker","latex","latexmk","lualatex","pdflatex"],"created_at":"2024-08-02T07:01:01.519Z","updated_at":"2025-04-26T18:30:59.452Z","avatar_url":"https://github.com/dante-ev.png","language":"TeX","funding_links":[],"categories":["TeX","Build Tools"],"sub_categories":["GitHub Actions"],"readme":"# latex-action [![GitHub Actions Status](https://github.com/dante-ev/latex-action/workflows/Test%20Github%20Action/badge.svg)](https://github.com/dante-ev/latex-action/actions)\n\n🚧 For a more lightweight solution, head to https://github.com/zauguin/install-texlive 🚧\n\nGitHub Action to compile LaTeX documents. This actions runs on docker using a [maximal TeXLive environment](https://hub.docker.com/r/danteev/texlive/) installed.\n\n## Inputs\n\n* `root_file`\n\n    The root LaTeX file to be compiled. This input is required.\n\n* `working_directory`\n\n    The working directory for the latex compiler to be invoked.\n\n* `compiler`\n\n    The LaTeX engine to be used. By default [`latexmk`](https://ctan.org/pkg/latexmk) is used. `latexmk` automates the process of generating LaTeX documents by issuing the appropriate sequence of commands to be run.\n\n* `args`\n\n    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](http://texdoc.net/texmf-dist/doc/support/latexmk/latexmk.pdf) for more information.\n\n* `extra_system_packages`\n\n    The extra packages to be installed by [`apt-get`](https://en.wikipedia.org/wiki/APT_(Package_Manager)) separated by space.\n\n* `extra_font_packages`\n\n    The extra fonts such as some chinese fonts, please package them as a ZIP format.\n    ```yaml\n    with:\n      extra_font_packages: fonts # means fonts.zip\n    ```\n\n## Examples\n\n### Build `main.tex` using `latexmk`\n\nNote that by default [`latexmk`](https://ctan.org/pkg/latexmk) is used.\n`latexmk` automates the process of generating LaTeX documents by issuing the appropriate sequence of commands to be run.\n\n```yaml\nname: Build LaTeX document\non: [push]\njobs:\n  build_latex:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Set up Git repository\n        uses: actions/checkout@v2\n      - name: Compile LaTeX document\n        uses: dante-ev/latex-action@latest\n        with:\n          root_file: main.tex\n```\n\n### Build `example-class-relations--svg.tex` using `lualatex`\n\nThis is required if one does not trust latexmk and wants to build \"by hand\"\n\n```yaml\nname: Build LaTeX document\non: [push]\njobs:\n  build_latex:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Set up Git repository\n        uses: actions/checkout@v2\n      - name: example-class-relations--svg\n        uses: dante-ev/latex-action@latest\n        with:\n          root_file: example-class-relations--svg.tex\n          compiler: lualatex\n          args: -interaction=nonstopmode -shell-escape\n```\n\n### \"Real\" document\n\nIn a \"real\" document, one would have to encode all steps one after another:\n\n```yaml\nname: Build LaTeX document\non: [push]\njobs:\n  build_latex:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Set up Git repository\n        uses: actions/checkout@v2\n      - name: pdflatex main\n        uses: dante-ev/latex-action@latest\n        with:\n          root_file: main.tex\n          compiler: pdflatex\n          args: -interaction=nonstopmode -shell-escape\n      - name: bibtex main\n        uses: dante-ev/latex-action@latest\n        with:\n          root_file: main.aux\n          compiler: bibtex\n          args: \n      - name: pdflatex main\n        uses: dante-ev/latex-action@latest\n        with:\n          root_file: main.tex\n          compiler: pdflatex\n          args: -interaction=nonstopmode -shell-escape\n```\n\n### Custom build script\n\nWhen using a custom shell script for building, one can pass this as follows:\n\n```yaml\nname: Build LaTeX document\non: [push]\njobs:\n  build_latex:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Set up Git repository\n        uses: actions/checkout@v2\n      - name: release.sh\n        uses: dante-ev/latex-action@latest\n        with:\n          entrypoint: ./release.sh\n```\n\nReal life example: \u003chttps://github.com/koppor/plantuml/blob/main/.github/workflows/build-and-publish.yml\u003e\n\n## FAQs\n\n### How to use XeLaTeX or LuaLaTeX instead of pdfLaTeX?\n\nBy 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](https://mg.readthedocs.io/latexmk.html) for more information.\nPlease 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.\n\n### How to enable `--shell-escape`?\n\nTo 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.\n\n### Where does the initial code come from?\n\nThe initial code is from [xu-cheng/latex-action](https://github.com/xu-cheng/latex-action).\nThe idea there is to initially provide all packages instead of using [texliveonfly](https://ctan.org/pkg/texliveonfly).\nUsing a full installation, this action also offers to use packages such as [pax](https://ctan.org/pkg/pax), which require other tooling such as perl.\nMore reasoning is given in [ADR-0002](https://github.com/dante-ev/docker-texlive/blob/master/docs/adr/0002-provide-all-packages.md#provide-all-packages).\n\n### How can I speedup the build?\n\nYou can try to use [caching](https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows), though be careful as sometimes a LaTeX document needs to be rebuilt completly in order to have a proper result.\n\nHere 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/github/gitignore/blob/master/TeX.gitignore):\n\n```yaml\n      # https://github.com/actions/cache#creating-a-cache-key\n      # http://man7.org/linux/man-pages/man1/date.1.html\n      - name: Get Date\n        id: get-date\n        run: |\n          echo \"::set-output name=date::$(/bin/date -u \"+%Y%m%d\")\"\n        shell: bash\n\n      - name: Cache\n        uses: actions/cache@v2.1.3\n        with:\n          # A list of files, directories, and wildcard patterns to cache and restore\n          path: |\n            *.aux\n            *.lof\n            *.lot\n            *.fls\n            *.out\n            *.toc\n            *.fmt\n            *.fot\n            *.cb\n            *.cb2\n            .*.lb\n            *.bbl\n            *.bcf\n            *.blg\n            *-blx.aux\n            *-blx.bib\n            *.run.xml\n          key: ${{ runner.os }}-${{ steps.get-date.outputs.date }}\n```\n\n## Where to find my PDF?\n\nPlease use an appropriate GitHub action.\nOne option is [upload-artifact](https://github.com/actions/upload-artifact), which collects the build artifacts and stores them into a GitHub space.\nAnother option is to use rsync via [action-rsyncer](https://github.com/Pendect/action-rsyncer).\n\n## Available versions\n\n* `@latest` points to the latest release of [DANTE e.V.'s docker-texlive](https://github.com/dante-ev/docker-texlive)\n* `@edge` is the latest development version of [DANTE e.V.'s docker-texlive](https://github.com/dante-ev/docker-texlive)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdante-ev%2Flatex-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdante-ev%2Flatex-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdante-ev%2Flatex-action/lists"}