2


I am trying to draw a Feynman diagram using the feynMF package where I wanted to put a specific color to a line and a blob. But even if I use the foreground command in \fmf and \fmfv environments, the color is not coming (it's the default black color). Below is the code I am using.

\documentclass[11pt, border=10pt, svgnames]{standalone}
\usepackage{amsmath, amssymb, slashed, graphicx, xcolor, feynmf}%, feynmp}

\begin{document}
\begin{fmffile}{feyngraph}
\begin{fmfgraph*}(150,80)

\fmfleft{i1,i2}
\fmfright{o1,o2}

\fmf{fermion}{i1,v1}
\fmf{fermion}{v1,i2}
\fmf{fermion}{v2,o1}
\fmf{fermion}{o2,v2}
\fmf{photon}{v1,v2}

% first vertex
\fmfdot{v1}
\fmflabel{V1}{v1}

% second vertex
\fmfv{d.sh=circle, d.fi=full, d.si=2thick, f=(1,,0,,0), l=V2}{v2}

\end{fmfgraph*}
\end{fmffile}
\end{document}

If anyone can give me some idea of what's going wrong I will be very thankful.

Thanks and regards, Saumyen

1
  • 1
    You can only get colour if you use MetaPost to generate the image instead of Metafont (as it says in the manual ctan.org/pkg/feynmf). But you have commented out the feynmp option.
    – Thruston
    Nov 5, 2022 at 13:43

1 Answer 1

1

To get colour you have to use METAPOST instead of METAFONT.

As it says in the manual:

2.5.4 Color

If METAPOST is used for rendering the diagrams, vertices and arcs can be colored. The corresponding options give a warning message under METAFONT and are otherwise ignored.

So change your \usepackage line to:

\usepackage{amsmath, amssymb, slashed, graphicx, xcolor}
\usepackage{feynmp}

and then compile as recommended in the manual:

latex <yourfile>.tex
mpost feyngraph.mp  
latex <yourfile>.tex
dvipdf <yourfile>.dvi

if I do all that, then the OP input gives a PDF that looks like this:

enter image description here

2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .