# PyTinyTeX

[](https://pypi.python.org/pypi/PyTinyTeX/)
[](https://pypi.python.org/pypi/PyTinyTeX/)
[](https://pypi.python.org/pypi/PyTinyTeX/)

PyTinyTeX provides a thin wrapper for [TinyTeX](https://yihui.org/tinytex), A lightweight, cross-platform, portable, and easy-to-maintain LaTeX distribution based on TeX Live.
### Installation
Installation through the normal means
§§§
pip install pytinytex
§§§
### Installing a version of TinyTeX
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)
§§§
### Getting the TinyTeX path
After installing TinyTeX, you can get the path to the installed distribution with the following:
§§§
import pytinytex
pytinytex.get_tinytex_path()
# /home/jessica/.pytinytex/
# c:\Users\Jessica\.pytinytex\
§§§
### Integrating with pypandoc
PyTinyTeX can be used with [PyPandoc](https://pypi.org/project/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
# make sure that pytinytex is installed
pytinytex.download_tinytex(variation=1)
# get the path to the pdflatex executable
pdflatex_path = pytinytex.get_pdf_latex_engine()
# convert a markdown file to a pdf
pypandoc.convert_file('input.md', 'pdf', outputfile='output.pdf', extra_args=['--pdf-engine', pdflatex_path])
§§§
### TODO
* Write docs, since this looks to be a bigger wrapper than PyPandoc
* Wrap the tlmgr interface
* Wrap the PDFLatex engine
### Contributing
Contributions are welcome. When opening a PR, please keep the following guidelines in mind:
1. Before implementing, please open an issue for discussion.
2. Make sure you have tests for the new logic.
3. Add yourself to contributors at README.md unless you are already there. In that case tweak your
### Contributors
* [Jessica Tegner](https://github.com/JessicaTegner) - Maintainer and original creator of PyTinyTeX
### License
PyTinyTeX is available under MIT license. See [LICENSE](https://raw.githubusercontent.com/JessicaTegner/PyTinyTeX/master/LICENSE) for more details. TinyTeX itself is available under the GPL-2 license.
Raw data
{
"_id": null,
"home_page": null,
"name": "PyTinyTeX",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "TinyTeX, LaTeX, TeX, PDF, wrapper, Python, pypandoc, pandoc",
"author": null,
"author_email": "JessicaTegner <jessica@jessicategner.com>",
"download_url": "https://files.pythonhosted.org/packages/8a/63/2e239149e4f3d536f6edc8e5cb0fdfa72b32cf044d67f1501cd4cb613195/pytinytex-0.4.0.tar.gz",
"platform": null,
"description": "# PyTinyTeX\n\n\n[](https://pypi.python.org/pypi/PyTinyTeX/)\n[](https://pypi.python.org/pypi/PyTinyTeX/)\n[](https://pypi.python.org/pypi/PyTinyTeX/)\n\n\nPyTinyTeX provides a thin wrapper for [TinyTeX](https://yihui.org/tinytex), A lightweight, cross-platform, portable, and easy-to-maintain LaTeX distribution based on TeX Live.\n\n### Installation\n\nInstallation through the normal means\n\n\u00a7\u00a7\u00a7\npip install pytinytex\n\u00a7\u00a7\u00a7\n\n### Installing a version of TinyTeX\n\nEach version of TinyTeX contains three variations:\n* TinyTeX-0.* contains the infraonly scheme of TeX Live, without any LaTeX packages.\n* TinyTeX-1.* contains about 90 LaTeX packages enough to compile common R Markdown documents (which was the original motivation of the TinyTeX project).\n* 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.\n\n\nBy default the variation PyTinyTeX will install is variation 1, but this can be changed.\n\n\u00a7\u00a7\u00a7\nimport pytinytex\n\npytinytex.download_tinytex(variation=0)\n\u00a7\u00a7\u00a7\n\n\n### Getting the TinyTeX path\n\nAfter installing TinyTeX, you can get the path to the installed distribution with the following:\n\n\u00a7\u00a7\u00a7\nimport pytinytex\n\npytinytex.get_tinytex_path()\n# /home/jessica/.pytinytex/\n# c:\\Users\\Jessica\\.pytinytex\\\n\u00a7\u00a7\u00a7\n\n### Integrating with pypandoc\n\nPyTinyTeX can be used with [PyPandoc](https://pypi.org/project/pypandoc/), a Python wrapper for Pandoc. PyPandoc can be used to convert documents between different formats, including LaTeX to PDF.\nTo 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:\n\n\u00a7\u00a7\u00a7\nimport pytinytex\nimport pypandoc\n\n# make sure that pytinytex is installed\npytinytex.download_tinytex(variation=1)\n\n# get the path to the pdflatex executable\npdflatex_path = pytinytex.get_pdf_latex_engine()\n\n# convert a markdown file to a pdf\npypandoc.convert_file('input.md', 'pdf', outputfile='output.pdf', extra_args=['--pdf-engine', pdflatex_path])\n\u00a7\u00a7\u00a7\n\n\n### TODO\n\n* Write docs, since this looks to be a bigger wrapper than PyPandoc\n* Wrap the tlmgr interface\n* Wrap the PDFLatex engine\n\n\n### Contributing\n\nContributions are welcome. When opening a PR, please keep the following guidelines in mind:\n\n1. Before implementing, please open an issue for discussion.\n2. Make sure you have tests for the new logic.\n3. Add yourself to contributors at README.md unless you are already there. In that case tweak your \n\n\n### Contributors\n\n* [Jessica Tegner](https://github.com/JessicaTegner) - Maintainer and original creator of PyTinyTeX\n\n### License\n\nPyTinyTeX is available under MIT license. See [LICENSE](https://raw.githubusercontent.com/JessicaTegner/PyTinyTeX/master/LICENSE) for more details. TinyTeX itself is available under the GPL-2 license.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Thin wrapper for \"TinyTeX\" (MIT)",
"version": "0.4.0",
"project_urls": null,
"split_keywords": [
"tinytex",
" latex",
" tex",
" pdf",
" wrapper",
" python",
" pypandoc",
" pandoc"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "c4e504099979927cefa196582ff10dd70f06c0db7b81d05a76c8562176457e31",
"md5": "16462307dbd9886b7adf81927693b6b2",
"sha256": "646f9fd7019618d6cd0e9e4b7524f7c4a04b0949a189e76c2e28c48861dc1d23"
},
"downloads": -1,
"filename": "PyTinyTeX-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "16462307dbd9886b7adf81927693b6b2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 7553,
"upload_time": "2025-02-23T15:02:32",
"upload_time_iso_8601": "2025-02-23T15:02:32.355216Z",
"url": "https://files.pythonhosted.org/packages/c4/e5/04099979927cefa196582ff10dd70f06c0db7b81d05a76c8562176457e31/PyTinyTeX-0.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "8a632e239149e4f3d536f6edc8e5cb0fdfa72b32cf044d67f1501cd4cb613195",
"md5": "cc445aad744ea20a4e1ec80b990791e3",
"sha256": "8036696b96b481d3693229303097e2abcd456e33fa0f5fff9b82ce35f7fda50e"
},
"downloads": -1,
"filename": "pytinytex-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "cc445aad744ea20a4e1ec80b990791e3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 7779,
"upload_time": "2025-02-23T15:02:33",
"upload_time_iso_8601": "2025-02-23T15:02:33.479491Z",
"url": "https://files.pythonhosted.org/packages/8a/63/2e239149e4f3d536f6edc8e5cb0fdfa72b32cf044d67f1501cd4cb613195/pytinytex-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-23 15:02:33",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pytinytex"
}