Thin wrapper for "TinyTeX" (MIT)
Project description
PyTinyTeX
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:
- 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
Contributors
- Jessica Tegner - Maintainer and original creator of PyTinyTeX
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8036696b96b481d3693229303097e2abcd456e33fa0f5fff9b82ce35f7fda50e
|
|
| MD5 |
cc445aad744ea20a4e1ec80b990791e3
|
|
| BLAKE2b-256 |
8a632e239149e4f3d536f6edc8e5cb0fdfa72b32cf044d67f1501cd4cb613195
|
Provenance
The following attestation bundles were made for pytinytex-0.4.0.tar.gz:
Publisher:
ci.yaml on JessicaTegner/PyTinyTeX
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytinytex-0.4.0.tar.gz -
Subject digest:
8036696b96b481d3693229303097e2abcd456e33fa0f5fff9b82ce35f7fda50e - Sigstore transparency entry: 173602478
- Sigstore integration time:
-
Permalink:
JessicaTegner/PyTinyTeX@0868f92a7370a24a0721f7147b7626e528e3716f -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/JessicaTegner
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yaml@0868f92a7370a24a0721f7147b7626e528e3716f -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
646f9fd7019618d6cd0e9e4b7524f7c4a04b0949a189e76c2e28c48861dc1d23
|
|
| MD5 |
16462307dbd9886b7adf81927693b6b2
|
|
| BLAKE2b-256 |
c4e504099979927cefa196582ff10dd70f06c0db7b81d05a76c8562176457e31
|
Provenance
The following attestation bundles were made for PyTinyTeX-0.4.0-py3-none-any.whl:
Publisher:
ci.yaml on JessicaTegner/PyTinyTeX
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytinytex-0.4.0-py3-none-any.whl -
Subject digest:
646f9fd7019618d6cd0e9e4b7524f7c4a04b0949a189e76c2e28c48861dc1d23 - Sigstore transparency entry: 173602479
- Sigstore integration time:
-
Permalink:
JessicaTegner/PyTinyTeX@0868f92a7370a24a0721f7147b7626e528e3716f -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/JessicaTegner
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yaml@0868f92a7370a24a0721f7147b7626e528e3716f -
Trigger Event:
push
-
Statement type: