This page is still under constructions.
It will teach you how to compile LaTeX code to produce images of Feynman diagrams with the feynmp
package.
Compile standalone
Standalone compilation is useful to create a single .tex file that creates a single PDF that you can then import into other projects.
For example:
\documentclass[11pt,border=2pt]{standalone} \usepackage{feynmp-auto} \begin{document} \begin{fmffile}{feyngraph} \begin{fmfgraph*}(90,60) % dimensions (WH) \fmfleft{i2,i1} \fmfright{o2,o1} \fmf{fermion}{i2,v1,i1} \fmf{boson}{v1,v2} \fmf{fermion}{o2,v2,o1} \fmfv{decor.shape=circle,decor.filled=full,decor.size=4,f=(0,,0,,0.6)}{v2} \end{fmfgraph*} \end{fmffile} \end{document}
If you add more than one fmffile
or tikzpicture
environment, it will create a PDF wilt multiple pages. This can be handy if you like everything in one place, and use some common settings like line or color style. To import a particular page from a multipage PDF into a LaTeX, you can use something like
\includegraphics[width=0.25\textwidth,page=2]{fig/myfeyn.pdf}
Compile on-the-fly as a figure
Please see this page.
Compile inside equations
Please see this page.
Compile standalone with LaTeXiT (macOS)
Please see this page by Taku Yamanaka.