emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] MathJax is now the default for HTML math

 From: Carsten Dominik Subject: Re: [Orgmode] MathJax is now the default for HTML math Date: Sat, 14 Aug 2010 22:59:25 +0200


On Aug 14, 2010, at 9:37 PM, Jan Böcker wrote:


On 08/14/2010 08:09 AM, Carsten Dominik wrote:

From now on, the default settings will
use the incredible MathJax library to display math in
exported HTML.  If you had never turned on LaTeX snipped
math publishing, this will now magically work all by itself.


Yes, indeed it does!

Since I read the announcement this morning, I have been playing with
MathJax. I found that when an HTML file on the local hard disk uses

MathJax from the web, MathJax reverts to image fonts in Firefox (this is
caused by a security feature of Firefox and mentioned in the MathJax
FAQ). Using a local MathJax installation in a subdirectory fixes this.

Most of my time was spent messing around with XULRunner to load the
exported HTML page, wait until MathJax has done its magic, then
serialize the result back to XHTML.


Hi Jan,


can you expand a bit on why this is interesting to do? What are the advantages?

Thanks!

- Carsten



And replace the file:// URLs pointing to the fonts of my local MathJax
installation with data: URIs, thus embedding the fonts within the HTML
file itself, just because I can.


The result is a single HTML file which does not require JavaScript to be viewed (and incurs no delay while the math is being rendered). However,
as no MathJax code is present, the zoom and view source functions of
MathJax are not available.

I have put an example online.

Normal org-mode export using MathJax from orgmode.org:
http://www.jboecker.de/2010/08/14/mathjax-example.html

Single-file no-javascript version:
http://www.jboecker.de/2010/08/14/mathjax-example-nojs.html

Internet Explorer will not use the correct font, AFAIK because it only
supports the EOT fonts (MathJax uses OTF for other browsers), and in
this case also because I embedded the fonts using data: URIs and IE
limits the size of data: URIs to 32 KB.

In browsers other than Firefox (I tested with Firefox and Opera), the
font size and spacing will differ slightly between the two versions.


If people are interested, I can try to make the program take the name of a file to operate on as a command line argument, so this could be run as
part of an org-mode export process or something. Of course, the
embedding of fonts in data: URIs would be optional.


I am really, really excited about this change.  Using MathJax makes
Org-mode
a tool without peer for scientific note taking, I believe.  It will
also drastically improve the quality of printed web pages, because

the web pages will not use fixed-resolution images, but scaleable fonts.

And don't forget that on modern high resolution displays, it is common

to zoom in just to be able to decipher math in images, especially if you
want sub- and superscripts to be legible.

-- Jan


- Carsten



reply via email to

 [Prev in Thread] Current Thread [Next in Thread]