I want to put a tikz graph (a Feynman diagram using tikz-feynman
) inside other tikz nodes, but it doesn't seem to work. A MWE is below. It has to be compiled with lualatex
as I'm using graphs.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{graphs}
\usepackage[compat=1.1.0]{tikz-feynman}
\begin{document}
\tikzset{
box/.pic={
\feynmandiagram[inner,horizontal=a to d]{
a -- [fermion] b -- [fermion] c -- [fermion] d -- [draw=none]
e -- [fermion] f -- [fermion] g -- [fermion] h -- [draw=none] a,
b -- [boson] g, c -- [boson] f,
};
}
}
\begin{tikzpicture}
\graph [clockwise=4,radius=5em]{
% a/{B}, b/{\tikz{\pic {box};}}, c/{C}, d/{f} %% <-- what I want to do
a/{B}, b/{box}, c/{C}, d/{f}
};
\graph {
(a) -> {(b), (d)}, {(b), (d)} -> (c)
};
\end{tikzpicture}
\end{document}
PS: I also found out tikz-feynman
does not work with the standalone
document class after I had wasted a few hours!
EDIT: Thanks to @TorbjørnT., the above issues is due to standalone
, and is resolved by starting with \RequirePackage{luatex85}
.
tikz-feynman
works fine withstandalone
, butstandalone
doesn't work withlualatex
. To fix that, add\RequirePackage{luatex85}
just before\documentclass{standalone}