Status: New
Owner: ----
Labels: Type-Defect Priority-Medium Printing

New issue 3871 by boyfarr...@gmail.com: sympy.printing.latex returns incorrect latex code for symbol with symbolic superscript and subscript
http://code.google.com/p/sympy/issues/detail?id=3871

If we make a simple equation with symbolic variables defined with names including superscripts and subscripts,

a,b = symbols("a_{j}^{+},b_{j}^{-}")
f = 1 / (a + b)**2

Calling latex(f) returns correct the correct latex (which compiles fine),

latex(f)
'\\left(a^{{+}}_{{j}} + b^{{-}}_{{j}}\\right)^{-2}'

However, if a substitution is made,

f = f.subs({b:0})

The returned latex code then fails,

latex(f)
a^{{+}}_{{j}}^{-2}

This latex is incorrect, a bracket is need before the squared term e.g.
(a^{{+}}_{{j}})^{-2}

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy-issues+unsubscr...@googlegroups.com.
To post to this group, send email to sympy-issues@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy-issues?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to