Skip to main content

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!

image

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


Download files

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

Source Distribution

stattotex-0.1.3.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

stattotex-0.1.3-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file stattotex-0.1.3.tar.gz.

File metadata

  • Download URL: stattotex-0.1.3.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for stattotex-0.1.3.tar.gz
Algorithm Hash digest
SHA256 088f6313ebbf938e14f9745befe1435c1f71e5ec49a69b76eaffcb3f23dbd0f7
MD5 b0887292de4e928c06436ddea568271b
BLAKE2b-256 48973f754e58e3d5f3b604dd9e4f4a708f6ea35643718b63849f081daf411ccd

See more details on using hashes here.

File details

Details for the file stattotex-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: stattotex-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for stattotex-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 541f712f1369a9616c68a6f964ff4af9d85432070d7c44b54fb58896d82bdd5c
MD5 71a56ca4d2ec5e1861a0a4ef7a1d5b8e
BLAKE2b-256 a0ee03b63df4949e0116766c60b5d428fc5731ecf6a1674a9de0bd9c1bda47f2

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