[Mac OS X Softwares], [Setting up Mac (Japanese)], [FeynMP]

How to draw Feynman diagrams with LaTeXiT on Mac OS X

You can draw Feynman diagrams using LaTeXiT. This is an easy way to put diagrams in Keynote slides, etc..

1. Required software

You need to have the following items installed.

2. Preparation

  1. Launch LaTeXiT (1.8.0 or later). In the LaTeXiT > Preferences... > Composition panel, press the pull-down menu next to "Configuration" and select "Edit configurations list ...".
  2. Press "+" button, rename "Untitled" to "feynmp", and press "OK".
    [LaTeXiT Configuration pane]
  3. In the same Preferences > Composition > Behaviour panel, choose "latex + dvipdf".
    [LaTeXiT Preferences panel]
  4. Press "Additional scripts" button, enable "Middle-processing", and enter 3 line scipts as shown below. [Additional scripts]
  5. Close the Preferences panel.

3. How to draw Feynman diagrams

  1. In the LaTeXiT panel to enter LaTeX source code, pull down a knob in the middle to disclose preamble. Add
    \usepackage{feynmp}
    					
    in the preamble. Write the feynmf/feynmp source code in the usual editing area underneath.
    Make sure you start with
    	\begin{fmffile}{feyngraph}
    					
    since "feyngraph" is the file name you specified in the middle-processing script for "feynmp" configuration. (You can use this same name for different diagrams, since it is just a temporary file name.)
    [LaTeXiT editing panel]
  2. From the LaTeXiT pulldown menu at the top, select "Paletts > Composition configurations". Select "feynmp" configuration that we just created.
  3. Choose "Text" mode, and press "LaTeX it!" button.
  4. You can drag the Feynman diagram to Keynote or other applications, or keep it in LaTeXiT Library for future use.
  5. If you have multiple \begin{fmffile}{...} in your source, use the following middle-processing script, provided by Pierre Chatelier (father of LateXiT). In this case, use different filename for each diagram.
    #first, extract all fmffiles of the input text file
    FMFFILES=`cat "${INPUTTEXFILE}" | grep "begin{fmffile}" | sed "s/.*\\begin{fmffile}{\([^}]*\)}/\1/g"`
    
    #run mpost for each fmffile
    for i in ${FMFFILES}; do
    mpost $i
    done
    
    #re-run latex now that mpost has been run
    latex ${INPUTTEXFILE}
    dvipdf ${OUTPUTDVIFILE}
    					
  6. To go back to normal equations, just select "default" from the "Composition configuration" panel.

4. More on feynmp


Updated 2006-03-25, Taku Yamanaka