| 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)}"))
| 2 | No.2 Revision |
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)}"))
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.