Help:jsMath

From QED

Revision as of 17:25, 11 September 2009 by Peak (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search


jsMath renders pages that use the <math> tag in such a way that the rendered text and symbols can be dynamically resized. The results are usually quite beautiful.


Image:Imbox notice.png
To view QED pages with jsMath, one must currently be logged in and one must also have selected the jsMath option in the "my preferences > Math" tab. In addition, the browser must be configured to allow JavaScript.


Contents

Fonts

The jsMath documentation states that:

"The jsMath package is designed to work best if you have installed the TeX font set [on your browser's machine]."

However, if you do not have the TeX fonts installed, you can still use jsMath; it will use image versions of the TeX fonts. You can also select to use your browser's unicode fonts.

Downloading the TeX fonts

Instructions for downloading the TeX fonts are here. Only one file should be downloaded per target machine.

Preferences

Once you have logged-in to QED, you can enable or disable jsMath by visiting my preferences and clicking on the Math tab. Other preferences can be set from the jsMath control panel, described in the following subsection.

The jsMath Control Panel

If one is logged in and has jsMath enabled, then a "jsMath" button will appear at the bottom right-hand side of the window of any page that uses at least one <math> tag (such as this page).

Clicking on this jsMath button will cause the jsMath control panel to pop up. This control panel enables various options to be set, and has a Help button, which is a link to this page.

The control panel has an option to Go Global. You can safely ignore this option and probably should unless you have read the cautionary explanation.

Notes for Authors

The following standard jsMath extensions have been installed on QED:

  • AMSmath
  • AMSsymbols
  • boldsymbol
  • moreArrows

Server Fonts

The following six Computer Modern TeX fonts come standard with jsMath:

  • cmr10, cmmi10, cmsy10, cmex10, cmti10 and cmbx10.
    r=roman, mi=math italic, sy=math symbol, ex=extended symbol; ti=text italic, bx=bold text

The following additional fonts have been installed on the server and are loaded automatically:

  • cmmib10 (bold italic math)
  • cmbsy10
  • msbm10 (AMS math symbol)
  • msam10 (AMS math symbol)

Bugs and Workarounds

Please add information about bugs you find here.

Tests

You may need to enclose the \char command within a macro like \mathrel or \mathop to let jsMath know how you plan to use the symbol. For example, you may use \mathrel{\char{msam10}{0x26}} to get a greater-than sign over a tilde as a relation, and \mathbin{\char{msam10}{0x01}} to get a plus-sign in a square as a binary operator. See The TeXBook page 155 for more details on these macros.

The above paragraph renders as follows:

You may need to enclose the \char command within a macro like \mathrel or \mathop to let jsMath know how you plan to use the symbol. For example, you may use Failed to parse (unknown function\char): \mathrel{\char{msam10}{0x26}}

to get a greater-than sign over a tilde as a relation, and Failed to parse (unknown function\char): \mathbin{\char{msam10}{0x01}}
to get a plus-sign in a square as a binary operator. See The TeXBook page 155 for more details on these macros.

jsMath.Macro()

Since \boxplus is already defined in AMSsymbols.js, we use \myboxplus here. \boxplus produces \boxplus

The following block:

<javascript> jsMath.Macro('myboxplus','\\mathbin{\\char{msam10}{0x01}}'); </javascript>
\myboxplus produces <math>\myboxplus</math>

produces:

\myboxplus produces Failed to parse (unknown function\myboxplus): \myboxplus


Version and Credits

Version 3.6b of jsMath was installed on QED on 19 March, 2009, together with a modified version of the jsMath MediaWiki extension by Tommy Ekola.

See also

Personal tools