JSON to LaTeX
json2latex is a library for converting a nested Python structure to a format
accessible in LaTeX.
Installation
JSON to LaTeX can be installed using pip by running pip install json2latex,
Usage
Full documentation of JSON to LaTeX is provided here. The basic usage is as follows.
The following Python code saves a file, `out.tex which includes the necessary LaTeX commands to access the data in LaTeX.
import json2latex
data = dict(a="test", b=[1, 2])
with open('out.tex', 'w') as f:
json2latex.dump('data', data, f)
The same result can be accomplished by running,
json2latex example.json data out.tex
where example.json is a JSON file containing the same data is the data` dictionary in the Python example.
The code output by JSON to LaTeX can be used as follows. First the file needs to be imported in LaTeX using \input{out.tex}. Then, the following commands can be used to access the data:
\datawill expand to the full JSON representation of the input,{"a": "test", "b": [1, 2]}.\data[a]will expand totest.\data[b]will expand to[1, 2].\data[b][0]will expand to1.\data[b][1]will expand to2.\data[b][2], and all other undefined values, will expand to??.
Metadata
Release files for json2latex 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| json2latex-0.0.3.tar.gz | 6.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| json2latex-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.5 kB
Release files / json2latex-0.0.3.tar.gz
| Download URL | json2latex-0.0.3.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c3adae82299bd23f36cf9daefa5a0d95303023581562b70c0d67d327e288feac
|
|
BLAKE2b-256 checksum How to use checksums |
e89ade1c5444b10a242eb1e8105bbef4286beb65c8df28235dbbc827683903d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / json2latex-0.0.3-py3-none-any.whl
| Download URL | json2latex-0.0.3-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f15f65bfbe40bb9b704e6192d7ba16c9562b40408644a9e586018ab7735048a0
|
|
BLAKE2b-256 checksum How to use checksums |
39d3d70bd5a5e3c889faa0aca7868fb4025a771a884104d7593ca0acaf55cda4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for json2latex 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.