How Do I Put a Mathematica Notebook on the Web?

Placing a Mathematica notebook on the web is platform independent. The following instructions are in reference to placing a notebook on the web under Windows 95/98/NT.

Converting a Notebook to HTML

To convert an entire notebook into HTML, do the following:

1. Open the notebook file.
2. Click the File menu.
3. Select Save As Special->HTML.
4. A dialog box will appear, prompting you for the name of the directory in which to save your file.


Because graphics and hyperlinks from the notebook will be stored in separate directories in this main folder, which Mathematica automatically names, you should type an unused name for the directory.


Some Tips and Tricks

Including External References

Mathematica will translate all hyperlinks to other URLs in the notebook into the HTML equivalent, so all the links in the notebook will still work.

Saving Each Section in a Separate File

Mathematica saves every closed group of cells into a separate HTML document in the Links subdirectory of the directory in which it saves the main index.html file. This feature makes it very easy to create well-organized web sites directly in Mathematica.

Saving Animations

There are a number of ways to present Mathematica animations on the web. Unfortunately, Mathematica does not automatically convert animations into a proper format. On the Macintosh, animations can be exported as QuickTime movies that can be viewed with Apple's free viewer.

On all platforms, the Export command supports exporting animations created in Mathematica as animated GIFs. To do this, create a Mathematica animation or list of graphics and use Export["filename", graphics, "GIF"]. Any list of graphics passed to this will be exported as an animated GIF file. Export supports a large number of options, including animation speed and color reduction. Please refer to the documentation about Export for more information on these options.

Creating Animated GIFs in Mathematica 3 and Slowdown in Mathematica 4.0

Export could not handle animated GIFs in Mathematica 3. Also, on some platforms, exporting a set of graphics as an animated GIF file takes a very long time in Mathematica 4.0. This is due to a specific implementation of the export routines that will be changed in future releases. Right now, there is a slightly more inconvenient, but about 25 times faster, alternative to using Export that also works in Mathematica 3.

Simply select the graphics you want to include in the animated GIF, copy and paste them into a new notebook, and use Save As Special to save that notebook as an HTML document. Mathematica will create a new directory with an index.html file and with all the images in the documentation in a separate subdirectory called images. You can then use any number of programs to arrange these GIFs into an animated GIF.