[Tex/LaTex] How does one draw a momentum arrow along a line in feynmf

arrowsdiagramsfeynmf

When drawing a Feynman diagram, one often wants to label each line and draw the momentum arrows. How can one draw a satisfactory momentum arrow? Take for example electron-muon scattering, where I've tried to draw arrows myself by putting them in the labels.

\begin{fmfgraph*}(40,25)
    \fmfleftn{i}{2}
    \fmfrightn{o}{2}
    \fmf{fermion,label=$\longrightarrow$}{i1,v1,o1}
    \fmf{fermion}{i2,v2,o2}
    \fmf{photon,label=$\gamma$}{v1,v2}
    \fmfdotn{v}{2}
    \fmflabel{$e^-$}{i1}
    \fmflabel{$e^-$}{o1}
    \fmflabel{$\mu^-$}{i2}
    \fmflabel{$\mu^-$}{o2}
\end{fmfgraph*}

The result is silly at most:

A futile attempt to draw momentum arrows

If this would be done properly, there would be an arrow parallel to the line, next (in the direction orthogonal to the line and arrow) to which there would be a text like $p_i$. How could this be achieved?

Best Answer

If you don't mind switching to plain Metapost syntax, and making your graphic into an external file, you can import the feynmp definitions and use them in a regular MP diagram. This provides a simple way to do diagrams with layouts that the standard bits of feynmf don't support.

Here's my first attempt at what you describe above.

enter image description here

which was produced with this MP input:

prologues := 3;
outputtemplate := "%j%c.eps";

input feynmp

beginfig(1);

z1 = -z2 = 20 up;
z3 = (-60,40); 
z4 = z3 reflectedabout(up,down);
z5 = z3 reflectedabout(left,right);
z6 = z4 reflectedabout(left,right);

draw fermion z3 -- z1;
draw fermion z5 -- z2;
draw fermion z1 -- z4;
draw fermion z2 -- z6;
draw photon  z1 -- z2;

label.lft(btex $\gamma$ etex, .5[z1,z2]);

label.ulft(btex $\mu^-$ etex, z3);
label.urt (btex $\mu^-$ etex, z4);

label.llft(btex $e^-$ etex, z5);
label.lrt (btex $e^-$ etex, z6);

fill fullcircle scaled 4 shifted z1;
fill fullcircle scaled 4 shifted z2;

path a[];

a1 = subpath (0.3,0.6) of (z5--z2) shifted 8 up;
drawarrow a1; label.top(btex $p_i$ etex, point .5 of a1);

a2 = subpath (0.4,0.7) of (z2--z6) shifted 8 up;
drawarrow a2; label.top(btex $p_i$ etex, point .5 of a2);

endfig;
end.

However if you would prefer to stick more closely to your original input, then you can use an fmfcmd to add a new line style to add the momentum arrows. Like this:

\begin{fmfgraph*}(120,55)
    \fmfleftn{i}{2}
    \fmfrightn{o}{2}
    \fmf{fermion}{i1,v1,o1}
    \fmf{fermion}{i2,v2,o2}
    \fmf{photon,label=$\gamma$}{v1,v2}
    \fmfdotn{v}{2}
    \fmflabel{$e^-$}{i1}
    \fmflabel{$e^-$}{o1}
    \fmflabel{$\mu^-$}{i2}
    \fmflabel{$\mu^-$}{o2}
    % additions here
    \fmffreeze
    \fmfcmd{style_def marrow expr p = drawarrow subpath (1/4, 3/4) of p shifted 6 up
        withpen pencircle scaled 0.4; label.top(btex $p_i$ etex, point 0.5 of p
        shifted 6 up); enddef;}
    \fmf{marrow}{i1,v1,o1}
\end{fmfgraph*}

which produces this:

enter image description here

Note that the fmffreeze stops the extra connections messing up the layout. And I freely admit that the labels are a bit of a hack.

To produce this output, by the way, I found it convenient to put the fmfgraph into a LaTeX file like this:

\documentclass{article}
\usepackage{feynmp-auto}
\begin{document}
\begin{fmffile}{first}
\begin{fmfgraph*}(120,55)
   ... graph commands here ...
\end{fmfgraph*}
\end{fmffile}
\end{document}

Note that I had to change the size of the OP to something that came out readable on my system.

Related Question