pythontex
pythontex copied to clipboard
`align*` prevents following `\py` from using correct value
\documentclass{article}
\usepackage{amsmath,amsfonts}
\usepackage[keeptemps]{pythontex}
\usepackage{siunitx}
\begin{document}
\begin{pycode}
(m, a ) = (14, 3)
F = m*a
num=1
unit='cm'
\end{pycode}
\begin{align*}
ma =& F&\\
a =& \dfrac{F}{a}
= \dfrac{\py{F}}{\py{a}}
= \py{a}
= {\py{a}} \ \si{m/s^2}
= \SI[parse-numbers=false]{\py{a}}{m/s^2}
\end{align*}
\py{r'\SI{%s}{%s}' % (num, unit)}
\end{document}
After further testing, it appears that the actual issue is due to a combination of align*
with \SI[parse-numbers=false]
. Using \py
outside \SI
is fine.