python-sty icon indicating copy to clipboard operation
python-sty copied to clipboard

\newcommand does not get executed

Open jalonsomartinez opened this issue 11 years ago • 0 comments

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!

jalonsomartinez avatar May 30 '14 11:05 jalonsomartinez