# MathJax - "typesetting" of maths in Web pages

#### Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

•  Subject
• Author
• Posted on
I recently followed a link to a Scholarpedia page, and observed in it
some "properly typeset" equations which were not images.  Right-clicking
such an equation shows a substitute context menu (cf. CLJ FAQ item) with

It uses a JavaScript include file to edit the transmitted body of the
page; there is a perceptible delay.

Any experience of using MathJax?  Any advice?  Is LaTex or MathML or
AsciiMath the better option?  Which is easier?  Will support continue?
Do browsers have a reliable alternative?

There are better demonstrations at <http://www.mathjax.org/ , but my own
test page (using TeX) is growing at
<http://www.merlyn.demon.co.uk/math-jax.htm .

--
news:comp.lang.javascript FAQ <http://www.jibbering.com/faq/index.html .
<http://www.merlyn.demon.co.uk/js-index.htm jscr maths, dates, sources.

## Re: MathJax - "typesetting" of maths in Web pages

2012-08-05 1:08, Dr J R Stockton wrote:

Yes, there might be a flash of non-typeset content, perhaps even more
than just a flash. I've got used to it.

Whichever you are more used to. LaTeX is widely used in math, MathML
might be more natural to a person or too, and AsciiMath is suitable if
you have just some simple equations and don't know LaTeX much.

Who knows? But being open source and widely used, I would expect someone
to take it over if the people currently working on it stop doing that.
And even if not, you could still keep using the code. So I'd say it's
much safer to use than most software.

No.

--
Yucca, http://www.cs.tut.fi/~jkorpela /

## Re: MathJax - "typesetting" of maths in Web pages

This is a P4/3GHz (XP sp3), and my intended document, a translation of
Lagrange's prize-winning "Essay ..." of 1772, has about 507 equations.
So far, I've translated 37 of them to LaTeX, and it takes about 5
seconds to convert them for elegant display.  That suggests around 68
seconds for the full work.

It's not sufficient for the author to get used to it; one must consider
the effect on a first-time reader.

alleviating the problem.

I was used to none of those.  MathML is too long-winded, AsciiMath looks
limited, and the sample page shown did not work (I now see why).  LaTeX
notation seems to be about as brief as possible, and I don't think any
additional features will be needed for the other 470 equations.

I see it is sponsored by, among others, IoP Publishing; I shall be a
member of  IoP for life.

--
(c) John Stockton, nr London, UK.  For Mail, see Home Page.  Turnpike, WinXP.
Web  <http://www.merlyn.demon.co.uk/ - FAQ-type topics, acronyms, and links.
Command-prompt MiniTrue is useful for viewing/searching/altering files. Free,
DOS/Win/UNIX now 2.0.6; see <URL:http://www.merlyn.demon.co.uk/pc-links.htm .

## Re: MathJax - "typesetting" of maths in Web pages

2012-08-06 22:35, Dr J R Stockton wrote:

This sounds serious, but I don't think it's really that serious. It's
the delay required to convert the first few equations that matters, as a
rule. A reader who opens the page will probably spend several seconds
with the initial display before scrolling or otherwise moving forward.
So the conversion mostly takes place in the background, from the user's
point of view.

The situation can be improved by using prose at the start of a document,
such as a heading, a summary, a table of content, and other material
that does not contain typeset formulas.

--
Yucca, http://www.cs.tut.fi/~jkorpela /

## Re: MathJax - "typesetting" of maths in Web pages

It is a translation, and therefore I cannot control the bulk of the
content.

First-time readers will, I hope, start at the beginning; but those who
return are likely to do so by a link to an anchor at the start of the
translation, or to a particular source page or section.

But the MathJax user group has some helpful suggestions - when I've
transcribed the other half of the equations, I'll see what they do.
What I currently have takes about 35 seconds to process.

--
(c) John Stockton, nr London, UK.  For Mail, see Home Page.  Turnpike, WinXP.
Web  <http://www.merlyn.demon.co.uk/ - FAQ-type topics, acronyms, and links.
Command-prompt MiniTrue is useful for viewing/searching/altering files. Free,
DOS/Win/UNIX now 2.0.6; see <URL:http://www.merlyn.demon.co.uk/pc-links.htm .

## Re: MathJax - "typesetting" of maths in Web pages

Dr J R Stockton wrote:

Why not add a paragraph of text at the
beginning warning the reader of possible
delays.

--
Regards,
Martin Leese
Web: http://members.tripod.com/martin_leese /

## Re: MathJax - "typesetting" of maths in Web pages

posted:

Done from (more or less) the beginning; and the present page will only
found by from a link in such a paragraph, or by searching around.

I mentioned "there is a perceptible delay" to inform readers of this
thread; that was not a question.  I place MathJax questions in the haunt
of the enlightened.

--
(c) John Stockton, nr London, UK.    ?@merlyn.demon.co.uk     Turnpike v6.05.
Website  <http://www.merlyn.demon.co.uk/ - w. FAQish topics, links, acronyms
PAS EXE etc. : <http://www.merlyn.demon.co.uk/programs/ - see in 00index.htm
Dates - miscdate.htm estrdate.htm js-dates.htm pas-time.htm critdate.htm etc.

## Re: MathJax - "typesetting" of maths in Web pages

2012-08-11 0:59, Dr J R Stockton wrote:

Using some creative styling, it might be possible to arrange things so
that the initial screen does not contain formulas. For example, liberal
vertical spacing might help.

That's true, so the question arises whether the document should be
divided into smaller pieces. After all, even if the original is a single
document, a translation in web format need not be (any more than modern
editions of ancient scripts need to be printed on papyrus scrolls).

--
Yucca, http://www.cs.tut.fi/~jkorpela /

## Re: MathJax - "typesetting" of maths in Web pages

If you can write a date/time like that, you might to be able to do the
job better, by adding a correct time offset indication (Z preferred, of
course).  And "wrote" is incorrect; you can only know what the date

It is a translation, and therefore formulae will occur where they were
originally placed 240 years ago (or, to be exact, where the Oeuvres
editor placed them; that copy is probably _more_ reliable than the
original publication).

Handling such a document as fragments can be very inconvenient, since
one then cannot readily search the whole thing at once, by eye or by a
"Find" control.

matter; I mentioned the delay only as a warning to others.  Expert

--
(c) John Stockton, nr London, UK.  Mail via homepage.  Turnpike v6.05  MIME.
Web  <http://www.merlyn.demon.co.uk/ - FAQqish topics, acronyms and links;
Astro stuff via astron-1.htm, gravity0.htm ; quotings.htm, pascal.htm, etc.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.

## Re: MathJax - "typesetting" of maths in Web pages

2012-08-12 21:38, Dr J R Stockton wrote:

Translations need not replicate the presentational style of the
original. They seldom do. It is common, and often useful, to start a
translation with the translator's preface, for example.

You can always make the document also available as a single page, for
those who wish to do such things (or print it as a whole, for example).
The point is that for normal use, bulky content works better on the web
when divided into parts, called "web pages".

Indeed. This is a discussion forum, not a helpdesk. You post something,
others discuss it. If this happens to address a question you've asked,
that's coincidental.

You seemed to be worried about the issue, and not without reason. You
may still choose to ignore the points made about it here. Others who
have similar issues may still benefit from the discussion.

So you came here for non-expert advice? You don't always get what you want.

--
Yucca, http://www.cs.tut.fi/~jkorpela /

## Re: MathJax - "typesetting" of maths in Web pages

You or Thomas?  I am trying to educate you in how a date ought to be
presented, in an international medium, to be fully meaningful.
University staff should be aware of such things.  I'd do the same for
the authors of my present News software, if they had not been moved to
pastures new.

That is different.  A translation of an important document should
faithfully represent the original, warts and all (in the alleged words
of the Lord Protector, to Lely).  There is prefatory material; but I'm
not going to bloat that unnecessarily.

I am not going to maintain two parallel copies, and I have better things
to do than find or write software to maintain two copies from a single
data set.  The text is only 85kB, the equations about 55kB.

I have in fact tried to read the original in Gallica's default page-wise
display at UJF; it is deeply unsatisfactory, until one finds the
"defilement vertical" control.  I'm following the ULg presentation.

Yes; and those who give bad or irrelevant advice should expect to be
told so.  You are not lecturing a somnolent class here.

Advice is much better given by those with knowledge of the particular
informed is counter-productive - and especially so when given by those
whose advice, on other topics can be well-informed and therefore useful.
I'm interested only in well-informed advice.

You have been provided with sufficient information to let you become
useful on this topic; you seem not to have used it.

--
(c) John Stockton, Surrey, UK.  ?@merlyn.demon.co.uk   Turnpike v6.05   MIME.
Web  <http://www.merlyn.demon.co.uk/ - FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)

## Re: MathJax - "typesetting" of maths in Web pages

On 08/06/2012 03:35 PM, Dr J R Stockton wrote:

I'm surprised that MathJax doesn't offer the ability to create static
output, but maybe they didn't expect people would have hundreds of
equations on a single page... If you could grab the .innerHTML and
generated styles for each equation then you could simply include them.

--
Norman
Registered Linux user #461062
AMD64X2 6400+ Ubuntu 10.04 64bit

## Re: MathJax - "typesetting" of maths in Web pages

Norman Peelman wrote:

The goal of MathJax, however, is for scientists to be able to continue using
the familiar LaTeX syntax in their works and have them presented in a way on
the Web that is both very compatible (as opposed to e. g. MathML,
unfortunately) and easily readable (for the scientific community) *without*
the author having to maintain its HTML representation as well.

PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
)  // Plone, register_function.js:16

## Re: MathJax - "typesetting" of maths in Web pages

I fear that those might be quite large, possibly larger than a well-
coded image of the electronically-typeset equations (which would at
least be better than a cut of the scanned images of the c.19 inky
printing).

And MathJax's typesetting, while quite good, is likely to improve with
time, whereas a capture would not.

I now have to think about how to represent a character of whose identity
there is no doubt (an equals sign), but which in the scan has only about
1% of the ink that it ought to; and at least one case of a real typo in
the c.19 document.  AFAIK, the c.18 original printing is not on the Web.

--
(c) John Stockton, nr London, UK.  Mail via homepage.  Turnpike v6.05  MIME.
Web  <http://www.merlyn.demon.co.uk/ - FAQqish topics, acronyms and links;
Astro stuff via astron-1.htm, gravity0.htm ; quotings.htm, pascal.htm, etc.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.

## Re: MathJax - "typesetting" of maths in Web pages

On Mon, 13 Aug 2012 19:23:49 +0100, Dr J R Stockton wrote of ...:

Ah, you recall to my mind the mid-20th century publications of the French
publisher Hermann -- Bourbaki, in particular, but not only -- their "equals
sign"s were astonishingly long (a good 1-em dash long) and astonishingly
razor's-edged (surely under a thousandth of an inch in breadth per stroke).

At times you could hardly see them on the printed page.

Think it's inappropriate to substitute a visible, modern "=" ?

Cheers, -- tlvp
--
Avant de repondre, jeter la poubelle, SVP.

## Re: MathJax - "typesetting" of maths in Web pages

2012-08-14 8:48, tlvp wrote:

Why would it be inappropriate? If the text clearly contains an equals
sign, then the HTMLized version should contain U+003D EQUALS SIGN, just
as the letter Q should be the letter Q, no matter how decorative or
exotic its appearance in the original is.

Should you wish to preserve the visual appearance of glyphs, then you
need to work on scanned images, not HTML. Images can be improved, using
techniques that make the document partly recover from physical corruption.

It is technically possible to add styling to HTML in an attempt to
simulate the glyphs used in the original. Many fonts contain wide glyphs
with thin strokes for the equals sign. Such design can be regarded as
Cambria Math vs. Cambria.

It would be a different matter if the text contain such an equals sign
*and* a different (narrower) equals sign, in a context where the general
style of the text is similar. Then you might have a case for suggesting
the addition of MATHEMATICAL EQUALS SIGN to Unicode, to allow
disambiguation from normal equals sign. Allow eight years for acceptance
and implementation (optimistically speaking). But I'm afraid it would
not work: the opponents could well argument that it's still a glyph
difference only, and fonts suitable for mathematical texts generally
have operator symbols that are stylistically different from fonts
designed for general texts.

--
Yucca, http://www.cs.tut.fi/~jkorpela /

## Re: MathJax - "typesetting" of maths in Web pages

On Tue, 14 Aug 2012 09:25:19 +0300, Jukka K. Korpela wrote:

Both "why" (your question) and "whether" (mine) are really for the OP to
decide -- I just raised the question "whether" for the following reason:

I had the impression OP sought to hew as closely as possible to the
vagaries of the original. By that question I was hoping to suggest that
such close hewing might not be uniformly necessary.

That'd be my inclination too, for that matter :-) .

Cheers, -- tlvp
--
Avant de repondre, jeter la poubelle, SVP.

## Re: MathJax - "typesetting" of maths in Web pages

In comp.lang.javascript message <kharnxi0umeg$.1rjj54hqs67ph$.dlg@40tude
posted:

To reproduce as closely as convenient the intent of the original, but
showing (with suitable annotation) all typos.  I preserve, for example,
two references to the "radius rector" in the c.19 version.

--
(c) John Stockton, nr London, UK.  Mail via homepage.  Turnpike v6.05  MIME.
Web  <http://www.merlyn.demon.co.uk/ - FAQqish topics, acronyms and links;
Astro stuff via astron-1.htm, gravity0.htm ; quotings.htm, pascal.htm, etc.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.

## Re: MathJax - "typesetting" of maths in Web pages

The new version of the equation is not HTMLised.

--
(c) John Stockton, nr London, UK. ???@merlyn.demon.co.uk Turnpike v6.05  MIME.
Web  <URL:http://www.merlyn.demon.co.uk/ - FAQish topics, acronyms, & links.

Food expiry ambiguities: <URL:http://www.merlyn.demon.co.uk/date2k-3.htm#Food

## Re: MathJax - "typesetting" of maths in Web pages

In comp.lang.javascript message <18x4oy2548iyi.1g7ob9t8kqke3.dlg@40tude.
posted:

A good c.19 equals sign was without doubt intended; I cannot say whether
the little piece of lead used was our-of-spec, or the ink-spreading was
deficient.  I'm certainly using a MathJax-standard equals sign - but I
feel a slight temptation to mention the flaw in the c.19 printing.  I
don't know whether a copy of the c.18 original can be found - there
should be one in Paris.

I've so far found three real typos in the c.19 version; it would be of
interest to consult the c.18 for those.

All of the equations are now in MathJax, and the first new-typo-
correcting pass is 3/4 complete ...

--
(c) John Stockton, nr London, UK.  Mail via homepage.  Turnpike v6.05  MIME.
Web  <http://www.merlyn.demon.co.uk/ - FAQqish topics, acronyms and links;
Astro stuff via astron-1.htm, gravity0.htm ; quotings.htm, pascal.htm, etc.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.