You need to compile with lualatex
!
If compiled width pdflatex
, there's a warning message
Package tikz-feynman Warning: LuaTeX is required if you wish to have vertices a
utomatically placed. You can disable this warning by setting /tikzfeynman/warn
luatex=false on input line 8.
However, disabling the warning does not cure the problem.
Unfortunately the tikz-feynman
manual does not reveal anything about the usage of lualatex
. It seems to be a hidden feature or the package author relied that this is known.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,positioning,automata,backgrounds,calc,er,patterns}
\usepackage{tikz-feynman}
\tikzfeynmanset{compat=1.0.0}
\begin{document}
\begin{tikzpicture}
\begin{feynman}
\vertex (a) {\(\mu^{-}\)};
\vertex [right=of a] (b);
\vertex [above right=of b] (f1) {\(\nu_{\mu}\)};
\vertex [below right=of b] (c);
\vertex [above right=of c] (f2) {\(\overline \nu_{e}\)};
\vertex [below right=of c] (f3) {\(e^{-}\)};
\diagram* {
(a) -- [fermion] (b) -- [fermion] (f1),
(b) -- [boson, edge label'=\(W^{-}\)] (c),
(c) -- [anti fermion] (f2),
(c) -- [fermion] (f3),
};
\end{feynman}
\end{tikzpicture}
\end{document}
Here's the image produced for that apparent muon-decay
EDIT
As mentioned in the comment below, this was a bug in TikZ-Feynman in v1.0.0. As of v1.1.0, TikZ-Feynman issues warnings whenever a feature requiring LuaLaTeX is used.
If you still try using the automatic graph placement algorithms and don't use LuaLaTeX, a very simple algorithm is used which generates something like:
If you see this output, you'll either need to change compiler to LuaLaTeX, or manually position the location of the vertices.
Looks like you can just add the usual keys to the options of the \vertex
macro, e.g. \vertex [below=2.5cm of qf2,blob] (c) {blob};
. The blob
style is defined by tikz-feynman
.
\documentclass[border=4mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,positioning,automata,backgrounds,calc,er,patterns}
\usepackage[compat=1.1.0]{tikz-feynman}
\begin{document}
\begin{tikzpicture}
\begin{feynman}
\vertex (pf) {$\underline{p}$};
\vertex [right=1cm of pf] (qf1) {$\underline{q}_1$};
\vertex [right=1cm of qf1] (qf2) {$\underline{q}_2$};
\vertex [right=1cm of qf2] (qf3) {$\underline{q}_3$};
\vertex [right=1cm of qf3] (qf4) {$\underline{q}_4$};
\vertex [below=5cm of pf] (pi) {$p$};
\vertex [right=1cm of pi] (qi1) ;
\vertex [right=1cm of qi1] (qi2) {$q_1$};
\vertex [right=1cm of qi2] (qi3) {$q_2$};
\vertex [right=1cm of qi3] (qi4);
\vertex [below=2.5cm of qf2,blob] (c) {blob} ;
\diagram*{
(pi) -- [scalar] (c) -- [scalar] (pf),
{(qi2),(qi3)} -- (c),
(c) -- {(qf1),(qf2),(qf3),(qf4)},
};
\draw [decoration = {brace} , decorate] (qf1.north west) -- (qf4.north east) node [pos = 0.5 , above = 0.125cm] {\underline{\alpha}};
\draw [decoration = {brace} , decorate] (qi3.south east) -- (qi2.south west) node [pos = 0.5 , below = 0.125cm] {\alpha};
\end{feynman}
\end{tikzpicture}
\end{document}
Best Answer
Thanks for your interest in TikZ-Feynman. Since the package is available on CTAN, all you really need to do is make sure your distribution is up to date which is well described in this question.
If, for any reason, you can't update your distribution, you can still install the package in your local TEXMF tree. Firsty, you'll need to obtain the package files from either project page or CTAN. Next, you'll need to locate your local TEXMF tree, and there are instructions for that in other questions (Linux / Unix, Windows).
In the end, you should have all the files in:
Note that TikZ-Feynman contains a few extra files in addition to the usual
.cls
files and just to be safe, you should copy them all.