From d0454fbe3c966efaf3504805b7bb8c1f25d5e1a7 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 20 Jan 2016 22:51:24 +0000 Subject: tikz-feynman (20jan16) git-svn-id: svn://tug.org/texlive/trunk@39441 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/tikz-feynman/tikz-feynman.sty | 40 ++ .../latex/tikz-feynman/tikzfeynman.keys.code.tex | 758 +++++++++++++++++++++ .../latex/tikz-feynman/tikzlibraryfeynman.code.tex | 337 +++++++++ 3 files changed, 1135 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/tikz-feynman/tikz-feynman.sty create mode 100644 Master/texmf-dist/tex/latex/tikz-feynman/tikzfeynman.keys.code.tex create mode 100644 Master/texmf-dist/tex/latex/tikz-feynman/tikzlibraryfeynman.code.tex (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/tikz-feynman/tikz-feynman.sty b/Master/texmf-dist/tex/latex/tikz-feynman/tikz-feynman.sty new file mode 100644 index 00000000000..2b37196e6ad --- /dev/null +++ b/Master/texmf-dist/tex/latex/tikz-feynman/tikz-feynman.sty @@ -0,0 +1,40 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% TikZ-Feynman +% Feynman Diagrams with TikZ +% Copyright (C) 2015 Joshua Ellis +% +% +% This work may be distributed and/or modified under the conditions of the LaTeX +% Project Public License, either version 1.3 of this license or (at your option) +% any later version. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Joshua Ellis. +% +% This program is distributed in the hope that it will be useful, but WITHOUT +% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +% FOR A PARTICULAR PURPOSE. See the LaTeX Project Public License for more +% details. +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\def\tikzfeynman@date{2016/01/19} +\def\tikzfeynman@version@major{1} +\def\tikzfeynman@version@minor{0} +\def\tikzfeynman@version@patch{0} +\edef\tikzfeynman@version{\tikzfeynman@version@major.\tikzfeynman@version@minor.\tikzfeynman@version@patch} + +\ProvidesPackage{tikz-feynman}[\tikzfeynman@date v\tikzfeynman@version Feynman diagrams with TikZ] + +\RequirePackage{tikz}[2013/12/13] % v3.0.0 +\RequirePackage{ifluatex} + +\usetikzlibrary{feynman} + +\endinput + +% Local Variables: +% TeX-master: "tikz-feynman" +% End: diff --git a/Master/texmf-dist/tex/latex/tikz-feynman/tikzfeynman.keys.code.tex b/Master/texmf-dist/tex/latex/tikz-feynman/tikzfeynman.keys.code.tex new file mode 100644 index 00000000000..2558325fc39 --- /dev/null +++ b/Master/texmf-dist/tex/latex/tikz-feynman/tikzfeynman.keys.code.tex @@ -0,0 +1,758 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% TikZ-Feynman +% Feynman Diagrams with TikZ +% Copyright (C) 2015 Joshua Ellis +% +% +% This work may be distributed and/or modified under the conditions of the LaTeX +% Project Public License, either version 1.3 of this license or (at your option) +% any later version. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Joshua Ellis. +% +% This program is distributed in the hope that it will be useful, but WITHOUT +% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +% FOR A PARTICULAR PURPOSE. See the LaTeX Project Public License for more +% details. +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Shapes +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Crossed Circle +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\pgfdeclareshape{crossed circle} +{ + \inheritsavedanchors[from=circle] + \inheritanchorborder[from=circle] + \inheritanchor[from=circle]{north} + \inheritanchor[from=circle]{north west} + \inheritanchor[from=circle]{north east} + \inheritanchor[from=circle]{center} + \inheritanchor[from=circle]{west} + \inheritanchor[from=circle]{east} + \inheritanchor[from=circle]{mid} + \inheritanchor[from=circle]{mid west} + \inheritanchor[from=circle]{mid east} + \inheritanchor[from=circle]{base} + \inheritanchor[from=circle]{base west} + \inheritanchor[from=circle]{base east} + \inheritanchor[from=circle]{south} + \inheritanchor[from=circle]{south west} + \inheritanchor[from=circle]{south east} + + \inheritbackgroundpath[from=circle] + + \foregroundpath{ + % Compute south west + \centerpoint + \pgf@xc=\radius + \advance\pgf@x by-0.707107\pgf@xc + \advance\pgf@y by-0.707107\pgf@xc + \pgf@xa=\pgf@x \pgf@ya=\pgf@y % Store coordinates + % Compute north east point + \centerpoint + \pgf@xc=\radius + \advance\pgf@x by0.707107\pgf@xc + \advance\pgf@y by0.707107\pgf@xc + \pgf@xb=\pgf@x \pgf@yb=\pgf@y % Store coordinates + \pgfpathmoveto{\pgfqpoint{\pgf@xa}{\pgf@ya}} + \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yb}} + \pgfpathmoveto{\pgfqpoint{\pgf@xa}{\pgf@yb}} + \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@ya}} + \pgfsetarrowsstart{} + \pgfsetarrowsend{} + } +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Decorations +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Complete Sines +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Complete sines replaces the path with a whole number of sine waves. +%% Thanks to http://tex.stackexchange.com/a/134516/26980 +\pgfdeclaredecoration{complete sines}{initial} +{ + %% Begin by computing the overall path length and find how many sine waves we + %% can fit in. Nothing happens beyond the computation. + \state{initial}[ + width=+0pt, + next state=move, + persistent precomputation={ + \def\tikzfeynman@cs@angle@step{30} + \def\tikzfeynman@cs@current@angle{0} + \pgfmathsetlengthmacro{\tikzfeynman@cs@points@per@step}{ + \pgfdecoratedinputsegmentlength + / int(\pgfdecoratedinputsegmentlength + / \pgfdecorationsegmentlength) + / 360 + * \tikzfeynman@cs@angle@step} + }, + ]{} + %% Move to the origin to the path + \state{move}[ + width=+\tikzfeynman@cs@points@per@step, + next state=draw + ]{ + \pgfpathmoveto{\pgfpointorigin} + } + %% Draw the sine wave itself. This computes the value every 20 degrees and draws straight edges. + \state{draw}[ + width=+\tikzfeynman@cs@points@per@step, + switch if less than=1.25*\tikzfeynman@cs@points@per@step to final, % <- bit of a hack + persistent postcomputation={ + \pgfmathparse{mod(\tikzfeynman@cs@current@angle+\tikzfeynman@cs@angle@step, 360)} + \let\tikzfeynman@cs@current@angle=\pgfmathresult% + }, + ]{ + \pgfmathparse{sin(\tikzfeynman@cs@current@angle) * \pgfmetadecorationsegmentamplitude / 2} + \tikz@decoratepathfalse + \pgfpathlineto{\pgfqpoint{0pt}{\pgfmathresult pt}}% + } + + \state{final}{ + \ifdim\pgfdecoratedremainingdistance>0pt\relax + \pgfpathlineto{\pgfpointdecoratedpathlast} + \fi + } +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Keys +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\pgfkeys{ + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %% Family + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + /tikzfeynman/search path for tikz/.search also={/tikz,/tikzfeynman}, + /tikzfeynman/.is family, +} + +\tikzfeynmanset{ + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Hooks + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + execute at begin feynman/.code={}, + execute at end feynman/.code={}, + every feynman/.style={}, + every feynman@@/.style={ + /tikzfeynman/.cd, + .search also={/tikz}, + /tikzfeynman/medium, + }, + execute at begin feynman@@/.code={} %% Internal version + execute at end feynman@@/.code={}, %% Internal version + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %% Diagrams + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + every diagram/.style={}, + every diagram@@/.style={ + /tikzfeynman/.cd, + .search also={/tikz/graphs, /tikz}, + nodes={ + /tikzfeynman/.cd, + /tikzfeynman/.search also={/tikz/graphs, /tikz}, + /tikzfeynman/every vertex@@, + /tikzfeynman/every vertex}, + edges={ + /tikzfeynman/.cd, + /tikzfeynman/.search also={/tikz/graphs, /tikz}, + /tikzfeynman/every edge@@, + /tikzfeynman/every edge}, + /tikzfeynman/medium, + }, + inline/.style={ + /tikz/baseline={#1}, + /tikzfeynman/small, + }, + small/.style={ + /tikz/node distance=1cm, + /graph drawing/node distance=1.25cm, + /graph drawing/level distance=1cm, + /graph drawing/sibling distance=1.5cm, + /tikzfeynman/every dot@@/.append style={/tikz/minimum size=1mm}, + /tikzfeynman/every crossed dot@@/.append style={/tikz/minimum size=2mm}, + /tikzfeynman/every blob@@/.append style={/tikz/minimum size=0.5cm}, + /tikzfeynman/arrow size=1.2pt, + /tikzfeynman/insertion/size=2.5pt, + }, + medium/.style={ + /tikz/node distance=1.5cm, + /graph drawing/node distance=1.9cm, + /graph drawing/level distance=1.5cm, + /graph drawing/sibling distance=2.25cm, + }, + large/.style={ + /tikz/node distance=2cm, + /graph drawing/node distance=2.5cm, + /graph drawing/level distance=2cm, + /graph drawing/sibling distance=3cm, + /tikz/graphs/edges={thick}, + /tikzfeynman/every dot@@/.append style={/tikz/minimum size=2mm}, + /tikzfeynman/every crossed dot@@/.append style={/tikz/minimum size=4mm}, + /tikzfeynman/every blob@@/.append style={/tikz/minimum size=1cm}, + /tikzfeynman/arrow size=1.6pt, + /tikzfeynman/insertion/size=4pt, + }, + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Vertices + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + every vertex@@/.style={ + /tikz/shape=coordinate, + }, + every vertex/.style={}, + vertex/.style={ + /tikzfeynman/every vertex@@, + /tikzfeynman/every vertex, + }, + every dot@@/.style={ + /tikz/shape=circle, + /tikz/graphs/as={}, + /tikz/draw, + /tikz/fill, + /tikz/inner sep=0pt, + /tikz/outer sep=0pt, + /tikz/minimum size=1.5mm, + }, + every dot/.style={}, + dot/.style={ + /tikzfeynman/every dot@@, + /tikzfeynman/every dot, + }, + every square dot@@/.style={ + /tikz/shape=rectangle, + }, + every square dot/.style={}, + square dot/.style={ + /tikzfeynman/every dot@@, + /tikzfeynman/every dot, + /tikzfeynman/every square dot@@, + /tikzfeynman/every square dot, + }, + every empty dot@@/.style={ + /tikz/fill=none, + }, + every empty dot/.style={}, + empty dot/.style={ + /tikzfeynman/every dot@@, + /tikzfeynman/every dot, + /tikzfeynman/every empty dot@@, + /tikzfeynman/every empty dot, + }, + every crossed dot@@/.style={ + /tikz/fill=none, + /tikz/shape=crossed circle, + /tikz/minimum size=3mm, + }, + every crossed dot/.style={}, + crossed dot/.style={ + /tikzfeynman/every dot@@, + /tikzfeynman/every dot, + /tikzfeynman/every crossed dot@@, + /tikzfeynman/every crossed dot, + }, + every blob@@/.style={ + /tikz/shape=circle, + /tikz/graphs/as={}, + /tikz/draw, + /tikz/fill=none, + /tikz/outer sep=0.5\pgflinewidth, + /tikz/inner sep=0pt, + /tikz/minimum size=0.75cm, + /tikz/pattern=north west lines, + }, + every blob/.style={}, + blob/.style={ + /tikzfeynman/every blob@@, + /tikzfeynman/every blob, + }, + every particle@@/.style={ + /tikz/shape=rectangle, + /tikz/draw=none, + /tikz/fill=none, + /tikz/inner sep=0.3333em, + /tikz/outer sep=0.5\pgflinewidth, + }, + every particle/.style={}, + particle/.style args={#1}{ + /tikzfeynman/every particle@@, + /tikzfeynman/every particle, + /tikz/graphs/as={#1}, + }, + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %% Edge styles + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %% Arrow Style + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + arrow size/.store in=\tikzfeynman@arrow@size, + arrow size=1.5pt, + with arrow/.style={ + /tikz/decoration={ + markings, + mark=at position #1 with { + \node[ + transform shape, + xshift=-0.5mm, + fill, + inner sep=\tikzfeynman@arrow@size, + draw=none, + isosceles triangle + ] { }; + }, + }, + /tikz/postaction={ + /tikz/decorate=true, + }, + }, + with reversed arrow/.style={ + /tikz/decoration={ + markings, + mark=at position #1 with { + \node[ + transform shape, + xshift=-0.5mm, + rotate=180, + fill, + inner sep=\tikzfeynman@arrow@size, + draw=none, + isosceles triangle + ] { }; + }, + }, + /tikz/postaction={ + /tikz/decorate=true, + }, + }, + %% Base Edge Styles + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + every edge@@/.style={}, + every edge/.style={}, + %% Specific Styles + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + every boson@@/.style={ + /tikz/draw=none, + /tikz/decoration={name=none}, + /tikz/postaction={ + /tikz/draw, + /tikz/decoration={ + complete sines, + amplitude=1mm, + segment length=2mm, + }, + /tikz/decorate=true, + }, + }, + every boson/.style={}, + boson/.style={ + /tikzfeynman/every boson@@, + /tikzfeynman/every boson, + }, + every charged boson@@/.style={ + /tikzfeynman/with arrow=0.5, + }, + every charged boson/.style={}, + charged boson/.style={ + /tikzfeynman/boson, + /tikzfeynman/every charged boson@@, + /tikzfeynman/every charged boson, + }, + every anti charged boson@@/.style={ + /tikzfeynman/with reversed arrow=0.5, + }, + every anti charged boson/.style={}, + anti charged boson/.style={ + /tikzfeynman/boson, + /tikzfeynman/every anti charged boson@@, + /tikzfeynman/every anti charged boson, + }, + every photon@@/.style={ + /tikz/draw=none, + /tikz/decoration={name=none}, + /tikz/postaction={ + /tikz/draw, + /tikz/decoration={ + complete sines, + amplitude=1mm, + segment length=2mm, + }, + /tikz/decorate=true, + }, + }, + every photon/.style={}, + photon/.style={ + /tikzfeynman/every photon@@, + /tikzfeynman/every photon, + }, + every scalar@@/.style={ + /tikz/dashed, + }, + every scalar/.style={}, + scalar/.style={ + /tikzfeynman/every scalar@@, + /tikzfeynman/every scalar, + }, + every charged scalar@@/.style={ + /tikzfeynman/with arrow=0.5, + }, + every charged scalar/.style={}, + charged scalar/.style={ + /tikzfeynman/scalar, + /tikzfeynman/every charged scalar@@, + /tikzfeynman/every charged scalar, + }, + every anti charged scalar@@/.style={ + /tikzfeynman/with reversed arrow=0.5, + }, + every anti charged scalar/.style={}, + anti charged scalar/.style={ + /tikzfeynman/scalar, + /tikzfeynman/every charged scalar, + /tikzfeynman/every anti charged scalar@@, + /tikzfeynman/every anti charged scalar, + }, + every ghost@@/.style={ + /tikz/dotted, + /tikz/thick, + }, + every ghost/.style={}, + ghost/.style={ + /tikzfeynman/every ghost@@, + /tikzfeynman/every ghost, + }, + every fermion@@/.style={ + /tikzfeynman/with arrow=0.5, + }, + every fermion/.style={}, + fermion/.style={ + /tikzfeynman/every fermion@@, + /tikzfeynman/every fermion, + }, + every anti fermion@@/.style={ + /tikzfeynman/with reversed arrow=0.5, + }, + every anti fermion/.style={}, + anti fermion/.style={ + /tikzfeynman/every fermion, + /tikzfeynman/every anti fermion@@, + /tikzfeynman/every anti fermion, + }, + every majorana@@/.style={ + /tikzfeynman/with arrow=0.33, + /tikzfeynman/with reversed arrow=0.73, + }, + every majorana/.style={}, + majorana/.style={ + /tikzfeynman/every majorana@@, + /tikzfeynman/every majorana, + }, + every anti majorana@@/.style={ + /tikzfeynman/with reversed arrow=0.33, + /tikzfeynman/with arrow=0.73, + }, + every anti majorana/.style={}, + anti majorana/.style={ + /tikzfeynman/every anti majorana@@, + /tikzfeynman/every anti majorana, + }, + every gluon@@/.style={ + /tikz/draw=none, + /tikz/decoration={name=none}, + /tikz/postaction={ + /tikz/draw, + /tikz/decoration={ + coil, + aspect=0.75, + mirror, + segment length=1.5mm + }, + /tikz/decorate=true, + }, + }, + every gluon/.style={}, + gluon/.style={ + /tikzfeynman/every gluon@@, + /tikzfeynman/every gluon, + }, + %% Insertions + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %% Parameters + insertion/size/.store in=\tikzfeynman@insertion@size, + insertion/size=3pt, + insertion/style/.store in=\tikzfeynman@insertion@style, + insertion/style={}, + %% Styles + insertion@@/.style args={[#1]#2}{ + /tikz/decoration={ + markings, + mark=at position #2 with { + \tikzfeynmanset{insertion/.cd, insertion/.search also={/tikz}, #1} + \draw [\tikzfeynman@insertion@style] (-\tikzfeynman@insertion@size, -\tikzfeynman@insertion@size) -- (\tikzfeynman@insertion@size, \tikzfeynman@insertion@size); + \draw [\tikzfeynman@insertion@style] (-\tikzfeynman@insertion@size, \tikzfeynman@insertion@size) -- (\tikzfeynman@insertion@size, -\tikzfeynman@insertion@size); + }, + }, + /tikz/postaction={ + /tikz/decorate=true, + }, + }, + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Momentum arrows + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %% Parameters + momentum/label distance/.store in=\tikzfeynman@momentum@label@distance, + momentum/label distance=0pt, + momentum/arrow distance/.store in=\tikzfeynman@momentum@arrow@distance, + momentum/arrow distance=3mm, + momentum/arrow shorten/.store in=\tikzfeynman@momentum@arrow@shorten, + momentum/arrow shorten=0.15, + momentum/label style/.store in=\tikzfeynman@momentum@label@style, + momentum/label style={}, + momentum/arrow style/.store in=\tikzfeynman@momentum@arrow@style, + momentum/arrow style={}, + %% Styles + momentum@@/.style args={[#1]#2}{ + /tikz/preaction={ + /tikz/decoration={ + show path construction, + moveto code={}, + lineto code={ + \tikzfeynmanset{momentum/.cd, momentum/.search also={/tikz}, #1} + \path (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast) + coordinate [pos=\tikzfeynman@momentum@arrow@shorten] (tf@m@1) + coordinate [pos=1 - \tikzfeynman@momentum@arrow@shorten] (tf@m@2); + \draw [-Stealth, \tikzfeynman@momentum@arrow@style] + ($(tf@m@1)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@2)$) + -- ($(tf@m@2)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@1)$) + node [pos=0.5, auto, + outer sep=\tikzfeynman@momentum@label@distance, + \tikzfeynman@momentum@label@style] {#2}; + }, + curveto code={ + \tikzfeynmanset{momentum/.cd, #1} + \path (\tikzinputsegmentfirst) + .. controls (\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb) + .. (\tikzinputsegmentlast) + { \foreach \i in {1, ..., 50} { + coordinate [pos=\tikzfeynman@momentum@arrow@shorten + (1-2 * \tikzfeynman@momentum@arrow@shorten)*\i/50] (tf@m@\i) } }; + \draw [-Stealth, \tikzfeynman@momentum@arrow@style] + ($(tf@m@1)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@2)$) + foreach \i [count=\j from 3] in {2, ..., 24} { + -- ($(tf@m@\i)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@\j)$) + } + -- ($(tf@m@25)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@26)$) + node [pos=0.5, auto, + outer sep=\tikzfeynman@momentum@label@distance, + \tikzfeynman@momentum@arrow@style] {#2} + foreach \i [count=\j from 27] in {26, ..., 49} { + -- ($(tf@m@\i)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@\j)$) + } + -- ($(tf@m@50)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@49)$); + }, + closepath code={ + \tikzfeynmanset{momentum/.cd, #1} + \path (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast) + coordinate [pos=\tikzfeynman@momentum@arrow@shorten] (tf@m@1) + coordinate [pos=1 - \tikzfeynman@momentum@arrow@shorten] (tf@m@2); + \draw [-Stealth, \tikzfeynman@momentum@arrow@style] + ($(tf@m@1)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@2)$) + -- ($(tf@m@2)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@1)$) + node [pos=0.5, auto, + outer sep=\tikzfeynman@momentum@label@distance, + \tikzfeynman@momentum@label@style] {#2}; + }, + }, + /tikz/decorate=true, + }, + }, + momentum'@@/.style args={[#1]#2}{ + /tikz/preaction={ + /tikz/decoration={ + show path construction, + moveto code={}, + lineto code={ + \tikzfeynmanset{momentum/.cd, #1} + \path (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast) + coordinate [pos=\tikzfeynman@momentum@arrow@shorten] (tf@m@1) + coordinate [pos=1 - \tikzfeynman@momentum@arrow@shorten] (tf@m@2); + \draw [-Stealth, \tikzfeynman@momentum@arrow@style] + ($(tf@m@1)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@2)$) + -- ($(tf@m@2)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@1)$) + node [pos=0.5, auto, swap, + outer sep=\tikzfeynman@momentum@label@distance, + \tikzfeynman@momentum@label@style] {#2}; + }, + curveto code={ + \tikzfeynmanset{momentum/.cd, #1} + \path (\tikzinputsegmentfirst) + .. controls (\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb) + .. (\tikzinputsegmentlast) + { \foreach \i in {1, ..., 50} { + coordinate [pos=\tikzfeynman@momentum@arrow@shorten + (1-2 * \tikzfeynman@momentum@arrow@shorten)*\i/50] (tf@m@\i) } }; + \draw [-Stealth, \tikzfeynman@momentum@arrow@style] + ($(tf@m@1)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@2)$) + foreach \i [count=\j from 3] in {2, ..., 24} { + -- ($(tf@m@\i)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@\j)$) + } + -- ($(tf@m@25)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@26)$) + node [pos=0.5, auto, swap, + outer sep=\tikzfeynman@momentum@label@distance, + \tikzfeynman@momentum@arrow@style] {#2} + foreach \i [count=\j from 27] in {26, ..., 49} { + -- ($(tf@m@\i)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@\j)$) + } + -- ($(tf@m@50)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@49)$); + }, + closepath code={ + \tikzfeynmanset{momentum/.cd, #1} + \path (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast) + coordinate [pos=\tikzfeynman@momentum@arrow@shorten] (tf@m@1) + coordinate [pos=1 - \tikzfeynman@momentum@arrow@shorten] (tf@m@2); + \draw [-Stealth, \tikzfeynman@momentum@arrow@style] + ($(tf@m@1)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@2)$) + -- ($(tf@m@2)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@1)$) + node [pos=0.5, auto, swap, + outer sep=\tikzfeynman@momentum@label@distance, + \tikzfeynman@momentum@label@style] {#2}; + }, + }, + /tikz/decorate=true, + }, + }, + reversed momentum@@/.style args={[#1]#2}{ + /tikz/preaction={ + /tikz/decoration={ + show path construction, + moveto code={}, + lineto code={ + \tikzfeynmanset{momentum/.cd, #1} + \path (\tikzinputsegmentlast) -- (\tikzinputsegmentfirst) + coordinate [pos=\tikzfeynman@momentum@arrow@shorten] (tf@m@1) + coordinate [pos=1 - \tikzfeynman@momentum@arrow@shorten] (tf@m@2); + \draw [-Stealth, \tikzfeynman@momentum@arrow@style] + ($(tf@m@1)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@2)$) + -- ($(tf@m@2)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@1)$) + node [pos=0.5, auto, swap, + outer sep=\tikzfeynman@momentum@label@distance, + \tikzfeynman@momentum@label@style] {#2}; + }, + curveto code={ + \tikzfeynmanset{momentum/.cd, #1} + \path (\tikzinputsegmentlast) + .. controls (\tikzinputsegmentsupportb) and (\tikzinputsegmentsupporta) + .. (\tikzinputsegmentfirst) + { \foreach \i in {1, ..., 50} { + coordinate [pos=\tikzfeynman@momentum@arrow@shorten + (1-2 * \tikzfeynman@momentum@arrow@shorten)*\i/50] (tf@m@\i) } }; + \draw [-Stealth, \tikzfeynman@momentum@arrow@style] + ($(tf@m@1)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@2)$) + foreach \i [count=\j from 3] in {2, ..., 24} { + -- ($(tf@m@\i)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@\j)$) + } + -- ($(tf@m@25)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@26)$) + node [pos=0.5, auto, swap, + outer sep=\tikzfeynman@momentum@label@distance, + \tikzfeynman@momentum@arrow@style] {#2} + foreach \i [count=\j from 27] in {26, ..., 49} { + -- ($(tf@m@\i)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@\j)$) + } + -- ($(tf@m@50)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@49)$); + }, + closepath code={ + \tikzfeynmanset{momentum/.cd, #1} + \path (\tikzinputsegmentlast) -- (\tikzinputsegmentfirst) + coordinate [pos=\tikzfeynman@momentum@arrow@shorten] (tf@m@1) + coordinate [pos=1 - \tikzfeynman@momentum@arrow@shorten] (tf@m@2); + \draw [-Stealth, \tikzfeynman@momentum@arrow@style] + ($(tf@m@1)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@2)$) + -- ($(tf@m@2)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@1)$) + node [pos=0.5, auto, swap, + outer sep=\tikzfeynman@momentum@label@distance, + \tikzfeynman@momentum@label@style] {#2}; + }, + }, + /tikz/decorate=true, + }, + }, + reversed momentum'@@/.style args={[#1]#2}{ + /tikz/preaction={ + /tikz/decoration={ + show path construction, + moveto code={}, + lineto code={ + \tikzfeynmanset{momentum/.cd, #1} + \path (\tikzinputsegmentlast) -- (\tikzinputsegmentfirst) + coordinate [pos=\tikzfeynman@momentum@arrow@shorten] (tf@m@1) + coordinate [pos=1 - \tikzfeynman@momentum@arrow@shorten] (tf@m@2); + \draw [-Stealth, \tikzfeynman@momentum@arrow@style] + ($(tf@m@1)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@2)$) + -- ($(tf@m@2)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@1)$) + node [pos=0.5, + auto, + outer sep=\tikzfeynman@momentum@label@distance, + \tikzfeynman@momentum@label@style] {#2}; + }, + curveto code={ + \tikzfeynmanset{momentum/.cd, #1} + \path (\tikzinputsegmentlast) + .. controls (\tikzinputsegmentsupportb) and (\tikzinputsegmentsupporta) + .. (\tikzinputsegmentfirst) + { \foreach \i in {1, ..., 50} { + coordinate [pos=\tikzfeynman@momentum@arrow@shorten + (1-2 * \tikzfeynman@momentum@arrow@shorten)*\i/50] (tf@m@\i) } }; + \draw [-Stealth, \tikzfeynman@momentum@arrow@style] + ($(tf@m@1)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@2)$) + foreach \i [count=\j from 3] in {2, ..., 24} { + -- ($(tf@m@\i)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@\j)$) + } + -- ($(tf@m@25)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@26)$) + node [pos=0.5, + auto, + outer sep=\tikzfeynman@momentum@label@distance, + \tikzfeynman@momentum@arrow@style] {#2} + foreach \i [count=\j from 27] in {26, ..., 49} { + -- ($(tf@m@\i)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@\j)$) + } + -- ($(tf@m@50)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@49)$); + }, + closepath code={ + \tikzfeynmanset{momentum/.cd, #1} + \path (\tikzinputsegmentlast) -- (\tikzinputsegmentfirst) + coordinate [pos=\tikzfeynman@momentum@arrow@shorten] (tf@m@1) + coordinate [pos=1 - \tikzfeynman@momentum@arrow@shorten] (tf@m@2); + \draw [-Stealth, \tikzfeynman@momentum@arrow@style] + ($(tf@m@1)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@2)$) + -- ($(tf@m@2)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@1)$) + node [pos=0.5, auto, + outer sep=\tikzfeynman@momentum@label@distance, + \tikzfeynman@momentum@label@style] {#2}; + }, + }, + /tikz/decorate=true, + }, + }, + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Modifiers + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + half left/.style={ + /tikz/bend left=90, + /tikz/looseness=1.5, + }, + half right/.style={ + /tikz/bend right=90, + /tikz/looseness=1.5, + }, + quarter left/.style={ + /tikz/bend left=45, + }, + quarter right/.style={ + /tikz/bend right=45, + }, +} + +\endinput \ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/tikz-feynman/tikzlibraryfeynman.code.tex b/Master/texmf-dist/tex/latex/tikz-feynman/tikzlibraryfeynman.code.tex new file mode 100644 index 00000000000..380f7125096 --- /dev/null +++ b/Master/texmf-dist/tex/latex/tikz-feynman/tikzlibraryfeynman.code.tex @@ -0,0 +1,337 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% TikZ-Feynman +% Feynman Diagrams with TikZ +% Copyright (C) 2015 Joshua Ellis +% +% +% This work may be distributed and/or modified under the conditions of the LaTeX +% Project Public License, either version 1.3 of this license or (at your option) +% any later version. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Joshua Ellis. +% +% This program is distributed in the hope that it will be useful, but WITHOUT +% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +% FOR A PARTICULAR PURPOSE. See the LaTeX Project Public License for more +% details. +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Pre-requisites +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\usetikzlibrary{ + arrows.meta, + calc, + decorations, + decorations.markings, + decorations.pathmorphing, + decorations.pathreplacing, + graphs, + patterns, + positioning, + shapes.geometric, +} +\ifluatex + \usetikzlibrary{ + graphdrawing + } + \usegdlibrary{ + circular, + force, + layered, + trees + } +\fi + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Function definitions +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Miscellaneous functions +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\def\tikzfeynman@empty{} + +%% Key Manager +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Setup the tikz-feynman key family +\pgfkeys{/tikzfeynman/.is family} + +%% |\tikzfeynmanset| allows keys that belong with tikz-feynman to be easily set. +\def\tikzfeynmanset{\pgfqkeys{/tikzfeynman}} + +%% Luatex Waring +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Check if we are using luatex +\newif\iftikzfeynman@warn@luatex% +\tikzfeynmanset{ + warn luatex/.is if=tikzfeynman@warn@luatex, + warn luatex=true, +} + +\AtBeginDocument{ + \ifluatex\else + \iftikzfeynman@warn@luatex + \PackageWarning{tikz-feynman}{LuaTeX is required if you wish to have vertices automatically placed. You can disable this warning by setting /tikzfeynman/warn luatex=false} + \fi + \fi +} + +%% Version check +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Check which version is expected and which is installed +\def\tikzfeynman@compat@parse#1.#2.#3\pgfeov{ + \edef\tikzfeynman@compat@major{#1} + \edef\tikzfeynman@compat@minor{#2} + \edef\tikzfeynman@compat@patch{#3} + \edef\tikzfeynman@compat{#1.#2.#3} +} +\let\tikzfeynman@compat=\tikzfeynman@empty +\pgfkeyslet{/tikzfeynman/compat/.@cmd}{\tikzfeynman@compat@parse} + +\AtBeginDocument{ + \ifx\tikzfeynman@version\tikzfeynman@compat\else + \ifx\tikzfeynman@compat\tikzfeynman@empty + \PackageWarning{tikz-feynman}{Consider adding \string\tikzfeynmanset{compat=\tikzfeynman@version} to your preamble so that you can be warned if TikZ-Feynman changes.} + \else + \ifx\tikzfeynman@compat@major\tikzfeynman@version@major + \ifx\tikzfeynman@compat@minor\tikzfeynman@version@minor + \ifx\tikzfeynman@compat@patch\tikzfeynman@version@patch\else + \PackageInfo{tikz-feynman}{The preamble requested version \tikzfeynman@compat, but the system version is \tikzfeynman@version. This should cause no issue.} + \fi + \else + \PackageWarning{tikz-feynman}{The preamble requested version \tikzfeynman@compat, but the system version is \tikzfeynman@version. This may change some diagrams.} + \fi + \else + \PackageError{tikz-feynman}{The preamble requested version \tikzfeynman@compat, but the system version is \tikzfeynman@version. They are most likely incompatible. Please download the appropriate version at github.com/JP-Ellis/tikz-feynman.} + \fi + \fi + \fi +} + +%% Override Lua code if necessary +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\def\tikzfeynman@apply@patch{ + \directlua{require("tikzfeynman.patch.lua")} +} + +%% Version 3.0.0, 3.0.1 and 3.0.1a need to be patched. +\ifluatex + \def\tikzfeynman@temp{3.0.0} + \ifx\pgfversion\tikzfeynman@temp + \tikzfeynman@apply@patch + \else + \def\tikzfeynman@temp{3.0.1} + \ifx\pgfversion\tikzfeynman@temp + \tikzfeynman@apply@patch + \else + \def\tikzfeynman@temp{3.0.1a} + \ifx\pgfversion\tikzfeynman@temp + \tikzfeynman@apply@patch + \fi + \fi + \fi +\fi + +%% Feynman Environment +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Provide `\begin{feynman} ... \end{feynman}` within TikZ pictures. +\tikzaddtikzonlycommandshortcutlet\feynman\tikzfeynman@environment@feynman +\tikzaddtikzonlycommandshortcutlet\endfeynman\endtikzfeynman@environment@feynman + +%% \begin{feynman}...\end{feynman} +\def\tikzfeynman@environment@feynman{% + \pgfutil@ifnextchar[{\tikzfeynman@environment@feynman@opt} + {\tikzfeynman@environment@feynman@opt[]}} + +\def\tikzfeynman@environment@feynman@opt[#1]{% + \begingroup + %% Local overrides + \let\tikz@@scan@fig=\tikzfeynman@scan@fig + \let\tikzfeynman@orig@graph=\graph + %% Local commands + \let\vertex=\tikzfeynman@commands@vertex + \let\diagram=\tikzfeynman@commands@diagram + \let\graph=\tikzfeynman@commands@graph + %% Opening hooks + \scope + \tikz@lib@ignore@sizetrue + \tikzfeynman@tikz@search@tikzfeynman + \pgfkeys{ + /tikzfeynman/every feynman@@, + /tikzfeynman/every feynman, + #1} + \pgfkeysvalueof{/tikzfeynman/execute at begin feynman@@}% + \pgfkeysvalueof{/tikzfeynman/execute at begin feynman}% +} + +\def\endtikzfeynman@environment@feynman{% + %% Closing hooks + \pgfkeysvalueof{/tikzfeynman/execute at end feynman}% + \pgfkeysvalueof{/tikzfeynman/execute at end feynman@@}% + \endscope + \endgroup +} + +%% \feynmandiagram +\def\feynmandiagram{% + \pgfutil@ifnextchar[{\feynmandiagram@opt} + {\feynmandiagram@opt[]}} +\def\feynmandiagram@opt[#1]{% + \pgfutil@ifnextchar[{\feynmandiagram@opt@opt[#1]} + {\feynmandiagram@opt@opt[#1][#1]}} +\def\feynmandiagram@opt@opt[#1][#2]{% + \tikz [/tikzfeynman/.cd, .search also={/tikz}, #1] + \graph [/tikzfeynman/every diagram@@, /tikzfeynman/every diagram, /tikz/graphs/spring layout, #2]} + +%% Allow empty nodes +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\newif\iftikzfeynmanallowemptynode +\newif\iftikzfeynmanvertex +\def\tikzfeynman@scan@fig{% + \pgfutil@ifnextchar a{\tikz@fig@scan@at} + {\pgfutil@ifnextchar({\tikz@fig@scan@name} + {\pgfutil@ifnextchar[{\tikz@fig@scan@options}% + {\pgfutil@ifnextchar\bgroup{\tikz@fig@main}% + {\iftikzfeynmanvertex% + \tikzset{ + /tikzfeynman/every vertex@@, + /tikzfeynman/every vertex}% + \iftikzfeynmanallowemptynode% + \else% + \tikzset{/tikzfeynman/particle}% + \fi% + \fi% + \tikz@fig@main{}}}}}}%}} + +%% Include /tikzfeynman in the search path +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\def\tikzfeynman@tikz@search@tikzfeynman{% + \pgfkeys{/tikz/.unknown/.code=% + \let\tikz@key\pgfkeyscurrentname% + %% Is it a tikzfeynman key? + \pgfkeys{/tikzfeynman/\tikz@key/.try={##1}}% + \ifpgfkeyssuccess% + \else% + %% Is it a pgf key? + \pgfkeys{/pgf/\tikz@key/.try={##1}}% + \ifpgfkeyssuccess% + \else% + \expandafter\pgfutil@in@\expandafter!\expandafter{\tikz@key}% + \ifpgfutil@in@% + %% this is a color! + \expandafter\tikz@addoption\expandafter{\expandafter\tikz@compat@color@set\expandafter{\tikz@key}}% + \edef\tikz@textcolor{\tikz@key}% + \else% + \pgfutil@doifcolorelse{\tikz@key} + {% + \expandafter\tikz@addoption\expandafter{\expandafter\tikz@compat@color@set\expandafter{\tikz@key}}% + \edef\tikz@textcolor{\tikz@key}% + }% + {% + %% Ok, second chance: This might be an arrow specification: + \expandafter\pgfutil@in@\expandafter-\expandafter{\tikz@key}% + \ifpgfutil@in@% + %% Ah, an arrow spec! + \expandafter\tikz@processarrows\expandafter{\tikz@key}% + \else% + %% Ok, third chance: A shape! + \expandafter\ifx\csname pgf@sh@s@\tikz@key\endcsname\relax% + \pgfkeys{/errors/unknown key/.expand + once=\expandafter{\expandafter/\expandafter t\expandafter + i\expandafter k\expandafter z\expandafter/\tikz@key}{##1}}% + \else% + \edef\tikz@shape{\tikz@key}% + \fi% + \fi% + }% + \fi% + \fi% + \fi% + } +} + + +%% Vertex +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Adapted from |\coordinate| code +\def\tikzfeynman@commands@vertex{ + \path \pgfextra{\tikzfeynmanallowemptynodetrue} + \pgfextra{\tikzfeynmanvertextrue} + node} + +%% Diagram +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\def\tikzfeynman@commands@diagram{\@ifstar + \tikzfeynman@commands@diagram@star% + \tikzfeynman@commands@diagram@nostar} + +\def\tikzfeynman@commands@diagram@nostar{% + \pgfutil@ifnextchar[{\tikzfeynman@commands@diagram@nostar@opt} + {\tikzfeynman@commands@diagram@nostar@opt[]}} +\def\tikzfeynman@commands@diagram@nostar@opt[#1]{% + \tikzfeynman@orig@graph [/tikzfeynman/every diagram@@, /tikzfeynman/every diagram, /tikz/graphs/spring layout, #1]} + +\def\tikzfeynman@commands@diagram@star{% + \pgfutil@ifnextchar[{\tikzfeynman@commands@diagram@star@opt} + {\tikzfeynman@commands@diagram@star@opt[]}} +\def\tikzfeynman@commands@diagram@star@opt[#1]{% + \tikzfeynman@orig@graph [/tikzfeynman/every diagram@@, /tikzfeynman/every diagram, #1]} + +%% Graph +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\def\tikzfeynman@commands@graph{% + \pgfutil@ifnextchar[{\tikzfeynman@commands@graph@opt} + {\tikzfeynman@commands@graph@opt[]}} +\def\tikzfeynman@commands@graph@opt[#1]{% + \PackageWarning{tikz-feynman}{It is not recommended to use \string\graph. Use \string\diagram\space or \string\diagram* instead.} + \tikzfeynman@orig@graph [/tikzfeynman/every diagram@@, /tikzfeynman/every diagram, #1]} + +%% Optional argument in style key +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\def\tikzfeynman@key@opt#1[#2]#3\pgfeov{% + \tikzfeynmanset{#1={[#2]#3}}} + +%% Insertion +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\def\tikzfeynman@insertion{% + \pgfutil@ifnextchar[{\tikzfeynman@key@opt{insertion@@}} + {\tikzfeynman@key@opt{insertion@@}[]}} +\pgfkeyslet{/tikzfeynman/insertion/.@cmd}{\tikzfeynman@insertion} + +%% Momentum +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\def\tikzfeynman@momentum@std{% + \pgfutil@ifnextchar[{\tikzfeynman@key@opt{momentum@@}} + {\tikzfeynman@key@opt{momentum@@}[]}} +\pgfkeyslet{/tikzfeynman/momentum/.@cmd}{\tikzfeynman@momentum@std} + +\def\tikzfeynman@momentum@stdp{% + \pgfutil@ifnextchar[{\tikzfeynman@key@opt{momentum'@@}} + {\tikzfeynman@key@opt{momentum'@@}[]}} +\pgfkeyslet{/tikzfeynman/momentum'/.@cmd}{\tikzfeynman@momentum@stdp} + +\def\tikzfeynman@momentum@stdr{% + \pgfutil@ifnextchar[{\tikzfeynman@key@opt{reversed momentum@@}} + {\tikzfeynman@key@opt{reversed momentum@@}[]}} +\pgfkeyslet{/tikzfeynman/reversed momentum/.@cmd}{\tikzfeynman@momentum@stdr} +\pgfkeyslet{/tikzfeynman/rmomentum/.@cmd}{\tikzfeynman@momentum@stdr} + +\def\tikzfeynman@momentum@stdrp{% + \pgfutil@ifnextchar[{\tikzfeynman@key@opt{reversed momentum'@@}} + {\tikzfeynman@key@opt{reversed momentum'@@}[]}} +\pgfkeyslet{/tikzfeynman/reversed momentum'/.@cmd}{\tikzfeynman@momentum@stdrp} +\pgfkeyslet{/tikzfeynman/rmomentum'/.@cmd}{\tikzfeynman@momentum@stdrp} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Styles +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\input tikzfeynman.keys.code.tex + +\endinput \ No newline at end of file -- cgit v1.2.3