Hi, I'm trying to pprint() a variable that I call barphi. What I want to get is
$\bar{\phi}$
when printed as pprint(barphi).
I try
barphy = Symbol('\bar{phi}')
but it does not work. Any help? Thanks in advance.
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/d1da7393-dee0-4a17-a0b8-f9dc07379454%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Python converts \ + character in strings as escaping. The \b in your string becomes a backspace (see https://en.wikipedia.org/wiki/ASCII#ASCII_control_code_chart).You need to either escape the \, i.e., use '\\bar{\\phi}$', or, much easier, if you don't care about escaping, use a raw string, which just means to put an r in front of the quotes, like r'\bar{\phi}'.If you want to get LaTeX, pprint() will not do it. You should use init_printing() to enable latex printing.