Drawing a scattering Feynman diagram with TikZ The Next CEO of Stack OverflowPackage for typesetting Feynman diagrams (efficiency of `feynmp` and `tikz`)Feynman Diagrams with tikzWrapping a Feynman diagram in an ellipse or a circle?How to get vertical lines on my Feynman graph?Rotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?Tikz-Tree: Arrow-style depending on parent nodeNumerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionDrawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingDrawing specific Feynman diagram with TikZLine up nested tikz enviroments or how to get rid of themTikz Feynman Delbruck ScatteringFeynman diagram with spectator quarks (TikZ-Feynman)

Do I need to write [sic] when a number is less than 10 but isn't written out?

Axiom Schema vs Axiom

Prepend last line of stdin to entire stdin

Is French Guiana a (hard) EU border?

Does soap repel water?

Are police here, aren't itthey?

How to get from Geneva Airport to Metabief, Doubs, France by public transport?

How did people program for Consoles with multiple CPUs?

Is there a difference between "Fahrstuhl" and "Aufzug"

Why does standard notation not preserve intervals (visually)

Is a distribution that is normal, but highly skewed considered Gaussian?

Does increasing your ability score affect your main stat?

Why is information "lost" when it got into a black hole?

Why isn't acceleration always zero whenever velocity is zero, such as the moment a ball bounces off a wall?

Should I tutor a student who I know has cheated on their homework?

How do I align (1) and (2)?

When you upcast Blindness/Deafness, do all targets suffer the same effect?

Which one is the true statement?

Find non-case sensitive string in a mixed list of elements?

How to count occurrences of text in a file?

Can MTA send mail via a relay without being told so?

What connection does MS Office have to Netscape Navigator?

How to edit “Name” property in GCI output?

Can we say or write : "No, it'sn't"?



Drawing a scattering Feynman diagram with TikZ



The Next CEO of Stack OverflowPackage for typesetting Feynman diagrams (efficiency of `feynmp` and `tikz`)Feynman Diagrams with tikzWrapping a Feynman diagram in an ellipse or a circle?How to get vertical lines on my Feynman graph?Rotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?Tikz-Tree: Arrow-style depending on parent nodeNumerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionDrawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingDrawing specific Feynman diagram with TikZLine up nested tikz enviroments or how to get rid of themTikz Feynman Delbruck ScatteringFeynman diagram with spectator quarks (TikZ-Feynman)










17















I am trying to produce a scattering diagram with TikZ but I have become stuck.



The Desired Structure



enter image description here



I am trying to achieve this layout of lines, including their arrow directions. In my diagram.



Minimum Working Example



documentclass[11pt]article
usepackage[latin1]inputenc
usepackagetikz
usetikzlibrarytrees
usetikzlibrarydecorations.pathmorphing
usetikzlibrarydecorations.markings

begindocument

tikzset
photon/.style=decorate, decoration=snake, draw=red,
particle/.style=draw=blue, postaction=decorate,
decoration=markings,mark=at position .5 with arrow[draw=blue]>,
antiparticle/.style=draw=blue, postaction=decorate,
decoration=markings,mark=at position .5 with arrow[draw=blue]<,
gluon/.style=decorate, draw=black,
decoration=coil,amplitude=4pt, segment length=5pt


begintikzpicture[
thick,
% Set the overall layout of the tree
level/.style=level distance=1.5cm,
level 2/.style=sibling distance=3.5cm,
]
coordinate
child[grow=down]
edge from parent [antiparticle]
child
node$E$
edge from parent [particle]

child
node$D$
edge from parent [gluon]

node [above=3pt] $C$

% I have to insert a dummy child to get the tree to grow
% correctly to the right.
child[grow=right, level distance=0pt]
child
node$A$
edge from parent [gluon]

child
node$B$
edge from parent [particle]

;
endtikzpicture

enddocument


Output



enter image description here



So far, I have the basic structure, except one of my lines is 'wandering'. The one that's labelled $A$ should be 'reflected' from where it is by 180 degrees.



Edit



Using @GonzaloMedina's approach, and with his helpful suggestion to the TikZ lirary, I found I can get the following diagram, which is very close to what I wanted:



begindocument
tikzset
particle/.style=thick,draw=blue, postaction=decorate,
decoration=markings,mark=at position .5 with arrow[blue]triangle 45,
gluon/.style=decorate, draw=black,
decoration=coil,aspect=0

tikzset
particle/.style=thin,draw=blue, postaction=decorate,
decoration=markings,mark=at position .5 with arrow[blue]stealth,
gluon/.style=decorate, draw=black, decoration=snake=coil


begintikzpicture[node distance=1cm and 1.5cm]
coordinate[label=left:$G$] (e1);
coordinate[below right=of e1] (aux1);
coordinate[above right=of aux1,label=right:$N$] (e2);
coordinate[below=1.25cm of aux1] (aux2);
coordinate[below left=of aux2,label=left:$N$] (e3);
coordinate[below right=of aux2,label=right:$G$] (e4);

draw[gluon] (e1) -- (aux1);
draw[particle] (aux1) -- (e2);
draw[particle] (e3) -- (aux2);
draw[gluon] (aux2) -- (e4);
draw[particle] (aux2) -- node[label=right:$N$] (aux1);
endtikzpicture
enddocument


enter image description here



I looked in the TikZ manual (on page 95) and found how to make a coil (like a spring), but it didn't seem to work.










share|improve this question



















  • 1





    Why do you use grow=right instead of grow=up (and switching the children)? That being said, I think the tikz-cd package might be something you would be interested in, although your picture seems to be about chemistry. How complex do these kind of diagrams get? Maybe a plain-TikZ approach would be easier.

    – Qrrbrbirlbel
    Mar 30 '13 at 15:08







  • 1





    @Qrrbrbirlbel It's not chemistry but particle physics. ;-) nevertheless would I also suggest a plain-TikZ approach instead of somehow modified TikZ-trees.

    – Benedikt Bauer
    Mar 30 '13 at 15:59











  • @BenediktBauer I should have read the title and not only the body of the question where Feynman hasn’t come up once. :)

    – Qrrbrbirlbel
    Mar 30 '13 at 16:15






  • 2





    Would be useful: Feynman Diagrams with tikz and Package for typesetting Feynman diagrams (efficiency of feynmp and tikz).

    – m0nhawk
    Mar 30 '13 at 16:52












  • @Qrrbrbirlbel I was using a template from texample.net

    – User 17670
    Mar 30 '13 at 20:32















17















I am trying to produce a scattering diagram with TikZ but I have become stuck.



The Desired Structure



enter image description here



I am trying to achieve this layout of lines, including their arrow directions. In my diagram.



Minimum Working Example



documentclass[11pt]article
usepackage[latin1]inputenc
usepackagetikz
usetikzlibrarytrees
usetikzlibrarydecorations.pathmorphing
usetikzlibrarydecorations.markings

begindocument

tikzset
photon/.style=decorate, decoration=snake, draw=red,
particle/.style=draw=blue, postaction=decorate,
decoration=markings,mark=at position .5 with arrow[draw=blue]>,
antiparticle/.style=draw=blue, postaction=decorate,
decoration=markings,mark=at position .5 with arrow[draw=blue]<,
gluon/.style=decorate, draw=black,
decoration=coil,amplitude=4pt, segment length=5pt


begintikzpicture[
thick,
% Set the overall layout of the tree
level/.style=level distance=1.5cm,
level 2/.style=sibling distance=3.5cm,
]
coordinate
child[grow=down]
edge from parent [antiparticle]
child
node$E$
edge from parent [particle]

child
node$D$
edge from parent [gluon]

node [above=3pt] $C$

% I have to insert a dummy child to get the tree to grow
% correctly to the right.
child[grow=right, level distance=0pt]
child
node$A$
edge from parent [gluon]

child
node$B$
edge from parent [particle]

;
endtikzpicture

enddocument


Output



enter image description here



So far, I have the basic structure, except one of my lines is 'wandering'. The one that's labelled $A$ should be 'reflected' from where it is by 180 degrees.



Edit



Using @GonzaloMedina's approach, and with his helpful suggestion to the TikZ lirary, I found I can get the following diagram, which is very close to what I wanted:



begindocument
tikzset
particle/.style=thick,draw=blue, postaction=decorate,
decoration=markings,mark=at position .5 with arrow[blue]triangle 45,
gluon/.style=decorate, draw=black,
decoration=coil,aspect=0

tikzset
particle/.style=thin,draw=blue, postaction=decorate,
decoration=markings,mark=at position .5 with arrow[blue]stealth,
gluon/.style=decorate, draw=black, decoration=snake=coil


begintikzpicture[node distance=1cm and 1.5cm]
coordinate[label=left:$G$] (e1);
coordinate[below right=of e1] (aux1);
coordinate[above right=of aux1,label=right:$N$] (e2);
coordinate[below=1.25cm of aux1] (aux2);
coordinate[below left=of aux2,label=left:$N$] (e3);
coordinate[below right=of aux2,label=right:$G$] (e4);

draw[gluon] (e1) -- (aux1);
draw[particle] (aux1) -- (e2);
draw[particle] (e3) -- (aux2);
draw[gluon] (aux2) -- (e4);
draw[particle] (aux2) -- node[label=right:$N$] (aux1);
endtikzpicture
enddocument


enter image description here



I looked in the TikZ manual (on page 95) and found how to make a coil (like a spring), but it didn't seem to work.










share|improve this question



















  • 1





    Why do you use grow=right instead of grow=up (and switching the children)? That being said, I think the tikz-cd package might be something you would be interested in, although your picture seems to be about chemistry. How complex do these kind of diagrams get? Maybe a plain-TikZ approach would be easier.

    – Qrrbrbirlbel
    Mar 30 '13 at 15:08







  • 1





    @Qrrbrbirlbel It's not chemistry but particle physics. ;-) nevertheless would I also suggest a plain-TikZ approach instead of somehow modified TikZ-trees.

    – Benedikt Bauer
    Mar 30 '13 at 15:59











  • @BenediktBauer I should have read the title and not only the body of the question where Feynman hasn’t come up once. :)

    – Qrrbrbirlbel
    Mar 30 '13 at 16:15






  • 2





    Would be useful: Feynman Diagrams with tikz and Package for typesetting Feynman diagrams (efficiency of feynmp and tikz).

    – m0nhawk
    Mar 30 '13 at 16:52












  • @Qrrbrbirlbel I was using a template from texample.net

    – User 17670
    Mar 30 '13 at 20:32













17












17








17


4






I am trying to produce a scattering diagram with TikZ but I have become stuck.



The Desired Structure



enter image description here



I am trying to achieve this layout of lines, including their arrow directions. In my diagram.



Minimum Working Example



documentclass[11pt]article
usepackage[latin1]inputenc
usepackagetikz
usetikzlibrarytrees
usetikzlibrarydecorations.pathmorphing
usetikzlibrarydecorations.markings

begindocument

tikzset
photon/.style=decorate, decoration=snake, draw=red,
particle/.style=draw=blue, postaction=decorate,
decoration=markings,mark=at position .5 with arrow[draw=blue]>,
antiparticle/.style=draw=blue, postaction=decorate,
decoration=markings,mark=at position .5 with arrow[draw=blue]<,
gluon/.style=decorate, draw=black,
decoration=coil,amplitude=4pt, segment length=5pt


begintikzpicture[
thick,
% Set the overall layout of the tree
level/.style=level distance=1.5cm,
level 2/.style=sibling distance=3.5cm,
]
coordinate
child[grow=down]
edge from parent [antiparticle]
child
node$E$
edge from parent [particle]

child
node$D$
edge from parent [gluon]

node [above=3pt] $C$

% I have to insert a dummy child to get the tree to grow
% correctly to the right.
child[grow=right, level distance=0pt]
child
node$A$
edge from parent [gluon]

child
node$B$
edge from parent [particle]

;
endtikzpicture

enddocument


Output



enter image description here



So far, I have the basic structure, except one of my lines is 'wandering'. The one that's labelled $A$ should be 'reflected' from where it is by 180 degrees.



Edit



Using @GonzaloMedina's approach, and with his helpful suggestion to the TikZ lirary, I found I can get the following diagram, which is very close to what I wanted:



begindocument
tikzset
particle/.style=thick,draw=blue, postaction=decorate,
decoration=markings,mark=at position .5 with arrow[blue]triangle 45,
gluon/.style=decorate, draw=black,
decoration=coil,aspect=0

tikzset
particle/.style=thin,draw=blue, postaction=decorate,
decoration=markings,mark=at position .5 with arrow[blue]stealth,
gluon/.style=decorate, draw=black, decoration=snake=coil


begintikzpicture[node distance=1cm and 1.5cm]
coordinate[label=left:$G$] (e1);
coordinate[below right=of e1] (aux1);
coordinate[above right=of aux1,label=right:$N$] (e2);
coordinate[below=1.25cm of aux1] (aux2);
coordinate[below left=of aux2,label=left:$N$] (e3);
coordinate[below right=of aux2,label=right:$G$] (e4);

draw[gluon] (e1) -- (aux1);
draw[particle] (aux1) -- (e2);
draw[particle] (e3) -- (aux2);
draw[gluon] (aux2) -- (e4);
draw[particle] (aux2) -- node[label=right:$N$] (aux1);
endtikzpicture
enddocument


enter image description here



I looked in the TikZ manual (on page 95) and found how to make a coil (like a spring), but it didn't seem to work.










share|improve this question
















I am trying to produce a scattering diagram with TikZ but I have become stuck.



The Desired Structure



enter image description here



I am trying to achieve this layout of lines, including their arrow directions. In my diagram.



Minimum Working Example



documentclass[11pt]article
usepackage[latin1]inputenc
usepackagetikz
usetikzlibrarytrees
usetikzlibrarydecorations.pathmorphing
usetikzlibrarydecorations.markings

begindocument

tikzset
photon/.style=decorate, decoration=snake, draw=red,
particle/.style=draw=blue, postaction=decorate,
decoration=markings,mark=at position .5 with arrow[draw=blue]>,
antiparticle/.style=draw=blue, postaction=decorate,
decoration=markings,mark=at position .5 with arrow[draw=blue]<,
gluon/.style=decorate, draw=black,
decoration=coil,amplitude=4pt, segment length=5pt


begintikzpicture[
thick,
% Set the overall layout of the tree
level/.style=level distance=1.5cm,
level 2/.style=sibling distance=3.5cm,
]
coordinate
child[grow=down]
edge from parent [antiparticle]
child
node$E$
edge from parent [particle]

child
node$D$
edge from parent [gluon]

node [above=3pt] $C$

% I have to insert a dummy child to get the tree to grow
% correctly to the right.
child[grow=right, level distance=0pt]
child
node$A$
edge from parent [gluon]

child
node$B$
edge from parent [particle]

;
endtikzpicture

enddocument


Output



enter image description here



So far, I have the basic structure, except one of my lines is 'wandering'. The one that's labelled $A$ should be 'reflected' from where it is by 180 degrees.



Edit



Using @GonzaloMedina's approach, and with his helpful suggestion to the TikZ lirary, I found I can get the following diagram, which is very close to what I wanted:



begindocument
tikzset
particle/.style=thick,draw=blue, postaction=decorate,
decoration=markings,mark=at position .5 with arrow[blue]triangle 45,
gluon/.style=decorate, draw=black,
decoration=coil,aspect=0

tikzset
particle/.style=thin,draw=blue, postaction=decorate,
decoration=markings,mark=at position .5 with arrow[blue]stealth,
gluon/.style=decorate, draw=black, decoration=snake=coil


begintikzpicture[node distance=1cm and 1.5cm]
coordinate[label=left:$G$] (e1);
coordinate[below right=of e1] (aux1);
coordinate[above right=of aux1,label=right:$N$] (e2);
coordinate[below=1.25cm of aux1] (aux2);
coordinate[below left=of aux2,label=left:$N$] (e3);
coordinate[below right=of aux2,label=right:$G$] (e4);

draw[gluon] (e1) -- (aux1);
draw[particle] (aux1) -- (e2);
draw[particle] (e3) -- (aux2);
draw[gluon] (aux2) -- (e4);
draw[particle] (aux2) -- node[label=right:$N$] (aux1);
endtikzpicture
enddocument


enter image description here



I looked in the TikZ manual (on page 95) and found how to make a coil (like a spring), but it didn't seem to work.







tikz-pgf feynman






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 3 '16 at 20:39









giordano

7,59621943




7,59621943










asked Mar 30 '13 at 15:01









User 17670User 17670

1,87262246




1,87262246







  • 1





    Why do you use grow=right instead of grow=up (and switching the children)? That being said, I think the tikz-cd package might be something you would be interested in, although your picture seems to be about chemistry. How complex do these kind of diagrams get? Maybe a plain-TikZ approach would be easier.

    – Qrrbrbirlbel
    Mar 30 '13 at 15:08







  • 1





    @Qrrbrbirlbel It's not chemistry but particle physics. ;-) nevertheless would I also suggest a plain-TikZ approach instead of somehow modified TikZ-trees.

    – Benedikt Bauer
    Mar 30 '13 at 15:59











  • @BenediktBauer I should have read the title and not only the body of the question where Feynman hasn’t come up once. :)

    – Qrrbrbirlbel
    Mar 30 '13 at 16:15






  • 2





    Would be useful: Feynman Diagrams with tikz and Package for typesetting Feynman diagrams (efficiency of feynmp and tikz).

    – m0nhawk
    Mar 30 '13 at 16:52












  • @Qrrbrbirlbel I was using a template from texample.net

    – User 17670
    Mar 30 '13 at 20:32












  • 1





    Why do you use grow=right instead of grow=up (and switching the children)? That being said, I think the tikz-cd package might be something you would be interested in, although your picture seems to be about chemistry. How complex do these kind of diagrams get? Maybe a plain-TikZ approach would be easier.

    – Qrrbrbirlbel
    Mar 30 '13 at 15:08







  • 1





    @Qrrbrbirlbel It's not chemistry but particle physics. ;-) nevertheless would I also suggest a plain-TikZ approach instead of somehow modified TikZ-trees.

    – Benedikt Bauer
    Mar 30 '13 at 15:59











  • @BenediktBauer I should have read the title and not only the body of the question where Feynman hasn’t come up once. :)

    – Qrrbrbirlbel
    Mar 30 '13 at 16:15






  • 2





    Would be useful: Feynman Diagrams with tikz and Package for typesetting Feynman diagrams (efficiency of feynmp and tikz).

    – m0nhawk
    Mar 30 '13 at 16:52












  • @Qrrbrbirlbel I was using a template from texample.net

    – User 17670
    Mar 30 '13 at 20:32







1




1





Why do you use grow=right instead of grow=up (and switching the children)? That being said, I think the tikz-cd package might be something you would be interested in, although your picture seems to be about chemistry. How complex do these kind of diagrams get? Maybe a plain-TikZ approach would be easier.

– Qrrbrbirlbel
Mar 30 '13 at 15:08






Why do you use grow=right instead of grow=up (and switching the children)? That being said, I think the tikz-cd package might be something you would be interested in, although your picture seems to be about chemistry. How complex do these kind of diagrams get? Maybe a plain-TikZ approach would be easier.

– Qrrbrbirlbel
Mar 30 '13 at 15:08





1




1





@Qrrbrbirlbel It's not chemistry but particle physics. ;-) nevertheless would I also suggest a plain-TikZ approach instead of somehow modified TikZ-trees.

– Benedikt Bauer
Mar 30 '13 at 15:59





@Qrrbrbirlbel It's not chemistry but particle physics. ;-) nevertheless would I also suggest a plain-TikZ approach instead of somehow modified TikZ-trees.

– Benedikt Bauer
Mar 30 '13 at 15:59













@BenediktBauer I should have read the title and not only the body of the question where Feynman hasn’t come up once. :)

– Qrrbrbirlbel
Mar 30 '13 at 16:15





@BenediktBauer I should have read the title and not only the body of the question where Feynman hasn’t come up once. :)

– Qrrbrbirlbel
Mar 30 '13 at 16:15




2




2





Would be useful: Feynman Diagrams with tikz and Package for typesetting Feynman diagrams (efficiency of feynmp and tikz).

– m0nhawk
Mar 30 '13 at 16:52






Would be useful: Feynman Diagrams with tikz and Package for typesetting Feynman diagrams (efficiency of feynmp and tikz).

– m0nhawk
Mar 30 '13 at 16:52














@Qrrbrbirlbel I was using a template from texample.net

– User 17670
Mar 30 '13 at 20:32





@Qrrbrbirlbel I was using a template from texample.net

– User 17670
Mar 30 '13 at 20:32










4 Answers
4






active

oldest

votes


















11





+50









One possibility: instead of a tree, I just used some coordinates and decorated paths; I used the triangle 45 arrow tip from the arrows library, changed the gluon style to use decoration=coil,aspect=0, and suppressed parts of the original code not relevant here:



documentclass[11pt]article
usepackagetikz
usetikzlibrarypositioning,arrows
usetikzlibrarydecorations.pathmorphing
usetikzlibrarydecorations.markings

begindocument

tikzset
particle/.style=thick,draw=blue, postaction=decorate,
decoration=markings,mark=at position .5 with arrow[blue]triangle 45,
gluon/.style=decorate, draw=black,
decoration=coil,aspect=0


begintikzpicture[node distance=1cm and 1.5cm]
coordinate[label=left:$e^-$] (e1);
coordinate[below right=of e1] (aux1);
coordinate[above right=of aux1,label=right:$e^-$] (e2);
coordinate[below=1.25cm of aux1] (aux2);
coordinate[below left=of aux2,label=left:$e^-$] (e3);
coordinate[below right=of aux2,label=right:$e^-$] (e4);

draw[particle] (e1) -- (aux1);
draw[particle] (aux1) -- (e2);
draw[particle] (e3) -- (aux2);
draw[particle] (aux2) -- (e4);
draw[gluon] (aux1) -- node[label=right:$gamma$] (aux2);
endtikzpicture
enddocument


enter image description here



After an edit to the question, here's some new code with the required coil decoration:



documentclass[11pt]article
usepackagetikz
usetikzlibrarypositioning,arrows
usetikzlibrarydecorations.pathmorphing
usetikzlibrarydecorations.markings


begindocument
tikzset
particle/.style=thick,draw=blue, postaction=decorate,
decoration=markings,mark=at position .5 with arrow[blue]triangle 45,
gluon/.style=decorate, draw=black,
decoration=coil,aspect=0.3,segment length=3pt,amplitude=3pt


begintikzpicture[node distance=1cm and 1.5cm]
coordinate[label=left:$G$] (e1);
coordinate[below right=of e1] (aux1);
coordinate[above right=of aux1,label=right:$N$] (e2);
coordinate[below=1.25cm of aux1] (aux2);
coordinate[below left=of aux2,label=left:$N$] (e3);
coordinate[below right=of aux2,label=right:$G$] (e4);

draw[gluon] (e1) -- (aux1);
draw[particle] (aux1) -- (e2);
draw[particle] (e3) -- (aux2);
draw[gluon] (aux2) -- (e4);
draw[particle] (aux2) -- node[label=right:$N$] (aux1);
endtikzpicture
enddocument


enter image description here






share|improve this answer

























  • TeX beast! Thanks a lot! Do you know how I can get coils - as in the ones on p.95 of the TikZ documentation (see question edit)?

    – User 17670
    Mar 30 '13 at 20:47











  • @User17670 You're welcome. However, page 95 of the current pgfmanual doesn't show any coils. Please add to your question (a link to) an image showing the desired type of coil.

    – Gonzalo Medina
    Mar 30 '13 at 20:56











  • I posted a link to a manual (maybe it's not the most up to date, sorry) at the bottom of my question edit. In terms of what the snake=coil is supposed to look like - it's the one that features in the second image of my question (they look like springs).

    – User 17670
    Mar 30 '13 at 21:03






  • 1





    @User17670 Ah, now I see. Yes; that manual is outdated. Now I know what you want. Please see my updated answer (in 40 seconds).

    – Gonzalo Medina
    Mar 30 '13 at 21:08






  • 1





    @User17670 answer updated; here you can find the updated manual mirrors.ctan.org/graphics/pgf/base/doc/generic/pgf/… . On page 323 you can find the attributes for the coil decoration.

    – Gonzalo Medina
    Mar 30 '13 at 21:11


















11














You can also use the feynMP package to create Feynman diagrams. It uses metapost instead of tikz, but provides a nice interface for creating different types of Feynman diagrams. For example:



documentclassarticle
usepackagefeynmp
DeclareGraphicsRule*mps*

begindocument
unitlength = 1mm
beginfmffilegluon
beginfmfgraph*(40,30)
fmflefti1,i2
fmflabel$e^-$i1
fmflabel$e^-$i2
fmfrighto1,o2
fmflabel$e^-$o1
fmflabel$e^-$o2
fmffermion, fore=bluei1,v1,o1
fmffermion, fore=bluei2,v2,o2
fmfphoton,label=$gamma$v1,v2
fmfdotv1,v2
endfmfgraph*
endfmffile
write18mpost gluon
enddocument


Run this twice with pdflatex --shell-escape filename, and you will get



enter image description here






share|improve this answer























  • +1 That's a nice output! For me, though, I just got a white space, with no errors.

    – User 17670
    Mar 30 '13 at 20:34











  • You need to enable shell escape. Otherwise run pdflatex, run metapost gluon, and then run pdflatex again.

    – Aditya
    Mar 30 '13 at 20:36


















5














These diagrams are very easy to produce with the new tikz-feynman package (see also the project page), based on this answer. The only requirement for using automatic positioning of the vertices is to compile the document with lualatex:



documentclass[tikz]standalone
usepackage[compat=1.1.0]tikz-feynman
begindocument
feynmandiagram [vertical=b to a]
i1 [particle=(textupe^-)] -- [fermion] a -- [fermion] i2 [particle=(textupe^-)],
a -- [photon,edge label'=(gamma)] b,
f1 [particle=(textupe^-)] -- [fermion] b -- [fermion] f2 [particle=(textupe^-)],
;

tikzfeynmanset
every fermion=draw=blue,

feynmandiagram [vertical=b to a]
i1 [particle=(N)] -- [fermion] a,
i2 [particle=(G)] -- [photon] a,
a -- [fermion,edge label'=(N)] b,
b -- [photon] f1 [particle=(G)],
b -- [fermion] f2 [particle=(N)],
;
enddocument



enter image description here



enter image description here







share|improve this answer

























  • I'm the author of TikZ-Feynman! It's amazing to see it being used. Thanks @giordano!

    – JP-Ellis
    Feb 4 '16 at 11:34



















3














Here is my take on this. I think it produces beautiful output and doesn't require running any special programs like feynmp. Drawback: you have to put in the nodes manually, but that's very managable imho. Bonus: it retains full flexibility for using any kind of tikz decorations and so on while at the same time making it easy to use due to the tree approach.



documentclassstandalone

usepackage[utf8]inputenc
usepackagetikz
usetikzlibrarytrees
usetikzlibrarydecorations.pathmorphing
usetikzlibrarydecorations.markings

begindocument

% Define styles for the different kind of edges in a Feynman diagram
tikzset
gageboson/.style=decorate,decoration=snake,draw=tud9a,
electronin/.style=draw=tud1a,postaction=decorate,decoration=markings,mark=at position .55 with arrow[draw=tud1a]<,
electronout/.style=draw=tud1a,postaction=decorate,decoration=markings,mark=at position .55 with arrow[draw=tud1a]>,
gluon/.style=decorate,draw=magenta,decoration=coil,amplitude=4pt,segment length=5pt


begintikzpicture[thick,
% Set the overall layout of the tree
level/.style=level distance=1.2cm,
level 2/.style=sibling distance=2.6cm,
level 3/.style=sibling distance=2cm
]
coordinate
child[grow=up]
child
node $k^'_1$
edge from parent [electronout]

child
node $k_1$
edge from parent [electronin]

edge from parent [gageboson] node [right=3pt] $q$

child[grow=down,level distance=0pt]
child
node $k_2$
edge from parent [electronin]

child
node $k^'_2$
edge from parent [electronout]

;
fill[black] (0,0) circle (.05cm);
fill[black] (0,1.2cm) circle (.05cm);
endtikzpicture

enddocument


Yields:
resulting graphic



However, when you look closely, the wriggly line of the phonon is not perfect. Anybody know how to get rid of that linear part?



In the particular case asked above, the code would be:



documentclassstandalone

usepackage[utf8]inputenc
usepackagetikz
usetikzlibrarytrees
usetikzlibrarydecorations.pathmorphing
usetikzlibrarydecorations.markings

begindocument

% Define styles for the different kind of edges in a Feynman diagram
tikzset
gageboson/.style=decorate,decoration=snake,draw=black,
electronin/.style=draw=tud1a,postaction=decorate,decoration=markings,mark=at position .55 with arrow[draw=red]<,
electronout/.style=draw=tud1a,postaction=decorate,decoration=markings,mark=at position .55 with arrow[draw=red]>,
gluon/.style=decorate,draw=magenta,decoration=coil,amplitude=4pt,segment length=5pt


begintikzpicture[
thick,
% Set the overall layout of the tree
level/.style=level distance=1.5cm,
level 2/.style=sibling distance=2.6cm,
level 3/.style=sibling distance=2cm
]
coordinate
child[grow=up]
child
node $N$
edge from parent [electronout]

child
node $G$
edge from parent [gageboson]

edge from parent [electronout] node [right=3pt] $N$

child[grow=down,level distance=0pt]
child
node $N$
edge from parent [electronin]

child
node $G$
edge from parent [gageboson]

;
fill[black] (0,0) circle (.05cm);
fill[black] (0,1.5cm) circle (.05cm);
endtikzpicture

enddocument


and results in this
answer






share|improve this answer




















  • 1





    (Once the vote cap passes) Nice answer. I can clearly see the pictures :P By the way, the special program you mention is the mighty MetaPost. So that's not quite an external special program but a monster that is created together with TeX :) Though I'm a die-hard TikZ user, I don't think anybody can discard MetaPost via TikZ.

    – percusse
    Apr 12 '13 at 22:14











  • Thanks for the flowers! One reason to use my approach over others using MetaPost is that writeLaTeX for example does - to my knowledge - not support the --shell-escape option. Now everything is contained within TikZ. Plus, it should compile faster.

    – Meferdati
    Apr 15 '13 at 2:12











  • Since 2012 the --shell-escape should not be needed for MetaPost any more since TeXLive considers it a “safe” program now.

    – Martin Ueding
    Jul 4 '15 at 7:35











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f106038%2fdrawing-a-scattering-feynman-diagram-with-tikz%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























4 Answers
4






active

oldest

votes








4 Answers
4






active

oldest

votes









active

oldest

votes






active

oldest

votes









11





+50









One possibility: instead of a tree, I just used some coordinates and decorated paths; I used the triangle 45 arrow tip from the arrows library, changed the gluon style to use decoration=coil,aspect=0, and suppressed parts of the original code not relevant here:



documentclass[11pt]article
usepackagetikz
usetikzlibrarypositioning,arrows
usetikzlibrarydecorations.pathmorphing
usetikzlibrarydecorations.markings

begindocument

tikzset
particle/.style=thick,draw=blue, postaction=decorate,
decoration=markings,mark=at position .5 with arrow[blue]triangle 45,
gluon/.style=decorate, draw=black,
decoration=coil,aspect=0


begintikzpicture[node distance=1cm and 1.5cm]
coordinate[label=left:$e^-$] (e1);
coordinate[below right=of e1] (aux1);
coordinate[above right=of aux1,label=right:$e^-$] (e2);
coordinate[below=1.25cm of aux1] (aux2);
coordinate[below left=of aux2,label=left:$e^-$] (e3);
coordinate[below right=of aux2,label=right:$e^-$] (e4);

draw[particle] (e1) -- (aux1);
draw[particle] (aux1) -- (e2);
draw[particle] (e3) -- (aux2);
draw[particle] (aux2) -- (e4);
draw[gluon] (aux1) -- node[label=right:$gamma$] (aux2);
endtikzpicture
enddocument


enter image description here



After an edit to the question, here's some new code with the required coil decoration:



documentclass[11pt]article
usepackagetikz
usetikzlibrarypositioning,arrows
usetikzlibrarydecorations.pathmorphing
usetikzlibrarydecorations.markings


begindocument
tikzset
particle/.style=thick,draw=blue, postaction=decorate,
decoration=markings,mark=at position .5 with arrow[blue]triangle 45,
gluon/.style=decorate, draw=black,
decoration=coil,aspect=0.3,segment length=3pt,amplitude=3pt


begintikzpicture[node distance=1cm and 1.5cm]
coordinate[label=left:$G$] (e1);
coordinate[below right=of e1] (aux1);
coordinate[above right=of aux1,label=right:$N$] (e2);
coordinate[below=1.25cm of aux1] (aux2);
coordinate[below left=of aux2,label=left:$N$] (e3);
coordinate[below right=of aux2,label=right:$G$] (e4);

draw[gluon] (e1) -- (aux1);
draw[particle] (aux1) -- (e2);
draw[particle] (e3) -- (aux2);
draw[gluon] (aux2) -- (e4);
draw[particle] (aux2) -- node[label=right:$N$] (aux1);
endtikzpicture
enddocument


enter image description here






share|improve this answer

























  • TeX beast! Thanks a lot! Do you know how I can get coils - as in the ones on p.95 of the TikZ documentation (see question edit)?

    – User 17670
    Mar 30 '13 at 20:47











  • @User17670 You're welcome. However, page 95 of the current pgfmanual doesn't show any coils. Please add to your question (a link to) an image showing the desired type of coil.

    – Gonzalo Medina
    Mar 30 '13 at 20:56











  • I posted a link to a manual (maybe it's not the most up to date, sorry) at the bottom of my question edit. In terms of what the snake=coil is supposed to look like - it's the one that features in the second image of my question (they look like springs).

    – User 17670
    Mar 30 '13 at 21:03






  • 1





    @User17670 Ah, now I see. Yes; that manual is outdated. Now I know what you want. Please see my updated answer (in 40 seconds).

    – Gonzalo Medina
    Mar 30 '13 at 21:08






  • 1





    @User17670 answer updated; here you can find the updated manual mirrors.ctan.org/graphics/pgf/base/doc/generic/pgf/… . On page 323 you can find the attributes for the coil decoration.

    – Gonzalo Medina
    Mar 30 '13 at 21:11















11





+50









One possibility: instead of a tree, I just used some coordinates and decorated paths; I used the triangle 45 arrow tip from the arrows library, changed the gluon style to use decoration=coil,aspect=0, and suppressed parts of the original code not relevant here:



documentclass[11pt]article
usepackagetikz
usetikzlibrarypositioning,arrows
usetikzlibrarydecorations.pathmorphing
usetikzlibrarydecorations.markings

begindocument

tikzset
particle/.style=thick,draw=blue, postaction=decorate,
decoration=markings,mark=at position .5 with arrow[blue]triangle 45,
gluon/.style=decorate, draw=black,
decoration=coil,aspect=0


begintikzpicture[node distance=1cm and 1.5cm]
coordinate[label=left:$e^-$] (e1);
coordinate[below right=of e1] (aux1);
coordinate[above right=of aux1,label=right:$e^-$] (e2);
coordinate[below=1.25cm of aux1] (aux2);
coordinate[below left=of aux2,label=left:$e^-$] (e3);
coordinate[below right=of aux2,label=right:$e^-$] (e4);

draw[particle] (e1) -- (aux1);
draw[particle] (aux1) -- (e2);
draw[particle] (e3) -- (aux2);
draw[particle] (aux2) -- (e4);
draw[gluon] (aux1) -- node[label=right:$gamma$] (aux2);
endtikzpicture
enddocument


enter image description here



After an edit to the question, here's some new code with the required coil decoration:



documentclass[11pt]article
usepackagetikz
usetikzlibrarypositioning,arrows
usetikzlibrarydecorations.pathmorphing
usetikzlibrarydecorations.markings


begindocument
tikzset
particle/.style=thick,draw=blue, postaction=decorate,
decoration=markings,mark=at position .5 with arrow[blue]triangle 45,
gluon/.style=decorate, draw=black,
decoration=coil,aspect=0.3,segment length=3pt,amplitude=3pt


begintikzpicture[node distance=1cm and 1.5cm]
coordinate[label=left:$G$] (e1);
coordinate[below right=of e1] (aux1);
coordinate[above right=of aux1,label=right:$N$] (e2);
coordinate[below=1.25cm of aux1] (aux2);
coordinate[below left=of aux2,label=left:$N$] (e3);
coordinate[below right=of aux2,label=right:$G$] (e4);

draw[gluon] (e1) -- (aux1);
draw[particle] (aux1) -- (e2);
draw[particle] (e3) -- (aux2);
draw[gluon] (aux2) -- (e4);
draw[particle] (aux2) -- node[label=right:$N$] (aux1);
endtikzpicture
enddocument


enter image description here






share|improve this answer

























  • TeX beast! Thanks a lot! Do you know how I can get coils - as in the ones on p.95 of the TikZ documentation (see question edit)?

    – User 17670
    Mar 30 '13 at 20:47











  • @User17670 You're welcome. However, page 95 of the current pgfmanual doesn't show any coils. Please add to your question (a link to) an image showing the desired type of coil.

    – Gonzalo Medina
    Mar 30 '13 at 20:56











  • I posted a link to a manual (maybe it's not the most up to date, sorry) at the bottom of my question edit. In terms of what the snake=coil is supposed to look like - it's the one that features in the second image of my question (they look like springs).

    – User 17670
    Mar 30 '13 at 21:03






  • 1





    @User17670 Ah, now I see. Yes; that manual is outdated. Now I know what you want. Please see my updated answer (in 40 seconds).

    – Gonzalo Medina
    Mar 30 '13 at 21:08






  • 1





    @User17670 answer updated; here you can find the updated manual mirrors.ctan.org/graphics/pgf/base/doc/generic/pgf/… . On page 323 you can find the attributes for the coil decoration.

    – Gonzalo Medina
    Mar 30 '13 at 21:11













11





+50







11





+50



11




+50





One possibility: instead of a tree, I just used some coordinates and decorated paths; I used the triangle 45 arrow tip from the arrows library, changed the gluon style to use decoration=coil,aspect=0, and suppressed parts of the original code not relevant here:



documentclass[11pt]article
usepackagetikz
usetikzlibrarypositioning,arrows
usetikzlibrarydecorations.pathmorphing
usetikzlibrarydecorations.markings

begindocument

tikzset
particle/.style=thick,draw=blue, postaction=decorate,
decoration=markings,mark=at position .5 with arrow[blue]triangle 45,
gluon/.style=decorate, draw=black,
decoration=coil,aspect=0


begintikzpicture[node distance=1cm and 1.5cm]
coordinate[label=left:$e^-$] (e1);
coordinate[below right=of e1] (aux1);
coordinate[above right=of aux1,label=right:$e^-$] (e2);
coordinate[below=1.25cm of aux1] (aux2);
coordinate[below left=of aux2,label=left:$e^-$] (e3);
coordinate[below right=of aux2,label=right:$e^-$] (e4);

draw[particle] (e1) -- (aux1);
draw[particle] (aux1) -- (e2);
draw[particle] (e3) -- (aux2);
draw[particle] (aux2) -- (e4);
draw[gluon] (aux1) -- node[label=right:$gamma$] (aux2);
endtikzpicture
enddocument


enter image description here



After an edit to the question, here's some new code with the required coil decoration:



documentclass[11pt]article
usepackagetikz
usetikzlibrarypositioning,arrows
usetikzlibrarydecorations.pathmorphing
usetikzlibrarydecorations.markings


begindocument
tikzset
particle/.style=thick,draw=blue, postaction=decorate,
decoration=markings,mark=at position .5 with arrow[blue]triangle 45,
gluon/.style=decorate, draw=black,
decoration=coil,aspect=0.3,segment length=3pt,amplitude=3pt


begintikzpicture[node distance=1cm and 1.5cm]
coordinate[label=left:$G$] (e1);
coordinate[below right=of e1] (aux1);
coordinate[above right=of aux1,label=right:$N$] (e2);
coordinate[below=1.25cm of aux1] (aux2);
coordinate[below left=of aux2,label=left:$N$] (e3);
coordinate[below right=of aux2,label=right:$G$] (e4);

draw[gluon] (e1) -- (aux1);
draw[particle] (aux1) -- (e2);
draw[particle] (e3) -- (aux2);
draw[gluon] (aux2) -- (e4);
draw[particle] (aux2) -- node[label=right:$N$] (aux1);
endtikzpicture
enddocument


enter image description here






share|improve this answer















One possibility: instead of a tree, I just used some coordinates and decorated paths; I used the triangle 45 arrow tip from the arrows library, changed the gluon style to use decoration=coil,aspect=0, and suppressed parts of the original code not relevant here:



documentclass[11pt]article
usepackagetikz
usetikzlibrarypositioning,arrows
usetikzlibrarydecorations.pathmorphing
usetikzlibrarydecorations.markings

begindocument

tikzset
particle/.style=thick,draw=blue, postaction=decorate,
decoration=markings,mark=at position .5 with arrow[blue]triangle 45,
gluon/.style=decorate, draw=black,
decoration=coil,aspect=0


begintikzpicture[node distance=1cm and 1.5cm]
coordinate[label=left:$e^-$] (e1);
coordinate[below right=of e1] (aux1);
coordinate[above right=of aux1,label=right:$e^-$] (e2);
coordinate[below=1.25cm of aux1] (aux2);
coordinate[below left=of aux2,label=left:$e^-$] (e3);
coordinate[below right=of aux2,label=right:$e^-$] (e4);

draw[particle] (e1) -- (aux1);
draw[particle] (aux1) -- (e2);
draw[particle] (e3) -- (aux2);
draw[particle] (aux2) -- (e4);
draw[gluon] (aux1) -- node[label=right:$gamma$] (aux2);
endtikzpicture
enddocument


enter image description here



After an edit to the question, here's some new code with the required coil decoration:



documentclass[11pt]article
usepackagetikz
usetikzlibrarypositioning,arrows
usetikzlibrarydecorations.pathmorphing
usetikzlibrarydecorations.markings


begindocument
tikzset
particle/.style=thick,draw=blue, postaction=decorate,
decoration=markings,mark=at position .5 with arrow[blue]triangle 45,
gluon/.style=decorate, draw=black,
decoration=coil,aspect=0.3,segment length=3pt,amplitude=3pt


begintikzpicture[node distance=1cm and 1.5cm]
coordinate[label=left:$G$] (e1);
coordinate[below right=of e1] (aux1);
coordinate[above right=of aux1,label=right:$N$] (e2);
coordinate[below=1.25cm of aux1] (aux2);
coordinate[below left=of aux2,label=left:$N$] (e3);
coordinate[below right=of aux2,label=right:$G$] (e4);

draw[gluon] (e1) -- (aux1);
draw[particle] (aux1) -- (e2);
draw[particle] (e3) -- (aux2);
draw[gluon] (aux2) -- (e4);
draw[particle] (aux2) -- node[label=right:$N$] (aux1);
endtikzpicture
enddocument


enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 30 '13 at 21:09

























answered Mar 30 '13 at 16:47









Gonzalo MedinaGonzalo Medina

402k4113151580




402k4113151580












  • TeX beast! Thanks a lot! Do you know how I can get coils - as in the ones on p.95 of the TikZ documentation (see question edit)?

    – User 17670
    Mar 30 '13 at 20:47











  • @User17670 You're welcome. However, page 95 of the current pgfmanual doesn't show any coils. Please add to your question (a link to) an image showing the desired type of coil.

    – Gonzalo Medina
    Mar 30 '13 at 20:56











  • I posted a link to a manual (maybe it's not the most up to date, sorry) at the bottom of my question edit. In terms of what the snake=coil is supposed to look like - it's the one that features in the second image of my question (they look like springs).

    – User 17670
    Mar 30 '13 at 21:03






  • 1





    @User17670 Ah, now I see. Yes; that manual is outdated. Now I know what you want. Please see my updated answer (in 40 seconds).

    – Gonzalo Medina
    Mar 30 '13 at 21:08






  • 1





    @User17670 answer updated; here you can find the updated manual mirrors.ctan.org/graphics/pgf/base/doc/generic/pgf/… . On page 323 you can find the attributes for the coil decoration.

    – Gonzalo Medina
    Mar 30 '13 at 21:11

















  • TeX beast! Thanks a lot! Do you know how I can get coils - as in the ones on p.95 of the TikZ documentation (see question edit)?

    – User 17670
    Mar 30 '13 at 20:47











  • @User17670 You're welcome. However, page 95 of the current pgfmanual doesn't show any coils. Please add to your question (a link to) an image showing the desired type of coil.

    – Gonzalo Medina
    Mar 30 '13 at 20:56











  • I posted a link to a manual (maybe it's not the most up to date, sorry) at the bottom of my question edit. In terms of what the snake=coil is supposed to look like - it's the one that features in the second image of my question (they look like springs).

    – User 17670
    Mar 30 '13 at 21:03






  • 1





    @User17670 Ah, now I see. Yes; that manual is outdated. Now I know what you want. Please see my updated answer (in 40 seconds).

    – Gonzalo Medina
    Mar 30 '13 at 21:08






  • 1





    @User17670 answer updated; here you can find the updated manual mirrors.ctan.org/graphics/pgf/base/doc/generic/pgf/… . On page 323 you can find the attributes for the coil decoration.

    – Gonzalo Medina
    Mar 30 '13 at 21:11
















TeX beast! Thanks a lot! Do you know how I can get coils - as in the ones on p.95 of the TikZ documentation (see question edit)?

– User 17670
Mar 30 '13 at 20:47





TeX beast! Thanks a lot! Do you know how I can get coils - as in the ones on p.95 of the TikZ documentation (see question edit)?

– User 17670
Mar 30 '13 at 20:47













@User17670 You're welcome. However, page 95 of the current pgfmanual doesn't show any coils. Please add to your question (a link to) an image showing the desired type of coil.

– Gonzalo Medina
Mar 30 '13 at 20:56





@User17670 You're welcome. However, page 95 of the current pgfmanual doesn't show any coils. Please add to your question (a link to) an image showing the desired type of coil.

– Gonzalo Medina
Mar 30 '13 at 20:56













I posted a link to a manual (maybe it's not the most up to date, sorry) at the bottom of my question edit. In terms of what the snake=coil is supposed to look like - it's the one that features in the second image of my question (they look like springs).

– User 17670
Mar 30 '13 at 21:03





I posted a link to a manual (maybe it's not the most up to date, sorry) at the bottom of my question edit. In terms of what the snake=coil is supposed to look like - it's the one that features in the second image of my question (they look like springs).

– User 17670
Mar 30 '13 at 21:03




1




1





@User17670 Ah, now I see. Yes; that manual is outdated. Now I know what you want. Please see my updated answer (in 40 seconds).

– Gonzalo Medina
Mar 30 '13 at 21:08





@User17670 Ah, now I see. Yes; that manual is outdated. Now I know what you want. Please see my updated answer (in 40 seconds).

– Gonzalo Medina
Mar 30 '13 at 21:08




1




1





@User17670 answer updated; here you can find the updated manual mirrors.ctan.org/graphics/pgf/base/doc/generic/pgf/… . On page 323 you can find the attributes for the coil decoration.

– Gonzalo Medina
Mar 30 '13 at 21:11





@User17670 answer updated; here you can find the updated manual mirrors.ctan.org/graphics/pgf/base/doc/generic/pgf/… . On page 323 you can find the attributes for the coil decoration.

– Gonzalo Medina
Mar 30 '13 at 21:11











11














You can also use the feynMP package to create Feynman diagrams. It uses metapost instead of tikz, but provides a nice interface for creating different types of Feynman diagrams. For example:



documentclassarticle
usepackagefeynmp
DeclareGraphicsRule*mps*

begindocument
unitlength = 1mm
beginfmffilegluon
beginfmfgraph*(40,30)
fmflefti1,i2
fmflabel$e^-$i1
fmflabel$e^-$i2
fmfrighto1,o2
fmflabel$e^-$o1
fmflabel$e^-$o2
fmffermion, fore=bluei1,v1,o1
fmffermion, fore=bluei2,v2,o2
fmfphoton,label=$gamma$v1,v2
fmfdotv1,v2
endfmfgraph*
endfmffile
write18mpost gluon
enddocument


Run this twice with pdflatex --shell-escape filename, and you will get



enter image description here






share|improve this answer























  • +1 That's a nice output! For me, though, I just got a white space, with no errors.

    – User 17670
    Mar 30 '13 at 20:34











  • You need to enable shell escape. Otherwise run pdflatex, run metapost gluon, and then run pdflatex again.

    – Aditya
    Mar 30 '13 at 20:36















11














You can also use the feynMP package to create Feynman diagrams. It uses metapost instead of tikz, but provides a nice interface for creating different types of Feynman diagrams. For example:



documentclassarticle
usepackagefeynmp
DeclareGraphicsRule*mps*

begindocument
unitlength = 1mm
beginfmffilegluon
beginfmfgraph*(40,30)
fmflefti1,i2
fmflabel$e^-$i1
fmflabel$e^-$i2
fmfrighto1,o2
fmflabel$e^-$o1
fmflabel$e^-$o2
fmffermion, fore=bluei1,v1,o1
fmffermion, fore=bluei2,v2,o2
fmfphoton,label=$gamma$v1,v2
fmfdotv1,v2
endfmfgraph*
endfmffile
write18mpost gluon
enddocument


Run this twice with pdflatex --shell-escape filename, and you will get



enter image description here






share|improve this answer























  • +1 That's a nice output! For me, though, I just got a white space, with no errors.

    – User 17670
    Mar 30 '13 at 20:34











  • You need to enable shell escape. Otherwise run pdflatex, run metapost gluon, and then run pdflatex again.

    – Aditya
    Mar 30 '13 at 20:36













11












11








11







You can also use the feynMP package to create Feynman diagrams. It uses metapost instead of tikz, but provides a nice interface for creating different types of Feynman diagrams. For example:



documentclassarticle
usepackagefeynmp
DeclareGraphicsRule*mps*

begindocument
unitlength = 1mm
beginfmffilegluon
beginfmfgraph*(40,30)
fmflefti1,i2
fmflabel$e^-$i1
fmflabel$e^-$i2
fmfrighto1,o2
fmflabel$e^-$o1
fmflabel$e^-$o2
fmffermion, fore=bluei1,v1,o1
fmffermion, fore=bluei2,v2,o2
fmfphoton,label=$gamma$v1,v2
fmfdotv1,v2
endfmfgraph*
endfmffile
write18mpost gluon
enddocument


Run this twice with pdflatex --shell-escape filename, and you will get



enter image description here






share|improve this answer













You can also use the feynMP package to create Feynman diagrams. It uses metapost instead of tikz, but provides a nice interface for creating different types of Feynman diagrams. For example:



documentclassarticle
usepackagefeynmp
DeclareGraphicsRule*mps*

begindocument
unitlength = 1mm
beginfmffilegluon
beginfmfgraph*(40,30)
fmflefti1,i2
fmflabel$e^-$i1
fmflabel$e^-$i2
fmfrighto1,o2
fmflabel$e^-$o1
fmflabel$e^-$o2
fmffermion, fore=bluei1,v1,o1
fmffermion, fore=bluei2,v2,o2
fmfphoton,label=$gamma$v1,v2
fmfdotv1,v2
endfmfgraph*
endfmffile
write18mpost gluon
enddocument


Run this twice with pdflatex --shell-escape filename, and you will get



enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 30 '13 at 17:08









AdityaAditya

55.8k2110237




55.8k2110237












  • +1 That's a nice output! For me, though, I just got a white space, with no errors.

    – User 17670
    Mar 30 '13 at 20:34











  • You need to enable shell escape. Otherwise run pdflatex, run metapost gluon, and then run pdflatex again.

    – Aditya
    Mar 30 '13 at 20:36

















  • +1 That's a nice output! For me, though, I just got a white space, with no errors.

    – User 17670
    Mar 30 '13 at 20:34











  • You need to enable shell escape. Otherwise run pdflatex, run metapost gluon, and then run pdflatex again.

    – Aditya
    Mar 30 '13 at 20:36
















+1 That's a nice output! For me, though, I just got a white space, with no errors.

– User 17670
Mar 30 '13 at 20:34





+1 That's a nice output! For me, though, I just got a white space, with no errors.

– User 17670
Mar 30 '13 at 20:34













You need to enable shell escape. Otherwise run pdflatex, run metapost gluon, and then run pdflatex again.

– Aditya
Mar 30 '13 at 20:36





You need to enable shell escape. Otherwise run pdflatex, run metapost gluon, and then run pdflatex again.

– Aditya
Mar 30 '13 at 20:36











5














These diagrams are very easy to produce with the new tikz-feynman package (see also the project page), based on this answer. The only requirement for using automatic positioning of the vertices is to compile the document with lualatex:



documentclass[tikz]standalone
usepackage[compat=1.1.0]tikz-feynman
begindocument
feynmandiagram [vertical=b to a]
i1 [particle=(textupe^-)] -- [fermion] a -- [fermion] i2 [particle=(textupe^-)],
a -- [photon,edge label'=(gamma)] b,
f1 [particle=(textupe^-)] -- [fermion] b -- [fermion] f2 [particle=(textupe^-)],
;

tikzfeynmanset
every fermion=draw=blue,

feynmandiagram [vertical=b to a]
i1 [particle=(N)] -- [fermion] a,
i2 [particle=(G)] -- [photon] a,
a -- [fermion,edge label'=(N)] b,
b -- [photon] f1 [particle=(G)],
b -- [fermion] f2 [particle=(N)],
;
enddocument



enter image description here



enter image description here







share|improve this answer

























  • I'm the author of TikZ-Feynman! It's amazing to see it being used. Thanks @giordano!

    – JP-Ellis
    Feb 4 '16 at 11:34
















5














These diagrams are very easy to produce with the new tikz-feynman package (see also the project page), based on this answer. The only requirement for using automatic positioning of the vertices is to compile the document with lualatex:



documentclass[tikz]standalone
usepackage[compat=1.1.0]tikz-feynman
begindocument
feynmandiagram [vertical=b to a]
i1 [particle=(textupe^-)] -- [fermion] a -- [fermion] i2 [particle=(textupe^-)],
a -- [photon,edge label'=(gamma)] b,
f1 [particle=(textupe^-)] -- [fermion] b -- [fermion] f2 [particle=(textupe^-)],
;

tikzfeynmanset
every fermion=draw=blue,

feynmandiagram [vertical=b to a]
i1 [particle=(N)] -- [fermion] a,
i2 [particle=(G)] -- [photon] a,
a -- [fermion,edge label'=(N)] b,
b -- [photon] f1 [particle=(G)],
b -- [fermion] f2 [particle=(N)],
;
enddocument



enter image description here



enter image description here







share|improve this answer

























  • I'm the author of TikZ-Feynman! It's amazing to see it being used. Thanks @giordano!

    – JP-Ellis
    Feb 4 '16 at 11:34














5












5








5







These diagrams are very easy to produce with the new tikz-feynman package (see also the project page), based on this answer. The only requirement for using automatic positioning of the vertices is to compile the document with lualatex:



documentclass[tikz]standalone
usepackage[compat=1.1.0]tikz-feynman
begindocument
feynmandiagram [vertical=b to a]
i1 [particle=(textupe^-)] -- [fermion] a -- [fermion] i2 [particle=(textupe^-)],
a -- [photon,edge label'=(gamma)] b,
f1 [particle=(textupe^-)] -- [fermion] b -- [fermion] f2 [particle=(textupe^-)],
;

tikzfeynmanset
every fermion=draw=blue,

feynmandiagram [vertical=b to a]
i1 [particle=(N)] -- [fermion] a,
i2 [particle=(G)] -- [photon] a,
a -- [fermion,edge label'=(N)] b,
b -- [photon] f1 [particle=(G)],
b -- [fermion] f2 [particle=(N)],
;
enddocument



enter image description here



enter image description here







share|improve this answer















These diagrams are very easy to produce with the new tikz-feynman package (see also the project page), based on this answer. The only requirement for using automatic positioning of the vertices is to compile the document with lualatex:



documentclass[tikz]standalone
usepackage[compat=1.1.0]tikz-feynman
begindocument
feynmandiagram [vertical=b to a]
i1 [particle=(textupe^-)] -- [fermion] a -- [fermion] i2 [particle=(textupe^-)],
a -- [photon,edge label'=(gamma)] b,
f1 [particle=(textupe^-)] -- [fermion] b -- [fermion] f2 [particle=(textupe^-)],
;

tikzfeynmanset
every fermion=draw=blue,

feynmandiagram [vertical=b to a]
i1 [particle=(N)] -- [fermion] a,
i2 [particle=(G)] -- [photon] a,
a -- [fermion,edge label'=(N)] b,
b -- [photon] f1 [particle=(G)],
b -- [fermion] f2 [particle=(N)],
;
enddocument



enter image description here



enter image description here








share|improve this answer














share|improve this answer



share|improve this answer








edited Apr 13 '17 at 12:35









Community

1




1










answered Feb 3 '16 at 9:31









giordanogiordano

7,59621943




7,59621943












  • I'm the author of TikZ-Feynman! It's amazing to see it being used. Thanks @giordano!

    – JP-Ellis
    Feb 4 '16 at 11:34


















  • I'm the author of TikZ-Feynman! It's amazing to see it being used. Thanks @giordano!

    – JP-Ellis
    Feb 4 '16 at 11:34

















I'm the author of TikZ-Feynman! It's amazing to see it being used. Thanks @giordano!

– JP-Ellis
Feb 4 '16 at 11:34






I'm the author of TikZ-Feynman! It's amazing to see it being used. Thanks @giordano!

– JP-Ellis
Feb 4 '16 at 11:34












3














Here is my take on this. I think it produces beautiful output and doesn't require running any special programs like feynmp. Drawback: you have to put in the nodes manually, but that's very managable imho. Bonus: it retains full flexibility for using any kind of tikz decorations and so on while at the same time making it easy to use due to the tree approach.



documentclassstandalone

usepackage[utf8]inputenc
usepackagetikz
usetikzlibrarytrees
usetikzlibrarydecorations.pathmorphing
usetikzlibrarydecorations.markings

begindocument

% Define styles for the different kind of edges in a Feynman diagram
tikzset
gageboson/.style=decorate,decoration=snake,draw=tud9a,
electronin/.style=draw=tud1a,postaction=decorate,decoration=markings,mark=at position .55 with arrow[draw=tud1a]<,
electronout/.style=draw=tud1a,postaction=decorate,decoration=markings,mark=at position .55 with arrow[draw=tud1a]>,
gluon/.style=decorate,draw=magenta,decoration=coil,amplitude=4pt,segment length=5pt


begintikzpicture[thick,
% Set the overall layout of the tree
level/.style=level distance=1.2cm,
level 2/.style=sibling distance=2.6cm,
level 3/.style=sibling distance=2cm
]
coordinate
child[grow=up]
child
node $k^'_1$
edge from parent [electronout]

child
node $k_1$
edge from parent [electronin]

edge from parent [gageboson] node [right=3pt] $q$

child[grow=down,level distance=0pt]
child
node $k_2$
edge from parent [electronin]

child
node $k^'_2$
edge from parent [electronout]

;
fill[black] (0,0) circle (.05cm);
fill[black] (0,1.2cm) circle (.05cm);
endtikzpicture

enddocument


Yields:
resulting graphic



However, when you look closely, the wriggly line of the phonon is not perfect. Anybody know how to get rid of that linear part?



In the particular case asked above, the code would be:



documentclassstandalone

usepackage[utf8]inputenc
usepackagetikz
usetikzlibrarytrees
usetikzlibrarydecorations.pathmorphing
usetikzlibrarydecorations.markings

begindocument

% Define styles for the different kind of edges in a Feynman diagram
tikzset
gageboson/.style=decorate,decoration=snake,draw=black,
electronin/.style=draw=tud1a,postaction=decorate,decoration=markings,mark=at position .55 with arrow[draw=red]<,
electronout/.style=draw=tud1a,postaction=decorate,decoration=markings,mark=at position .55 with arrow[draw=red]>,
gluon/.style=decorate,draw=magenta,decoration=coil,amplitude=4pt,segment length=5pt


begintikzpicture[
thick,
% Set the overall layout of the tree
level/.style=level distance=1.5cm,
level 2/.style=sibling distance=2.6cm,
level 3/.style=sibling distance=2cm
]
coordinate
child[grow=up]
child
node $N$
edge from parent [electronout]

child
node $G$
edge from parent [gageboson]

edge from parent [electronout] node [right=3pt] $N$

child[grow=down,level distance=0pt]
child
node $N$
edge from parent [electronin]

child
node $G$
edge from parent [gageboson]

;
fill[black] (0,0) circle (.05cm);
fill[black] (0,1.5cm) circle (.05cm);
endtikzpicture

enddocument


and results in this
answer






share|improve this answer




















  • 1





    (Once the vote cap passes) Nice answer. I can clearly see the pictures :P By the way, the special program you mention is the mighty MetaPost. So that's not quite an external special program but a monster that is created together with TeX :) Though I'm a die-hard TikZ user, I don't think anybody can discard MetaPost via TikZ.

    – percusse
    Apr 12 '13 at 22:14











  • Thanks for the flowers! One reason to use my approach over others using MetaPost is that writeLaTeX for example does - to my knowledge - not support the --shell-escape option. Now everything is contained within TikZ. Plus, it should compile faster.

    – Meferdati
    Apr 15 '13 at 2:12











  • Since 2012 the --shell-escape should not be needed for MetaPost any more since TeXLive considers it a “safe” program now.

    – Martin Ueding
    Jul 4 '15 at 7:35















3














Here is my take on this. I think it produces beautiful output and doesn't require running any special programs like feynmp. Drawback: you have to put in the nodes manually, but that's very managable imho. Bonus: it retains full flexibility for using any kind of tikz decorations and so on while at the same time making it easy to use due to the tree approach.



documentclassstandalone

usepackage[utf8]inputenc
usepackagetikz
usetikzlibrarytrees
usetikzlibrarydecorations.pathmorphing
usetikzlibrarydecorations.markings

begindocument

% Define styles for the different kind of edges in a Feynman diagram
tikzset
gageboson/.style=decorate,decoration=snake,draw=tud9a,
electronin/.style=draw=tud1a,postaction=decorate,decoration=markings,mark=at position .55 with arrow[draw=tud1a]<,
electronout/.style=draw=tud1a,postaction=decorate,decoration=markings,mark=at position .55 with arrow[draw=tud1a]>,
gluon/.style=decorate,draw=magenta,decoration=coil,amplitude=4pt,segment length=5pt


begintikzpicture[thick,
% Set the overall layout of the tree
level/.style=level distance=1.2cm,
level 2/.style=sibling distance=2.6cm,
level 3/.style=sibling distance=2cm
]
coordinate
child[grow=up]
child
node $k^'_1$
edge from parent [electronout]

child
node $k_1$
edge from parent [electronin]

edge from parent [gageboson] node [right=3pt] $q$

child[grow=down,level distance=0pt]
child
node $k_2$
edge from parent [electronin]

child
node $k^'_2$
edge from parent [electronout]

;
fill[black] (0,0) circle (.05cm);
fill[black] (0,1.2cm) circle (.05cm);
endtikzpicture

enddocument


Yields:
resulting graphic



However, when you look closely, the wriggly line of the phonon is not perfect. Anybody know how to get rid of that linear part?



In the particular case asked above, the code would be:



documentclassstandalone

usepackage[utf8]inputenc
usepackagetikz
usetikzlibrarytrees
usetikzlibrarydecorations.pathmorphing
usetikzlibrarydecorations.markings

begindocument

% Define styles for the different kind of edges in a Feynman diagram
tikzset
gageboson/.style=decorate,decoration=snake,draw=black,
electronin/.style=draw=tud1a,postaction=decorate,decoration=markings,mark=at position .55 with arrow[draw=red]<,
electronout/.style=draw=tud1a,postaction=decorate,decoration=markings,mark=at position .55 with arrow[draw=red]>,
gluon/.style=decorate,draw=magenta,decoration=coil,amplitude=4pt,segment length=5pt


begintikzpicture[
thick,
% Set the overall layout of the tree
level/.style=level distance=1.5cm,
level 2/.style=sibling distance=2.6cm,
level 3/.style=sibling distance=2cm
]
coordinate
child[grow=up]
child
node $N$
edge from parent [electronout]

child
node $G$
edge from parent [gageboson]

edge from parent [electronout] node [right=3pt] $N$

child[grow=down,level distance=0pt]
child
node $N$
edge from parent [electronin]

child
node $G$
edge from parent [gageboson]

;
fill[black] (0,0) circle (.05cm);
fill[black] (0,1.5cm) circle (.05cm);
endtikzpicture

enddocument


and results in this
answer






share|improve this answer




















  • 1





    (Once the vote cap passes) Nice answer. I can clearly see the pictures :P By the way, the special program you mention is the mighty MetaPost. So that's not quite an external special program but a monster that is created together with TeX :) Though I'm a die-hard TikZ user, I don't think anybody can discard MetaPost via TikZ.

    – percusse
    Apr 12 '13 at 22:14











  • Thanks for the flowers! One reason to use my approach over others using MetaPost is that writeLaTeX for example does - to my knowledge - not support the --shell-escape option. Now everything is contained within TikZ. Plus, it should compile faster.

    – Meferdati
    Apr 15 '13 at 2:12











  • Since 2012 the --shell-escape should not be needed for MetaPost any more since TeXLive considers it a “safe” program now.

    – Martin Ueding
    Jul 4 '15 at 7:35













3












3








3







Here is my take on this. I think it produces beautiful output and doesn't require running any special programs like feynmp. Drawback: you have to put in the nodes manually, but that's very managable imho. Bonus: it retains full flexibility for using any kind of tikz decorations and so on while at the same time making it easy to use due to the tree approach.



documentclassstandalone

usepackage[utf8]inputenc
usepackagetikz
usetikzlibrarytrees
usetikzlibrarydecorations.pathmorphing
usetikzlibrarydecorations.markings

begindocument

% Define styles for the different kind of edges in a Feynman diagram
tikzset
gageboson/.style=decorate,decoration=snake,draw=tud9a,
electronin/.style=draw=tud1a,postaction=decorate,decoration=markings,mark=at position .55 with arrow[draw=tud1a]<,
electronout/.style=draw=tud1a,postaction=decorate,decoration=markings,mark=at position .55 with arrow[draw=tud1a]>,
gluon/.style=decorate,draw=magenta,decoration=coil,amplitude=4pt,segment length=5pt


begintikzpicture[thick,
% Set the overall layout of the tree
level/.style=level distance=1.2cm,
level 2/.style=sibling distance=2.6cm,
level 3/.style=sibling distance=2cm
]
coordinate
child[grow=up]
child
node $k^'_1$
edge from parent [electronout]

child
node $k_1$
edge from parent [electronin]

edge from parent [gageboson] node [right=3pt] $q$

child[grow=down,level distance=0pt]
child
node $k_2$
edge from parent [electronin]

child
node $k^'_2$
edge from parent [electronout]

;
fill[black] (0,0) circle (.05cm);
fill[black] (0,1.2cm) circle (.05cm);
endtikzpicture

enddocument


Yields:
resulting graphic



However, when you look closely, the wriggly line of the phonon is not perfect. Anybody know how to get rid of that linear part?



In the particular case asked above, the code would be:



documentclassstandalone

usepackage[utf8]inputenc
usepackagetikz
usetikzlibrarytrees
usetikzlibrarydecorations.pathmorphing
usetikzlibrarydecorations.markings

begindocument

% Define styles for the different kind of edges in a Feynman diagram
tikzset
gageboson/.style=decorate,decoration=snake,draw=black,
electronin/.style=draw=tud1a,postaction=decorate,decoration=markings,mark=at position .55 with arrow[draw=red]<,
electronout/.style=draw=tud1a,postaction=decorate,decoration=markings,mark=at position .55 with arrow[draw=red]>,
gluon/.style=decorate,draw=magenta,decoration=coil,amplitude=4pt,segment length=5pt


begintikzpicture[
thick,
% Set the overall layout of the tree
level/.style=level distance=1.5cm,
level 2/.style=sibling distance=2.6cm,
level 3/.style=sibling distance=2cm
]
coordinate
child[grow=up]
child
node $N$
edge from parent [electronout]

child
node $G$
edge from parent [gageboson]

edge from parent [electronout] node [right=3pt] $N$

child[grow=down,level distance=0pt]
child
node $N$
edge from parent [electronin]

child
node $G$
edge from parent [gageboson]

;
fill[black] (0,0) circle (.05cm);
fill[black] (0,1.5cm) circle (.05cm);
endtikzpicture

enddocument


and results in this
answer






share|improve this answer















Here is my take on this. I think it produces beautiful output and doesn't require running any special programs like feynmp. Drawback: you have to put in the nodes manually, but that's very managable imho. Bonus: it retains full flexibility for using any kind of tikz decorations and so on while at the same time making it easy to use due to the tree approach.



documentclassstandalone

usepackage[utf8]inputenc
usepackagetikz
usetikzlibrarytrees
usetikzlibrarydecorations.pathmorphing
usetikzlibrarydecorations.markings

begindocument

% Define styles for the different kind of edges in a Feynman diagram
tikzset
gageboson/.style=decorate,decoration=snake,draw=tud9a,
electronin/.style=draw=tud1a,postaction=decorate,decoration=markings,mark=at position .55 with arrow[draw=tud1a]<,
electronout/.style=draw=tud1a,postaction=decorate,decoration=markings,mark=at position .55 with arrow[draw=tud1a]>,
gluon/.style=decorate,draw=magenta,decoration=coil,amplitude=4pt,segment length=5pt


begintikzpicture[thick,
% Set the overall layout of the tree
level/.style=level distance=1.2cm,
level 2/.style=sibling distance=2.6cm,
level 3/.style=sibling distance=2cm
]
coordinate
child[grow=up]
child
node $k^'_1$
edge from parent [electronout]

child
node $k_1$
edge from parent [electronin]

edge from parent [gageboson] node [right=3pt] $q$

child[grow=down,level distance=0pt]
child
node $k_2$
edge from parent [electronin]

child
node $k^'_2$
edge from parent [electronout]

;
fill[black] (0,0) circle (.05cm);
fill[black] (0,1.2cm) circle (.05cm);
endtikzpicture

enddocument


Yields:
resulting graphic



However, when you look closely, the wriggly line of the phonon is not perfect. Anybody know how to get rid of that linear part?



In the particular case asked above, the code would be:



documentclassstandalone

usepackage[utf8]inputenc
usepackagetikz
usetikzlibrarytrees
usetikzlibrarydecorations.pathmorphing
usetikzlibrarydecorations.markings

begindocument

% Define styles for the different kind of edges in a Feynman diagram
tikzset
gageboson/.style=decorate,decoration=snake,draw=black,
electronin/.style=draw=tud1a,postaction=decorate,decoration=markings,mark=at position .55 with arrow[draw=red]<,
electronout/.style=draw=tud1a,postaction=decorate,decoration=markings,mark=at position .55 with arrow[draw=red]>,
gluon/.style=decorate,draw=magenta,decoration=coil,amplitude=4pt,segment length=5pt


begintikzpicture[
thick,
% Set the overall layout of the tree
level/.style=level distance=1.5cm,
level 2/.style=sibling distance=2.6cm,
level 3/.style=sibling distance=2cm
]
coordinate
child[grow=up]
child
node $N$
edge from parent [electronout]

child
node $G$
edge from parent [gageboson]

edge from parent [electronout] node [right=3pt] $N$

child[grow=down,level distance=0pt]
child
node $N$
edge from parent [electronin]

child
node $G$
edge from parent [gageboson]

;
fill[black] (0,0) circle (.05cm);
fill[black] (0,1.5cm) circle (.05cm);
endtikzpicture

enddocument


and results in this
answer







share|improve this answer














share|improve this answer



share|improve this answer








edited 7 hours ago









Glorfindel

261129




261129










answered Apr 12 '13 at 16:30









MeferdatiMeferdati

636414




636414







  • 1





    (Once the vote cap passes) Nice answer. I can clearly see the pictures :P By the way, the special program you mention is the mighty MetaPost. So that's not quite an external special program but a monster that is created together with TeX :) Though I'm a die-hard TikZ user, I don't think anybody can discard MetaPost via TikZ.

    – percusse
    Apr 12 '13 at 22:14











  • Thanks for the flowers! One reason to use my approach over others using MetaPost is that writeLaTeX for example does - to my knowledge - not support the --shell-escape option. Now everything is contained within TikZ. Plus, it should compile faster.

    – Meferdati
    Apr 15 '13 at 2:12











  • Since 2012 the --shell-escape should not be needed for MetaPost any more since TeXLive considers it a “safe” program now.

    – Martin Ueding
    Jul 4 '15 at 7:35












  • 1





    (Once the vote cap passes) Nice answer. I can clearly see the pictures :P By the way, the special program you mention is the mighty MetaPost. So that's not quite an external special program but a monster that is created together with TeX :) Though I'm a die-hard TikZ user, I don't think anybody can discard MetaPost via TikZ.

    – percusse
    Apr 12 '13 at 22:14











  • Thanks for the flowers! One reason to use my approach over others using MetaPost is that writeLaTeX for example does - to my knowledge - not support the --shell-escape option. Now everything is contained within TikZ. Plus, it should compile faster.

    – Meferdati
    Apr 15 '13 at 2:12











  • Since 2012 the --shell-escape should not be needed for MetaPost any more since TeXLive considers it a “safe” program now.

    – Martin Ueding
    Jul 4 '15 at 7:35







1




1





(Once the vote cap passes) Nice answer. I can clearly see the pictures :P By the way, the special program you mention is the mighty MetaPost. So that's not quite an external special program but a monster that is created together with TeX :) Though I'm a die-hard TikZ user, I don't think anybody can discard MetaPost via TikZ.

– percusse
Apr 12 '13 at 22:14





(Once the vote cap passes) Nice answer. I can clearly see the pictures :P By the way, the special program you mention is the mighty MetaPost. So that's not quite an external special program but a monster that is created together with TeX :) Though I'm a die-hard TikZ user, I don't think anybody can discard MetaPost via TikZ.

– percusse
Apr 12 '13 at 22:14













Thanks for the flowers! One reason to use my approach over others using MetaPost is that writeLaTeX for example does - to my knowledge - not support the --shell-escape option. Now everything is contained within TikZ. Plus, it should compile faster.

– Meferdati
Apr 15 '13 at 2:12





Thanks for the flowers! One reason to use my approach over others using MetaPost is that writeLaTeX for example does - to my knowledge - not support the --shell-escape option. Now everything is contained within TikZ. Plus, it should compile faster.

– Meferdati
Apr 15 '13 at 2:12













Since 2012 the --shell-escape should not be needed for MetaPost any more since TeXLive considers it a “safe” program now.

– Martin Ueding
Jul 4 '15 at 7:35





Since 2012 the --shell-escape should not be needed for MetaPost any more since TeXLive considers it a “safe” program now.

– Martin Ueding
Jul 4 '15 at 7:35

















draft saved

draft discarded
















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f106038%2fdrawing-a-scattering-feynman-diagram-with-tikz%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Wikipedia:Contact us Navigation menu Navigation menuLeave a Reply Cancel reply Post navigationRecent PostsRecent CommentsArchivesCategoriesMeta

Farafra Inhaltsverzeichnis Geschichte | Badr-Museum Farafra | Nationalpark Weiße Wüste (as-Sahra al-baida) | Literatur | Weblinks | Navigationsmenü27° 3′ N, 27° 58′ OCommons: Farafra

Tórshavn Kliima | Partnerstääden | Luke uk diar | Nawigatsjuun62° 1′ N, 6° 46′ W62° 1′ 0″ N, 6° 46′ 0″ WWMOTórshavn