# How can a label be positioned in feynmp?

I have a Feynman diagram like this:

Let's say I want the label for the W+ to be on the opposite side of its squiggly line or the label for the lowermost tbar to be on the opposite side of its straight line (in order to make the diagram a bit more symmetric). How could I do this?

\documentclass{article}
\usepackage{feynmp}
\usepackage{ifpdf}
\ifpdf
\DeclareGraphicsRule{*}{mps}{*}{}
\fi

\unitlength=1.00 mm

\begin{document}
\begin{fmffile}{fmftempl}
\begin{fmfchar*}(100,70)

\fmfleftn{i}{2}                         % 2 initial states
\fmfrightn{o}{8}                        % 8 final states

\fmf{curly}{i1,v1}                      % g
\fmf{curly}{i2,v2}                      % g
\fmf{fermion, label=$$\bar{t}$$}{v3,v1} % tbar
\fmf{fermion, label=$$t$$}{v1,v7}       % t
\fmf{fermion, label=$$\bar{t}$$}{v7,v2} % tbar
\fmf{fermion, label=$$t$$}{v2,v4}       % t
\fmf{fermion}{v4,o6}
\fmf{fermion}{o3,v3}
\fmf{photon, label=$$W^{-}$$}{v3,v5}    % W-
\fmf{photon, label=$$W^{+}$$}{v4,v6}    % W+
\fmf{fermion}{o2,v5}
\fmf{fermion}{v5,o1}
\fmf{fermion}{o7,v6}
\fmf{fermion}{v6,o8}
\fmf{dashes, label=$$H^{0}$$}{v7,v8}    % H
\fmf{fermion}{o4,v8}
\fmf{fermion}{v8,o5}

\fmflabel{$$g$$}{i1}                    % g
\fmflabel{$$g$$}{i2}                    % g
\fmflabel{$$q$$}{o8}                    % q
\fmflabel{$$\bar{q^{\prime}}$$}{o7}     % q'bar
\fmflabel{$$b$$}{o6}                    % b
\fmflabel{$$b$$}{o5}                    % b
\fmflabel{$$\bar{b}$$}{o4}              % bbar
\fmflabel{$$\bar{b}$$}{o3}              % bbar
\fmflabel{$$\bar{\nu}_{l}$$}{o2}        % nubar
\fmflabel{$$l^{-}$$}{o1}                % l-

\end{fmfchar*}
\end{fmffile}
\end{document}

• Might be a duplicate: see e.g. my answer here. In your case, just add the option label.side=left to \fmf{fermion, label=$$\bar{t}$$}{v3,v1} and \fmf{photon, label=$$W^{+}$$}{v4,v6}. Apr 12, 2016 at 13:22

This solution doesn't use feynmf, but uses a new package called TikZ-Feynman (CTAN).

For this particular diagram, the automatic vertex placement result is unsatisfactory, so I manually specify the placement of vertices relative to other vertices (I may have gotten a little carried away fine-tuning certain distances...). Generally, it is enough to just have left=of (vertex) or above right=of (vertex) but the distances can be fine tuned with above right=(distance) and (distance) of (vertex).

You can specify edge labels with either edge label=... or edge label'=..., depending on which side of the edge you want the label to be.

\documentclass[tikz]{standalone}

\usepackage[compat=1.1.0]{tikz-feynman}

\begin{document}
\begin{tikzpicture}
\begin{feynman}
%% Gluon and top quarks
\vertex (g1) {$$g$$};
\vertex[below right=0.5cm and 2.5cm of g1] (t4);
\vertex[below right=1.5cm and 0.5cm of t4] (t3);
\vertex[below left=1.5cm and 0.5cm of t3] (t2);
\vertex[below left=0.5cm and 2.5cm of t2] (g2) {$$g$$};

\vertex[above right=0.1cm and 1.5cm of t4] (t5);
\vertex[below right=0.1cm and 1.5cm of t2] (t1);

%% Upper shower
\vertex[right=1cm of t5] (f3) {$$b$$};
\vertex[above right=0.5cm and 0.5cm of t5] (W1);
\vertex[above right=0.8cm and 0.1cm of W1] (f1) {$$q$$};
\vertex[above right=0.3cm and 0.8cm of W1] (f2) {$$\overline q'$$};

%% Lower shower
\vertex[right=1cm of t1] (f6) {$$\overline b$$};
\vertex[below right=0.5cm and 0.5cm of t1] (W2);
\vertex[below right=0.8cm and 0.1cm of W2] (f7) {$$\overline \nu_{\ell}$$};
\vertex[below right=0.3cm and 0.8cm of W2] (f8) {$$\ell$$};

%% Higgs
\vertex[right=1.5cm of t3] (H);
\vertex[above right=0.5cm and 1cm of H] (f4) {$$b$$};
\vertex[below right=0.5cm and 1cm of H] (f5) {$$\overline b$$};

\diagram* {
(g1) -- [gluon] (t4),
(g2) -- [gluon] (t2),
{[edges=fermion]
(f6) -- (t1)
-- [edge label=$$\overline t$$] (t2)
-- [edge label=$$t$$] (t3)
-- [edge label=$$\overline t$$] (t4)
-- [edge label=$$t$$] (t5)
-- (f3),
(f7) -- (W2) -- (f8),
(f2) -- (W1) -- (f1),
(f5) -- (H) -- (f4),
},
(t3) -- [scalar, edge label=$$H^{0}$$] (H),
(t1) -- [boson, edge label'=$$W^{-}$$] (W2),
(t5) -- [boson, edge label=$$W^{+}$$] (W1),
};
\end{feynman}
\end{tikzpicture}
\end{document}

• Wow, this looks like an great package. Thanks muchly for the solution -- and thanks for writing TikZ-Feynman!
– d3pd
Apr 13, 2016 at 14:17