If you want to run arbitrary commands in a TeXLive environment, use texlive-action instead.
Inputs
Each input is provided as a key inside the with section of the action.
root_file
The root LaTeX file to be compiled. This input is required. You can also pass multiple files as a multi-line string to compile multiple documents. For example:
Change directory into each root file's directory before compiling each documents. This will be helpful if you want to build multiple documents and have the compiler work in each of the corresponding directories.
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 -halt-on-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: "inkscape" will install the package inkscape to allow using SVG images in your LaTeX document.
extra_fonts
Install extra .ttf/.otf fonts to be used by fontspec. You can also pass multiple files as a multi-line string. Each file path will be interpreted as glob pattern. For example:
Arbitrary bash codes to be executed before compiling LaTeX documents. For example, pre_compile: "tlmgr update --self && tlmgr update --all" to update all TeXLive packages.
post_compile
Arbitrary bash codes to be executed after compiling LaTeX documents. For example, post_compile: "latexmk -c" to clean up temporary files.
The following inputs are only valid if the input compiler is not changed.
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 latexmk_use_xelatex or latexmk_use_lualatex input respectively. For example:
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 a zip containing the PDF file to the workflow tab. For example you can add
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.
How to add additional paths to the LaTeX input search path?
Sometimes you may have custom package (.sty) or class (.cls) files in other directories. If you want to add these directories to the LaTeX input search path, you can add them in TEXINPUTS environment variable. For example:
Noted that you should NOT use {{ github.workspace }} or $GITHUB_WORKSPACE in TEXINPUTS. This action works in a separated docker container, where the workspace directory is mounted into it. Therefore, the workspace directory inside the docker container is different from github.workspace.
请发表评论