答案1
您必须使用 LuaLaTeX 进行编译才能获得预期的输出。但是,由于 Lua 代码中存在错误,需要进行一些修复,请参阅https://sourceforge.net/p/pgf/bugs/493/和https://tex.stackexchange.com/a/453157/4427
\documentclass[]{article}
\usepackage{tikz}
\usetikzlibrary{graphdrawing}
\usepackage{luacode}
\begin{luacode*}
function pgf_lookup_and_require(name)
local sep = package.config:sub(1,1)
local function lookup(name)
local sub = name:gsub('%.',sep)
if kpse.find_file(sub, 'lua') then
require(name)
elseif kpse.find_file(sub, 'clua') then
collectgarbage('stop')
require(name)
collectgarbage('restart')
else
return false
end
return true
end
return
lookup('pgf.gd.' .. name .. '.library') or
lookup('pgf.gd.' .. name) or
lookup(name .. '.library') or
lookup(name)
end
\end{luacode*}
\usepackage[compat=1.1.0]{tikz-feynman}
\begin{document}
\feynmandiagram[inline=(b),vertical=a to b, green!40!black] {
a -- b -- {c [particle=\(c\)], d [particle=\(d\)]}
};
\end{document}