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.
Aaron Meurer
On Thu, Apr 3, 2014 at 9:37 AM, Macias <[email protected]> wrote:
> 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 [email protected].
> To post to this group, send email to [email protected].
> 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<https://groups.google.com/d/msgid/sympy/d1da7393-dee0-4a17-a0b8-f9dc07379454%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
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 [email protected].
To post to this group, send email to [email protected].
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/CAKgW%3D6%2Bv%3DGO-GS5LQz%2B%3D6iFr_HgJ7TaBKEtrkODwbF%2Bi0ffv-Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.