Skip to content

\newcommand does not get executed #3

@jalonsomartinez

Description

@jalonsomartinez

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions