63d3229: VR renders LaTex (python 2 only)

26 views
Skip to first unread message

Edward K. Ream

unread,
Mar 24, 2017, 10:37:15 AM3/24/17
to leo-editor
It renders LaTeX using mathjax in a QtWebKitWidgets.QWebView.

This is experimental code, and only works with Python 2. On my Windows 10 machine, it hangs when using Python 3. I have no idea why.

Even on a fast machine, it takes several seconds to render Maxwell's equations:

\begin{align}
  \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\
  \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\
  \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\
  \nabla \cdot \vec{\mathbf{B}} & = 0
\end{align}
yielding the attached image. I'll be testing on Ubuntu next.
Edward
Maxwell.png

Edward K. Ream

unread,
Mar 24, 2017, 10:43:19 AM3/24/17
to leo-editor
On Friday, March 24, 2017 at 9:37:15 AM UTC-5, Edward K. Ream wrote:
It renders LaTeX using mathjax in a QtWebKitWidgets.QWebView.

This is experimental code, and only works with Python 2. On my Windows 10 machine, it hangs when using Python 3. I have no idea why.

I should have added that VR plugin avoids the hang by not rendering when g.isPython3 is True. Not great, but better than hanging ;-)

Edward

Edward K. Ream

unread,
Mar 24, 2017, 10:54:23 AM3/24/17
to leo-editor
On Friday, March 24, 2017 at 9:37:15 AM UTC-5, Edward K. Ream wrote:
It renders LaTeX using mathjax in a QtWebKitWidgets.QWebView.

This is experimental code, and only works with Python 2. On my Windows 10 machine, it hangs when using Python 3. I have no idea why.

Even on a fast machine, it takes several seconds to render Maxwell's equations:

On Linux, rendering is much faster than on Windows and works for both Python 2 and 3.

Rev 20601c disables rendering only on Windows and only when using Python 3.

Edward
Reply all
Reply to author
Forward
0 new messages