Text Formatting In Mathematica

Barry McQuarrie

A short introduction to typesetting in Mathematica.

You can format your text in Mathematica to be suitable for reports. There is a nice downloadable Mathematica file which describes this at
http://resources.wolfram.com/conferences/devconf99/withoff/Basic5.nb

Obviously, you can also embed hyperlinks in a Mathematica document! You select the text you want to make a hyperlink, and then choose Input>Create Hyperlink from the drop down menu.

The main thing you need to know to get started is how to change the input style. You do this by selecting Format>Style from the drop down menu, or using the shortcut ALT+1 to ALT+7. You can quickly switch between section headings, typed text, and input for the kernel to process.

I usually type the entire document and then decide what style sheet I want. The style sheet will change the look of the entire document, and is like a style file you would use in LATEX. The style sheets are available through Format>Style Sheet drop down menu. Different styles are available for different style sheets; for example, the numbered equation style is not available in the default style sheet, but it is available in the ArticleClassic style.

Once you have created your document, you can spell check it by Edit>Spell Checking.

You can export your entire notebook as an html document, or a LATEX document. This is done through the Edit>Save as Special drop down menu. I usually have no problems with the html output, but the LATEX output never seems to work well for me. You certainly need to create postscript rather than dvi files to get anything useful out of your converted file. I use TeXForm to get LATEX versions of complicated equations.

Another thing you may be interested in is the Format>Show Page Breaks drop down, which will give you some idea of how your document will look when printed. You may choose to change the size of graphs based on page breaks.

There are a wealth of changes and stylizations you can do to your document, but you do not want to fall into the trap of over typesetting your reports! Choose simple, basic commands that make your results easily read, and then leave it at that. For truly great looking formatting, you should use LATEX, since LATEX was designed to typeset equations beautifully and not burden you with the details of marking up your reports.

Example

Solve[x^2 + 2 == 0, x]

Solve[x^2 + 2 == 0, x]

References

http://resources.wolfram.com/conferences/devconf99/withoff/