|
6 months ago | |
---|---|---|
pytex | 1 year ago | |
tests | 1 year ago | |
.gitignore | 7 months ago | |
LICENSE | 3 years ago | |
README.md | 6 months ago | |
requirements.txt | 3 years ago | |
setup.py | 7 months ago |
Pytex is a simple package which make a bridge between Latex and Python.
pip install mypytex
texenv is a jinja2 environment which allow to use python commands inside latex.
Use the environment with a string template.
>>> from pytex import texenv
>>> text = "Hello"
>>> template = """\
\Var{text}
\Block{set a = 2}
%-set b = 3
\Var{a}
\Var{b}
"""
>>> template = texenv.from_string(template)
>>> print(template.render(text = text)
Hello
2
3