Attention
Version 3 is now the current version of MathJax. This document is for version 1.
Installing and Testing MathJax¶
MathJax can be loaded from a public web server or privately from your hard drive
or other local media. To use MathJax in either way, you will need to obtain a
copy of MathJax and its font package. There are three ways to do this: via
git
, svn
, or via a pre-packaged archive. We recommend git or svn, as it
is easier to keep your installation up to date.
Obtaining MathJax via Git¶
The easiest way to get MathJax and keep it up to date is to use the Git version control system to access our GitHub repository. Use the commands
git clone git://github.com/mathjax/MathJax.git mathjax
cd mathjax
unzip fonts.zip
to obtain and set up a copy of MathJax.
Whenever you want to update MathJax, you can now use
cd mathjax
git status
to check if there are updates to MathJax. If MathJax needs updating, use
cd mathjax
git pull origin
# if fonts.zip is updated, do the following as well:
rm -rf fonts
unzip fonts.zip
to udpate your copy of MathJax to the current release version. If the
fonts.zip
file has been updated, you will need to remove the old fonts
directory and unpack the new one bring your installation up to date. If you keep
MathJax updated in this way, you will be sure that you have the latest bug fixes
and new features as they become available.
This gets you the current development copy of MathJax, which is the
“bleeding-edge” version that contains all the latest changes to MathJax. At
times, however, these may be less stable than the “release” version. If you
prefer to use the most stable version (that may not include all the latest
patches and features), use git tag -l
to see all versions and use git
checkout <tag_name>
to checkout that version of MathJax. When you want to
upgrade to a new release, you will need to repeat this for the latest release
tag.
Obtaining MathJax via SVN¶
If you are more comfortable with the subversion source control system, you may want to use our svn mirror. If you want to get the latest svn revision, use the commands
svn co http://mathjax.svn.sourceforge.net/svnroot/mathjax/trunk/mathjax mathjax
cd mathjax
unzip fonts.zip
to obtain and set up a copy of MathJax. (The SourceForge development page also shows how to do this.)
Whenever you want to update MathJax, you can now use
cd mathjax
svn status
to check if there are updates to MathJax. If MathJax needs updating, use
cd mathjax
svn update
# if fonts.zip is updated, do the following as well:
rm -rf fonts
unzip fonts.zip
to udpate your copy of MathJax to the current release version. If the
fonts.zip
file has been updated, you will need to remove the old
fonts directory and unpack the new one bring your installation up to
date. If you keep MathJax updated in this way, you will be sure that
you have the latest bug fixes and new features as they become
available.
This gets you the current development copy of MathJax, which is the “bleeding-edge” version that contains all the latest changes to MathJax. At times, however, these may be less stable than the “release” version. If you prefer to use the most stable version (that may not include all the latest patches and features), use
svn co http://mathjax.svn.sourceforge.net/svnroot/mathjax/tags/mathjax-1.0.1 mathajx
cd mathjax
unzip fonts.zip
to obtain the version 1.0.1 release. When you wish to update to a new release, you will need to check out a new copy of MathJax with the new release number.
Obtaining MathJax via an archive¶
Release versions of MathJax are available in archive files from the MathJax download page or the GitHub downloads (click the big download button on the right), where you can download the archives that you need.
You should download the MathJax-v1.0.1.zip
file, then simply unzip
it. Once the MathJax directory is unpacked, you should move it to the
desired location on your server (or your hard disk, if you are using
it locally rather then through a web server). One natural location is
to put it at the top level of your web server’s hierarchy. That would
let you refer to the main MathJax file as /MathJax/MathJax.js
from
within any page on your server.
Testing your installation¶
Use the HTML files in the test
directory to see if your
installation is working properly:
test/
index.html # Tests default configuration
index-images.html # Tests image-font fallback display
sample.html # Sample page with lots of pretty equations
Open these files in your browser to see that they appear to be working
properly. If you have installed MathJax on a server, use the web
address for those files rather than opening them locally. When you
view the index.html
file, you should see (after a few moments) a
message that MathJax appears to be working. If not, you should check
that the files have been transferred to the server completely, that
the fonts archive has been unpacked in the correct location, and that
the permissions allow the server to access the files and folders that
are part of the MathJax directory (be sure to verify the MathJax
folder’s permissions as well). Checking the server logs may help
locate problems with the installation.