Once you have jsMath installed and tested, edit the file
Getting Started with jsMath
jsMath/easy/load.jsto suit your needs (see configuring jsMath for more details). In particular, change the setting for
rootto be the URL for the
jsMathfolder, wherever you have placed it on your web server or hard disk. The comments in the file should help you decide which values need to be changed. You may make copies of that file, each with different settings, if you need to be able to use jsMath in more than one configuration.
Next, create an html file containing mathematics. Your settings in
easy/load.jswill determine how you have to indicate the mathematics within your file. For example, with the default settings, you could use \(...\) around in-line math and \[...\] around displayed equations. There is a sample file in
jsMath/test/sample.htmlthat should help you with your first document containing mathematics.
Adding jsMath to an HTML documentTo use jsMath in a web page, you should add the line<SCRIPT SRC="path-to-jsMath/easy/load.js"></SCRIPT>to the
HEADsection of your document. Here, path-to-jsMath should point to the location where you have placed the jsMath package. You can make jsMath be available site-wide by putting it in a place that is easy for many web pages to access (say
), or you could make jsMath be local to your particular web page by putting it in the same directory as your
.htmlfile (in which case
jsMath/easy/load.jswould be sufficient to locate jsMath).
That's it; jsMath will use the settings in your
easy/load.jsfile to process the mathematics on your page. For example, you should be able to load the
jsMath/test/sample.htmlfile and have it display (some of) the mathematics it contains. (Parts of it will not be typeset, because the default settings in
easy/load.jshave some features of jsMath turned off.)
www.math.union.eduand jsMath is taken from
union.edu, then jsMath will still be able to access its optional components. To do this, it sets that
document.domainfor the main page to be the largest common domain between the two addresses.