LaTeXDatax.py
Import calculated values from a python script into a LaTeX document. This is a python interface for the datax LaTeX package [ctan].
Installation
pip install LaTeXDatax
Usage
In a python script:
from LaTeXDatax import datax
datax(
filename = "data.tex",
a = "Literal string",
b = 3.141592,
c = (3.141592,"\\meter"),
d = (3.141592,"\\meter","%.2g"),
e = (3.141592,"%.2g"),
)
In the LaTeX document:
\documentclass{article}
\usepackage{siunitx}
\usepackage{datax}
\begin{document}
The length was measured as \(d=\datax{d}\).
\end{document}
Pint integration
from pint import Quantity
from LaTeXDatax import datax
datax(filename = "data.tex", E = Quantity(24,"kg m / s^2"))
Works as you would hope, in large part because of how well pint implements siunitx strings. Hat off.
Looking for contributors
I don't know python very well. This package works, but if you have ideas for how to improve it, or you spot some python faux pas, feel free to make a PR or get in touch!
Metadata
Release files for LaTeXDatax 1.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 | |
|---|---|---|---|
| LaTeXDatax-1.3.tar.gz | 4.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| LaTeXDatax-1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.3 kB
Release files / LaTeXDatax-1.3.tar.gz
| Download URL | LaTeXDatax-1.3.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
30e8da781d069d3c6f5115a19e912f05d2570e0fb65f5f62685574906912f733
|
|
BLAKE2b-256 checksum How to use checksums |
7ef351c60fbd93e90e49053439f2a8668fbae7e7fdc81556f2482870db46499e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
|
Release files / LaTeXDatax-1.3-py3-none-any.whl
| Download URL | LaTeXDatax-1.3-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
629479ad27c6a3e02306b8fd7d4e1684695ce05122ebc222dce74246dc2042d9
|
|
BLAKE2b-256 checksum How to use checksums |
ea6783dfa6e37217a1e8cdcffd82c97f67e113de79236d1047078ffd5e87bb1b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
|