0

When compiling the following:

% !TeX program = xelatex
\documentclass{standalone}

\usepackage[force]{feynmp-auto} \DeclareGraphicsRule{}{mps}{}{} % for being able to read the produced file

\begin{document}

\begin{equation} \begin{fmffile}{phi-phi} \begin{fmfgraph}(4,3)% units are now in cm % \fmfpen{thick} \fmfleft{i} \fmfright{o} \fmflabel{$x$}{i} \fmflabel{$y$}{v} \fmflabel{$z$}{o} \fmf{plain}{i,v,v,o} \fmfdot{v} \end{fmfgraph} \end{fmffile} \end{equation} \begin{equation} \begin{fmffile}{psi-psi} \begin{fmfgraph}(4,3)% units are now in cm % \fmfpen{thick} \fmfleft{i} \fmfright{o} \fmflabel{$x$}{i} \fmflabel{$y$}{v} \fmflabel{$z$}{o} \fmf{dashes}{i,v,v,o} \fmfdot{v} \end{fmfgraph} \end{fmffile} \end{equation}

\end{document}

I get the output:

enter image description here

What is going wrong?

I'm compiling with XelateX. Also, I am not interested in solutions that are based on tikz-feynman.

M91
  • 45
  • 1
    Sorry, but your MWE does not compile for me. Maybe some packages are missing? – Jasper Habicht Mar 09 '23 at 14:39
  • I accidentally updated the code in an older post of mine: link. Is it possible to undo this? – M91 Mar 09 '23 at 14:55
  • I rolled back your edits of the other post. Please check – Jasper Habicht Mar 09 '23 at 14:57
  • Rewrite your MWE, this one doesn`t works... – Jimeens Mar 09 '23 at 14:59
  • Thanks! Should I update this code with all my packages now? – M91 Mar 09 '23 at 14:59
  • It would be nice if you could provide a code snippet that is compilable and shows the problem you are facing. You don't need to put all the packages you use. Only put those which are necessary for compilation of this code snippet (see my answer how such a code snippet could look like). – Jasper Habicht Mar 09 '23 at 15:03
  • Apart from the Feynman package, there isn't really another package (relevant to this problem). Thanks anyways, it seems this is going to take time. – M91 Mar 09 '23 at 15:22
  • 1
    @M91 You can't use equation* without loading e.g. the amsmath package. Also standalone will cause troubles because it does not have a fixed width. Please test your code before posting to make sure there aren't any errors in it. – samcarter_is_at_topanswers.xyz Mar 09 '23 at 15:32

1 Answers1

3

I am not sure what you are really doing, since your MWE does not produce the output you show. Maybe what is going wrong is that somehow in your code the \unitlength is being reset or overwritten. The following compiles just fine with both pictures having the same size:

% !TeX program = xelatex
\documentclass{article}
\usepackage{amsmath}

\usepackage[force]{feynmp-auto} \DeclareGraphicsRule{}{mps}{}{} % for being able to read the produced file

\begin{document}

\setlength{\unitlength}{1cm}

\begin{equation} \begin{fmffile}{phi-phi} \begin{fmfgraph}(4,3)% units are now in cm % \fmfpen{thick} \fmfleft{i} \fmfright{o} \fmflabel{$x$}{i} \fmflabel{$y$}{v} \fmflabel{$z$}{o} \fmf{plain}{i,v,v,o} \fmfdot{v} \end{fmfgraph} \end{fmffile} \end{equation} \begin{equation} \begin{fmffile}{psi-psi} \begin{fmfgraph}(4,3)% units are now in cm % \fmfpen{thick} \fmfleft{i} \fmfright{o} \fmflabel{$x$}{i} \fmflabel{$y$}{v} \fmflabel{$z$}{o} \fmf{dashes}{i,v,v,o} \fmfdot{v} \end{fmfgraph} \end{fmffile} \end{equation}

\end{document}

enter image description here

  • 1
    I forgot to -shell-escape (https://tex.stackexchange.com/questions/99475/how-to-invoke-latex-with-the-shell-escape-flag-in-texstudio-former-texmakerx). Thanks again – M91 Mar 10 '23 at 18:45