I believe you can set str_printer=latex.

Aaron Meurer

On Sunday, July 24, 2016, singlets <[email protected]> wrote:

> (Probably a newbie question here, but not finding it in ggroup or docs)
>
> Can I convince init_printing() to give the mathjax/latex representation of
> an expression in an IPython terminal session without using latex(expr)?
>
> For example (Anaconda/python3, linux, sympy 1.0 in an xterm or emacs
> console):
>
> from sympy import *
> init_printing(use_latex='mathjax')
> var('x')
> expr = x**2
> expr
>
> desired output:
> x^{2}
>
> I have tried various options to init_printing() like use_latex=True,
> use_latex='mathjax', 'matplotlib', etc., but sympy falls back to simple
> forms (str, pretty-printers) unless in a qtconsole or notebook. I must be
> misunderstanding how init_printing() works (or maybe there's another
> approach I should be using?).
>
> Motivation: I'm using org mode and it's support for mathjax/latex to
> generate content that can be migrated directly into Jupyter notebooks. I'm
> hoping to avoid translating latex(expr) into expr everywhere.
>
> Thanks,
> Steve
>
> --
> 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]
> <javascript:_e(%7B%7D,'cvml','sympy%[email protected]');>.
> To post to this group, send email to [email protected]
> <javascript:_e(%7B%7D,'cvml','[email protected]');>.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/9f4b3633-77b2-41b7-826b-64c09355be70%40googlegroups.com
> <https://groups.google.com/d/msgid/sympy/9f4b3633-77b2-41b7-826b-64c09355be70%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 https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAKgW%3D6%2B4FZd0-s-OLM2wE2zn0rEvDKz0AzCxmbYQ898JJo9-4Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to