We are using MathJax for the new IPython notebook and it is really
great, so I think this would be a good move.

Is there anyway of getting latex output in the sympy code samples?

Cheers,

Brian


On Thu, Jun 30, 2011 at 11:11 PM, Aaron Meurer <[email protected]> wrote:
> I just tried this on my iPod touch, and it works.  It takes a little
> while to render the math, due to the slower processor, but once it
> does, it's worth it, because it's way crisper when you zoom in, which
> you tend to do a lot on these mobile devices with their small screens.
>
> And anyway, like I said, you can at least see the LaTeX math while
> you're waiting for it to render, which is readable.
>
> Aaron Meurer
>
> On Thu, Jun 30, 2011 at 11:55 PM, Aaron Meurer <[email protected]> wrote:
>> I've made this easer for people who just want to play around with what
>> it looks like by pushing a demo up to docs.sympy.org.
>>
>> Go to http://docs.sympy.org/mathjax/ and navigate to a LaTeX intensive
>> page (the mpmath function pages are good examples). Then compare
>> against the same page replacing "mathjax" in the url with "dev".
>>
>> You can see on some pages there are errors (yellow boxes).  For
>> example, at http://docs.sympy.org/mathjax/modules/galgebra/GA/GAsympy.html.
>>  This is because they are somehow defining custom control sequences.
>> I haven't figured out how to make these work with MathJax yet.  I want
>> to see if people like this idea before I try anything further.
>>
>> By the way, the built mathjax docs are 7.3 MB, whereas the built docs
>> using the current method are 13 MB.
>>
>> Aaron Meurer
>>
>> On Thu, Jun 30, 2011 at 11:43 PM, Aaron Meurer <[email protected]> wrote:
>>> Hi.  I just discovered how to use MathJax in our Sphinx docs, and it's
>>> really easy.  You just have to copy a file to the doc/src directory
>>> and make a couple of changes to the conf.py file.  I have done this at
>>> my mathjax branch (https://github.com/asmeurer/sympy/tree/mathjax).
>>> More information (also in the commit message):
>>>
>>> See https://bitbucket.org/kevindunn/sphinx-extension-mathjax/wiki/Home
>>> and
>>> https://groups.google.com/forum/#!msg/sphinx-dev/SkLZlqapcM8/tI2qk5uTY3gJ.
>>>
>>> MathJax renders the LaTeX equations in the browser.  This has several
>>> advantages:
>>>
>>> - Compiling the Sphinx docs from scratch is *way* faster, since it
>>> doesn't have to compile the LaTeX images.  Previously on my machine, it
>>> took about half an hour to compile from scratch (mainly due to heavy
>>> LaTeX use in the mpmath docs).  Now it only takes a couple of minutes.
>>>
>>> - Because no LaTeX images are stored, the overall size of the compiled
>>> docs is smaller.
>>>
>>> - The rendered math in the browser is selectable (which also means it's
>>> searchable), and crisp at arbitrary zoom levels, since it renders the
>>> math using actual fonts, not images.  So it's just like an equation in a
>>> regular LaTeX pdf document.
>>>
>>> - You can right click on the equation and get a menu that will show the
>>> source.  As a side benefit, you can also use this to convert the LaTeX
>>> to mathml.
>>>
>>> - No changes are required in the source files.  This uses the same
>>> :math: pragma as the previous system, so it's very swappable.
>>>
>>> - This currently uses an online version of the mathjax.js file that is
>>> free to use for production, but this can easily be downloaded and used
>>> locally for offline use.
>>>
>>> Disadvantages:
>>>
>>> - You will not be warned about LaTeX errors at doc compile time.  The
>>> only way I know to find them is to look at all the rendered html files
>>> for yellow MathJax error boxes.  Perhaps there is a more streamlined way
>>> to do this, though.
>>>
>>> - There currently are some errors in the GA docs, due to some strange
>>> control sequences like \W and \lbrk.  I'm not sure where these are
>>> defined, but this will have to be fixed if we use this.
>>>
>>> - Your browser has to render the math at load time, which makes it a
>>> little slower for LaTeX intensive pages.  Actually, it isn't too bad.
>>> And it seems to render from the top down, so you can see the math at the
>>> top almost immediately.  And while it is rendering, you see the LaTeX
>>> source, so you can at least read it.
>>>
>>> To compare this against the old system checkout my branch and, do
>>>
>>> cd doc
>>> make clean # To clear the old docs
>>> make html
>>>
>>> And open a LaTeX intensive page like
>>> _build/html/modules/mpmath/functions/hypergeometric.html in your browser
>>> and compare it against the current page at docs.sympy.org (in this case,
>>> http://docs.sympy.org/0.7.0/modules/mpmath/functions/hypergeometric.html#mpmath.hyp0f1).
>>>
>>> Note how with the MathJax, you can select parts of the math equations,
>>> you can zoom in (using your browser's zoom functionality) without any
>>> loss of resolution, and you right click on the equation to get the
>>> source.
>>>
>>> Aaron Meurer
>>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/sympy?hl=en.
>
>



-- 
Brian E. Granger
Cal Poly State University, San Luis Obispo
[email protected] and [email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to