- Writing mathematics
- Reading mathematics
- Virtualization -- running Linux side-by-side with MacOS
- Remote collaboration
Writing mathematics
Latex
Almost all serious mathematics is now written in LaTeX; if you don't know what LaTeX is, try this article.
To install LaTeX on the Macintosh, I recommend MacTeX. The full package is quite large. Installation is self-explanatory.
The MacTeX distribution comes with the popular editor TeXshop, as well as the cross-platform analogue TeXworks and the LaTeXit tool discussed below.
I used to use Skim for viewing PDF's when working with LaTeX. Recently, however, I find that Preview works fine for me; in particular, Preview now reloads the file when it changes (if you click on the preview window).
Emacs
emacs is a text editor, widely used for programming (and TeX). If you have worked with Unix before, you're probably already familiar with it. If not, you should probably skip the rest of this section.
- A nice port of emacs to the Macintosh is Aquamacs. Installation is self-explanatory. The rest of these instructions assume you have installed Aquamacs in your applications folder, installed MacTeX, and installed Skim in your applications folder.
- If you don't already have a .emacs file with your preferred options, you can download mine here. Rename it to .emacs and move it to your home directory (
/Users/YOUR_USER_NAME
also known as~
). It enables the following features:- fly-spell: on-the-fly, LaTeX aware spell checking. Alt-Tab guesses corrections.
Control-C g
jumps to a specified line.- iDo mode completion: clever auto completion when opening files (
Control-x Control-f
) Control-Tab
cycles through tabs in Aquamacs. (Note: I'm currently experiencing some anomalous behavior with Aquamacs's Tabbar settings.)
- WhizzyTex works with emacs to give real-time previews (updated every fraction of a second) of LaTeX documents. (A related tool is preview-latex, which is included with recent versions of AUCTeX and with Aquamacs.)
Thanks to Philipp Weißmann, you can now install WhizzyTeX using MacPorts. Steps:
- Install X11 and Macports (as discussed below).
- From a command prompt, type:
sudo port install tex-whizzytex
- Add the following lines to your .emacs file in your home directory:
(add-to-list 'load-path "/opt/local/share/whizzytex/emacs/")
(autoload 'whizzytex-mode "whizzytex" "WhizzyTeX, a minor-mode WYSIWIG environment for LaTeX" t) - Either install advi (
sudo port install advi
) or install xdvi (sudo port install xdvi
) and add the following line to your .emacs:(setq-default whizzy-viewers '(("-dvi" "xdvi"))
- You will probably need to install additional TeX / LaTeX packages using MacPorts for your documents to compile (or else edit MacPorts's version of WhizzyTeX to point to your other TeX installation). A list of MacPorts's TeX packages is here.
- Currently, advi refuses to install for me (MacPorts chokes on CamlImages). It looks like this is a bug which has been fixed (and the fix will be released soon).
- My current installation of WhizzyTeX seems to crash Aquamacs regularly. So be careful.
My previous instructions, for installing WhizzyTeX directly, are here.
Producing mathematical graphics
xfig
Most mathematical graphics are produced using xfig, which is easy to learn and quick to use, if somewhat limited in capabilities. There are various ways to install xfig on the Mac; I list them roughly from easiest to hardest.
For all except the first one, you need to install X11 first. It's on the system DVD that came with your Mac. Once xfig is installed (via any but the first method), to run it you open X11 (found in Applications/Utilities
) and type xfig
.
- The jfig port. jfig is a port of xfig to Java. To install, just download jfig3.jar. Doubleclicking the downloaded file will run jfig.
Drawbacks:- jfig is shareware, not freeware, and nags you to pay for it.
- jfig is not quite identical to xfig.
- According to the website, jfig downloads have been suspended pending resolution of two bugs.
- Installing xfig via i-Installer. i-Installer is included in the MacTex package. My recollection is that installing xfig using i-Installer is fairly self-explanatory (or at least, explained in the i-Installer documentation.)
Drawbacks:- i-Installer is no longer maintained
- Installing xfig via Fink. Instructions for downloading and installing Fink are here. You will probably need to install XCode before using Fink; it should be on the DVDs that came with your Mac. Once Fink is installed, open FinkCommander. From the
Source
menu, selectSelfupdate
. After that finishes, from theSource
menu selectUpdate-all
. After that finishes, find xfig in the list of programs, select it, and run eitherInstall
from either theBinary
orSource
menus.
Drawbacks:- In my experience, Fink sometimes behaves erratically.
- When I last checked, Fink had not yet been fully ported to OS 10.6.
- Installing xfig via MacPorts. Download MacPorts from their webpage and follow the installation instructions. Again, you will probably need to install XCode before using Fink; it should be on the DVDs that came with your Mac. Installing xfig should be self-explanatory from there.
Drawbacks:- In my experience, MacPorts sometimes behaves erratically.
Other free programs
- InkScape. Anecdotally, this seems to be becoming very popular for producing mathematical graphics. It has most of the abilities of Adobe Illustrator, and also features built-in LaTeX integration, and there is a plugin providing more capabilities. (That said, Illustrator behaves more consistently and I prefer its interface.) You probably need to install X11 first; see above.
- Skencil. I used this for a while, and liked it, though it's not very polished. There was a period when it was not being mainatained. Skencil can be installed via Fink or MacPorts (see above). (You will, of course, need to have X11 installed. To run skencil, open X11 and type
skencil
.) There are several plugins for using LaTeX in Skencil; I used this one. - A Wikipedia list of vector graphics programs.
Adobe Illustrator
Adobe Illustrator is a commercial vector graphics program; at heart it's similar to xfig, but an order of magnitude more powerful (and complicated), and much more expensive. Illustrator takes a substantial time investment to learn, so if xfig does what you want, it's probably not worth switching.
A few remarks on integrating xfig with LaTeX:
- Including formulas in pictures. Use LaTeXit, which is included in the MacTeX distribution. In LaTeXit preferences, for
Export format of images
selectPDF with outlined fonts.
Type your formula in LaTeXit's box (as ordinary LaTeX code) and click theLaTeX it!
. Drag the resulting typeset formula and drop it in your Illustrator document. - Including Illustrator files in LaTeX documents.
- If using pdflatex: save your Illustrator file as
Adobe PDF
and then include it in your TeX document with\includegraphics{filename}
(if your image was calledfilename.pdf
). You may want to play with the settings in Illustrator's save dialogue for optimal results with minimal file size. For example, I save asAcrobat 5 (PDF 1.4)
and uncheckPreserve Illustrator Editing Capabilities
. - If using latex: save your Illustrator file as
Illustrator EPS
and then include it in your TeX document with\includegraphics{filename}
(if your image was calledfilename.eps
). Again, you may want to play with the settings in Illustrator's save dialogue for optimal results and smaller file sizes. (Another option is to save as a PDF and then use Acrobat or pdf2ps to convert the file to EPS. This probably yields smaller image files.)
- If using pdflatex: save your Illustrator file as
- Other advice:
- Make comments in your LaTeX files recording the font sizes in the images.
- I find that setting Illustrator's art board to a width of 4 inches (and height of 3, say) is convenient. You can make this an Illustrator template.
- Illustrator can save images in the SVG (Scalable Vector Graphics) format. These can be read natively by Inkscape and other open source programs. (Inkscape can also read, less reliably, Illustrator's default format.)
Producing web pages
There are many excellent free ways to write web pages, including (of course) a text editor. This page, the symplectic geometry / gauge theory seminar web page, and others on my site were created with Adobe's Dreamweaver.
Reading mathematics
- Papers software. Most papers are available in electronic form now. The commercial software Papers does a nice job of keeping them organized. With the release of version 2, Papers has gotten quite expensive (but has lots of new features). It will also sync with an iPhone / iPod / iPad app.
- Firefox plugins. Various extensions make the Firefox web browser more useful.
- PDF Browser Plugin allows you to read PDF files inside Firefox. (I'm not aware of other options for the Macintosh at the moment.)
- Zotero is a tool for collecting and managing online references. It allows you to take snapshots of web pages, cross reference them, associate files to them, and so on. It also automatically recognizes information from certain scholarly websites like the arXiv. (Olivia Judson wrote a comparison of Zotero and Papers in her blog.)
- Mendeley is both a web service and a stand-alone program, similar to Papers. It has the advantages of being cross-platform and free; the disadvantage is that it's somewhat less polished. It will also sync with an iPhone / iPod / iPad app.
- BibDesk is an open source program mainly aimed at managing bibtex files, but which might be able to serve a similar purpose to Papers, Zotero and Mendeley. I haven't quite understood how / if that works yet.
Virtualization
Another approach to using software like Emacs and TeX on the Mac is to run a copy of Linux as an application under MacOS. This is an instance of virtualization, and is now fairly easy to do. This is particularly useful if you use somewhat esoteric Unix programs, which have not been ported to the Mac. The drawbacks are that this is somewhat slower (and takes up more memory), and the interface is a little less refined -- things like copying and pasting text, say, between the two operating systems tend not to work well. The same strategy allows you to run Windows under MacOS (if you buy a copy of Windows).
There are three main virtualization programs are VirtualBox (free), Parallels Desktop (commercial) and VMWare Fusion (commercial). Of these, I have used a previous version of Parallels Desktop, and currently use VirtualBox. Under either of the two, the steps to install Linux are:
- Install VirtualBox (or Parallels).
- Download a disk image of Linux (for instance, Ubuntu).
- Run VirtualBox or Parallels and follow the steps in the set-up wizard to install the Linux system.
- After the Linux system is up and running, install VirtualBox's or Parallel's "guest additions". (This allows you to access files on your Mac from inside the Linux system, better integration of the mouse cursor between the windows, and so on.)
- Create a directory on the Linux system for mounting your Mac's filesystem, and set it up as a mountpoint.
Remote collaboration
Real-time communication
My research, which is almost all collaborative, involves both a lot of pictures and formulas. In increasing order of complexity, here are three methods for communicating these that have worked for us. (The second and third can also be useful when editing or writing together, at a distance.) All three methods work cross-platform: the other person does not need to have a Mac.
- Skype and a webcam. This is dead easy: most Macs have a built-in webcam, and setting up a Skype video chat is straightforward. Either drawing on paper and holding it in front of the webcam or drawing on a blackboard and pointing the webcam at it works for relatively low-complexity pictures. Even when we are not talking about a picture, I find it easier to follow mathematics over a video connection than an audio-only connection. (At the time of writing, Skype charges for video conferences with more than two participants. A free option is iChat, if everyone involved is using a Mac.)
- Skype, screen sharing and a drawing program. Skype has an option to share your screen. Combined with a drawing program, one can communicate more complicated pictures. The disadvantage is that drawing decent pictures on the computer tends to be pretty slow. The only way I am able to do it reasonably well in real-time is using a drawing tablet; I have one made by Wacom. I like to draw in Denis Auroux's program xournal (which can be installed with Macports, for instance), but almost any drawing program works okay.
- Both of the above methods only allow one person to edit the drawing. A slightly more complicated method that allows both people to work on the drawing is to use VNC. VNC allows a remote user to see and control a computer's desktop. MacOS has a VNC server built in, via "Screen Sharing" in the "Sharing" System Preference; the person on the other end will need a VNC client, like Chicken of the VNC. VNC can be a pain to set up if you are using a router (e.g., on a home WiFi network). A somewhat easier to use, VNC-based program is TeamViewer; it works even through routers, does not require any set-up, and can be accessed from a free iPod / iPhone / Android application.
In a slightly different direction, we recently discovered Rudel, which allows several people to edit a document (in emacs) at once. Installation was surprisingly simple: download the package, unzip it, and add the appropriate line to your .emacs (see the Rudel web page).
Revision control
Revision control is about allowing several people to work on a project simultaneously, tracking and merging changes that they make. Peter Ozsváth, Dylan Thurston and I use darcs (installable via Macports) for revision control for papers we are writing. It is somewhat complicated, but works well once you get used to it. Other revision control systems are available (and some have graphical user interfaces), but Dylan assures me this is the best one.