axiom-developer
[Top][All Lists]
Advanced

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

FW: [Axiom-developer] RE: tex4ht and jsmath


From: Page, Bill
Subject: FW: [Axiom-developer] RE: tex4ht and jsmath
Date: Tue, 20 Dec 2005 09:42:36 -0500

 

-----Original Message-----
From: Davide P. Cervone [mailto:address@hidden 
Sent: Monday, December 19, 2005 7:29 PM
To: Bill Page
Subject: Re: [Axiom-developer] RE: tex4ht and jsmath

Bill:

Thanks for CCing me on the conversation about jsMath in the Axiom- 
Developer mailing list.  I read through the recent postings, and I  
might be able to shed some light on the subject.  Could you pass  
these comments on to the list?  I'd appreciate it.

There are several things involved with the font issues that some of  
you are having.  One of them is the font change that occurred with  
the v3.0 release of jsMath.  This release has new fonts that use a  
different encoding from the original BaKoMa fonts, and so I have  
named them with a "jsMath-" prefix to differentiate them, and avoid  
name collisions with the original ones.  Older versions of jsMath  
will not recognize or use these new fonts, so if you have downloaded  
fonts starting with "jsMath-", you will still get the font warning  
message if you view the jsMathExperiment site or http://page.axiom- 
developer.org/jstest.html (which use jsMath v1.8, which is now quite  
old), but will NOT get a font warning message on the jsMath examples  
page (which uses jsMath v3.0).  Those who reported bad rendering in  
MSIE are probably suffering from the older version of jsMath; v2.0 is  
where the image-based fallback was introduced.  With 1.8 if the TeX  
fonts were not available, jsMath would use unicode characters, and  
these were not entirely successful with things like roots and other  
delicate spacing (since jsMath doesn't know what font they will be  
taken from, so can't really know how they should line up).

If you want to test things with jsMath versions 2.x or 1.x, you need  
to get the BaKoMa versions of the fonts, still available on the  
jsMath font page (http://www.math.union.edu/locate/jsMath/download/ 
fonts.html).  You can install both sets of fonts if you want (the  
original BaKoMa fonts and the newer jsMath-specific ones).

Someone mentioned that he had not installed any fonts but still  
didn't get the font warning.  That is probably because the BaKoMa  
fonts are the ones that Firefox uses as part of their font suite for  
MathML.  If you installed the fonts for MathML, then jsMath will use  
them without your needing to install anything else.

Someone else talked about MikTeX installations, but these are not the  
fonts that jsMath uses.  It does not use the .mf or .pk files from a  
TeX installation, but rather .ttf fonts, which are not usually part  
of TeX itself.  (Some previewers may use these, but not a native TeX  
installation.)  In general, jsMath will not have any connection to a  
native TeX installation.

There was some concern over the method of testing for the TeX fonts.   
I admit that it is a hack, in the sense that it is not a guaranteed  
method of detecting the presence of the fonts, but in practice it has  
worked remarkably well.  The CMEX10 font has unusually large depth,  
and this is so unusual that it is pretty indicative of having the  
right font.  So far there has only been one complaint that I have  
received about not properly recognizing the fonts, and that was very  
early on, and the test has been adjusted since then.  In fact, it has  
worked well enough that similar test can be used to detect the  
presence of other fonts (like those in the extra-fonts area of the  
jsMath download site).  So I'm pretty satisfied with that method of  
detecting the fonts.  The problems that you all are facing are not  
due to that, but to the change in the fonts used by jsMath.  Sorry  
about the complication that has introduced.

A second issue is with the jsMath installations on your servers.  I  
am not able to access the ohio-state site, but the conversation  
indicates that someone at least had tried to make a page that sourced  
the copy of jsMath.js from the jsMath home page, and they got warning  
messages about not taking jsMath from the local server.  This is not  
an idle warning, and is not because I didn't want you to be able to  
do that; it is a restriction based on the browsers' javascript  
security model, and it will prevent jsMath from working properly.  In  
particular, jsMath consists of more than one javascript file (not  
just jsMath.js), and jsMath loads additional components as it needs  
them.  For example, the image fallback mode is not downloaded unless  
you need it.  But the method used to obtain these files relies on the  
other files coming from the same server as the main page (otherwise  
the browser won't let jsMath look at the files since they come from a  
different security domain).  The upshot is, if you load jsMath.js  
from a different server, it will be crippled and won't be able to  
function fully.  If you have the TeX fonts installed, jsMath will run  
OK in this situation (but the user will not be able to open the  
control panel, for example), however, if you DON'T have the TeX fonts  
installed, jsMath will not be able to download the code for the  
fallback method, and so you will not have your mathematics rendered  
properly (or at all).  This may account for why some of you can see  
it OK and some of you can't: those WITH the TeX fonts would see  
properly rendered math, and those without would see the TeX source  
code unrendered.

The same thing goes for those who downloaded one of the jsMath  
example files and tried to run it locally.  First, in those examples,  
the SCRIPT tag that calls in jsMath has a relative URL not an  
absolute one, so you would need to change that to point to a local  
copy of jsMath.  Second, if you pointed this to the jsMath.js on my  
server, you will run into the problems I mentioned above of taking  
jsMath from a non-local server.  Some browsers are less secure than  
others, and some will let you do this, but not all.  Finally, you  
can't just copy jsMath.js to the local machine, but must get a  
complete installation of jsMath, otherwise files that jsMath needs  
will be missing, and things like the fallback method for when the  
fonts are unavailable will not work.  Unfortunately, the lack of TeX  
fonts and the incomplete jsMath installation have combined to make  
matters worse for you.  If you download the complete jsMath  
distribution, you should be able to run a local copy just fine.

Finally, a note about the image mode for jsMath.  This does not use a  
single image of the complete equation (as is the case with most image- 
based mathematics).  Rather it uses separate images of the individual  
characters in the TeX fonts and creates the typeset mathematics from  
those just as though they were a real font.  So even when jsMath is  
using its image fallback mode, you will still get the progress  
message for the math being typeset.

I hope you are able to get this working for you.  Let me know if you  
have additional questions.

Davide

PS, it is possible to extend jsMath to include additional LaTeX  
environments that you may need.  The changes in v3.0 will make this  
sort of thing easier to do.  If Axiom uses a limited number of  
environments that are not currently supported by jsMath, I might be  
able to add them in for you.










reply via email to

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