A simple function for automatically updating LaTeX documents with numbers from Python.
Project description
stattotex-python
A simple function for automatically updating LaTeX documents with numbers or strings from Python. No more manually copying your calculations over every time your code is re-run!
Inspired by the Stata package isapollnik/stattotex.
Installation
pip install stattotex
Usage
For examples, see the "demo.py" and "Demo Report.tex" and the overall demo folder. A summary is below:
In Python, import the function with
from stattotex.stattotex import stattotex
and use it with
stattotex(variable_name, variable_value, filename, clear_file)
where variable_name
is a name you want to assign to the variable in LaTeX (note that you may not include underscores), variable_value
is a number or string, filename
is a file path string to save the variable to, and clear_file
is an optional True/False flag to delete a pre-existing file.
Then, in your LaTex document, put
\input{<your filename>}
in the preamble and add your variable with
\<your variable_name>
You may find it helpful to insert \space
afterwards (\<your variable_name> \space
) to correct the spacing.
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
File details
Details for the file stattotex-0.1.2.tar.gz
.
File metadata
- Download URL: stattotex-0.1.2.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eed65bb4329c9026b89b6e97c9204038e714f3e612189ea88f00006bb9373dac |
|
MD5 | 401f91aef87e06afb754f29a4dddb7e8 |
|
BLAKE2b-256 | 1c125e7df2cdcc93ea9b5ef9fcf73ba17f5c6c7399d9a7361debed9a05ec78e2 |
File details
Details for the file stattotex-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: stattotex-0.1.2-py3-none-any.whl
- Upload date:
- Size: 15.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f651f7971679c521aaf5641f0cb3e098cf94ba87ebaa9307f1055979c445162 |
|
MD5 | b1b862d3d4e4790a3cb86a8e84610249 |
|
BLAKE2b-256 | 62377c0c0ffc219b2f6a817299076b93f335fd3a664e946e5f21b3751fb6235a |