Setting up and using TeX at F&M

This web page was written on January 28, 2004 and last updated on January 9, 2007. Caveat lector, especially as the page gets old.

Except for Mathematica, all the software I describe here is free, assuming you already have OS X. F&M has a site license for Mathematica which allows local users to install and run it.

This is not a how-to on writing TeX documents. That's a long story, but the best way to learn is probably buy or borrow a reference manual, then just plunge in using an existing document as a model, and look up what you need when you need it. Here is a place to look for places to look: TeX resources on the web. And here is one specific Not So Short Introduction to LaTeX2e. There are many alternatives.

Nor is this web page original in any way. I gratefully acknowledge that I'm just gathering instructions from the different pages linked below.

My current TeX setup (as of January 2007) uses TeXShop as a front end to Gerben Wierda's teTeX installation. It works well, and unlike back in the old days (when you had to use great big iron hammers to crush the stone tablets to size before they'd fit into the floppy disk drive), installation is easy. I just reinstalled it today, based on instructions at the TeXShop home page. Install TeX first, by downloading the installation package at http://www.ctan.org/tex-archive/systems/mac/mactex/; it should be the one called MacTeX.dmg. Open, click, and follow your nose. Then download the latest version of TeXShop itself from the TeXShop home page. Follow the installation instructions, which amount to downloading a file and moving it file into your applications directory.

Xfig is an X-windows drawing program. (The X Window System is a graphics display system for unix computers.) To use xfig, you first need X-windows (aka X11) itself. Now that X11 is available for download on OS X from Apple here, unix users can once again use much of that software they got used to in graduate school.

Xfig is available via i-Installer. Proceed as for TeX, but select Xfig instead.


The xfig instructions below are sketchy. Use at your own risk.

To run xfig, open an xterm using Applications/Utilities/X11, and type xfig&. If you anticipate using latex specials in the output, use xfig -spec&. The option -po puts xfig in portrait (rather than lansdcape) mode. Might need it for the export orientation to work out.

Unfortunately, xfig wants a three-button mouse. But you can (and I have) set "emulate three-button mouse" as a preference in X11 (via the pull-down menu on the mac). Then Click = left-click; OptionClick = middle-click, and command-click = right-click.

David Lyon, at Lebanon Valley College, has some useful instructions here on using xfig to put pictures into LaTeX documents. But they seem to need a little modification to be compatible with TeX on the Mac OS X setup described above (which, by default, is really pdftex):

  1. Start xfig using xfig -po -spec&
  2. Make your picture. Save it as an xfig file.
  3. Export the file as combined PDF/LaTex. The output file name should have the suffix ".pdf". (This appears not only as the name of the graphics part of the output, but also as an *input* file within the LaTeX code that xfig generates. But TeXshop (or is it TeX itself?) seems to get confused if it can't recognize the output as a graphics format, and using the default (.pdftex), it can't.)
  4. Your main latex document should include the lines
    \usepackage{graphicx} and \usepackage{color}in its preamble. (You can include these in one of your TeXshop templates.) Then put the line \input{picturename.pdf_t} wherever the picture is supposed to go in your main document. This will probably be within a figure, center, or whatever, but that's up to you.
  5. Don't forget to save everything in the same directory.
Here's an example of the sort of amazing results you, too, can create! Yup, I know. Shock and awe...
You can also use Mathematica to export graphs, diagrams, and so forth. For a really basic example:
  1. The output of the Mathematica command Plot[x^2, {x,-2,2}] (inside a notebook) is a sketch of the graph.
  2. The Mathematica command Export exports Mathematica objects into all sorts of file formats. Check the documentation for details. But if I wanted to put the above graph into a quiz, I'd run Export["parabolagraph.tif", %, ImageSize ->216, ImageResolution ->300] on the next line. This sends a .tif format graphics file into my home directory. Tiff is a graphics format which works (and this is my ONLY criterion) with my LaTeX setup. The image will be 216 printer's points (three inches) wide, with 300 dpi resolution. The percent sign refers to mathematica's most recent output; an example of an alternative is Out[42], if the parabola happened to be output number 42.
  3. Put \includepackage{graphics} in the preamble of my LaTeX document, and \resizebox*{4in}{!}{\includegraphics{parabolagraph.tif}} where the diagram belongs. (This would make it four inches wide on my quiz paper, since I wasn't thinking ahead when I made the image in the first place. Adjust as necessary.)
  4. Think of a good quiz question about parabolas.
Here is a Mathematica 5.0 notebook containing an example and a bit more explanation.

Back to Michael McCooey's home page.

Franklin and Marshall home page.

F&M Calendar, reference point for various college deadlines, breaks, and new beginnings.