Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytex_lib-0.1.8.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytex_lib-0.1.8-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

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

Hashes for pytex_lib-0.1.8.tar.gz
Algorithm Hash digest
SHA256 53cc619540dfa3f6d95b3964d71ac244d86be5712022b4e1bca91d1ee4bf7ab6
MD5 f068ca15cfb3e5b357c1d48245f1fa8c
BLAKE2b-256 2bbbcfb60b496751ac37ceea6e74c3ef0fd5be7935cc2f6cda4c74223a4e7ab7

See more details on using hashes here.

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

Hashes for pytex_lib-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 2690ab1e27db7603fa1efc464d74546a47bf0f7e2f332c66b4f4bbc2a21753bf
MD5 af80a9ea3244f3445096161060eb9dae
BLAKE2b-256 04e3acd76c2997e7d057c7e7671d6fe0de4bf85fec257ed9de6cf6d9abbd5672

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page