2

I like the drawing, and I want answer to this question: Loops in tikz-feynman more circular. I have found, after many attemps, in this link, how to put the momentum. There is this newcommand named \marrow:

\newcommand{\marrow}[5]{%
        \fmfcmd{style_def marrow#1
        expr p = drawarrow subpath (1/4, 3/4) of p shifted 6 #2 withpen pencircle scaled 0.4;
        label.#3(btex #4 etex, point 0.5 of p shifted 6 #2);
        enddef;}
    \fmf{marrow#1,tension=0}{#5}}

that not given to me eulervm font over the momentum. How is it possible to solve the problem?

My MWE:

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amssymb}
\usepackage{feynmp-auto}
\usepackage{eulervm}
\newcommand{\marrow}[5]{%
    \fmfcmd{style_def marrow#1
    expr p = drawarrow subpath (1/4, 3/4) of p shifted 6 #2 withpen pencircle scaled 0.4;
    label.#3(btex #4 etex, point 0.5 of p shifted 6 #2);
    enddef;}
\fmf{marrow#1,tension=0}{#5}}

\begin{document}
\begin{fmffile}
 \begin{fmfgraph*}(100,80)
       \fmfleft{i}
       \fmfright{o}
       \fmflabel{$\mu$}{i}
       \fmflabel{$\nu$}{o}
       \marrow{fi}{up}{top}{$p$}{i,v1}
       \marrow{se}{up}{top}{$p$}{v2,o}
       \fmf{photon,tension=1}{i,v1}
       \fmf{photon,tension=1}{v2,o}
       \fmf{fermion,left,tension=0.4,label=$k$}{v1,v2}
       \fmf{fermion,left,tension=0.4,label=$k-p$}{v2,v1}
\end{fmfgraph*}
\end{fmffile}   
    
\end{document}

h

1
  • @downvoter: is there a particular reason for a downvote? Please, can you explain me?
    – Sebastiano
    Sep 6, 2020 at 11:37

1 Answer 1

3

To get the matching external font, you need to use the feynmp macro LaTeX_text instead of the plain btex .. etex mechanism.

I made this change to your macro:

\newcommand{\marrow}[5]{%
    \fmfcmd{style_def marrow#1
    expr p = drawarrow subpath (1/4, 3/4) of p shifted 6 #2 withpen pencircle scaled 0.4;
    % label.#3(btex #4 etex, point 0.5 of p shifted 6 #2); <- removed
    LaTeX_text(point 0.5 of p shifted 8 #2, #3, "#4");
    enddef;}
\fmf{marrow#1,tension=0}{#5}}

The first argument to LaTeX_text is the point for the label, the second is an angle, the third is the text as a string. So I needed to change the calls to your macro like this:

   \marrow{fi}{up}{90}{$p$}{i,v1}
   \marrow{se}{up}{90}{$p$}{v2,o}

The 90 here means "up", "-90" would be down etc...

I also had to add a missing filename after your fmffile to get it to compile. So I compiled this:

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amssymb}
\usepackage{feynmp-auto}
\usepackage{eulervm}
\newcommand{\marrow}[5]{%
    \fmfcmd{style_def marrow#1
    expr p = drawarrow subpath (1/4, 3/4) of p shifted 6 #2 withpen pencircle scaled 0.4;
    % label.#3(btex #4 etex, point 0.5 of p shifted 6 #2);
    LaTeX_text(point 0.5 of p shifted 8 #2, #3, "#4");
    enddef;}
\fmf{marrow#1,tension=0}{#5}}

\begin{document}
\begin{fmffile}{first}
\begin{fmfgraph*}(100,80)
       \fmfleft{i}
       \fmfright{o}
       \fmflabel{$\mu$}{i}
       \fmflabel{$\nu$}{o}
       \marrow{fi}{up}{90}{$p$}{i,v1}
       \marrow{se}{up}{90}{$p$}{v2,o}
       \fmf{photon,tension=1}{i,v1}
       \fmf{photon,tension=1}{v2,o}
       \fmf{fermion,left,tension=0.4,label=$k$}{v1,v2}
       \fmf{fermion,left,tension=0.4,label=$k-p$}{v2,v1}
\end{fmfgraph*}
\end{fmffile}   
\end{document}

I saved this as seb.tex and compiled it using xelatex seb && mpost first && xelatex seb to get this:

enter image description here

which, I think, is what was wanted.

However, I don't think you really need to go to all the trouble of defining a macro -- you could just add your momentum labels directly to your photons, like this:

\documentclass[border=5mm]{standalone}
\usepackage{amsmath,amssymb}
\usepackage{feynmp-auto}
\usepackage{eulervm}
\begin{document}
\begin{fmffile}{first}
\begin{fmfgraph*}(100,80)
       \fmfleft{i}
       \fmfright{o}
       \fmflabel{$\mu$}{i}
       \fmflabel{$\nu$}{o}
       \fmf{photon,tension=1,label=$\underrightarrow{p}$}{v1,i}
       \fmf{photon,tension=1,label=$\underrightarrow{p}$}{o,v2}
       \fmf{fermion,left,tension=0.4,label=$k$}{v1,v2}
       \fmf{fermion,left,tension=0.4,label=$k-p$}{v2,v1}
\end{fmfgraph*}
\end{fmffile}   
\end{document}

which produces this:

enter image description here

1
  • 😄In the meantime, thank you very much.😄😄About in 2004 I wanted to learn how to use metapost, which if I'm not mistaken 16 years ago there was a blue site with white characters, to make drawings with metagraphs. Then I abandoned my project. I didn't understand the syntax of the macro. Now it's definitely a bit clearer. I wish you all the best too.
    – Sebastiano
    Sep 6, 2020 at 15:15

You must log in to answer this question.

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