Open williamstein opened 4 years ago
Here is an example pythontex file:
\documentclass[11pt]{article}
\usepackage{pythontex}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{pyconsole}
x = 987.27
x = x**2
\end{pyconsole}
The variable is $x=\pycon{x}$
\end{document}
Wow this is a huge bug and is still a problem today!
A possibly better fix would be to remove the python code, format, and put the code back.
Also https://github.com/siefkenj/unified-latex might do a better job (NOPE -- the demo there is way worse: https://siefkenj.github.io/latex-parser-playground/)
Why -- formatting results in indentation of the code blocks, which is a syntax error in Python!