3

I'm trying to define a new line style in feynmf which should represent gluons in colour flow notation. Each line should consist of two parallel fermion lines, each of which has an arrow. The arrows should point in opposite directions. It should look like the middle line in this diagram: http://inspirehep.net/record/782277/files/W-exchange-cond-double2.png

feynmf has a double line style, however it has one big arrow instead of two arrows showing in opposite direction. Creating custom styles is in principle supported, a description of how to do so is given in chapter 2.8.1 (page 36) of http://mirrors.ctan.org/macros/latex/contrib/feynmf/fmfman.pdf

I looked into the code of feynmf to find how the standard styles are defined. Here are some code snippets which might prove useful:

style_def plain expr p = % single line without arrow
  cdraw p;
enddef;
style_def plain_arrow expr p = % single line with arrow
  cdraw p;
  cfill (arrow p);
enddef;
style_def dbl_plain expr p = % double line without arrow
  draw_double p;
enddef;
style_def dbl_plain_arrow expr p = % double line with one big arrow
  draw_double_arrow p;
enddef;

These definitions are quite simple and I'm able to understand them. However, they use some commands which are defined like this:

%
% |draw_double p| draws a double line.
%    \begin{macrocode}
style_def double expr p =
  save oldpen;
  pen oldpen;
  oldpen := currentpen;
%    \end{macrocode}
% draw a thick linn
%    \begin{macrocode}
  pickup oldpen scaled 3;
  ccutdraw p;
%    \end{macrocode}
% and remove the stuffing
%    \begin{macrocode}
  pickup oldpen;
  cullit; undraw p; cullit;
enddef;
style_def double_arrow expr p =
  draw_double p;
  shrink (1.5);
    cfill (arrow p);
  endshrink;
enddef;
%    \end{macrocode}
%

and this piece of code I unfortunately cannot understand any more. (Both code snippets are copied from http://mirrors.ctan.org/macros/latex/contrib/feynmf/feynmf.dtx, comments in the first snippet by me).

I would really appreciate some help in defining the "double line with opposite arrow" style!

Thanks in advance, Photon

1

Feynmf and feynmp don't actually draw double lines. What they actually draw is a single wide line with a white line on top to provide the gap between the two lines.

This causes problems for drawing two separate parallel lines as there aren't two lines to modify. It also means that the lines are always very close to each other. For this I would recommend generating a framework, calculating shifted points and then connecting these shifted points.

I have included code below that does this. It first generates a framework to build on (shown in dots but would be drawn with phantom in the real diagram and not actually needed here as both points are external vertices). I then use the commands \fmfvoffset{distance}{point}{towards_point} and \fmfvoffsetangle{distance}{angle}{point}{towards_point} which declare a new point which is offset from the vertex point by a distance of distance in the direction of towards_point or at and angle of angle from the direction towards towards_point respectively. The names of these new points are then accessed using \fmfoffsetpoint{point}{towards_point} or \fmfoffsetpoint{point}{towards_point[angle]} respectively. The inside pointers are offset by a distance of 7.1 at 45 degrees as this is equivelent to 5 units down and then 5 units to the side.

Hope this helps!

\begin{fmffile}{shiftedarrow}
\newcommand{\fmfvoffset}[3]{\fmfforce{vloc(__#2)+#1*unitvector(vloc(__#3)-vloc(__#2))}{#2.__#3}}
\newcommand{\fmfvoffsetangle}[4]{\fmfforce{vloc(__#3)+#1*unitvector(vloc(__#4)-vloc(__#3)) rotated #2}{#3.__#4[#2]}}
\newcommand{\fmfoffsetpoint}[2]{#1.__#2}
\begin{fmfgraph}(60,60)
\fmftop{t}
\fmfbottom{b}
\fmf{dots}{t,b}
\fmf{dots,left=1}{t,b}
\fmf{dots,right=1}{t,b}
\fmffreeze
\fmfvoffset{(-5)}{t}{b}
\fmfvoffset{(-5)}{b}{t}
\fmfvoffsetangle{7.1}{45}{t}{b}
\fmfvoffsetangle{7.1}{-45}{t}{b}
\fmfvoffsetangle{7.1}{45}{b}{t}
\fmfvoffsetangle{7.1}{-45}{b}{t}
\fmf{scalar,left=1}{\fmfoffsetpoint{t}{b},\fmfoffsetpoint{b}{t},\fmfoffsetpoint{t}{b}}
\fmf{fermion,right=0.8}{\fmfoffsetpoint{b}{t[-45]},\fmfoffsetpoint{t}{b[45]},}
\fmf{fermion}{\fmfoffsetpoint{t}{b[45]},\fmfoffsetpoint{b}{t[-45]}}
\fmf{fermion,right=0.8}{\fmfoffsetpoint{t}{b[-45]},\fmfoffsetpoint{b}{t[45]}}
\fmf{fermion}{\fmfoffsetpoint{b}{t[45]},\fmfoffsetpoint{t}{b[-45]}}
\end{fmfgraph}

Output is: enter image description here

  • Thanks a lot for the detailed reply! Unfortunately I already submitted my maser's thesis almost a year ago and ended up using JaxoDraw for the diagrams. But maybe this answer will still be useful for future users with a similar problem! – Photon Mar 18 '17 at 21:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.