It would be great if you could try out using https://www.sympy.org/sphinx-math-dollar/ instead of https://github.com/certik/theoretical-physics/blob/master/exts/math_dollar.py, and let me know if you have an issues with it. You'll have to inspect the math manually to make sure it doesn't do anything wrong, although you can also build with MATH_DOLLAR_DEBUG=1, which will print messages about any $'s that are skipped (e.g., because they are in a code block).
It would be great if you could try out using https://www.sympy.org/sphinx-math-dollar/ instead of https://github.com/certik/theoretical-physics/blob/master/exts/math_dollar.py, and let me know if you have an issues with it. You'll have to inspect the math manually to make sure it doesn't do anything wrong, although you can also build with
MATH_DOLLAR_DEBUG=1, which will print messages about any $'s that are skipped (e.g., because they are in a code block).