Skip to main content

Thin wrapper for "TinyTeX" (MIT)

Project description

PyTinyTeX

Build Status PyPI version Development Status Python version License

PyTinyTeX provides a thin wrapper for 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, 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

License

PyTinyTeX is available under MIT license. See LICENSE for more details. TinyTeX itself is available under the GPL-2 license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytinytex-0.4.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PyTinyTeX-0.4.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file pytinytex-0.4.0.tar.gz.

File metadata

  • Download URL: pytinytex-0.4.0.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pytinytex-0.4.0.tar.gz
Algorithm Hash digest
SHA256 8036696b96b481d3693229303097e2abcd456e33fa0f5fff9b82ce35f7fda50e
MD5 cc445aad744ea20a4e1ec80b990791e3
BLAKE2b-256 8a632e239149e4f3d536f6edc8e5cb0fdfa72b32cf044d67f1501cd4cb613195

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytinytex-0.4.0.tar.gz:

Publisher: ci.yaml on JessicaTegner/PyTinyTeX

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file PyTinyTeX-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: PyTinyTeX-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for PyTinyTeX-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 646f9fd7019618d6cd0e9e4b7524f7c4a04b0949a189e76c2e28c48861dc1d23
MD5 16462307dbd9886b7adf81927693b6b2
BLAKE2b-256 c4e504099979927cefa196582ff10dd70f06c0db7b81d05a76c8562176457e31

See more details on using hashes here.

Provenance

The following attestation bundles were made for PyTinyTeX-0.4.0-py3-none-any.whl:

Publisher: ci.yaml on JessicaTegner/PyTinyTeX

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page