Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Yes, that's normal: the backslash character in a string is interpreted as an escape character for special commands; for instance \f stands for an ASCII formfeed. To avoid this and restore the standard LaTeX interpretation one has to type a double backslash, as you did. An alternative is to prefix the string with r (for "raw" string):

show(LatexExpr(r"\frac{x}{\cos(x)}"))

Yes, that's normal: the backslash character in a string is interpreted as an escape character for special commands; for instance \f in \frac stands for an ASCII formfeed. To avoid this and restore the standard LaTeX interpretation one has to type a double backslash, as you did. An alternative is to prefix the string with r (for "raw" string):

show(LatexExpr(r"\frac{x}{\cos(x)}"))