Mac OS X for Astrophysicists
Since more and more astrophysicists are starting to use Macs as
laptops for their work here is a beginner's guide to software you may
want to look at and a few links to useful sites.
Oct 1st 2013: Time for a substantial overhaul and to trim out the
really dated stuff. This may not leave much behind... I've also not checked
how much of what is left still works. I started writing this page back in
the 10.2 or 10.3 days so you can imagine a lot has changed. You should
probably consider this page deprecated now!
- About Xgrid
Information on the OS X distributed computing tool.
Tips for using X11 on OS X.
- Standard tools
C compilers, X Windows, other tools you'd find with most Linux distributions.
Tools for talks
- Document preparation
LaTeX and the like
- Other applications
Other applications you might find useful
- Command line tips
Tips for interfacing the command line and the standard Mac OS X
- Useful links
Xgrid is a
new tool in Mac OS X 10.4 (Tiger) which makes it easy to distribute
heavy number crunching across a group of Macs (there is a preview
version for 10.2.8 or later). It automatically detects available nodes
and sends jobs to them, and does it all in the usual point-and-click
interface (although you can work from the command line if you
wish). Just give it your command line program and tell it how to vary
the calling argument (e.g. 'myprocess -begin i -end j') and it'll send
the job out and collect all the results for you. See also this
If you have problems such as being unable to paste or windows
disappearing try invoking ssh as 'ssh -Y' rather than 'ssh -X'. This
uses a somewhat newer ssh feature called 'trusted X11 forwarding'.
Copying and pasting
The Mac OS X pasteboard is completely separate from the X11
clipboard. Within X11.app the highlight-to-copy and
middle-click-to-paste behaviour works as you'd expect. In the native
environment the Edit menu or Command-C/Command-V lets you copy and
paste to the OS X pasteboard. To work between the two:
Paste from X11 to OS X - select your text in your X11 program
to copy it to the X11 clipboard, then in the 'Edit' menu at the top of
the screen select 'Copy' or use Command-C. Paste to your OS X
application as normal.
Paste from OS X to X11 - a bit confusing as the 'Paste' menu
option in X11.app is greyed out most of the time, but if you copy text
it should automatically go to the X11 clipboard. From there, just
middle-click or Control-V as normal. Alternatively, don't forget
'pbpaste' mentioned above.
Changing the startup
Do 'cp /etc/xinit/xinitrc ~/.xinitrc' to give yourself a
personal startup script you can edit (see below)
Keeping quartz-wm features
quartz-wm is the window manager that gives X11 the Mac OS X
look and feel. You may decide to change this for another window
manager by editing a .xinitrc file but if you do this it is
worth running 'quartz-wm --only-proxy' before your
alternative window manager as this will let you use copy and paste as
Focus follows mouse
If you use quartz-wm then try at the command line the
'defaults write com.apple.x11 wm_ffm -bool true' to get
focus-follows-mouse in your X windows.
'defaults write com.apple.x11 wm_click_through -bool true' to
disable the way that a click will activate a window but not pass the
click itself through to the application underneath.
Also, the Terminal program has an option for this, enabled with 'defaults
write com.apple.Terminal FocusFollowsMouse -string YES' and
disabled with 'defaults delete com.apple.Terminal
Nicer fonts in xterms
Try starting an xterm with the following options:
'xterm -fa Monaco -fs 11'
This starts it using a Monaco Freetype font with size 11.
- Developer tools
Make sure you install XCode from the App Store.
the Developer Tools! It's a big download, but
essential as it has C compilers and many other vital tools. Also, it
has the X11 SDK you'll need to compile X11 software.
Fink is a commonly used
package manager for *nix software on OS X and is pretty well supported
in the general Mac community. It is well documented and easy to use,
and one of the best ways to get other window managers, LaTeX and most
other standard X11 applications and the like.
another package manager for *nix software. It happens to be my preferred one,
but for no particular reason these days.
HomeBrew is an even newer package manager and
has had a lot of success.
The default emacs on OS X is not compiled for X11. Either roll your
own, grab one from Fink, MacPorts (do sudo port install
emacs-devel +x11), or HomeBrew (use --with-cocoa or --with-x to pick a
For presentation software you have three or four options. You can use
OpenOffice.org, or your usual
TeX based solution you might use on a Linux machine. Alternatively the
two big presentation packages on OS X are:
- Microsoft Office
is very commonly used and Powerpoint
is available for the Mac. This is probably the most common
presentation package, but I've never used it myself.
Apple's own solution, Keynote (now part of iWork along with Apple's Pages
word processor and the Numbers spreadsheet) is relatively cheap,
simple but very powerful and capable of 3d fancy graphical changes
that are guaranteed to ruin a talk just as well as any overly sugary
Powerpoint twirl-and-fade. Also available with an educational
discount, this is a real bargain and has excellent dual-head support
for Powerbook owners. If you don't already have Office and aren't
planning on getting it this is well worth the money. Vector graphics,
like PDFs (which are now easily created from your PostScript files)
drop in easily making it a doddle to drop in LaTeX typeset equations
without any pixellation. It imports Powerpoint files reasonably well,
and also exports nicely to PDF and Quicktime movie files.
- LaTeX i
LaTeX is available from Fink or MacPorts above, amongst other places (but if you've
installed one of those anyway it's easiest to get it from there). Also
note that Panther (10.3) and later can convert Postscript to PDF with
a built-in distiller, and look out for applications like TexShop
and iTexMac which are specially
designed for preparing TeX-based documents. Alternatively your trusty
emacs or whatever is readily available.
For typesetting equations for
presentations etc. see LaTeXiT, Equation
Service and Equation
- TeX FoG
If you have trouble remembering all the LaTeX commands for
mathematical symbols you may find TeX
FoG a handy tool. It lets you create the LaTeX code for an
equation by clicking buttons for each symbol you need.
- Grapher i
Tiger comes with a surprisingly capable graphing application. It is
also able to create
LaTeX code for the equations it graphs.
- TextWrangler i
As an alternative to emacs (above) or similar text editors, TextWrangler
is getting excellent reviews. It's a cut-down version of BBEdit
- a very powerful but expensive editor. TextWrangler will give syntax
highlighting for most common languages as well as fit in neatly with
OS X (providing features such as asking for authentication to save
over files with restricted permissions).
- The GIMP
The GIMP image editing tool is available as an OS X application
package, and this is one of the few X11 tools I'd suggest not using
Fink or DarwinPorts for. Gimp.app is a must-have.
Tofu is an unusual
program designed for reading large chunks of text. Rather than
scrolling downwards it scrolls sideways. It sounds odd, but it works
very well especially on those wide laptop screens. Very useful to have
around for large ASCII text files. It might be a bit out of date but I still
use it sometimes.
use later. Very useful for quick bits of maths.
The bizarrely-named Cyberduck is a
nice simple FTP and SFTP program for transferring files. It's also free.
- Fugu i
If you want a graphical frontend to SFTP and SCP Fugu may be what
Command line tips
There's a number of commands to link your command line and the OS X
environment. Here's a few very useful ones:
- 'open' will let you open standard file types in the right
application from the command line, for example 'open
paper.pdf' to open 'paper.pdf' in Preview or your default PDF
- 'open -a' lets you open a specific application from the
command line, for example 'open -a mail' to start Apple's
- 'open -e' invokes the default text editor on a file.
- 'pbpaste' and 'pbcopy' send the pasteboard (or
clipboard as it is called on other systems) to and from the command
line. For example, to get a word count of a PDF document you could
select all the text in Preview, copy it to the pasteboard and then in
Terminal enter 'pbpaste | wc -w'. Alternatively you might
want to get a text file into the pasteboard quickly using 'pbcopy
Additions, suggestions, comments etc to Edd.