Include python variable values in a LaTeX document
Project description
python-latex-bridge
Python package to include python variables in a LaTeX document.
Example
Some use cases given a file with
from bridge import save
from uncertainties import ufloat
from pint import UnitRegistry
ureg = UnitRegistry()
Q = ureg.Quantity
- Any python value:
x = 1024 save(x) # creates `variables/variable.dat` containing "1024"
- Uncertain value:
x = ufloat(3.1, 0.2) save(x, name='height') # creates `variables/height.dat` containing "3.10 \pm 0.20"
- Variable with unit
x = Q(42, 'mm') save(x, path='values') # creates `values/variable.dat` containing "42\,\si[]{\milli\meter}"
- Error and unit:
x = Q(ufloat(420, 7), 'ohm') save(x) # creates `variables/variable.dat` containing "(420 \pm 7)\,\si[]{\ohm}"
Usage in LaTeX
To fetch the value in a LaTeX document, simply include the .dat
file in math mode
$\include{variables/variable.dat}$
assuming the .tex
file and the variables/
folder share the same parent directory.
Project details
Release history Release notifications | RSS feed
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
Close
Hashes for python-latex-bridge-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c8cfaff9393a741b9a929847b1a1ccfcc3b85c63d8a8d6bda50568c923c0f4f |
|
MD5 | 154a57867e2923559cf0495ce2962b9f |
|
BLAKE2b-256 | 2bda042b8514578f0e17329868fabb222041ad110b2769c608e86b0f229b9356 |
Close
Hashes for python_latex_bridge-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e141ee7841d7901522a60ca2c3229c8ae8614a3c6402cdb20c48c5106b57478 |
|
MD5 | 651a51e162b64034803a409c13a1d7d1 |
|
BLAKE2b-256 | 53d1d2e153486c72075c855c5c7f1a477100e17640be32fa432a2da16c95158c |