[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
- 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 ...".
- Press "+" button, rename "Untitled" to "feynmp", and press "OK".
- In the same Preferences > Composition > Behaviour panel,
choose "latex + dvipdf".
- Press "Additional scripts" button, enable "Middle-processing", and
enter 3 line scipts as shown below.
- Close the Preferences panel.
3. How to draw Feynman diagrams
- 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.)
- From the LaTeXiT pulldown menu at the top, select "Paletts > Composition configurations". Select "feynmp" configuration that we just
created.
- Choose "Text" mode, and press "LaTeX it!" button.
- You can drag the Feynman diagram to Keynote or other applications, or keep it in LaTeXiT Library
for future use.
- 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}
- To go back to normal equations, just select "default" from the "Composition configuration" panel.
4. More on feynmp
Updated 2006-03-25, Taku Yamanaka