# MathJax - "typesetting" of maths in Web pages - Page 2

•  Subject
• Author
• Posted on

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

On 08/13/2012 02:23 PM, Dr J R Stockton wrote:

MathJax appears to add a lot of code (both HTML and CSS) to the
document. Upon closer examination it seems to me that MathJax should
possibly consolidate the CSS as quite a bit is redundant. Your current
page alone balloons from ~109KB to ~5.3MB

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

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

It was under 58kB of ASCII when it left here.  That 5.3 MB must be the
size in RAM, which hardly matters.  Page authors can configure aspects
of the loading, which might help there.

At the moment, I first wanted to get it all working in as near a default
setup as I can, and next I want to move the equations into the HTML
representation of the Englished text, at <essai-3c.htm>.  That means
delaying MathJax start until completion of the existing pre-processing.
I gather that it would be easy enough if I first read and remember the
right parts of the documentation.

--
(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

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

Saving the 'generated' source (after MathJax does it's thing) results
in a 5.3MB text file. All the generated <scripts> are left in even
though they aren't needed anymore and many of the <span>s created
contains duplicate inline styles.

It all looks very good so far.

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

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

Norman Peelman wrote:

That is to be expected, as the document is not expected to be saved as
rendered, but as it was.  Furthermore, there is no reliable method to remove
all SCRIPT element nodes from a document tree once they are not needed
anymore.

That would be suboptimal, indeed.  MathJax should use CSS classes, which
would reduce the footprint considerably.

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

That will be alleviated in the final version.

<http://www.merlyn.demon.co.uk/essai-3c.htm is currently a full
translation with dummy equations generated by an internal pre-processor.
One sees the equations by downloading the original French PDF scan from
Belgium (5MB),

<http://www.merlyn.demon.co.uk/esai-jax.htm is currently a full
transcription of Lagrange's equations into TeX/LaTeX, with MathJax auto-
started.

<http://www.merlyn.demon.co.uk/p231-jax.htm is currently a one-page
translation with dummy equations generated by an internal pre-processor,
but when a button is pressed the dummy equations rapidly turn into
TeX/LaTeX which after cogitation are turned into typeset style.

The present plan is to polish what I have for a little while, and then
to apply to the translation page, or to a copy of it, the equations of
esai-jax and the code of p231-jax.

Then you will be able to load and save the page without pressing the
button, to get (estimated) less than 150kB saved - and whenever you
inflate it you will get the latest MathJax used.  Then you can "Save As"
that to get a quick-load version.

--
(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

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

Your updated page takes ~46 seconds to load and render all the equations
(on my system). I think you have an error on page 290.

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

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

Without knowing what your system is, that is of little help.

What do you mean by that?  is the algebra wrong? does it disagree with
Serrat's c.19 version? have I missed an equation out? ...  In Chrome 21,
the bar of a fraction is, or can be, too long (that's a known
MathJax/Chrome bug, in hand).  Aha - last line, first equation, RHS,
second term, shows '\muf' in red, should be 'uf' in black, with 'u'
there representing Greek 'mu'.  A possible token such as "\mu" is
terminated by the first non-letter, so the code must be "\mu f", not
"\muf", but the next equation can use "\mu'f".  Thanks.

--
(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

On 08/17/2012 02:58 PM, Dr J R Stockton wrote:

Hmmm, I thought for sure my sig was included... any way, it's an AMDX2
6400+ (dual core, DDR2)

Sorry about the vagueness...

:)

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

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

So it was ...

Would you care to look at <http://www.merlyn.demon.co.uk/linxchek.htm ,
using Linux?  I find it very useful when shuffling parts of my Web site.

To get it to work properly on any machine, it is necessary first to read
the included instructions - and that needs testing.

To get it to work properly on any machine, it is necessary to provide a
directory file.  The instructions for that, written for Windows, are in
the section "Directory File".  For Windows, it is just necessary to run,
in the right folder, DIR /B /S > $DIR.TXT . For UNIX, I don't know. Perhaps something like the suggested find /current ! -type d -print will do it, though that can hardly be sufficient - it would need to give a format sufficiently like the windows one. Alternatively, it might be necessary to alter the JavaScript that processes the file. Then the instructions can have a UNIX section. The position is that my JavaScript can load files into an iframe, but it has no means of recognising that a file is missing, and will try to use whatever it seems to have got. Of course, if there is a cross-browser cross-OS cross-server way of recognising missingness, I can use that instead, which will be better all round. -- (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 On 08/19/2012 02:09 PM, Dr J R Stockton wrote: find$PWD > <filename>

will generate a file listing of the type you are looking for...

/var/www/example/index.htm
/var/www/example/images/example.jpg

Actually, Google Chrome is the only browser that showed it had read
the dir file (with an erro msg to use different browser)... FF14
wouldn't even load a local file (dunno what's up with that) and Opera
and Konqueror show EMPTY. Don't have Safari and didn't install the
optional scripts but will look at it tomorrow maybe.

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

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

That should be acceptable, if those strings are OK for loading an iframe
with 'src = <string>'.

I've upgraded those messages.

All browsers loaded "EMPTY" (EMPTY is now CLEARED).  Cooperative
browsers rapidly replace it with something else - a web page, if I
recall aright.

The page processes about 180 of my pages per minute, on my P4/3GHz WinXP
Firefox.

--
(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.

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

On 08/21/2012 03:34 PM, Dr J R Stockton wrote:

/var is a mount point such as C:\

Chrome gave me the contents of the dir list...

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

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

That means, of course, that Chrome has read that file.  It does not, of
itself, mean that JavaScript has been able to read from the iframe.  If
JavaScript fails, try..catch, to read from the iframe, there should be
an alert.  But if it reads an empty body element ??? <test> it would
have stopped for no evident reason.

What did the status line say?  That's the line between the textarea and
the iframe, under the long green button?  What do the Chrome developer
tools indicate?  For me, they are accessed by Spanner, Tools.

If you do not have a file matching the entry in the "Starting Page"
control, the browser should give some sort of "file not found" message.

I've added a few status calls in the region where your run seems to have
stopped.

Thanks for your interest.

--
(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)