emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* MathJax - use Tex/LaTeX/MathML in HTML pages
@ 2010-08-02  8:52 Bastien
  2010-08-02 15:57 ` Dan Davison
  0 siblings, 1 reply; 5+ messages in thread
From: Bastien @ 2010-08-02  8:52 UTC (permalink / raw)
  To: emacs-orgmode

Hi all,

I just discovered and tested MathJax:

  http://www.mathjax.org

This is quite straightforward: unpack MathJax on your server (together
with the fonts zip) and it will display inline LaTeX maths in a webpage.

I thought it could be interesting to have an option for people who want
to use it instead of the current LaTeX fragments mechanism.

Anyone already using MathJax?

-- 
 Bastien

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: MathJax - use Tex/LaTeX/MathML in HTML pages
  2010-08-02  8:52 MathJax - use Tex/LaTeX/MathML in HTML pages Bastien
@ 2010-08-02 15:57 ` Dan Davison
  2010-08-04  4:24   ` Bastien
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Davison @ 2010-08-02 15:57 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Hi Bastien,

Bastien <bastien.guerry@wikimedia.fr> writes:

> Hi all,
>
> I just discovered and tested MathJax:
>
>   http://www.mathjax.org
>
> This is quite straightforward: unpack MathJax on your server (together
> with the fonts zip) and it will display inline LaTeX maths in a webpage.
>
> I thought it could be interesting to have an option for people who want
> to use it instead of the current LaTeX fragments mechanism.

It's quite convenient already (see below), so what exactly would the
option involve?  Can the javascript and fonts be located remotely?
I.e. can org host them like it hosts org-info.js? (I just tried that and
failed)

I wasn't aware of mathjax but I've just had a quick play.

Some notes

- MathJax appears to be the successor of jsMath (same developer)
- Darlan Cavalcante has written a Worg article[1] on using jsMath with
  org
- Basically, to use jsMath all you need is

  #+options: latex:verbatim
  #+style: <script src="/path/to/jsMath/easy/load.js"></script>

- To convert this to MathJax, all you need to change is the path:
  /path/to/mathjax/MathJax.js
- I found that a document with lots of maths rendered visually the same
  in mathjax as jsMath
- Mathjax was considerably slower to render the maths. (I think that
  under the hood it converts to mathML which jsMath does not do (?))
- Whereas google-chrome did not work with jsMath for me, it worked fine
  with MathJax. This is nice because google-chrome produces a clean pdf
  (firefox adds the file path at the top of the document)
- We can put the latex in a src block using
  #+begin_src latex :results raw :exports results


As I said the other day[2], one reason I am excited about these
technologies is that we can produce a pdf with pretty source code
fontification via htmlize (rather than ugly[3] latex listings output)
and genuine mathematical fonts rather than ugly dvipng images. I do this
via CUPS print to file under linux, which allows the web browser to
produce a .ps or .pdf. I'd be interested to know how we can make this a
more "genuine" org export path.

Dan

>
> Anyone already using MathJax?

Footnotes:

[1] http://orgmode.org/worg/org-tutorials/org-jsmath.php

[2] http://thread.gmane.org/gmane.emacs.orgmode/28150

[3] No one has replied to my post the other day, so I'll be more
contentious. Can anyone demonstrate how to make source code look
anywhere near as nice using listings in latex as with htmlize.el?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: MathJax - use Tex/LaTeX/MathML in HTML pages
  2010-08-02 15:57 ` Dan Davison
@ 2010-08-04  4:24   ` Bastien
  2010-08-04  8:31     ` Christopher Witte
  2010-08-07  7:18     ` Carsten Dominik
  0 siblings, 2 replies; 5+ messages in thread
From: Bastien @ 2010-08-04  4:24 UTC (permalink / raw)
  To: Dan Davison; +Cc: emacs-orgmode

Hi Dan,

Dan Davison <davison@stats.ox.ac.uk> writes:

> It's quite convenient already (see below), so what exactly would the
> option involve?  Can the javascript and fonts be located remotely?

From what I understand, no, the javascript and fonts have to be on the
server.

I just installed an instance on orgmode.org:

  http://orgmode.org/mathjax/test/

> - Darlan Cavalcante has written a Worg article[1] on using jsMath with
>   org
> - Basically, to use jsMath all you need is
>
>   #+options: latex:verbatim
>   #+style: <script src="/path/to/jsMath/easy/load.js"></script>

Great!  So to use mathjax on orgmode.org (Worg etc.) :

  #+options: latex:verbatim
  #+style: <script type="text/javascript" src="/mathjax/MathJax.js"></script>

> - Mathjax was considerably slower to render the maths. (I think that
>   under the hood it converts to mathML which jsMath does not do (?))

I'm not sure.  Maybe MathJax is faster once reasonably tweaked.

> As I said the other day[2], one reason I am excited about these
> technologies is that we can produce a pdf with pretty source code
> fontification via htmlize (rather than ugly[3] latex listings output)
> and genuine mathematical fonts rather than ugly dvipng images. I do this
> via CUPS print to file under linux, which allows the web browser to
> produce a .ps or .pdf. I'd be interested to know how we can make this a
> more "genuine" org export path.

You mean org -> HTML -> ps?

Is it not possible to call firefox (or Xulrunner) in batch mode to
convert an HTML page into .ps?

If so, we can have two ways of producing org->pdf, one through LaTeX,
one through HTML...

-- 
 Bastien

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Re: MathJax - use Tex/LaTeX/MathML in HTML pages
  2010-08-04  4:24   ` Bastien
@ 2010-08-04  8:31     ` Christopher Witte
  2010-08-07  7:18     ` Carsten Dominik
  1 sibling, 0 replies; 5+ messages in thread
From: Christopher Witte @ 2010-08-04  8:31 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 2551 bytes --]

ASCIIMathML http://www1.chapman.edu/~jipsen/mathml/asciimath.html might also
be an alternative, for that you need fonts on the client (Firefox, I don't
think IE supports MathML out of the box), and it uses MathML so it is
standard compliant.

Regards
Chris.


On 4 August 2010 06:24, Bastien <bastien.guerry@wikimedia.fr> wrote:

> Hi Dan,
>
> Dan Davison <davison@stats.ox.ac.uk> writes:
>
> > It's quite convenient already (see below), so what exactly would the
> > option involve?  Can the javascript and fonts be located remotely?
>
> From what I understand, no, the javascript and fonts have to be on the
> server.
>
> I just installed an instance on orgmode.org:
>
>  http://orgmode.org/mathjax/test/
>
> > - Darlan Cavalcante has written a Worg article[1] on using jsMath with
> >   org
> > - Basically, to use jsMath all you need is
> >
> >   #+options: latex:verbatim
> >   #+style: <script src="/path/to/jsMath/easy/load.js"></script>
>
> Great!  So to use mathjax on orgmode.org (Worg etc.) :
>
>  #+options: latex:verbatim
>  #+style: <script type="text/javascript"
> src="/mathjax/MathJax.js"></script>
>
> > - Mathjax was considerably slower to render the maths. (I think that
> >   under the hood it converts to mathML which jsMath does not do (?))
>
> I'm not sure.  Maybe MathJax is faster once reasonably tweaked.
>
> > As I said the other day[2], one reason I am excited about these
> > technologies is that we can produce a pdf with pretty source code
> > fontification via htmlize (rather than ugly[3] latex listings output)
> > and genuine mathematical fonts rather than ugly dvipng images. I do this
> > via CUPS print to file under linux, which allows the web browser to
> > produce a .ps or .pdf. I'd be interested to know how we can make this a
> > more "genuine" org export path.
>
> You mean org -> HTML -> ps?
>
> Is it not possible to call firefox (or Xulrunner) in batch mode to
> convert an HTML page into .ps?
>
> If so, we can have two ways of producing org->pdf, one through LaTeX,
> one through HTML...
>
> --
>  Bastien
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>



-- 
Postdoctoral Research Fellow
Molecular Imaging Group
 Leibniz-Institut für Molekulare Pharmakologie (FMP)
Campus Berlin-Buch
Robert-Roessle-Str. 10
13125 Berlin, Germany
Phone: 00493094793-279

[-- Attachment #1.2: Type: text/html, Size: 4177 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Re: MathJax - use Tex/LaTeX/MathML in HTML pages
  2010-08-04  4:24   ` Bastien
  2010-08-04  8:31     ` Christopher Witte
@ 2010-08-07  7:18     ` Carsten Dominik
  1 sibling, 0 replies; 5+ messages in thread
From: Carsten Dominik @ 2010-08-07  7:18 UTC (permalink / raw)
  To: Bastien; +Cc: Dan Davison, emacs-orgmode


On Aug 4, 2010, at 6:24 AM, Bastien wrote:

> Hi Dan,
>
> Dan Davison <davison@stats.ox.ac.uk> writes:
>
>> It's quite convenient already (see below), so what exactly would the
>> option involve?  Can the javascript and fonts be located remotely?
>
> From what I understand, no, the javascript and fonts have to be on the
> server.
>
> I just installed an instance on orgmode.org:
>
>  http://orgmode.org/mathjax/test/
>
>> - Darlan Cavalcante has written a Worg article[1] on using jsMath  
>> with
>>  org
>> - Basically, to use jsMath all you need is
>>
>>  #+options: latex:verbatim
>>  #+style: <script src="/path/to/jsMath/easy/load.js"></script>
>
> Great!  So to use mathjax on orgmode.org (Worg etc.) :
>
>  #+options: latex:verbatim
>  #+style: <script type="text/javascript" src="/mathjax/MathJax.js"></ 
> script>

I just tried this:

  #+options: latex:verbatim
  #+style: <script type="text/javascript" src="http://orgmode.org/mathjax/MathJax.js 
"></script>

and it just worked, also with a remote server.....

Now, this is really really cool!  Wow.

Thanks to all for digging up this cool way of doing math in HTML.

- Carsten

>
>> - Mathjax was considerably slower to render the maths. (I think that
>>  under the hood it converts to mathML which jsMath does not do (?))
>
> I'm not sure.  Maybe MathJax is faster once reasonably tweaked.
>
>> As I said the other day[2], one reason I am excited about these
>> technologies is that we can produce a pdf with pretty source code
>> fontification via htmlize (rather than ugly[3] latex listings output)
>> and genuine mathematical fonts rather than ugly dvipng images. I do  
>> this
>> via CUPS print to file under linux, which allows the web browser to
>> produce a .ps or .pdf. I'd be interested to know how we can make  
>> this a
>> more "genuine" org export path.
>
> You mean org -> HTML -> ps?
>
> Is it not possible to call firefox (or Xulrunner) in batch mode to
> convert an HTML page into .ps?
>
> If so, we can have two ways of producing org->pdf, one through LaTeX,
> one through HTML...
>
> -- 
> Bastien
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-08-08 17:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-02  8:52 MathJax - use Tex/LaTeX/MathML in HTML pages Bastien
2010-08-02 15:57 ` Dan Davison
2010-08-04  4:24   ` Bastien
2010-08-04  8:31     ` Christopher Witte
2010-08-07  7:18     ` Carsten Dominik

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).