Drawing Feynman diagrams
A Feynman diagram is a mathematical visualization of the behavior of subatomic particles. There are several ways to generate them using LaTeX.
How to do it...
We will use the tikz-feynman package. The author documented it in J. Ellis, ‘TikZ-Feynman: Feynman diagrams with TikZ’, (2016), arXiv:1601.05437 [hep-ph], and you can access the documentation executing texdoc tikz-feynman via the command line or at https://texdoc.org/pkg/tikz-feynman.
The positions of the vertices are calculated using Lua, so we must compile with LuaLaTeX. Follow these steps:
- Start with any document class:
\documentclass[border=10pt]{standalone}
- Load the tikz-feynman package:
\usepackage{tikz-feynman}
- Load additional useful TikZ libraries and begin the document:
\usetikzlibrary{positioning,quotes} \begin{document}
- Utilize the \feynmandiagram command as follows:
\feynmandiagram [horizontal=a to b] { i1 [particle=$e^-$] -- [fermion] a ...