PyTinyTeX provides a thin wrapper for TinyTeX, A lightweight, cross-platform, portable, and easy-to-maintain LaTeX distribution based on TeX Live.
Installation through the normal means
§§§ pip install pytinytex §§§
Each version of TinyTeX contains three variations:
- TinyTeX-0.* contains the infraonly scheme of TeX Live, without any LaTeX packages.
- TinyTeX-1.* contains about 90 LaTeX packages enough to compile common R Markdown documents (which was the original motivation of the TinyTeX project).
- TinyTeX-2-* contains more LaTeX packages requested by the community. The list of packages may grow as time goes by, and the size of this variation will grow correspondingly.
By default the variation PyTinyTeX will install is variation 1, but this can be changed.
§§§ import pytinytex
pytinytex.download_tinytex(variation=0) §§§
After installing TinyTeX, you can get the path to the installed distribution with the following:
§§§ import pytinytex
pytinytex.get_tinytex_path()
§§§
PyTinyTeX can be used with PyPandoc, a Python wrapper for Pandoc. PyPandoc can be used to convert documents between different formats, including LaTeX to PDF. To use PyTinyTeX with pypandoc, when working with latex or pdf documents, you need to give pypandoc the path the pdflatex (included with variation 1 and above), like the ofllowing:
§§§ import pytinytex import pypandoc
pytinytex.download_tinytex(variation=1)
pdflatex_path = pytinytex.get_pdf_latex_engine()
pypandoc.convert_file('input.md', 'pdf', outputfile='output.pdf', extra_args=['--pdf-engine', pdflatex_path]) §§§
- Write docs, since this looks to be a bigger wrapper than PyPandoc
- Wrap the tlmgr interface
- Wrap the PDFLatex engine
Contributions are welcome. When opening a PR, please keep the following guidelines in mind:
- Before implementing, please open an issue for discussion.
- Make sure you have tests for the new logic.
- Add yourself to contributors at README.md unless you are already there. In that case tweak your
- Jessica Tegner - Maintainer and original creator of PyTinyTeX
PyTinyTeX is available under MIT license. See LICENSE for more details. TinyTeX itself is available under the GPL-2 license.