Changes in Recent Versions of jsMath
- Changed the way IE is detected to be more robust for IE8 in its various modes
- More fixes for vertical and horizontal alignment in IE8 in all its various modes, and in jsMath's various disoplay modes. More thurough testing than with 3.6d, which introduced some problems in some modes.
- Add
<code>
to the list of node types that are not scanned for mathematics by the tex2math plugin.
- Updated the unicode fallback mode font tables for Mac and PC to handle current font configurations better.
- This release includes an important speed improvement. By typesetting several equations before allowing the screen to update,
jsMath.Process()
now processes pages several times faster than in the past.
- Fixed a wrapping problem in Safari, Chrome, and FireFox, where recent versions of these browsers could allow a math expression to extend beyond the right margin on one line while leaving empty space for it on the next line.
- Fixed the missing font message used when the
noImageFonts
plugin is used so that it informs you that the unicode fonts are used rather than image fonts.
- Fixed a problem where the jsMath button would not appear in the correct location when a DOCTYPE triggers "standards" mode in MSIE.
- Worked around a bug in MSIE8 when a DOCTYPE triggers "standards" mode that would cause some mathematics not to be properly aligned on the baseline.
- Fixed a problem were a customized extra font warning message would be overriden by
jsMath/easy/load.js
when thenoImageFonts
value was set to 1. Also, the main font message is now adjusted in this case to indicate that unicode fonts will be used rather than image fonts.
- Put
<script>
tag into lower case ineasy/load.js
for XHTML compliance.
- Fixed a bug (introduced in version 3.6) with the
smallFonts
plugin that prevented it from running.
- Remove support for BaKoMa fonts -- they are too unreliable and cause problems now in Chrome as well as FireFox.
- Fixed a problem with the tex2math plugin that could cause the \\ terminator, when followed by an open parenthesis or bracket, to not be processed properly.
- The linux version of Firefox 3.5 doesn't seem to be able to read the jsMath TeX fonts (probably due to the non-standard encoding), and so new versions have been provided on the font download page for linux users.
- Fixed an error in the documentation for the
autoload
plugin that incorrectly listedcheckElement
aselement
.
- Made the
autoload
plugin use the same message box as the jsMath messages so that it can be controlled by the same CSS settings.
- Fixed a subtle timing bug where multiple calls to jsMath.Process() could cause math that autoloads an extension to be left as the source TeX code rather than typeset.
- Fixed an error where jsMath could produce uncaught exceptions during the loading of external files when those files could not be loaded properly. JsMath now throws a proper error message rather than a custom exception.
- Set the
jsMath/test/index.html
file to not use image fallback, since that might not be installed properly. This will allow you to test jsMath's core functionality separately from the image fonts.
- Worked around a bug in MSIE where jsMath used in a frame of a frameset would fail to load properly. This was due to jsMath's trying to determine whether it is running in a frameset produced by the GoGlobal button by changing the document domain to find one in common with the global frame. MSIE gets confused about its security settings even when the domain is set back to its original value. Since the GoGlobal feature is rarely used, and since the domain detection is only needed when a page is taken from a different machine within the same sub-domain (unlikely), this test is disabled for MSIE. Other well-behaved browsers will still perform the check.
- When a minimum font size is in effect, jsMath can mismeasure the heights of superscripts and subscripts. The algorithm for determining these values has been improved to handle minimum font sizes better, though it is not perfect.
- Added CSS to avoid a bug in IE6 and IE7 when jsMath is used within a PRE block.
- Worked around a problem where Safari and Chrome would not show negated relations properly when the jsMath-TeX fonts are used (i.e.,
\not
did not work properly).
- Added an alert if the document has no HEAD section when one is needed to handle the addition of stylesheets.
- Fixed a problem with MSIE where some characters could disappear when the DOCTYPE triggers "standards" mode.
- Worked around another problem with Firefox 3.5's single-origin policy for local files that would cause jsMath not to be able to load external components.
- Fixed an error in the Unicode fallback tables for the PC (the "floor" and "ceil" characters were reversed).
- Fixed a problem with MSIE where a relative URL used to obtain jsMath from a server that requires a port number was not handled properly by jsMath.
- Fixed a bug in which alignments could be clipped on the right in MSIE under certain font-scaling conditions.
- Added an
eqnarray*
environment for consistency with other starred environments, and made theeqn-number
extension honor the star.
- Updated the
bbox
extension to avoid a problem with box widths not being properly computed when\bbox
commands are nested. Also the old version was inefficient about typesetting the contents of the box (it was performed twice, so nested boxes caused the processing to go up exponentially). Finally, boxed elements now have superscripts and subscripts applied to the box, rather than the contents of the box.
- Fixed a problem with how jsMath measures the heights of characters (by removing an old hack that no longer appears to be necessary). This improves spacing in
\overline
and other situations that are height-sensitive.
- Fixed a bug introduced in v3.6a (by a typo) that would prevent processing of mathematics within an
\hbox
.
- In v3.6, the method for handling the
position:fixed
bug in MSIE caused type-in areas in forms to be difficult to select (due to another bug in MSIE), so the solution had to be scaled back a bit. It now allows you to override the horizontal position of the jsMath button and message box, but you can't position it relative to the top of the window in MSIE. Repositioning works fine in all other browsers. I'll keep working to see if I can get around this.
- Properly detect the Google Chrome browser.
- Fixed
\angle
to not use unicode but rather construct it from the fonts similar to how TeX does.
- Fixed bug where
\char
did not properly respect the current style (e.g., in scripts)
- Added a new
macros
field to theeasy/load.js
file that lets you define custom macros automatically. (This is easier than having to make your ownlocal.js
file.)
- Fixed a bug with
\operatorname
in theAMSmath
package that incorrectly handled the unstarred version of the operator in displayed math mode.
- Worked around a problem with image fonts in Firefox3. The width of the images were not being properly reported (even when specified explicitly in the IMG tag's STYLE attribute) if the image wasn't loaded from the server yet.
- Worked around a problem in IE8 when jsMath is loaded from the local disk rather than from a server.
- Added more checks when
jsMath.safeHBoxes
is set to prevent additional ways in which the user could have inserted HTML tags into\hbox
commands.
- Fixed a bug in the
spriteImageFonts
plugin that had been causing it to fail in Firefox2 and earlier, Opera 9.2x and earlier, and all versions of MSIE. It seems to have stopped working somewhere after version 3.4 of jsMath.
- Fixed a bug where newlines were not treated as spaces when scanning for arguments of macros that require arguments.
- Fixed the
eqn-number
extension to handle\nonumber
as a synonym for\nolabel
, and made theequation*
,align*
, andmultline*
environments not produce equation numbers.
- Removed a debugging alert from the Firefox3 local-file code that was accidentally left active in version 3.6.
- Added a new
eqn-number
extension that allows you to add equation numbers to displayed equations via\label{xxx}
and refer to those numbers at other locations in the HTML page via\ref{xxx}
. See theeqn-number
documentation for more details.
- Fixed more problems with Firefox3 and their new single-source security policy for loading local files. (Previous attempts worked with pre-release versions of Firefox3, but this works with the release version.)
- Worked around a print bug with Firefox3 where thin horizontal rules could disappear in the printed version even though they appear on screen.
- Added CSS styles to make images in hypertext links within mathematics be underlined when one of the image modes is in use.
- Added CSS to help isolate the control panel width from the CSS of the main page.
- Added ability to put the mathematics within CDATA to help avoid problems with <, > and & within the mathematics. For example:
<SPAN CLASS="math"><!--[CDATA[ x > y ]]--></SPAN>Using<![CDATA[ ... ]]>
without the--
does not work in some browsers.
- The
tex2math
plugin now processes thetex2math_ignore
andtex2math_process
directives on an element even if there are other class names included on the element as well.
- Fixed a bug with the
autobold
plugin in MSIE when certain fonts are used as the default font.
- Enhanced the ability to preset the styles used by jsMath by making the
jsMath.styles
entries be associative arrays rather than strings. This makes it easy to change a single style setting: instead of retyping the entire string, you simply set the style value that you are interested in changing.
- Fixed a problem where Safari3 would not be able to drag the TeX source window produced by double-clicking on typeset mathematics.
- Added an option to control whether the
@(...)
construct is processed within\hbox{}
or not. This would allow arbitrary HTML tags to be inserted, which poses a security risk for content-management systems where untrusted users are entering data. Theeasy/load.js
file now has a setting to control this, and it is off by default, though it is on by default when loadingjsMath.js
by hand. To turn it off by hand, setjsMath.safeHBoxes
to 1.
- Added checks within the
HTML
extension that prevent the insertion of raw HTML into jsMath equations.
- Added a
jsMath.ProcessElement()
call that allows you to process the contents of a single element (of class "math") as TeX code directly. Note that this call may return before the mathematics is actually finished typesetting. See the page on dynamic math for more details.
- Modified the way jsMath works around the lack of support for
position:fixed
in MSIE so that style changes for where the jsMath button and control panel appear should work properly in MSIE.
- Removed the "Check for Updates" button from the jsMath Control Panel and moved it to the
jsMath/test/index.html
page (since it is really an administrator function, not a user function).
- Fixed a problem with the
boldsymbol
extension where it could leave the fonts set to the bold fonts, so that all the rest of the mathematics on the page would be in bold. (This would occur if a jsMath auxiliary file had to be autoloaded by the\boldsymbol
command.)
- Fixed a timing problem with
easy/load.js
when autoloading and tex2math are both used (the default) that could cause some internal routines to run in the wrong order.
- Fixed a problem in detecting a font size change in MSIE when the font used at one location on the page is only slightly smaller or larger than that used at the previous location.
- Added ability for extra fonts to specify how they are handled in symbols-only image mode. This is used by the cmmib10 font to specify that the italic letters should be handled by bold italic letters in the serif font rather than by images, which was the old behaviour. You will need to replace the jsMath/fonts/cmmib10/def.js file with the new one to take advantage of this.
- Added a new
autobold
extension that allows jsMath to detect the presence of a <B>...</B> tags (or CSS that sets font-weight:bold) surrounding the mathematics and automatically apply\boldsymbol
to the mathematics. Since this requires the extracmmib10
andcmmsy10
fonts, this is an extension that you must activate yourself. See theautobold
documentation for details
- Implemented the
\verb
command for entering verbatim material. See theverb
extension documentation for details.
- Added
aligned
andgathered
environments to theAMSmath
plugin.
- Added
equation
andequation*
environments. (Sincetex2math
now processes LaTeX environments within the text of the page, it makes more sense to have these defined.)
- Fixed a problem with
\newcommand
where it would reject control-sequence names that included upper-case letters.
- Fixed a problem with the
\font
command where the control sequence would be lost when the font was loaded (if it wasn't already loaded when the\font
command was issued).
- Fixed a timing bug with
easy/load.js
when there are files specified in theloadFiles
array. The bug only occurred with the Opera browser.
- Worked around a problem with Opera where the
autoload
plugin could hang when trying to load the jsMath.js file.
- Worked around a spacing problem in IE7 where some elements in an array or fraction could be misaligned.
- Worked around a problem in IE7 where accented characters could disappear under some circumstances (particularly when they appear by themselves).
- Fixed a problem with Firefox3 where the control panel would not open.
- Firefox3's new single-origin policy restricts access to file outside the currect directory when local files (i.e.,
file:
URL's) are used. JsMath now uses the newwindow.postMessage()
facilty to work around this. If you usewindow.postMessage()
yourself you should be aware that jsMath is also using window messages, and so you should be careful to properly identify your own messages so as not to confuse them with the ones used by jsMath. All messages used by jsMath will begin withjsMLD:
,jsMCP:
, orjsMAL:
so you can filter these out of our own message-processing code.
- Disabled the BaKoMa font processing in Firefox3 since jsMath no longer works properly with those fonts in Firefox3.
Version 3.4f (5 November 2007)
- Fixed a problem with the
\bbox
extension where the sizes of boxed items in super- and subscripts was incorrectly set, and where super- and subscripts for large operators that are boxed might be placed incorrectly.
- Version 3.4e arranged for
tex2math
to recognize\begin{xxx}...\end{xxx}
outside of math mode. It incorrectly placed the environment into in-line math mode rather than display mode. This had been corrected.
- One more attempt to work around alignment problems with MSIE with a DOCTYPE that triggers "standards" mode. I think I finally found the real problem, and was able to remove several hacks that were not completely effective.
Version 3.4e (29 September 2007)
- Added ability for the
tex2math
to find LaTeX environments of the form\begin{xxx}...\end{xxx}
outside of math mode. This is enabled by default forjsMath.ConvertLaTeX()
, and can be enabled in theeasy/load.js
by setting theprocessLaTeXenvironments
value to 1 (now the default).
- Fixed issues with loading a local copy of jsMath in MSIE. Apparently, MSIE considers xmlHttpRequest calls for local files to be access violations, even when the calling file is also local, and so MSIE needs to use the non-xmlHttpRequest fallback method when loading jsMath locally.
- Worked around a long-standing issue with MSIE where elements that are positioned using backwards skips could be clipped in some circumstances. In particular, the Chapter 18 commutative diagram now displays correctly, as do exponents that have been adjusted to the left. This was a vexing MSIE bug that is good to finally have worked around.
- Fixed a problem with placement of accents in some situations (the italic correction was not being applied properly).
- Worked around bug in MSIE where the
\vec
vector arrow was being clipped at the right.
- Worked around bug in MSIE where
\mapsto
and\longmapsto
were displayed incorrectly (space appeared between the arrow and the tail).
- Fixed a problem with
easy/load.js
where jsMath could fail to run wheneasy/load.js
is loaded at the top of the BODY of the document (rather than the HEAD) andautoload
is specified buttex2math
is not needed (i.e.,autoload
is set to 1, whileprocessSlashParens
,processSlashBrackets
,processDoubleDollars
, andprocessSingleDollars
, are all set to 0 andcustomDelimiters
is commented out).
- Fixed a bug where
easy/load.js
could run its onload handler more than once in some browsers.
- Fixed a bug in the
autoload
plugin where jsMath.js could be loaded twice if a call tojsMath.Autoload.ReCheck()
is made while the first copy of jsMath.js is in the process of being downloaded.
- Fixed a subtle timing issue with
jsMath.Process()
when some mathematics on the page requires an external file to be autoloaded and there are additionaljsMath.Process()
calls pending.
- Modified the algorithm used by
easy/load.js
for finding theroot
when it is not specified so that it will work better with MSIE in the situation whereeasy/load.js
is loaded via a relative URL.
- Added
\operatorname
to theAMSmath
extension, which was acidentally left out previously.
- Fixed some alignment problems with MSIE when running in "standards" mode rather than "quirks" mode (i.e., in the presence of certain DOCTYPEs).
- Added a new
AMSmath
extension that implements most of the macros and environments from theamsmath
LaTeX package. This includes thealign
,multline
,split
, andgather
environments that were previously missing from jsMath. See the documentation for theAMSmath
plugin for more details.
- Added
\newenvironment
command to thenewcommand.js
extension. It is loaded automatically when the\newenvironment
command is first used. Thenewcommand.js
extension also includes ajsMath.Environment()
command, similar to the standardjsMath.Macro()
command, for defining environments in a JavaScript file. See the comments inextensions/newcommand.js
for more details. Note that you must load this extension explicitly in order to usejsMath.Environment()
.
- Added the missing
\overleftrightarrow
macro, plus missing\under...
versions of all the arrows. Also, the result is now made an "ord" box rather than an "inner" box, as it was (incorrectly) doing.
- Added
\pmb
for "poor-man's bold".
- Report an error when
#
is used outside of macro definitions (Use\#
instead).
- Fixed a bug with
\mathchoice
where empty values for one of the choices would cause jsMath to stop processing the formula.
- Fixed a bug with
\mathop
where the spacing within its argument could get incorrectly set.
- Fixed the
noImageFonts
plugin to allow authors to override the missing-font message that it contains. (Fixes bug #1722144)
- Fixed a typo in the
noImageFonts
plugin that would cause some browsers to fail to process the plugin correctly.
- Corrected the documentation for the
noImageFonts
plugin, which incorrectly indicated that it should be added to theeasy/load.js
file'sloadFiles
array. The correct way to indicate no image fonts ineasy/load.js
is to set thenoImageFonts
flag in that file.
- Corrected
easy/load.js
to properly handle thenoImageFonts
flag.
- Fixed a problem where jsMath could stop processing the page in some browsers when an autoloaded extension file is not found on the server.
- The
easy/load.js
file now attempts to set the root URL if one isn't provided. It will look up the URL where it was loaded from and try to locate the jsMath URL from that. (If you load a copy ofeasy/load.js
from somewhere other than the jsMath directory, however, this won't work.)
- The easy loader now propagates the root URL to other components of jsMath so that they will correctly determine the location of the jsMath directory.
- Modified the
autoload
plugin to use a floating window for the "loading jsMath..." message rather than an absolutely positioned one. (That had been done originally for MSIE, but it will treat this as absolute positioning anyway, so why not let other well-behaved browsers take advantage ofposition:fixed
?)
- Fixed a problem with the
autoload
plugin that caused jsMath to fail to run if the Prototype Javascript Framework was also loaded. (The problem was related to the additions the Prototype framework adds to the JavaScript Array object.)
- Fixed a problem with the
noImageFonts
plugin where extra fonts would still try to use image fonts even when they were supposed to be disabled. Also, noImageFonts now adjusts the error message to indicate that unicode fonts will be used for fallback rather than image fonts.
- Fixed a problem where changes in the CSS line-height attribute could cause alignment problems with arrays in MSIE.
- Fixed a number of alignment problems with MSIE when used with a DOCTYPE that triggers "standards" mode rather than "quirks" mode.
- A bug fix needed for MSIE6 that is one of the sources of jsMath's slowness with MSIE is now disabled when MSIE7 is used, since it is no longer needed in that version. This should give a noticable speed improvement for jsMath in MSIE7.
- Added a test page so that you can more easily determine if you have jsMath installed correctly. See the installation instructions page for details.
- Added a new "easy loader" so that jsMath can be loaded and run with a single <SCRIPT> tag. The file can be customized to configure jsMath to suit your needs, and it can control jsMath, invoke the
autoload
andtex2math
plugins, and load extensions and fonts. See the getting started author's documentation for details. Many of the author's documentation pages have been updated to reflect the new easy loader.
- A number of users have complained that the jsMath TeX fonts don't render well on the PC, and this problem has gotten worse with the release of MSIE7. This seems to be due to poor anti-aliasing, and so, for example, thin horizontal lines can disappear (causing minus signs to vanish, or plus signs to turn into minus signs). It is telling that Microsoft has disabled font smoothing within their own fonts. A new set of jsMath-TeX fonts have been sent to me by Jetsada Karnpracha with anti-aliasing turned off, which perform better than the original versions. To take advantage of this, you will need to downlaod new versions of the jsMath-TeX fonts from the fonts download page. The extra fonts have not yet been modified, but should be in the future.
- Fixed a problem with the jsMath button not staying in the lower right-hand corner in MSIE7. (The fix does not take into account changes in the position based on CSS for the button; that may be fixed in the future.)
- In the images-for-symbols fallback mode, the minus sign was being represented by an en-dash. This caused problems in some unix environments; it has been replaced by the unicode minus sign, which it should have used in the first place.
- Fixed an error where empty math lists could end up with negative widths (cached data wasn't being cleared properly).
- Fixed a bug where super- and subscripts immediately following
\over
and related macros would incorrectly apply the super- or subscript to the last item preceeding the\over
.
- Fixed an error with
\smash
that could cause the line spacing to be incorrectly set in some situations.
- Added
\lt
and\gt
macros to make it easier to enter mathematics that include<
and>
. Since these characters are used to mark HTML tags, it can be hard to include them in TeX code within an HTML page. Often putting spaces around the<
or>
will work, and you could enter them as HTML entities like<
and>
, but this is not very convenient.
- When sprite-image fonts are used in conjunction with any of the extra-fonts, then jsMath would incorrectly look in
jsMath/fonts
rather thanjsMath/fonts-sprite
for the definition files if the user has the native jsMath version of the font installed. This has been corrected. Also, thedef.js
files have been updated for four of the sprite fonts: cmbsy10, cmmib10, msam10, and msbm10, so you may want to download those sprite fonts again.
- The warning messages for missing extra fonts are now recorded in the jsMath cookie, so they will not be reissued after they have been displayed once.
- Changed the way that the
jsMath.Setup.User
routine works. You now specify functions for the individual times that theUser
function could be called via thejsMath.Setup.UserEvent
object. See the discussion in overriding jsMath functions for more details. Pages that replace thejsMath.Setup.User
function, and that properly check for thewhen
parameter, should continue to work.
- Added a new "onload" event to the ones that are processed by the
jsMath.Setup.User
routine. This is called whenjsMath.js
has finished loading and running. Note that ifjsMath.js
is loaded in the document HEAD, this will fire beforejsMath.Setup.Body()
has been called, so the "onload" event may come before the "pre-font" event (which occurs as the body is being set up).
- Fixed a problem with baseline alignment in Firefox when in-line math appears within text that has a non-standard line-height. (There are still some baseline issues with MSIE — big surprize).
- Added more CSS to jsMath's control panel to try to isolate it from the main page's CSS a bit more (so that font and background color changes won't bleed into the control panel).
- Added CSS to make the link button's border work properly in warning messages in MSIE.
- Fixed the documentation for
autoload
which incorrectly listedfindCustomStrings
asCustomStrings
.
- Fixed a problem with custom delimiters in
tex2math
. When the starting and ending delimiters are the same,tex2math
did not properly end the math mode at the first terminator.
- Fixed a problem with
tex2math
where theprocessSlashParens
andprocessSlashBrackets
flags did not get handled properly when they are set to zero.
- Fixed ability of jsMath to identify Intel-based Macs.
- When the AMSsymbols extension is loaded, the \mathbb macro is now changed to use the blackboard bold characters that are in the msbm font. (In the past, this would occur when the msbm font is first loaded, but the change should be made right away, since a use of \mathbb should cause the msbm font to load if it isn't already.)
- Fixed a bug introduced in version 3.3f that causes
tex2math
(when used withautoload
) to cause MSIE/PC to stop processing display mathematics in some situations.
- Fixed problem with
\longmapsto
that caused gaps between the characters that form the arrow. Also worked around a problem with Firefox that caused\mapsto
to lose its vertical tick at the left-hand end of the arrow.
- Fixed a problem with
autoload
where multiple calls totex2math
could causetex2math
to convert \$ to $ and then later try to interpret the $ as a start-of-math delimiter, even though it was previously escaped.
- Reorganized the
autoload
plugin so thatjsMath.Autoload.Run()
no longer needs to be called. In the past,autoload
would usetex2math
to look for text that needs to be converted to SPAN and DIV tags of class "math", but would not convert them itself. Now thatautoload
has settings to control whattex2math
functions will be performed, there is no need to put off the conversion, soautoload
now does thetex2math
conversion immediately. ThejsMath.Autoload.findMathElements
variable is no longer needed, and so has been depricated.
- Fixed a problem with
tex2math
where two escaped dollars in a row would not be processed properly (the second would not be treated as escaped, and so could be treated as a start-of-math delimiter).
- Fixed a problem with how the cookie data is stored for the control panel (special characters were not being escaped, which causes difficulties with some browsers).
- Fixed a bug where jsMath would not determine the em-size correctly in text blocks where the text-indent was set to a non-zero value.
- Added some CSS styles to try to isolate the jsMath control panel from changes that might be caused by CSS settings from the main page. (Page authors who set styles that affect the jsMath panel may want to add additional CSS rules to reset those within
#jsMath_panel
in order to make the panel continue to look correct.)
- Added
\newline
as an alternative to\cr
and\\
.
- Added a new help file explaining the missing font messages and how to address them.
- Fixed a bug (introduced in v3.3) when symbol or unicode fallback methods are used that would cause the heights and depths of some characters to be improperly determined. This could cause overbars, superscripts and subscripts to be incorrectly placed.
- Added a
smallFonts
plugin that can be used to enlarge the fonts used in subscripts so that if your page uses small font sizes, the subscripts won't become unreadable. This means the results will not match TeX quite so closely, but may be more visible for your readers.
- Fixed a problem that could cause Konqueror not to process any of the mathematics on the page.
- Fixed a problem where Konqueror would not properly detect the presence of the jsMath TeX fonts. (Credit to Martin Rubey for suggesting the solution.)
- Fixed a problem that prevented jsMath from loading auxiliary files when an Autoload root directory is specified that is a relative URL rather than an absolute location.
- Fixed a bug in the
tex2math
plugin in which custom search patterns that included dollar signs would cause jsMath to enter an infinite loop. You can now use custom searches that include dollars correctly. For example, you could usejsMath.tex2math.CustomSearch('$$','$$', '$$$','$$$'); jsMath.ConvertCustom(document);to use double-dollars to delimit in-line math mode and tripple-dollars for display mode.
- Modified the
autoload
plugin to allow the autoload checks to be called more than once. (For example, with dynamic documents, you may need to run the check again as new content is added to the page.) You can now calljsMath.Autoload.ReCheck()
in place ofjsMath.Autoload.Check()
in these cases.
- Modified the
autoload
plugin to processjsMath.Synchronize
calls even when jsMath is not loaded, so you can still use this to synchronize with the checking process even when there is no math on the page.
- Fixed a problem when the
global
plugin is used with asynchronous processing that could cause the page to open over and over again rather than open into global mode. This is the case whenautoload
orCHMmode
is used.
- Worked around a bug in Microsoft's help viewer that would cause the
hh.exe
process to use up 99% of the available CPU time when the help window is closed. This occurred when theautoload
or asynchronous file loads were used within compiled help files, or when the control panel was opened and the page reloaded. It still occurs when the user selects pages via the automatically generated table of contents, so it is recommended that you disable that table of contents and create your own HTML version. (This will also help jsMath operate better, since clicking in that table of contents would have caused the cache and control panel settings to be lost in any case.)
- Converted
autoload
plugin to useXMLHttpRequest
when possible rather thanjsMath-autoload.html
.
- Fixed a problem where jsMath could report an error when the
global
plugin is used with Safari.
- Fixed a problem where a javascript error could be reported on the frst page when the
autoload
plugin is used.
- Fixed a problem with regular expressions that caused old versions of Firefox to fail in global mode.
- Fixed a problem that prevented jsMath from loading properly in IE7 beta on the PC. (It does not seem to handle the XmlHTTPrequest object correctly.)
- Fixed a problem with the
CHMmode
plugin that could cause pages to continually attempt to reload global mode in an infinite loop. This only affects pages viewed in the Microsoft help viewer.
- The
CHMmode
plugin is supposed to disable the image fonts (since they are not usually included in the help file, because of their size), but there was a typo that prevented this from occurring. The typo has been fixed.
- Added the ability to include HTML tags in
\hbox{}
text more easily. Note that the contents of an\hbox
is not processed by jsMath (except for mathematics contained within\(...\)
or$...$
) but rather is passed to the browser for formatting as normal in-line text. This means that you can't use TeX commands to change the formatting within an\hbox
; but you can use HTML tags to do it. The prblem is that tags are removed from the mathematics before jsMath processes it, so you used to have to use "<
" and ">
" to introduce tags into\hbox
text. JsMath will now process "@(...)
" as an HTML tag in the text of an\hbox
; for example,\hbox{an @(I)italic@(/I) word}
will produce "an italic word". Still not as nice as actual tags in the\hbox
, but better than the previous method.
- Fixed a problem with the
tex2math
plugin introduced in version 3.3 that causes MSIE on the PC to fail to processtex2math
pages properly. The bug does not seem to have affected other browsers.This version introduces several new features that attempt to improve the rendering speed of jsMath via an equation cache that stores the typeset mathematics so that if the same equation appears again, the cached version will be used rather than reprocessing the equation a second time. This helps when the same equation is used several times on the same page. There is also a sub-expression cache that comes into play when expressions include common elements. See the author's page on the
noCache
plugin for details on how to control the cache.By default, the equation cache is kept on a per-page basis, so it is cleared when you link to the next page. (This is due to security limitations imposed by the JavaScript language.) This version if jsMath includes a means of making the equation cache be persistent across pages via its new "Global Mode". You can turn on Global Mode using the "Go Global" button on the jsMath Control panel. See the Global Mode help page for the details of how to use Global Mode, the issues that it introduces, and how to deal with them.
The new Global Mode has necessitated another slight reorganization of the main control panel in order to accommodate the extra buttons that it needs. See the control panel documentation for the details on these.
For web-page authors, there are several new plugins for controlling the cache and global mode. These include the
noCache
,global
andnoGlobal
plugins.In addition to the changes listed above, this version includes the following modifications:
- Added a new
\bbox
extension that allows you to produce a bounding box for a portion of an equation. This box can have a colored background or a colored border, and you can control how much padding to include around the mathematics. In addition to making colored backgrounds and borders, such backgrounds could be used to make click targets for interactive mathematics. See the comments in theextensions/bbox.js
file and the extensions example page for some examples.
- Fixed a bug with the command-synchronization mechanism that could cause commands to be executed in the wrong order if one external file loads a second external file when files load asynchronously. (This is the case by default only for MSIE/Mac, or when jsMath is loaded from a different server from the page containing the mathematics, though users can request asynchronous mode in the jsMath control panel.) This change also removes the need for
jsMath.Script.Start()
andjsMath.Script.End()
calls to be used within extensions and plugins. (This is now handled automatically by the file-loading code.)
- Fixed a problem with loading external fonts when the font was requested by
jsMath.Font.Load()
in the document HEAD section rather than the BODY. (Such requests are now queued and processed when jsMath's setup has been completed, after the BODY is available.)
- Fixed a bug where jsMath would not intialize correctly if the
AMSsymbols
plugin were loaded in the document HEAD when viewed with Safari.
- Fixed some instances where global variables were used accidentally instead of local ones in some functions.
- Fixed a number of places where FireFox would report warning messages when it was in strict JavaScript mode.
- Added modifications to allow jsMath to be used with MicroSoft's compiled help files (
.chm
files). See the documentation forCHMmode
plugin.
- Modified the handling of the horizontal rule for square-roots so that they will be thicker when shown at a large magification.
- Fixed a problem where jsMath would not initialize properly if it was used within a page that is loaded into a frameset.
- Fixed the
autoload
plugin to work with OmniWeb 4.x.
- Fixed a typo (introduced in version 3.2b) that caused the control panel not to load peroperly when jsMath is invoked from a server that is different from the one for the page containing the mathematics.
This release includes a number of minor bug fixes and enhancements.
- The font warning message is now only shown on screen, not in printed versions of the page.
- The CSS style used to control the atrributes for the missing-font message has been changed from "
#jsMath_noFont
" to "#jsMath_noFont .message
" for consistency with other styles used by jsMath. Old pages that use#jsMath_noFont
directly may need to be modified to include the.message
selector.
- The author's documentation for controling the missing-font messages has been updated to take into account the recent changes in the missing-font message handling.
- Most users are not aware that jsMath has a higher-resolution image mode designed to make printed output look better. For this reason, jsMath now will show a warning message at the top of the page when it is printed at low resolution (the message does not appear when viewed on screen). Because MSIE and Firefox on the PC print the image fonts with alpha-channel transparency incorrectly (the characters appear as black boxes), the message also instructs you to turn off alpha channel images when printing (this is done automatically when the "Hi-res fonts for printing" button is used). There is a new checkbox on the jsMath control panel that lets you disable these messages even when the low-resolution fonts are not used. There is also a checkbox that forces the high-resolution fonts always to be used (when image fonts are selected).
- The addition of several new checkboxes on the jsMath control panel made the window for the control panel rather tall. This has required a reorganization of the control panel, and it now has a horizontal rather than a vertical orientation which better matches the aspect ratio of most screens.
- Fixed a problem that prevented jsMath from initializing properly when it was loaded into a FRAME or IFRAME.
- Fixed a bug in the
autoload
plugin where the plugin would fail if thejsMath
variable was not defined before loadingautoload.js
.
- Fixed a spelling error in the jsMath alert that is displayed when jsMath fails to initialize properly.
- Added an extension that implements the
\font
command. (Now that jsMath can auto-load fonts as they are needed, this is feasible to do.)
- Added
\eqalign
and\displaylines
for creating multi-line displayed mathematics. Also added\eqalignno
, but it works by putting the line numbers in a right-justified column separated by 3 em's of space from the rest of the alignment (rather than putting them flush right, which would be difficult without more substantial changes to jsMath). Finally, added\leqalignno
, but the line numbers are placed on the right not the left (it is really just an alias for\eqalignno
, and is included only for completeness).
- Added the ability to use
\noalign{\vskip ...}
and\\[dimen]
to insert space within an array or alignment. This is not a complete implementation of\noalign
; only\vskip
and\vspace
commands are processed, and this is only intended as a way of controlling the spacing between rows of a table.
- Adjusted the spacing within some alignments to better match actual TeX output.
- Added
\mbox
and\hbox
to the commands that are processed correctly after ^ and _ (i.e., as unbraced superscripts and subscripts).
- JsMath's implementation of
\raise
and\lower
are non-standard in that they do not require an\hbox
, as TeX does; indeed using an\hbox
would cause jsMath to fail (unless it were enclosed in braces). This is no longer the case, as these commands now handle\hbox
and\mbox
as TeX does.
- This version of jsMath includes a new experimental image-font mode that tries to address some of the important drawbacks to the current implementation. As it stands now, each character in each size in each font is a separate image, so there are tens of thousands of tiny images used by jsMath. That means that there is a lot of overhead both in terms of network traffic when the image fonts are used and in storage space on the server to make image fonts available. For those who must use FTP to move individual files to the server, it can be quite painful to install the image fonts.
An alternative approach is to use one larger file to store the images of all the characters in a given font, and to display only a small portion of that file when one of its characters is needed. This has the advantage of reducing the number of needed files by a factor of 128 (the number of characters in each font), so they take up far less space and there is less network activity needed when a user requests image fonts.
Unfortunately, there are costs to this approach. One is that the clipping required to obtain the small images from within the larger file is very delicate, and even a one-pixel error can be disastrous. While the on-screen version works reasonably well, some browsers introduce slight spacing errors in the printed versions of their pages (most likely due to the changes in font metrics between the screen and printer versions of the fonts). Moreover, some browsers render the clipped regions slower than they do the individual images (presumably they are rendering the whole image even though most of it is not shown). This is particularly noticable in MSIE on the PC, which is already the slowest browser that handles jsMath, making it even slower. It also seems to be an issue with Firefox on the PC when the high-resolution images for printing are used (but not at normal resolutions). Finally, Opera has serious problems with this new approach: due to an alignment bug in Opera, the image fonts can't be scaled in Opera, and on the PC the image fonts don't print properly.
Due to these limitations, this new image mode has not been added to jsMath.js directly. Instead, it is available as a plugin, so you must choose this mode explicitly, and presumably because you need the smaller files and are willing to accept the slower performance in MSIE and the printing and scaling problems in Opera. See the spriteImageFonts plugin page in the author's documentation for the details of how to enable this image-font feature. Note that this plugin is considered experimental and is not guaranteed to be retained in the future; use it at your own discretion.
Additional changes in this version:
- Changed the way the cookie values are stored so that only the ones that are not the same as the defaults for the page are stored in the cookie. That means that if one page sets a value for the scaling factor, for example, it will not be retained in the cookie unless the user explicitly changes the value. That way, the default size can be set differently for different pages, and one page setting will not affect the others.
- Improved handling of inter-line spacing for lines containing inline mathematics in Opera and old versions of OmniWeb.
- Fixed a problem in MSIE on the PC where horizontal skips could be lost when the space is at the beginning of an expression.
- Fixed a bug where a mathematics element would lose its CSS class ("math") when it causes an extension to be autoloaded.
This release includes a number of bug fixes and some enhancements. Since there are more changes than usual, they are grouped by category below:
Browser-specific bug fixes
- Fixed a problem with Firefox 1.5.0.1 introduced in v3.1d that can cause arrays and other layouts to be improperly aligned in some circumstances.
- Fixed a problem with Firefox where the jsMath button would not have the correct width on some pages.
- Fixed a problem with alignment of horizontal rules (e.g., in fractions and square roots) in old versions of OmniWeb (versions prior to 5).
- Fixed a problem with MSIE and the
tex2math
plugin where displayed equations that are centered would not recenter if their containing element was resized. The centering was faked by jsMath, but now it is handled by the browser, so should recenter properly with changes to the surrounding page layout.
- Fixed a problem in MSIE where the URL for the jsMath directory was incorrectly determined when jsMath.js is loaded via a relative URL. This was introduced in v3.1e, but really should be right this time.
Changes related to styles and layout
- Eliminated the need for
blank.gif
except within old versions of OmniWeB and Opera, which don't handle the newer approach properly, and in MSIE when image fonts with alpha-channel transparency is used, due to the absurd way that MSIE handles alpha transparency. These changes allow for cleaning up a number of portions of the layout mechanism used by jsMath; but since this is a significant change in the way jsMath handles the layout, it may introduce problems in some circumstances. A large number of display bugs had to be circumvented in MSIE, so it is likely that there may still be some problems left to be found. Please submit bug reports for any that you see.
- Simplified the way that style sheets are added by jsMath, so there are fewer browser dependencies involved.
- Use "
@media print
" CSS attribute to prevent jsMath button from appearing when the page is printed.
- Added a new "Printing Issues" help item to the jsMath control panel.
Changes in font handling
- Fixed an error in
jsMath.Extension.Font()
that caused the font file not to be loaded correctly when it was used.
- Fixed a problem where equations that include less-than signs or other HTML special characters would not be properly rendered if they trigger an extension to be autoloaded.
- Fixed a problem when extra fonts are loaded dynamically and the native font is not available for the extra fonts, but native fonts are available for the main TeX fonts. In this case, the font images were taken from the wrong size and were scaled up by the browser, producing low quality results. The correct size is now used.
- Added the ability to auto-load fonts when a character is defined via jsMath's
mathchardef
array. There is now an extension command that makes this easy to do (see the extensions documentation for more details).
- Fixed a problem where autoloaded fonts might fail to be considered "safe" loads by the extension-loading mechanism (because the URL used to load the font is absolute rather than relative, and so appears to be outside of the jsMath hierarchy). JsMath now checks more carefully to see if the URL is within the jsMath directory.
- The "light" and "dark" versions of the fonts on the extra fonts page were reversed (so "dark" linked to the light font and vice versa). The links have been corrected, so if you downloaded the wrong ones, you might want to get the correct version for your platform.
- The definition files for the extra fonts lost their custom unicode fallback methods during an update in December. Also, changes to the naming of some of the CSS styles used by jsMath required changes to some of the extra-font definition files. So a number of these have been modified to correct those problems. You can download the complete archives from the extra-fonts download page, but only the
def.js
files have been changed, so you only need to get the new versions of those. They can be obtained from these links: cmbsy10, cmmib10, eufb10, eufm10, eurb10, eurm10, eusb10, eusm10, lasy10, lasyb10, msam10, msbm10, rsfs10.
Changes in TeX language processing
- Added a new
boldsymbol
extension to implement the\boldsymbol
command. Note that you need to install thecmmib10
andcmbsy10
from the extra fonts page in order for this to work. Because of this,\boldsymbol
is not defined by default; you must usejsMath.Extension.Require("boldsymbol")
after loadingjsMath.js
in order to activate it. Alternatively, you can use\require{boldsymbol}
within your TeX code before the first reference to\boldsymbol
. Note that the bold fonts are not loaded until they are used by the\boldsymbol
macro, so it is reasonable to load theboldsymbol
extension even on pages where you may not use bold symbols.
- Added a new
AMSsymbols
extension to define the various control sequences for the AMS symbol fonts. Note that you need to install themsam10
andmsbm10
fonts from the extra fonts page in order for these to work. Because of this, the symbols are not defined by default; you must usejsMath.Extension.Require("AMSsymbols")
after loadingjsMath.js
in order to activate them. Alternatively, you can use\require{AMSsymbols}
in your TeX code before the first reference to an AMS symbol. Note that the AMS fonts themselves are loaded only when the first reference to one of the characters is made, so it is reasonable to load theAMSsymbols
extension even on pages where you may not use an AMS symbol.
- Fixed a problem where ~ was not being converted to a space.
- Fixed a problem were a superscript or prime at the beginning of the math was not properly handled. (It is now treated as though there were a {} before it.)
- Fixed a problem where super- and subscripts were lost if they were applied to the results of
\hbox
,\mbox
, or other similar boxed items.
- Fixed a problem were a prime followed by a superscript incorrectly produced a "double superscript" error.
- Added
\textrm
,\textit
,\textbf
and\mathcal
macros.
- Added
\lbrack
and\rbrack
delimiters (same as [ and ]).
- In the past, a super- or subscript followed immediately by
\frac
with no enclosing braces would cause jsMath to report an error, even though this is a legal construction in TeX. This (and several other situations) are now handled as special cases by the code that looks for the right-hand argument of super- and subscripts. This is not a general solution to the problem of^
and_
followed by macros, but does at least handle several important cases in common use.
- Fixed a problem with MSIE not locating the jsMath directory correctly when a relative pathname is used to load the jsMath.js file. This problem was partly fixed in v3.1a, but this update should handle additional cases.
- This version includes a work-around for a bug in Firefox 1.5.0.1 on the PC where Firefox would crash when the compressed version of jsMath was used without the
autoload
plugin.
- There is a problem with MSIE on the PC where images are not cached if they haven't already been loaded when the second request is made. This means that jsMath could cause MSIE to load the
blank.gif
file multiple times, and under some circumstances this can cause a substantial slowdown (and MSIE is already slow enough). So this version of jsMath loadsblank.gif
and then (in MSIE) waits for it to be loaded before proceeding, so that the caching will work.
- OmniWeb 4.5 (very old) has a bug with vertical alignment, which is worked around in this version, at the cost of having some lines be too deep. OmniWeb 5.x works much better.
- Added a new extension that implements the
\newcommand
and\def
macros, so you can define you own control sequences without having to use thejMath.Macro()
command. The extension will be loaded automatically when you use the\newcommand
or\def
commands. Note that all macros are global.
- Fixed a bug with macro parameter substitution where a final control sequence in the substitution text for a parameter could accidentally be concatenated with the text that followed the parameter in the macro's replacement string, causing an "undefined macro" error.
- Despite the changes in v3.1b, there was still a problem with caching the character sizes in the unicode and symbols-only fallback methods when certain characters appear in a subscript before they are used at their usual size. This has been fixed (correctly this time).
- The fix to allow <BR> tags within math tags introduced in v3.1b causes some problems in Firefox. (It seems that Firefox will add tags inside <DIV> tags that aren't in the original HTML file under some. For example, in a file containing <FONT SIZE="3"><DIV CLASS="math">x+1</DIV></FONT> the FONT tag will migrate inside the DIV, as though it had been <DIV CLASS="math"><FONT SIZE="3">x+1</FONT></DIV>.) The algorithm used in v3.1b would cause the contents of the FONT tag (i.e., all the mathematics) to be ignored. A new algorithm is now being used that should properly handle this situation, while still turning <BR> into a space.
- Rather than loading
black.gif
from a file on the server, it is now loaded fromdata:image/gif
URL in those browsers that know how to handle that. This avoids having to load the file over the network.
- Only do the Safari "bump" (to get images that didn't update properly to update themselves) one time even if
jsMath.Process()
orjsMath.ProcessBeforeShowing()
is called more than once.
- Fixed an error in the
eqnarray
environment where the entries in the array were typeset in\textstyle
rather than\displaystyle
as they are supposed to be.
- Added a new
\cssId
macro to theHTML
extension that lets you specify a CSS element ID for a section of mathematics. This allows you to tag an expression (or part of one) so that you can manipulate it easily with JavaScript. This corresponds to the\class
and\style
macros already available in theHTML
extension. Use\cssID{id}{math}
to set the ID for the selected mathematics.
- If a <SPAN CLASS="math"> or <DIV CLASS="math"> contains <BR> tags or other HTML tags, they will be treated as spaces within the mathematics. (It used to be that jsMath used the SPAN or DIV's innerText field, but this did not convert BR to a space, so now it concatenates the element's children's text-node's nodeValues together with spaces for non-text nodes.)
- Fixed a number of errors in the unicode fallback methods.
- Moved some common code from the fallback files into jsMath.js itself so it would be consistent across all platforms.
- Fixed problems with determining the bounding box of characters in sizes other than the normal size, which could cause subsequent items to be misplaced on the page.
- Changed size calculations for characters with descenders.
- Fixed bounding boxes for big operators (\sum, \int, etc.) in sizes other than the normal size.
- Fixed some typos in the unix fallback file.
- Reinstalled bug fix for measuring italic characters in MSIE that was accidentally disabled in v3.1.
- Fixed the width calculation for \int in Opera on the Mac.
- Fixed a problem with the URLs for the image fonts in some unusual cases.
- Fixed a link on the jsMath Options panel to the font download site which was going to the v2.x download area rather than the 3.x one.
- Fixed a problem in MSIE on the PC where the image fonts were not always located properly (which resulted in a "jsMath has failed to set up properly" alert).
- With the switch to the new jsMath-encoded fonts, one of the work-arounds needed for MSIE on the PC is no longer needed and has been removed unless the BaKoMa fonts are used. This will help speed up the processing on MSIE, at least slightly.
- JsMath no longer looks for the BaKoMa versions of the TeX fonts with Firefox 1.5 and above on the Mac, since FireFox 1.5 seems to be unable to access some of the characters (probably could get access to them via other Unicode positions, but it's not worth it). The new jsMath versions of the TeX fonts work fine.
- Fixed some positioning problems that occurred in Firefox 1.5.
- Added a "Check for Updates" button to the jsMath Control panel that lets web page authors check to see if there is a newer version of jsMath than the one they are using. If there is, you are asked if you want to be taken to the jsMath download page.
- Added ability for jsMath to autoload components on the fly as it needs them. Macros, LaTeX environments and fonts can be made to automatically load the files that define them only when they are needed. See the page on jsMath extensions for more information on how to arrange for this. Several lesser-used portions of jsMath have been moved to such extensions to try to reduce the size of the jsMath.js file (but it turns out that only about 14K can be removed, since most of jsMath.js is pretty crucial). Fonts accessed through the
\char
command will be autoloaded automatically (provided they exist on your server).
- Replaced some macros that were accidentally removed from the eusm10 and msbm10 extra font files.
- Fixed a problem that was introduced in v3.0 with determining the height and depth of extra fonts.
- Fixed some examples in the autoload plugin documentation (several examples had extra commas at the ends of some lists; this will work in Firefox, but not in other browsers).
- Fixed a problem with MSIE where the floating jsMath button would fail to float when the
autoload
plugin was used.
- Fixed a problem with the
tex2math
plugin where some mathematics was skipped if it appears within an element that immediately follows the mathematics with no intervening spaces or tags.
- In an effort to reduce the download time for jsMath, version 3.1 now includes a compressed version of jsMath.js that is less than 50% as large as the uncompressed version (just over 100KB as opposed to nearly 220KB). That should cut the download time in half (for the initial download -- after that, the browser should cache jsMath.js so it doesn't have to be downloaded again). This is more than just removing the white space and comments; the size has been reduced by encoding repeated strings for additional savings. The cost is that there is a short delay required to unencode the file once it is downloaded. Depending on the speed of your computer and which browser you are using, this tends to range from 1/10 to 1/3 second (compared to a savings of 2 to 3 seconds for downloading a smaller file).
In addition to compressing jsMath.js, the main fallback files also have been compressed, (saving about 40% each) as well as the main file needed to define the image fonts (saving about 30KB out of 112KB). To take advantage of the latter, you need to download the new
def.js
file for this and replace the ones in thejsMath/fonts/cm-fonts/alpha
andjsMath/fonts/cm-fonts/plain
directories. See the download page for details.The compressed files are completely unreadable by a human, so in case you need to read the jsMath code, uncompressed versions are provided in the "
uncompressed
" subdirectory of thejsMath
directory.Version 3.0 (14 Dec 2005)
This is a major release of jsMath, though the main differences are in the internals of how jsMath works, not in its features. The most significant change is in the method used to load auxiliary files into jsMath; the new method now allows jsMath to be more flexible about where it is loaded and where it is called within the document (in particular, the requirement that jsMath run within the body of the document has been removed). There are also several small improvements to the user-interface for jsMath, and some fixes for problems that with jsMath 2.x in Firefox 1.5.
While the jsMath user should not see much different with version 3.0 of jsMath compared to v2.4, web-page authors need to be aware of some important caveats related to the new script-loading method. Version 3.0 is not fully backward compatible with version 2.x in terms of its timing, and so you may need to adjust your existing pages if you have used more complicated jsMath calls. These issues are mentioned below, but full details are available in the author's documentation pages. See in particular the page on synchronizing with jsMath. The other author pages have been updated to correspond to version 3.0, so if you took example code from one of them, you should check to see if it has changed.
The major technical changes in this release include the following:
- In the past, jsMath used
document.write()
to insert<SCRIPT SRC="...">
tags into the body of the document when it needed to load additional components. This had the advantage of working in all browsers, but had the notable drawback of only working if jsMath were loaded within the<BODY>
of the document itself (wheredocument.write
can be used), not in the<HEAD>
, or within the document'sonLoad
handler. This was also a problem for those interested in using jsMath within XML documents, asdocument.write()
is not available in XML.To overcome these problems, jsMath now uses a different method of loading auxiliary files. (For the technical, this is based on
XmlHttpRequest
for those browsers that support it, and on hidden<IFRAME>
tags for those that don't). Its main advantage is that this method can be use at any time (i.e., in the documentHEAD
or in theonLoad
hander), and so this makes jsMath more flexible than it was in the past. The old requirement of runningjsMath.Setup.Body()
within the body of the document is no longer necessary, so jsMath can be loaded in the documentHEAD
andjsMath.Process()
can be called within the document'sonLoad
handler, with no references to jsMath within the body itself, and the whole operation can be set up within the documentHEAD
.This makes it easier to include jsMath in content-management systems (see the section on including jsMath in a bulletin-board system). It is also a first step toward making jsMath work in XML documents, though there is more to be done before that is possible. Finally, the ability to work within XML documents is the first step toward making a version of jsMath that renders MathML (rather than TeX) as its input language, thus bringing MathML to a much wider range of browsers than currently support it. This is a long-range goal of the jsMath project.
There is a cost to this change, however. A side effect of using
document.write()
to insert SCRIPT tags was that the rest of the document would not be processed until the SCRIPT was loaded and executed, so this automatically synchronized the loading of the external scripts with the processing of the page. This is no longer the case with the new file-loading mechanism, and so synchronizing jsMath with the loading of auxiliary files is more complicated than it was in the past. Page authors now need to be aware that file loading may be asynchronous with the processing of other scripts on the page. The standard calls tojsMath.Process()
andjsMath.ProcessBeforeShowing()
handle this automatically, as do the calls that are part of thetex2math
plugin. Other author-defined scripts that interact with jsMath may need to be modified, although jsMath does provide tools to help you synchronize your calls to jsMath functions with the loading of the required jsMath files. See the author's page on synchronizing with jsMath for more details.One of the drawbacks of the old file-loading mechanism was that any extra files needed by jsMath had to be included while the page was being loaded; that is, before the math was processed. With this new and more flexible method, jsMath can load files at any time, so it is now possible for jsMath to load components on-the-fly while it is processing the mathematics on the page. Thus, it is potentially possible for jsMath to load components only when they are necessary, allowing you to use features of jsMath without knowing ahead of time that they will be needed. This has not yet been implemented in jsMath, but it is an important enhancement planned for the future which simply would not ave been possible using the older file-loading approach.
- The other place where
document.write()
was used was in defining the CSS styles used by jsMath to lay out the mathematics. This mechanism also has been replaced by one that can be used more flexibly (i.e., can be called at any time). This also may run asynchronously, so the methods that page authors use to override the styles defined by jsMath may need to be adjusted. See the author's documentation on customizing jsMath for more details.In addition to changing the method by which the styles are defined, the style names have been changed to take better advantage of the "cascading" part of the CSS specification. In the past, there was the chance that style names used by jsMath could conflict with styles used elsewhere on the page; now, however, the style names only apply to items within the typeset mathematics itself, so there should be no collisions with styles on the rest of the page. In addition, the styles used to control the jsMath button, control panel, and other display items are now bound to the element ID's rather than to element classes, again to avoid potential name conflicts. Authors who have overridden these values will need to change the style definitions in their pages to use the new names.
- The
autoload
plugin has been enhanced to take advantage of the new file-loading mechanism, so it can now be called in the document HEAD rather than in the document BODY. This should make it easier to include jsMath into content-management systems where you can modify the document HEAD but not the BODY. Theautoload
plugin can be configured to loadtex2math
automatically and the window's onload handler can be used to calltex2math
andjsMath.Process()
, and that can all be set up in the document HEAD. See the autload documentation for more information.
- There have been a number of complaints from PC users that the native TeX fonts are too light. This is due partly to the fact that the CM fonts are designed to be fairly thin (and were not originally intended for screen use), but mainly to the poor antialiasing available in Windows. To overcome this, darker versions of the TeX fonts are now available on the fonts download page for use with jsMath. These fonts use a custom encoding that is different from the one used by the BaKoMa fonts (that encoding was problematic for some browsers), and so these new fonts all have names prefixed by "jsMath-" so that they will not conflict with other installations of the TeX fonts.
If you already have the BaKoMa versions installed, jsMath will continue to use them, but PC users in particular may want to switch to the darker versions. JsMath will run slightly slower with the BaKoMa fonts (jsMath must load an auxiliary file to process them), and some characters in those fonts are not accessible in some browsers, and so needed to be replaced by their unicode equivalents. Users of those browsers may wish to switch as well.
The extra fonts now use the custom jsMath encoding, and you may want to update your installation of these fonts if you use them on your pages, though your old versions will still work. The scripts for making your own fonts have been updated to generate fonts using the new encoding, and can also make darker and lighter fonts so that you can provide versions appropriate for both the PC and the Mac.
- Finally, a number of users have asked that the license for jsMath be changed from the GPL to a more lenient one. To accommodate this, jsMath has switched to the Apache Licence 2. This should make it easier for you to include jsMath as part of your own packages, even if they are commercial ones.
The jsMath user will notice a few minor changes to the user interface, including the following:
- JsMath now shows a small progress message in the lower left-hand corner of the page while it is processing mathematics asynchronously or loading external files. Since these actions usually are time-consuming, this message area helps you see what jsMath is doing. You can disable this display using the jsMath Control panel (uncheck "Show progress messages" in the Options panel). If you do this, jsMath will try to use the window's status line for these messages rather than a separate panel on the page. This does not work well with all browsers, which is why the separate display is the default.
- If the mathematics on a page is taking a long time to process, and you wish to cancel it, you can do so by clicking on the progress message box, or on the "jsMath" button. (In the past, jsMath would continue to process the page even when the control panel was open.)
- The jsMath Options panel contains several new checkboxes, and has been slightly reorganized. The checkboxes that control the font-related features are all just below the font-selection radio buttons at the top of the panel, and are separated from the other checkboxes at the bottom, which include three new ones:
- Show progress messages: this is described above, and selects whether jsMath will use a separate panel within the browser window for its progress messages, or the window status bar (when possible).
- Force asynchronous processing: The page author can specify whether the mathematics on the page should be processed before the page is displayed, or whether the page will be displayed and then the mathematics processed (in which case, you will see the math "flicker" as it is typeset). Usually when a page is short or doesn't include much math, it is reasonable to process it before showing the page; but if the page includes lots of math, that would take a long time, and showing first is probably a good idea. Impatient readers might want to check this box in order to force the page to be shown first even if the author has requested the other order.
- Don't show page until complete: The page "flicker" that accompanies the asynchronous processing of the page may bother some readers. They can select this checkbox to cause the page to appear "blank" until the mathematics has been completed. (The message box will continue to be shown, so they can see that progress is being made, and can cancel jsMath if necessary.) This is in some sense the reverse of the preceding checkbox; if an author has specified asynchronous processing, this has the effect of making the page not show up until the math is completely processed.
A side effect of the change in the file-loading mechanism is that older browsers (that do not handle
XmlHttpRequest
) might load some code asynchronously. This means that thejsMath.ProcessBeforeShowing()
call may have to be delayed until the required components are loaded, and that means the page might be displayed beforejsMath.ProcessbeforeShowing()
runs. (In general, this will not occur if the user has the TeX fonts installed, but may occur if image fonts or unicode fonts are used.) This feature is a means of recovering the effect of processing before showing even when the page operates asynchronously.Note that changing any of the font-related settings will cause the page to be reloaded in order to force the mathematics to be redisplayed using the new selections; however, changing the three checkboxes described above will not cause the page to reload, but will only affect additional pages obtained from the same site (or the current page if it is reloaded).
Finally, this version fixes a long-standing problem where multiple calls tojsMath.Process()
would cause jsMath to become confused about what part of the page had already been processed. The new queuing method needed for the asynchronous file loading makes it easy to handle this circumstance properly.The documentation has been revised to incorporate the new features of jsMath, and fix some errors. In particular, the author's documentation has been updated in a number of areas.
See also the list of changes in version 2.x.
|
|