
To include files as well as providing shortcuts for paths (e.g., \graphicspath), thereĪre definitely some rough edges left. Since the package is in its early development phase and LaTeX provides a myriad of ways The following configuration value is true which is also the default. Pytask-latex tries to scan your LaTeX document for included files with the help of latex ( script = f "document_ ", "-interaction=nonstopmode", "-synctex=1", "-cd" ) ), ) def task_compile_latex_document (): pass Configuration The following task compiles two latex documents. You can compile multiple LaTeX documents as well as compiling a single. Repeating tasks with different scripts or inputs In the future, pytask-latex will provide more compilation steps for compilingīibliographies, glossaries and the like.

You can also pass your custom compilation step with the same signature to theĬompilation_steps keyword argument of the decorator.Įach compilation step receives the path to the LaTeX source file and the path to theįinal document which it uses to call some program on the command line to run another With the following signature: from pathlib import Path import subprocess def custom_compilation_step ( path_to_tex : Path, path_to_document : Path ) -> None. Ĭompilation_step.latexmk(options) generates a compilation step which is a function latexmk ( options = ( "-dvi", "-interaction=nonstopmode", "-synctex=1", "-cd" ) ), ) def task_compile_latex_document (). latex ( script = "document.tex", document = "document.pdf", compilation_steps = cs.

You can pass different options to change the compilation process with latexmk. In this example, compilation_steps.latexmk is a compilation step constructor whichĪccepts a set of options and creates a compilation step function. latexmk ( options = ( "-pdf", "-interaction=nonstopmode", "-synctex=1", "-cd" ) ), ) def task_compile_latex_document (). from pytask_latex import compilation_steps as cs. Using strings will use the default configuration of thisĬompilation step. Which accepts which accepts strings or list of strings pointing to internally The decorator has a keyword argument called compilation_steps latex ( script = "document.tex", document = "document.pdf", compilation_steps = "latexmk", ) def task_compile_latex_document (). Pytask-latex uses latexmk by default to compile the document because it handles most Dependencies and Productsĭependencies and products can be added as with a normal pytask task using and decorators. Task module to the LaTeX file and the compiled document. Script and the document keywords provide absolute paths or paths relative to the Use to indicate that this task compiles a LaTeX document. latex ( script = "document.tex", document = "document.pdf" ) def task_compile_latex_document (): pass Popular LaTeX distributions, like TeX Live,Ĭompiling your PDF can be as simple as writing the following task.
COMPILE LATEX FILE AS PDF COMMAND LINE INSTALL
If an error is shown instead of a help page, you can install latexmk with one of the To test whether it is installed, type theįollowing on the command line $ latexmk -help You also need to have latexmk installed which determines the necessary number ofĮxplanation for what latexmk achieves). $ conda install -c conda-forge pytask-latex Install it with $ pip install pytask-latex

tex files which are necessary to compile the LaTeX document. Pytask-latex allows you to compile LaTeX documents with pytaskĪutomatically infer the dependencies of the LaTeX document such as images,īibliographies and other.
