1

I have a hard time aligning diagrams in equations where everything fits on the same line:

enter image description here

As you can see the + is not aligned with the external lines. Here is the code

% !TeX program = xelatex
\documentclass{standalone}

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

\begin{document} \setlength{\unitlength}{1cm}

\begin{eqnarray} \begin{fmffile}{psi-phi} \begin{fmfgraph}(4,3)% units are now in cm \fmfleft{i} \fmfright{o} \fmflabel{$\phi$}{i} \fmf{fermion}{i,v} \fmf{dashes}{v,v} \fmf{fermion}{v,o} \fmfdot{v} \end{fmfgraph} \end{fmffile} &\quad + \quad& \begin{fmffile}{phi-psi} \begin{fmfgraph}(4,3)% units are now in cm \fmfleft{i} \fmfright{o} \fmflabel{$\phi$}{i} \fmf{dashes}{i,v} \fmf{fermion}{v,v} \fmf{dashes}{v,o} \fmfdot{v} \end{fmfgraph} \end{fmffile} \end{eqnarray}

\end{document}

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

M91
  • 45
  • Please make the code as complete as necessary to a) compile and b) show your problem. Hardly anybody is going to do the guesswork about your document. – MS-SPO Nov 27 '22 at 16:34
  • 1
    The is my first post in a long time. I have edited the code so it can be used right away. Hope this helps – M91 Nov 27 '22 at 16:50
  • 1
    As for my last edit: The OP accidentially edited their post by replacing the original code with that of another question. I was asked to undo this last edit by the OP. – Jasper Habicht Mar 09 '23 at 14:58
  • You should use \documentclass[12pt,a4paper]{article} instead of \documentclass{standalone} for this MWE, because standalone does not provide the eqnarray environment as far as I know. – Jasper Habicht Mar 09 '23 at 15:01

1 Answers1

3

To align two graphs I have used before \parbox{40mm} and after \parbox{30mm}. Here there is the result.

enter image description here

\documentclass[12pt,a4paper]{article}

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

\begin{document} \setlength{\unitlength}{1cm}

\begin{eqnarray} \begin{fmffile}{psi-phi} \parbox{40mm}{\begin{fmfgraph}(4,3)% units are now in cm \fmfleft{i} \fmfright{o} \fmflabel{$\phi$}{i} \fmf{fermion}{i,v} \fmf{dashes}{v,v} \fmf{fermion}{v,o} \fmfdot{v} \end{fmfgraph}} \end{fmffile} &\quad + \quad& \begin{fmffile}{phi-psi} \parbox{30mm}{\begin{fmfgraph}(4,3)% units are now in cm \fmfleft{i} \fmfright{o} \fmflabel{$\phi$}{i} \fmf{dashes}{i,v} \fmf{fermion}{v,v} \fmf{dashes}{v,o} \fmfdot{v} \end{fmfgraph}} \end{fmffile} \end{eqnarray}
\end{document}

Sebastiano
  • 54,118