I'm trying to use PythonTex (v 0.14), its pyconsole environment, and custom commands, and having some trouble. Here is an MWE:


\pythontexcustomc{py}{a=1; b=2} 


print a


The result is an error that a is undefined. How can I execute custom code for pyconsole? I've tried \pythontexcustomc{pyconsole}, \pythontexcustomc{py}, and \pythontexcustomc{console}.


You want \pythontexcustomc{pycon}{a=1; b=2}. pycon goes with the pyconsole environment, while py goes with the pycode environment. Everything console-related uses pycon somewhere in the name.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.