1

I am trying to draw a Feynman diagram by the feynmp package and LaTeXiT. But shifted vpaths are cropped in the generated image as shown in the attached. This example was working OK with my previous Mac environment, but I do not have an access to it at the moment.

Why are they cropped? How can I fix it?

The same cropping also appears when only normal LaTeX commands are used in the terminal.

$ latex latexit-1.tex
$ mpost feyngraph
$ latex latexit-1.tex
$ dvipdfm latexit-1.dvi
\documentclass[10pt]{article}
\usepackage[usenames]{color} %used for font color
\usepackage{amssymb} %maths
\usepackage{amsmath} %maths
\usepackage[utf8]{inputenc} %useful to type directly diacritic characters
\usepackage{feynmp}

\pagestyle{empty} \begin{document}\begin{fmffile}{feyngraph}
  \begin{fmfgraph}(120,80)
    \fmfset{arrow_len}{10}
    \fmfstraight
    \fmfleft{i3,i1}
    \fmfright{o3,o2,o1}
    % fermions
    \fmf{phantom}{i1,v1,o1}
    \fmf{fermion,tension=0}{o2,v1,o1}
    % boson
    \fmf{boson}{v1,v3}
    % neutron
    \fmf{phantom}{i3,v3,o3}
    \fmffreeze
    \fmfi{fermion}{vpath (__i3,__v3) shifted ( 0, 0)}
    \fmfi{fermion}{vpath (__v3,__o3) shifted ( 0, 0)}
    \fmfi{fermion}{vpath (__i3,__v3) shifted ( 0,-8)}
    \fmfi{fermion}{vpath (__v3,__o3) shifted ( 0,-8)}
    \fmfi{fermion}{vpath (__i3,__v3) shifted ( 0,-16)}
    \fmfi{fermion}{vpath (__v3,__o3) shifted ( 0,-16)}
  \end{fmfgraph}
\end{fmffile}

\end{document}

Generated Feynman Diagram

enter image description here

$ mpost --version
MetaPost 2.00 (TeX Live 2019) (kpathsea version 6.3.1)
$ /Library/TeX/texbin/latex --version
pdfTeX 3.14159265-2.6-1.40.20 (TeX Live 2019)
$ dvipdfm --version
This is xdvipdfmx Version 20190225 by the DVIPDFMx project team,

Updated

Suggestion by @egreg showed a different result on my Mac. With fmfframe

2 Answers 2

2

The manual warns that the diagram might overshoot the bounding box assigned from Metapost.

For this case you can use \fmfframe around the diagram, that allows to increase or decrease the bounding box (see the manual for details).

In the code below I also added \fbox around the whole construction so to be able to see when the bounding box is right.

\documentclass[10pt]{article}
\usepackage[usenames]{color} %used for font color
\usepackage{amssymb} %maths
\usepackage{amsmath} %maths
\usepackage[utf8]{inputenc} %useful to type directly diacritic characters
\usepackage{feynmp}

\pagestyle{empty}
\begin{document}
\begin{fmffile}{\jobname1}
  \fbox{\fmfframe(0,0)(0,20){\begin{fmfgraph}(120,80)
    \fmfset{arrow_len}{10}
    \fmfstraight
    \fmfleft{i3,i1}
    \fmfright{o3,o2,o1}
    % fermions
    \fmf{phantom}{i1,v1,o1}
    \fmf{fermion,tension=0}{o2,v1,o1}
    % boson
    \fmf{boson}{v1,v3}
    % neutron
    \fmf{phantom}{i3,v3,o3}
    \fmffreeze
    \fmfi{fermion}{vpath (__i3,__v3) shifted ( 0, 0)}
    \fmfi{fermion}{vpath (__v3,__o3) shifted ( 0, 0)}
    \fmfi{fermion}{vpath (__i3,__v3) shifted ( 0,-8)}
    \fmfi{fermion}{vpath (__v3,__o3) shifted ( 0,-8)}
    \fmfi{fermion}{vpath (__i3,__v3) shifted ( 0,-16)}
    \fmfi{fermion}{vpath (__v3,__o3) shifted ( 0,-16)}
  \end{fmfgraph}}}
\end{fmffile}

\end{document}

enter image description here

Below you can see the result with \fbox but without \fmfframe, which shows that the bounding box is not computed correctly, because of the vertical shifts.

enter image description here

2
  • Thank you, but the output I got is different from yours. I added my results in the original post. Jul 11, 2020 at 23:23
  • I added an answer myself based on the accepted answer for another post, which is also answered by you. Thank you! Jul 12, 2020 at 1:30
0

After more Googling, I found a post on a similar issue in XeLaTeX.

Feynman diagrams with feynmf/feynmp - edges of diagram cropped off?

The solution is to put \DeclareGraphicsRule{*}{mps}{*}{} and compile it with pdflatex instead of latex + dvipdf(m).

enter image description here enter image description here

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.