python-sty
python-sty copied to clipboard
\newcommand does not get executed
Any idea on why this code throws an error? The command does not get defined.
\documentclass{article}
\usepackage{python}
\begin{document}
\begin{python}
print r'\newcommand{\pya}{hi}'
\end{python}
\pya
\end{document}
I expected LaTex to run all the output from python. What are the limitations?
I was trying to get some variable values out of python code block results that I can use later in my latex file. This allows re-using values and allows clearer latex code compared to having python creating latex code.
Thank you!