galgebra, latex and jupyter qtconsole

187 views
Skip to first unread message

Johannes

unread,
Nov 27, 2015, 2:24:23 PM11/27/15
to sympy
Hello,

I have going to use sympy in the jupyter qtconsole with init_session(use_latex = True). I have installed MikTex on my windows machine and it works quite fine. I have worked through the tutorial and hit problems at the galgebra module. I can't get the pretty latex output in the qtconsole for the galgebra objects.

Can anybody give me some advise what I have to do to get the same latex rendering for the ga objects as for the other tutorial objects, e.g. Integral etc?

Is this a defect or as a feature?
Can I expect better working for sympy 1.0?
Are there other modules also not working with the latex output in the qtconsole?

Anyway, thank you very much for the amazing sympy library!

Best,
Johannes




Alan Bromborsky

unread,
Nov 27, 2015, 6:23:34 PM11/27/15
to sy...@googlegroups.com
I think jupyter is having growing pains.  LaTex rendering stopped working for me too.  I have an Xbuntu virtual machine (vmware player) where the rendering works.  If you wish I can put the Xbuntu virtual image on my Google drive and you could download it (several GB).  You would have to install vmware player (free) on you windows machine.  Note that I have found Chromium works better that Firefox for Jupyter. 

--
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/6abc7713-1c8e-4695-8dde-2ffc60b869c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jason Moore

unread,
Nov 28, 2015, 11:28:55 AM11/28/15
to sy...@googlegroups.com
Johannes,

Can you submit and issue on the Github repository with code that reproduces the error and a screenshot of the notebook. We've had to fix some printing bugs due to changes in Jupyter notebooks recently. This may just be another one.

Alan Bromborsky

unread,
Nov 28, 2015, 11:56:36 AM11/28/15
to sy...@googlegroups.com
Jason could you send a link as to where the changes for LaTeX printing for the jupyter notebook are documented.  I would need to change my galgebra printing code which is no longer part of sympy.

Alan Bromborsky

unread,
Nov 28, 2015, 12:03:11 PM11/28/15
to sy...@googlegroups.com
Attached is pdf of notebook.  Sometimes LaTeX rendering works and sometimes the tex ascii is printed instead.
dop.pdf

Jason Moore

unread,
Nov 28, 2015, 12:07:49 PM11/28/15
to sy...@googlegroups.com
Can you share the actual notebook file instead of a pdf? I'd like to run it.

I don't know of the exact changes to Jupyter that have started causing us problems. There are various issues in the tracker where we were dealing with errors printing latex environments.

You can run your notebook with the environment variable SYMPY_DEBUG set to True for some output from the printing mechanisms.

Alan Bromborsky

unread,
Nov 28, 2015, 1:39:18 PM11/28/15
to sy...@googlegroups.com
Attached is dop.ipynb.  You will need the galgebra modules at https://github.com/brombo/galgebra to run it.

dop.ipynb

Johannes

unread,
Nov 30, 2015, 3:34:19 AM11/30/15
to sympy
Hello Alan and Jason,


On 28.11.2015 00:23, Alan Bromborsky wrote:
> I have an Xbuntu virtual machine (vmware player)
> where the rendering works. If you wish I can put the Xbuntu virtual
> image on my Google drive and you could download it (several GB). You
> would have to install vmware player (free) on you windows machine.

No that is not a practical option for me. I would like to see a general fix so that no one has to worry about it in the future :-)


> Note
> that I have found Chromium works better that Firefox for Jupyter.
I work neither with Chromium nor with Firefox but with the Jupyter qtconsole.

To be clear about my environment. I have a 64 bit Python 2.7 installation in my windows machine with the following libraries installed:
ipython 4.0.0
jupyter 1.0.0
jupyter_core 4.0.6
qtconsole 4.1.0
sympy 0.7.6.1

galgebra is part of sympy 0.7.6.1

With other words a descent standard installation of the packages.


On 28.11.2015 17:28, Jason Moore wrote:
>
> Can you submit and issue on the Github repository with code that
> reproduces the error and a screenshot of the notebook. We've had to fix
> some printing bugs due to changes in Jupyter notebooks recently. This
> may just be another one.
Sorry, no I can't. I'm not familiar with the Github procedures. However, I just have done the following:

0) Initial test
from sympy import *
init_session(use_latex=True)
x**2+y**2

-> nice looking latex rendering of the expression

1) With the standard sympy release
from sympy import *
init_session(use_latex=True)
from sympy.galgebra.ga import *
(ex,ey,ez) = MV.setup('e*x|y|z')
ex

-> <sympy.galgebra.ga.MV at 0x7aa6320>, i.e. no latex rendering

2) With the standard sympy release but with additional installation of the galgebra library from https://github.com/brombo/galgebra
(https://github.com/brombo/galgebra, galgebra-0.4.0-py2.7.egg)

from sympy import *
init_session(use_latex=True)
from galgebra.mv import MV
(ex,ey,ez) = MV.setup('e*x|y|z')
ex

-> \begin{equation*} \boldsymbol{e}_{x} \end{equation*}

Regrads,
Johannes

Alan Bromborsky

unread,
Nov 30, 2015, 1:58:22 PM11/30/15
to sy...@googlegroups.com
Attached is pdf of dop.ipynb.  Latex printing is working with latest version jupyter and galagebra at github/brombo.  Note that printing works except in case of using A.Fmt(args) where A is a multivector (differential operator printing with Fmt works).  Work around for now is don't use .Fmt() to print multivectors.  Just use "A" for now.  I am tracking down problem with .Fmt() and multivectors in notebook.

--
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.
dop_notebook.pdf

Alan Bromborsky

unread,
Dec 1, 2015, 8:35:36 AM12/1/15
to sy...@googlegroups.com
Fixed error in latex printing of multivectors in ipython notebook.  Pushed changes to github brombo/galgebra.  Attached are ipython notebook ipynb file and output image (pdf).
dop_notebook.pdf
dop.ipynb
Reply all
Reply to author
Forward
0 new messages