use_latex=False in online documentation?

59 views
Skip to first unread message

Ricardo Mayer

unread,
Aug 20, 2013, 10:07:07 AM8/20/13
to sy...@googlegroups.com
Dear all, 

   is it just me or it seems that init_printing() does NOT invoke use_latex=True by default? It apparently causes not-so-pretty ascii output to appear in the documentation, as in  


Maybe that page should be change to replace calls of init_printing()  with init_printing(use_latex=True) ? (or maybe change the current default behaviour of init_printing)

thanks,
R

Aaron Meurer

unread,
Aug 20, 2013, 2:21:02 PM8/20/13
to sy...@googlegroups.com
The default is to use latex, but only in environments that support it, namely the IPython notebook or the ipython qtconsole of you have latex or matplotlib installed. See the printing section of the tutorial. 

If it's not enabling latex for you in those environments, that's a bug. 

Aaron Meurer
--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Ricardo Mayer

unread,
Aug 20, 2013, 4:16:58 PM8/20/13
to sy...@googlegroups.com
Thank you, Aaron.

I did tried it ipython (notebook and qt console) and calling init_printing() there does not enable latex (formulas were rendered in ascii characters). I had to pass the argument 'use_latex=True' explicitly.

Aaron Meurer

unread,
Aug 20, 2013, 5:11:09 PM8/20/13
to sy...@googlegroups.com
That's a bug then. Are you sure you are using SymPy 0.7.3? There were some issues with this in the previous version. 

Aaron Meurer

Ricardo Mayer

unread,
Aug 20, 2013, 5:57:32 PM8/20/13
to sy...@googlegroups.com
Yes, I'm sure  ... or at least 'conda search sympy'  says so :-) 

Oh, BTW, I'm using Ipython 1.0.0   (and sympy 0.7.3)  

I tried ipython 0.13.2 with sympy 0.7..2  and the problem does *not* occur

To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe@googlegroups.com.

Aaron Meurer

unread,
Aug 20, 2013, 6:19:26 PM8/20/13
to sy...@googlegroups.com
This is a bug then. I can't reproduce it. It's possible that your
installation is broken. You can try conda install -f sympy and conda
install -f ipython.

This is the code that automatically enables latex in the notebook
https://github.com/sympy/sympy/blob/master/sympy/interactive/printing.py#L278.
It seems like it should work.

What operating system are you on? How are you starting the IPython notebook?

Also, what happens if you set use_latex to 'png', 'matplotlib', or 'mathjax'.

We should enable debugging here.

Aaron Meurer

Ricardo Mayer

unread,
Aug 20, 2013, 6:36:51 PM8/20/13
to sy...@googlegroups.com
Thanks!

I'm in Windows 7 64bit and I'm starting the qtconsole and the notebook from Anaconda's Launcher program.

I did a conda install -f sympy and conda install -f ipython.

Mmmm after it, I still have the same problem with the ipython qtconsole (even after setting use_latex to 'png', 'matplotlib', or 'mathjax' or True)  (could it be a problem with 'untested Qt 6.2'?)

But .... it's *different* in the notebook: init_printing() now gives correct latex rendering and if I set  use_latex to 'png', 'matplotlib', or 'mathjax' then I'm back to the ugly display (sorry, ascii).

R




You received this message because you are subscribed to a topic in the Google Groups "sympy" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sympy/UkykJaifnZs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sympy+un...@googlegroups.com.

Aaron Meurer

unread,
Aug 20, 2013, 7:21:04 PM8/20/13
to sy...@googlegroups.com
What version of Python are you using? I just found a bug that prevents
the png formatter from working in Python 3 (which is fixed at
https://github.com/sympy/sympy/pull/2398).

I just pushed a branch that adds some debug calls, if you want to try
it out. To use it, you have to set the SYMPY_DEBUG environment
variable to "1" (you can do this from within Python by calling

import os
os.environ['SYMPY_DEBUG'] = '1'

before importing sympy (doing it before you import sympy is important,
because sympy checks this at import time).

Let me know if you want help in getting the code from the pull
request. I would just build a conda package for you, but I don't have
access to a Windows machine to build it on.

Aaron Meurer

Ricardo Mayer

unread,
Aug 20, 2013, 7:39:02 PM8/20/13
to sy...@googlegroups.com
It's Python 2.7.5 |Anaconda 1.6.2 (64-bit)| (default, Jul  1 2013, 12:37:52) [MSC v.1500 64 bit (AMD64)]

Thanks for your help, I'll see tomorrow if can pull such branch and build it

best,

R

PS: for now, I can still work in the notebook and set use_latex to True, though.
Reply all
Reply to author
Forward
0 new messages