Decorate your functions to direct the output to a LaTeX file.
Project description
pytex-lib
pytex-lib is a Python library that simplifies inserting function outputs into LaTeX documents. The @write_to_latex decorator allows you to automatically write function results into a specified LaTeX file at a predefined keyword location. This is particularly useful for dynamically generating LaTeX reports, papers, or documents with computed values. Installation is straightforward via pip install pytex-lib, and integration requires minimal setup.
Example Usage
Import the library:
from pytex_lib import write_to_latex
Use the write_to_latex decorator to automatically output your function's result to a LaTeX file:
@write_to_latex
def f(x):
return x**2
Call the function with the file_path and keyword parameters:
file_path = "Path/to/latex/doc"
keyword = "keyword in latex doc"
f(file_path=file_path, keyword=keyword)
This will modify your LaTeX document as follows:
\documentclass{article}
\begin{document}
The answer is
% keyword in latex doc
(answer from f(x) = x^2)
\end{document}
Installation
pip install pytex-lib
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
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 pytex_lib-0.1.8.tar.gz.
File metadata
- Download URL: pytex_lib-0.1.8.tar.gz
- Upload date:
- Size: 1.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.1 CPython/3.10.12 Linux/5.15.0-131-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53cc619540dfa3f6d95b3964d71ac244d86be5712022b4e1bca91d1ee4bf7ab6
|
|
| MD5 |
f068ca15cfb3e5b357c1d48245f1fa8c
|
|
| BLAKE2b-256 |
2bbbcfb60b496751ac37ceea6e74c3ef0fd5be7935cc2f6cda4c74223a4e7ab7
|
File details
Details for the file pytex_lib-0.1.8-py3-none-any.whl.
File metadata
- Download URL: pytex_lib-0.1.8-py3-none-any.whl
- Upload date:
- Size: 2.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.1 CPython/3.10.12 Linux/5.15.0-131-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2690ab1e27db7603fa1efc464d74546a47bf0f7e2f332c66b4f4bbc2a21753bf
|
|
| MD5 |
af80a9ea3244f3445096161060eb9dae
|
|
| BLAKE2b-256 |
04e3acd76c2997e7d057c7e7671d6fe0de4bf85fec257ed9de6cf6d9abbd5672
|