Debian Codegraph @

texmf-dist/tex/latex/tikz-feynman/tikzfeynman.keys.code.tex

raw
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 %
3 % TikZ-Feynman
4 % Feynman Diagrams with TikZ
5 % Copyright (C) 2015 Joshua Ellis
6 %
7 %
8 % This work may be distributed and/or modified under the conditions of the LaTeX
9 % Project Public License, either version 1.3 of this license or (at your option)
10 % any later version.
11 %
12 % This work has the LPPL maintenance status `maintained'.
13 %
14 % The Current Maintainer of this work is Joshua Ellis.
15 %
16 % This program is distributed in the hope that it will be useful, but WITHOUT
17 % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 % FOR A PARTICULAR PURPOSE. See the LaTeX Project Public License for more
19 % details.
20 %
21 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
22
23 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
24 %% Shapes
25 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
26
27 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
28 %% Crossed Circle
29 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
30 \pgfdeclareshape{crossed circle}
31 {
32 \inheritsavedanchors[from=circle]
33 \inheritanchorborder[from=circle]
34 \inheritanchor[from=circle]{north}
35 \inheritanchor[from=circle]{north west}
36 \inheritanchor[from=circle]{north east}
37 \inheritanchor[from=circle]{center}
38 \inheritanchor[from=circle]{west}
39 \inheritanchor[from=circle]{east}
40 \inheritanchor[from=circle]{mid}
41 \inheritanchor[from=circle]{mid west}
42 \inheritanchor[from=circle]{mid east}
43 \inheritanchor[from=circle]{base}
44 \inheritanchor[from=circle]{base west}
45 \inheritanchor[from=circle]{base east}
46 \inheritanchor[from=circle]{south}
47 \inheritanchor[from=circle]{south west}
48 \inheritanchor[from=circle]{south east}
49
50 \inheritbackgroundpath[from=circle]
51
52 \foregroundpath{
53 % Compute south west
54 \centerpoint
55 \pgf@xc=\radius
56 \advance\pgf@x by-0.707107\pgf@xc
57 \advance\pgf@y by-0.707107\pgf@xc
58 \pgf@xa=\pgf@x \pgf@ya=\pgf@y % Store coordinates
59 % Compute north east point
60 \centerpoint
61 \pgf@xc=\radius
62 \advance\pgf@x by0.707107\pgf@xc
63 \advance\pgf@y by0.707107\pgf@xc
64 \pgf@xb=\pgf@x \pgf@yb=\pgf@y % Store coordinates
65 \pgfpathmoveto{\pgfqpoint{\pgf@xa}{\pgf@ya}}
66 \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yb}}
67 \pgfpathmoveto{\pgfqpoint{\pgf@xa}{\pgf@yb}}
68 \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@ya}}
69 \pgfsetarrowsstart{}
70 \pgfsetarrowsend{}
71 }
72 }
73
74 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
75 %% Decorations
76 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
77
78 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
79 %% Complete Sines
80 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
81 %% Complete sines replaces the path with a whole number of sine waves.
82 %% Thanks to http://tex.stackexchange.com/a/134516/26980
83 \pgfdeclaredecoration{complete sines}{initial}
84 {
85 %% Begin by computing the overall path length and find how many sine waves we
86 %% can fit in. Nothing happens beyond the computation.
87 \state{initial}[
88 width=+0pt,
89 next state=move,
90 persistent precomputation={
91 \def\tikzfeynman@cs@angle@step{30}
92 \def\tikzfeynman@cs@current@angle{0}
93 \pgfmathsetlengthmacro{\tikzfeynman@cs@points@per@step}{
94 \pgfdecoratedinputsegmentlength
95 / int(\pgfdecoratedinputsegmentlength
96 / \pgfdecorationsegmentlength)
97 / 360
98 * \tikzfeynman@cs@angle@step}
99 },
100 ]{}
101 %% Move to the origin to the path
102 \state{move}[
103 width=+\tikzfeynman@cs@points@per@step,
104 next state=draw
105 ]{
106 \pgfpathmoveto{\pgfpointorigin}
107 }
108 %% Draw the sine wave itself. This computes the value every 20 degrees and draws straight edges.
109 \state{draw}[
110 width=+\tikzfeynman@cs@points@per@step,
111 switch if less than=1.25*\tikzfeynman@cs@points@per@step to final, % <- bit of a hack
112 persistent postcomputation={
113 \pgfmathparse{mod(\tikzfeynman@cs@current@angle+\tikzfeynman@cs@angle@step, 360)}
114 \let\tikzfeynman@cs@current@angle=\pgfmathresult%
115 },
116 ]{
117 \pgfmathparse{sin(\tikzfeynman@cs@current@angle) * \pgfmetadecorationsegmentamplitude / 2}
118 \tikz@decoratepathfalse
119 \pgfpathlineto{\pgfqpoint{0pt}{\pgfmathresult pt}}%
120 }
121
122 \state{final}{
123 \ifdim\pgfdecoratedremainingdistance>0pt\relax
124 \pgfpathlineto{\pgfpointdecoratedpathlast}
125 \fi
126 }
127 }
128
129 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
130 %% Keys
131 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
132 \tikzfeynmanset{
133 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
134 %% Hooks
135 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
136 execute at begin feynman/.code={},
137 execute at end feynman/.code={},
138 every feynman/.style={/tikzfeynman/every feynman@@/.append style={#1}},
139 every feynman@@/.style={
140 /tikzfeynman/.cd,
141 /tikzfeynman/medium,
142 },
143 execute at begin feynman@@/.code={} %% Internal version
144 execute at end feynman@@/.code={}, %% Internal version
145 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
146 %% Diagrams
147 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
148 every diagram/.style={/tikzfeynman/every diagram@@/.append style={#1}},
149 every diagram@@/.style={
150 /tikzfeynman/.cd,
151 .search also={/tikz/graphs, /tikz},
152 nodes={
153 /tikzfeynman/.cd,
154 /tikzfeynman/.search also={/tikz/graphs, /tikz},
155 /tikzfeynman/every vertex@@,
156 /tikzfeynman/every vertex},
157 edges={
158 /tikzfeynman/.cd,
159 /tikzfeynman/.search also={/tikz/graphs, /tikz},
160 /tikzfeynman/every edge@@,
161 /tikzfeynman/every edge},
162 /tikzfeynman/medium,
163 },
164 every inline/.style={/tikzfeynman/inline@@/.append style={#1}},
165 every inline@@/.style={
166 /tikzfeynman/small,
167 },
168 inline/.style={
169 /tikz/baseline={#1},
170 /tikzfeynman/every inline@@,
171 },
172 every small/.style={/tikzfeynman/small@@/.append style={#1}},
173 every small@@/.style={
174 /tikz/node distance=1cm,
175 /graph drawing/node distance=1.25cm,
176 /graph drawing/level distance=1cm,
177 /graph drawing/sibling distance=1.5cm,
178 /tikzfeynman/every dot@@/.append style={/tikz/minimum size=1mm},
179 /tikzfeynman/every crossed dot@@/.append style={/tikz/minimum size=2mm},
180 /tikzfeynman/every blob@@/.append style={/tikz/minimum size=0.5cm},
181 /tikzfeynman/arrow size=1.2pt,
182 /tikzfeynman/insertion/size=2.5pt,
183 },
184 small/.style={/tikzfeynman/every small@@},
185 every medium/.style={/tikzfeynman/medium@@/.append style={#1}},
186 every medium@@/.style={
187 /tikz/node distance=1.5cm,
188 /graph drawing/node distance=1.9cm,
189 /graph drawing/level distance=1.5cm,
190 /graph drawing/sibling distance=2.25cm,
191 },
192 medium/.style={/tikzfeynman/every medium@@},
193 every large/.style={/tikzfeynman/large@@/.append style={#1}},
194 every large@@/.style={
195 /tikz/node distance=2cm,
196 /graph drawing/node distance=2.5cm,
197 /graph drawing/level distance=2cm,
198 /graph drawing/sibling distance=3cm,
199 /tikz/graphs/edges={thick},
200 /tikzfeynman/every dot@@/.append style={/tikz/minimum size=2mm},
201 /tikzfeynman/every crossed dot@@/.append style={/tikz/minimum size=4mm},
202 /tikzfeynman/every blob@@/.append style={/tikz/minimum size=1cm},
203 /tikzfeynman/arrow size=1.6pt,
204 /tikzfeynman/insertion/size=4pt,
205 },
206 large/.style={/tikzfeynman/every large@@},
207 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
208 %% Vertices
209 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
210 every vertex@@/.style={
211 /tikz/shape=coordinate,
212 },
213 every vertex/.style={/tikzfeynman/every vertex@@/.append style={#1}},
214 vertex/.style={
215 /tikzfeynman/every vertex@@,
216 },
217 every dot@@/.style={
218 /tikz/shape=circle,
219 /tikz/graphs/as={},
220 /tikz/draw,
221 /tikz/fill,
222 /tikz/inner sep=0pt,
223 /tikz/outer sep=0pt,
224 /tikz/minimum size=1.5mm,
225 },
226 every dot/.style={/tikzfeynman/every dot@@/.append style={#1}},
227 dot/.style={
228 /tikzfeynman/every dot@@,
229 },
230 every square dot@@/.style={
231 /tikz/shape=rectangle,
232 },
233 every square dot/.style={/tikzfeynman/every square dot@@/.append style={#1}},
234 square dot/.style={
235 /tikzfeynman/every dot@@,
236 /tikzfeynman/every square dot@@,
237 },
238 every empty dot@@/.style={
239 /tikz/fill=none,
240 },
241 every empty dot/.style={/tikzfeynman/every empty dot@@/.append style={#1}},
242 empty dot/.style={
243 /tikzfeynman/every dot@@,
244 /tikzfeynman/every empty dot@@,
245 },
246 every crossed dot@@/.style={
247 /tikz/fill=none,
248 /tikz/shape=crossed circle,
249 /tikz/minimum size=3mm,
250 },
251 every crossed dot/.style={/tikzfeynman/every crossed dot@@/.append style={#1}},
252 crossed dot/.style={
253 /tikzfeynman/every dot@@,
254 /tikzfeynman/every crossed dot@@,
255 },
256 every blob@@/.style={
257 /tikz/shape=circle,
258 /tikz/graphs/as={},
259 /tikz/draw,
260 /tikz/fill=none,
261 /tikz/outer sep=0.5\pgflinewidth,
262 /tikz/inner sep=0pt,
263 /tikz/minimum size=0.75cm,
264 /tikz/pattern=north west lines,
265 },
266 every blob/.style={/tikzfeynman/every blob@@/.append style={#1}},
267 blob/.style={
268 /tikzfeynman/every blob@@,
269 },
270 every particle@@/.style={
271 /tikz/shape=rectangle,
272 /tikz/draw=none,
273 /tikz/fill=none,
274 /tikz/inner sep=0.3333em,
275 /tikz/outer sep=0.5\pgflinewidth,
276 },
277 every particle/.style={/tikzfeynman/every particle@@/.append style={#1}},
278 particle/.style args={#1}{
279 /tikzfeynman/every particle@@,
280 /tikz/graphs/as={#1},
281 },
282 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
283 %% Edge styles
284 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
285 %% Arrow Style
286 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
287 arrow size/.store in=\tikzfeynman@arrow@size,
288 arrow size=1.5pt,
289 with arrow/.style={
290 /tikz/decoration={
291 markings,
292 mark=at position #1 with {
293 \node[
294 transform shape,
295 xshift=-0.5mm,
296 fill,
297 inner sep=\tikzfeynman@arrow@size,
298 draw=none,
299 isosceles triangle
300 ] { };
301 },
302 },
303 /tikz/postaction={
304 /tikz/decorate=true,
305 },
306 },
307 with reversed arrow/.style={
308 /tikz/decoration={
309 markings,
310 mark=at position #1 with {
311 \node[
312 transform shape,
313 xshift=-0.5mm,
314 rotate=180,
315 fill,
316 inner sep=\tikzfeynman@arrow@size,
317 draw=none,
318 isosceles triangle
319 ] { };
320 },
321 },
322 /tikz/postaction={
323 /tikz/decorate=true,
324 },
325 },
326 %% Base Edge Styles
327 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
328 every edge@@/.style={},
329 every edge/.style={/tikzfeynman/every edge@@/.append style={#1}},
330 %% Specific Styles
331 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
332 every plain@@/.style={
333 /tikz/draw=none,
334 /tikz/decoration={name=none},
335 /tikz/postaction={
336 /tikz/draw
337 },
338 },
339 every plain/.style={/tikzfeynman/every plain@@/.append style={#1}},
340 plain/.style={
341 /tikzfeynman/every plain@@,
342 },
343 every boson@@/.style={
344 /tikz/draw=none,
345 /tikz/decoration={name=none},
346 /tikz/postaction={
347 /tikz/draw,
348 /tikz/decoration={
349 complete sines,
350 amplitude=1mm,
351 segment length=2mm,
352 },
353 /tikz/decorate=true,
354 },
355 },
356 every boson/.style={/tikzfeynman/every boson@@/.append style={#1}},
357 boson/.style={
358 /tikzfeynman/every boson@@,
359 },
360 every charged boson@@/.style={
361 /tikzfeynman/with arrow=0.5,
362 },
363 every charged boson/.style={/tikzfeynman/every charged boson@@/.append style={#1}},
364 charged boson/.style={
365 /tikzfeynman/boson,
366 /tikzfeynman/every charged boson@@,
367 },
368 every anti charged boson@@/.style={
369 /tikzfeynman/with reversed arrow=0.5,
370 },
371 every anti charged boson/.style={/tikzfeynman/every anti charged boson@@/.append style={#1}},
372 anti charged boson/.style={
373 /tikzfeynman/boson,
374 /tikzfeynman/every anti charged boson@@,
375 },
376 every photon@@/.style={
377 /tikz/draw=none,
378 /tikz/decoration={name=none},
379 /tikz/postaction={
380 /tikz/draw,
381 /tikz/decoration={
382 complete sines,
383 amplitude=1mm,
384 segment length=2mm,
385 },
386 /tikz/decorate=true,
387 },
388 },
389 every photon/.style={/tikzfeynman/every photon@@/.append style={#1}},
390 photon/.style={
391 /tikzfeynman/every photon@@,
392 },
393 every scalar@@/.style={
394 /tikz/draw=none,
395 /tikz/decoration={name=none},
396 /tikz/postaction={
397 /tikz/draw,
398 /tikz/dashed,
399 },
400 },
401 every scalar/.style={/tikzfeynman/every scalar@@/.append style={#1}},
402 scalar/.style={
403 /tikzfeynman/every scalar@@,
404 },
405 every charged scalar@@/.style={
406 /tikz/draw=none,
407 /tikz/decoration={name=none},
408 /tikz/postaction={
409 /tikzfeynman/with arrow=0.5,
410 },
411 },
412 every charged scalar/.style={/tikzfeynman/every charged scalar@@/.append style={#1}},
413 charged scalar/.style={
414 /tikzfeynman/scalar,
415 /tikzfeynman/every charged scalar@@,
416 },
417 every anti charged scalar@@/.style={
418 /tikz/draw=none,
419 /tikz/decoration={name=none},
420 /tikz/postaction={
421 /tikzfeynman/with reversed arrow=0.5,
422 },
423 },
424 every anti charged scalar/.style={/tikzfeynman/every anti charged scalar@@/.append style={#1}},
425 anti charged scalar/.style={
426 /tikzfeynman/scalar,
427 /tikzfeynman/every anti charged scalar@@,
428 },
429 every ghost@@/.style={
430 /tikz/draw=none,
431 /tikz/decoration={name=none},
432 /tikz/postaction={
433 /tikz/draw,
434 /tikz/dotted,
435 /tikz/thick,
436 },
437 },
438 every ghost/.style={/tikzfeynman/every ghost@@/.append style={#1}},
439 ghost/.style={
440 /tikzfeynman/every ghost@@,
441 },
442 every fermion@@/.style={
443 /tikz/draw=none,
444 /tikz/decoration={name=none},
445 /tikz/postaction={
446 /tikz/draw,
447 /tikzfeynman/with arrow=0.5,
448 },
449 },
450 every fermion/.style={/tikzfeynman/every fermion@@/.append style={#1}},
451 fermion/.style={
452 /tikzfeynman/every fermion@@,
453 },
454 every anti fermion@@/.style={
455 /tikz/draw=none,
456 /tikz/decoration={name=none},
457 /tikz/postaction={
458 /tikz/draw,
459 /tikzfeynman/with reversed arrow=0.5,
460 },
461 },
462 every anti fermion/.style={/tikzfeynman/every anti fermion@@/.append style={#1}},
463 anti fermion/.style={
464 /tikzfeynman/every anti fermion@@,
465 },
466 every majorana@@/.style={
467 /tikz/draw=none,
468 /tikz/decoration={name=none},
469 /tikz/postaction={
470 /tikz/draw,
471 /tikzfeynman/with arrow=0.33,
472 /tikzfeynman/with reversed arrow=0.73,
473 },
474 },
475 every majorana/.style={/tikzfeynman/every majorana@@/.append style={#1}},
476 majorana/.style={
477 /tikzfeynman/every majorana@@,
478 },
479 every anti majorana@@/.style={
480 /tikz/draw=none,
481 /tikz/decoration={name=none},
482 /tikz/postaction={
483 /tikz/draw,
484 /tikzfeynman/with reversed arrow=0.33,
485 /tikzfeynman/with arrow=0.73,
486 },
487 },
488 every anti majorana/.style={/tikzfeynman/every anti majorana@@/.append style={#1}},
489 anti majorana/.style={
490 /tikzfeynman/every anti majorana@@,
491 },
492 every gluon@@/.style={
493 /tikz/draw=none,
494 /tikz/decoration={name=none},
495 /tikz/postaction={
496 /tikz/draw,
497 /tikz/decoration={
498 coil,
499 aspect=0.75,
500 mirror,
501 segment length=1.5mm
502 },
503 /tikz/decorate=true,
504 },
505 },
506 every gluon/.style={/tikzfeynman/every gluon@@/.append style={#1}},
507 gluon/.style={
508 /tikzfeynman/every gluon@@,
509 },
510 %% Insertions
511 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
512 insertion/.search also={/tikzfeynman,/tikz},
513 %% Parameters
514 insertion/size/.store in=\tikzfeynman@insertion@size,
515 insertion/size=3pt,
516 insertion/style/.store in=\tikzfeynman@insertion@style,
517 insertion/style={},
518 %% Styles
519 insertion@@/.style args={[#1]#2}{
520 /tikz/decoration={
521 markings,
522 mark=at position #2 with {
523 \tikzfeynmanset{insertion/.cd,#1}
524 \draw [\tikzfeynman@insertion@style] (-\tikzfeynman@insertion@size, -\tikzfeynman@insertion@size) -- (\tikzfeynman@insertion@size, \tikzfeynman@insertion@size);
525 \draw [\tikzfeynman@insertion@style] (-\tikzfeynman@insertion@size, \tikzfeynman@insertion@size) -- (\tikzfeynman@insertion@size, -\tikzfeynman@insertion@size);
526 },
527 },
528 /tikz/postaction={
529 /tikz/decorate=true,
530 },
531 },
532 insertion@@/.default={[]0.5},
533 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
534 %% Momentum arrows
535 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
536 momentum/.search also={/tikzfeynman,/tikz},
537 %% Parameters
538 momentum/label distance/.store in=\tikzfeynman@momentum@label@distance,
539 momentum/label distance=0pt,
540 momentum/arrow distance/.store in=\tikzfeynman@momentum@arrow@distance,
541 momentum/arrow distance=3mm,
542 momentum/arrow shorten/.store in=\tikzfeynman@momentum@arrow@shorten,
543 momentum/arrow shorten=0.15,
544 momentum/label style/.store in=\tikzfeynman@momentum@label@style,
545 momentum/label style={},
546 momentum/arrow style/.store in=\tikzfeynman@momentum@arrow@style,
547 momentum/arrow style={},
548 %% Styles
549 momentum@@/.style args={[#1]#2}{
550 /tikz/preaction={
551 /tikz/decoration={
552 show path construction,
553 moveto code={},
554 lineto code={
555 \tikzfeynmanset{momentum/.cd,#1}
556 \path (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast)
557 coordinate [pos=\tikzfeynman@momentum@arrow@shorten] (tf@m@1)
558 coordinate [pos=1 - \tikzfeynman@momentum@arrow@shorten] (tf@m@2);
559 \draw [-Stealth, \tikzfeynman@momentum@arrow@style]
560 ($(tf@m@1)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@2)$)
561 -- ($(tf@m@2)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@1)$)
562 node [pos=0.5, auto,
563 outer sep=\tikzfeynman@momentum@label@distance,
564 \tikzfeynman@momentum@label@style] {#2};
565 },
566 curveto code={
567 \tikzfeynmanset{momentum/.cd,#1}
568 \path (\tikzinputsegmentfirst)
569 .. controls (\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb)
570 .. (\tikzinputsegmentlast)
571 { \foreach \i in {1, ..., 50} {
572 coordinate [pos=\tikzfeynman@momentum@arrow@shorten + (1-2 * \tikzfeynman@momentum@arrow@shorten)*\i/50] (tf@m@\i) } };
573 \draw [-Stealth, \tikzfeynman@momentum@arrow@style]
574 ($(tf@m@1)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@2)$)
575 foreach \i [count=\j from 3] in {2, ..., 24} {
576 -- ($(tf@m@\i)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@\j)$)
577 }
578 -- ($(tf@m@25)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@26)$)
579 node [pos=0.5, auto,
580 outer sep=\tikzfeynman@momentum@label@distance,
581 \tikzfeynman@momentum@arrow@style] {#2}
582 foreach \i [count=\j from 27] in {26, ..., 49} {
583 -- ($(tf@m@\i)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@\j)$)
584 }
585 -- ($(tf@m@50)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@49)$);
586 },
587 closepath code={
588 \tikzfeynmanset{momentum/.cd,#1}
589 \path (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast)
590 coordinate [pos=\tikzfeynman@momentum@arrow@shorten] (tf@m@1)
591 coordinate [pos=1 - \tikzfeynman@momentum@arrow@shorten] (tf@m@2);
592 \draw [-Stealth, \tikzfeynman@momentum@arrow@style]
593 ($(tf@m@1)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@2)$)
594 -- ($(tf@m@2)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@1)$)
595 node [pos=0.5, auto,
596 outer sep=\tikzfeynman@momentum@label@distance,
597 \tikzfeynman@momentum@label@style] {#2};
598 },
599 },
600 /tikz/decorate=true,
601 },
602 },
603 momentum'@@/.style args={[#1]#2}{
604 /tikz/preaction={
605 /tikz/decoration={
606 show path construction,
607 moveto code={},
608 lineto code={
609 \tikzfeynmanset{momentum/.cd,#1}
610 \path (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast)
611 coordinate [pos=\tikzfeynman@momentum@arrow@shorten] (tf@m@1)
612 coordinate [pos=1 - \tikzfeynman@momentum@arrow@shorten] (tf@m@2);
613 \draw [-Stealth, \tikzfeynman@momentum@arrow@style]
614 ($(tf@m@1)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@2)$)
615 -- ($(tf@m@2)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@1)$)
616 node [pos=0.5, auto, swap,
617 outer sep=\tikzfeynman@momentum@label@distance,
618 \tikzfeynman@momentum@label@style] {#2};
619 },
620 curveto code={
621 \tikzfeynmanset{momentum/.cd,#1}
622 \path (\tikzinputsegmentfirst)
623 .. controls (\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb)
624 .. (\tikzinputsegmentlast)
625 { \foreach \i in {1, ..., 50} {
626 coordinate [pos=\tikzfeynman@momentum@arrow@shorten + (1-2 * \tikzfeynman@momentum@arrow@shorten)*\i/50] (tf@m@\i) } };
627 \draw [-Stealth, \tikzfeynman@momentum@arrow@style]
628 ($(tf@m@1)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@2)$)
629 foreach \i [count=\j from 3] in {2, ..., 24} {
630 -- ($(tf@m@\i)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@\j)$)
631 }
632 -- ($(tf@m@25)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@26)$)
633 node [pos=0.5, auto, swap,
634 outer sep=\tikzfeynman@momentum@label@distance,
635 \tikzfeynman@momentum@arrow@style] {#2}
636 foreach \i [count=\j from 27] in {26, ..., 49} {
637 -- ($(tf@m@\i)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@\j)$)
638 }
639 -- ($(tf@m@50)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@49)$);
640 },
641 closepath code={
642 \tikzfeynmanset{momentum/.cd,#1}
643 \path (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast)
644 coordinate [pos=\tikzfeynman@momentum@arrow@shorten] (tf@m@1)
645 coordinate [pos=1 - \tikzfeynman@momentum@arrow@shorten] (tf@m@2);
646 \draw [-Stealth, \tikzfeynman@momentum@arrow@style]
647 ($(tf@m@1)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@2)$)
648 -- ($(tf@m@2)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@1)$)
649 node [pos=0.5, auto, swap,
650 outer sep=\tikzfeynman@momentum@label@distance,
651 \tikzfeynman@momentum@label@style] {#2};
652 },
653 },
654 /tikz/decorate=true,
655 },
656 },
657 reversed momentum@@/.style args={[#1]#2}{
658 /tikz/preaction={
659 /tikz/decoration={
660 show path construction,
661 moveto code={},
662 lineto code={
663 \tikzfeynmanset{momentum/.cd,#1}
664 \path (\tikzinputsegmentlast) -- (\tikzinputsegmentfirst)
665 coordinate [pos=\tikzfeynman@momentum@arrow@shorten] (tf@m@1)
666 coordinate [pos=1 - \tikzfeynman@momentum@arrow@shorten] (tf@m@2);
667 \draw [-Stealth, \tikzfeynman@momentum@arrow@style]
668 ($(tf@m@1)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@2)$)
669 -- ($(tf@m@2)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@1)$)
670 node [pos=0.5, auto, swap,
671 outer sep=\tikzfeynman@momentum@label@distance,
672 \tikzfeynman@momentum@label@style] {#2};
673 },
674 curveto code={
675 \tikzfeynmanset{momentum/.cd,#1}
676 \path (\tikzinputsegmentlast)
677 .. controls (\tikzinputsegmentsupportb) and (\tikzinputsegmentsupporta)
678 .. (\tikzinputsegmentfirst)
679 { \foreach \i in {1, ..., 50} {
680 coordinate [pos=\tikzfeynman@momentum@arrow@shorten + (1-2 * \tikzfeynman@momentum@arrow@shorten)*\i/50] (tf@m@\i) } };
681 \draw [-Stealth, \tikzfeynman@momentum@arrow@style]
682 ($(tf@m@1)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@2)$)
683 foreach \i [count=\j from 3] in {2, ..., 24} {
684 -- ($(tf@m@\i)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@\j)$)
685 }
686 -- ($(tf@m@25)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@26)$)
687 node [pos=0.5, auto, swap,
688 outer sep=\tikzfeynman@momentum@label@distance,
689 \tikzfeynman@momentum@arrow@style] {#2}
690 foreach \i [count=\j from 27] in {26, ..., 49} {
691 -- ($(tf@m@\i)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@\j)$)
692 }
693 -- ($(tf@m@50)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@49)$);
694 },
695 closepath code={
696 \tikzfeynmanset{momentum/.cd,#1}
697 \path (\tikzinputsegmentlast) -- (\tikzinputsegmentfirst)
698 coordinate [pos=\tikzfeynman@momentum@arrow@shorten] (tf@m@1)
699 coordinate [pos=1 - \tikzfeynman@momentum@arrow@shorten] (tf@m@2);
700 \draw [-Stealth, \tikzfeynman@momentum@arrow@style]
701 ($(tf@m@1)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@2)$)
702 -- ($(tf@m@2)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@1)$)
703 node [pos=0.5, auto, swap,
704 outer sep=\tikzfeynman@momentum@label@distance,
705 \tikzfeynman@momentum@label@style] {#2};
706 },
707 },
708 /tikz/decorate=true,
709 },
710 },
711 reversed momentum'@@/.style args={[#1]#2}{
712 /tikz/preaction={
713 /tikz/decoration={
714 show path construction,
715 moveto code={},
716 lineto code={
717 \tikzfeynmanset{momentum/.cd,#1}
718 \path (\tikzinputsegmentlast) -- (\tikzinputsegmentfirst)
719 coordinate [pos=\tikzfeynman@momentum@arrow@shorten] (tf@m@1)
720 coordinate [pos=1 - \tikzfeynman@momentum@arrow@shorten] (tf@m@2);
721 \draw [-Stealth, \tikzfeynman@momentum@arrow@style]
722 ($(tf@m@1)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@2)$)
723 -- ($(tf@m@2)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@1)$)
724 node [pos=0.5,
725 auto,
726 outer sep=\tikzfeynman@momentum@label@distance,
727 \tikzfeynman@momentum@label@style] {#2};
728 },
729 curveto code={
730 \tikzfeynmanset{momentum/.cd,#1}
731 \path (\tikzinputsegmentlast)
732 .. controls (\tikzinputsegmentsupportb) and (\tikzinputsegmentsupporta)
733 .. (\tikzinputsegmentfirst)
734 { \foreach \i in {1, ..., 50} {
735 coordinate [pos=\tikzfeynman@momentum@arrow@shorten + (1-2 * \tikzfeynman@momentum@arrow@shorten)*\i/50] (tf@m@\i) } };
736 \draw [-Stealth, \tikzfeynman@momentum@arrow@style]
737 ($(tf@m@1)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@2)$)
738 foreach \i [count=\j from 3] in {2, ..., 24} {
739 -- ($(tf@m@\i)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@\j)$)
740 }
741 -- ($(tf@m@25)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@26)$)
742 node [pos=0.5,
743 auto,
744 outer sep=\tikzfeynman@momentum@label@distance,
745 \tikzfeynman@momentum@arrow@style] {#2}
746 foreach \i [count=\j from 27] in {26, ..., 49} {
747 -- ($(tf@m@\i)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@\j)$)
748 }
749 -- ($(tf@m@50)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@49)$);
750 },
751 closepath code={
752 \tikzfeynmanset{momentum/.cd,#1}
753 \path (\tikzinputsegmentlast) -- (\tikzinputsegmentfirst)
754 coordinate [pos=\tikzfeynman@momentum@arrow@shorten] (tf@m@1)
755 coordinate [pos=1 - \tikzfeynman@momentum@arrow@shorten] (tf@m@2);
756 \draw [-Stealth, \tikzfeynman@momentum@arrow@style]
757 ($(tf@m@1)!\tikzfeynman@momentum@arrow@distance!90:(tf@m@2)$)
758 -- ($(tf@m@2)!\tikzfeynman@momentum@arrow@distance!-90:(tf@m@1)$)
759 node [pos=0.5, auto,
760 outer sep=\tikzfeynman@momentum@label@distance,
761 \tikzfeynman@momentum@label@style] {#2};
762 },
763 },
764 /tikz/decorate=true,
765 },
766 },
767 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
768 %% Modifiers
769 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
770 half left/.style={
771 /tikz/bend left=90,
772 /tikz/looseness=1.5,
773 },
774 half right/.style={
775 /tikz/bend right=90,
776 /tikz/looseness=1.5,
777 },
778 quarter left/.style={
779 /tikz/bend left=45,
780 },
781 quarter right/.style={
782 /tikz/bend right=45,
783 },
784 }
785
786 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
787 %% Graceful Failure of LuaTeX keys
788 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
789 \def\tikzfeynman@luatex@required@path{
790 \PackageWarning{tikz-feynman}{The key you tried to use '\pgfkeyscurrentpath/\pgfkeyscurrentname' requires LuaTeX. It will be ignored.}
791 }
792 \def\tikzfeynman@luatex@required@key{
793 \PackageWarning{tikz-feynman}{The key you tried to use '\pgfkeyscurrentpath' requires LuaTeX. It will be ignored.}
794 }
795
796 \ifluatex\else
797 \pgfkeys{
798 /graph drawing/.unknown/.code=\tikzfeynman@luatex@required@path,
799 /tikz/graphs/.unknown/.code=\tikzfeynman@luatex@required@path,
800 /tikz/horizontal/.code=\tikzfeynman@luatex@required@key,
801 /tikz/horizontal'/.code=\tikzfeynman@luatex@required@key,
802 /tikz/vertical/.code=\tikzfeynman@luatex@required@key,
803 /tikz/vertical'/.code=\tikzfeynman@luatex@required@key,
804 /tikz/tree layout/.code=\tikzfeynman@luatex@required@key,
805 /tikz/spring layout/.code=\tikzfeynman@luatex@required@key,
806 /tikz/layered layout/.code=\tikzfeynman@luatex@required@key,
807 /tikz/spring electrical layout/.code=\tikzfeynman@luatex@required@key,
808 /tikz/electric charge/.code=\tikzfeynman@luatex@required@key,
809 }
810 % \tikzfeynmanset{
811 % horizontal/.code={The key 'horizontal' requires LuaTeX. It will be ignored.},
812 % }
813 \fi
814
815 \endinput