Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to draw a simple single vertex Feynaman Diagram, like the one shown next

enter image description here

I've tried using feynmp package but I am not able to reproduce it.

My code is

\documentclass{article}
\usepackage{feynmp}
\DeclareGraphicsRule{.1}{mps}{.1}{}
\makeatletter
\def\endfmffile{%
  \fmfcmd{\p@rcent\space the end.^^J%
          end.^^J%
          endinput;}%
  \if@fmfio
    \immediate\closeout\@outfmf
  \fi
  \ifnum\pdfshellescape=\@ne
    \immediate\write18{mpost \thefmffile}%
  \fi}
\makeatother
\begin{document}
        \begin{fmffile}{DistributionScattering}
                \fmfframe(1,7)(1,7){
                        \begin{fmfgraph}(40,25)
                                \fmfleft{i1}
                                \fmfright{o1}
                                \fmf{fermion}{i1,v1}
                                \fmf{fermion}{v1,o1}
                                \fmfblob{.15w}{v2}
                                \fmf{photon}{v1,v2}
                        \end{fmfgraph}
                }
        \end{fmffile}
\end{document}

My output is

enter image description here

How to reproduce the first diagram?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

You need to define an external vertex also for the blob, with something like \fmfbottom{b}.

Using feynmp-auto you can avoid running metapost. Run pdflatex twice.

\documentclass{article}
\usepackage{feynmp-auto}
\unitlength=1mm
\begin{document}
\begin{fmffile}{DistributionScattering}
  \begin{fmfgraph*}(40,25)
    % Define two vertices on the left, but only `i2' will be actually used.
    \fmfleft{i1,i2}
    % The same on the right.
    \fmfright{o1,o2}
    % Define the vertex for the blob.
    \fmfbottom{b}
    \fmf{fermion,label=\(k_{\textup{i}}\),label.side=left}{i2,v1}
    \fmf{fermion,label=\(k_{\textup{f}}\),label.side=left}{v1,o2}
    \fmf{photon}{v1,b} \fmfblob{.15w}{b}
    % Labels on vertices.
    \fmflabel{e\(^{-}\)}{i2} \fmflabel{e\(^{-}\)}{o2}
  \end{fmfgraph*}
\end{fmffile}
\end{document}

This is the result:

You need to define two vertices on both sides because the diagram would be too flat otherwise. With this code

\begin{fmffile}{DistributionScattering}
  \begin{fmfgraph*}(40,25)
    \fmfleft{i2}
    \fmfright{o2}
    \fmfbottom{b}
    \fmf{fermion,label=\(k_{\textup{i}}\),label.side=left}{i2,v1}
    \fmf{fermion,label=\(k_{\textup{f}}\),label.side=left}{v1,o2}
    \fmf{photon}{v1,b}
    \fmfblob{.15w}{b}
    \fmflabel{e\(^{-}\)}{i2}
    \fmflabel{e\(^{-}\)}{o2}
  \end{fmfgraph*}
\end{fmffile}

the result would be

This example should help you understand why it's better using dummy vertices on both sides:

\begin{fmffile}{DistributionScattering}
  \begin{fmfgraph*}(40,25)
    \fmfleft{i1,i2}
    \fmfright{o1,o2}
    \fmfbottom{b}
    \fmf{fermion}{i2,v1,o2}
    \fmf{photon}{v1,b}
    \fmflabel{i1}{i1}
    \fmflabel{i2}{i2}
    \fmflabel{o1}{o1}
    \fmflabel{o2}{o2}
    \fmflabel{b}{b}
  \end{fmfgraph*}
\end{fmffile}

share|improve this answer
    
Thank you very much for your help! Not have you made the plot, but you showed the feynmp-auto package! I don't have to run metapost or metafont anymore! Thank's a lot!!! –  Thanos Jun 29 '13 at 11:55
    
@Thanos I expanded the answer, now it should be clearer. –  giordano Jun 29 '13 at 12:46

It's of course also always possible to use TikZ. In lack of a better reason, then just for the fun in it ;-)

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{patterns}

\begin{document}

\begin{tikzpicture}[decoration={
    markings,
    mark=at position 0.5 with {\arrow{>}}}
    ] 

\path[pattern=north east lines] plot[smooth] coordinates{(0,1) (.7,.5) (.9,-.6) (0,-.5) (-.8,-.8) (-.5,.8) (0,1)}; % External source

\draw[draw=white,double=red,very thick,decorate,decoration=snake]  (0,0) -- (0,2) node[right,pos=0.7,red] {$\gamma$}; % Photon

\draw[thick,postaction={decorate}]  (-2,3) node[left] {$e^-$} -- (0,2) node[above,pos=0.5] {$k_i$}; % Electron
\draw[thick,postaction={decorate}]  (0,2) -- (2,3) node[right] {$e^-$} node[above,pos=0.5] {$k_f$};

\end{tikzpicture}

\end{document}

Feynman diagram

share|improve this answer
    
TikZ is a great tool, but for Feynman diagrams you have to manually set all coordinates. Instead I find feynmp syntax very handy, you say left, right, bottom and it does all the work for you. I think a package based on TikZ but with a feynmp-like syntax would be awesome. –  giordano Jun 29 '13 at 12:51
1  
@giordano I agree that feynmp is probably the best way to go, if you have to typeset many feynman diagrams. But I would like to draw your attention to a great answer by Jake Package for typesetting Feynman diagrams (efficiency of feynmp and tikz), which is quite nice if you're willing to use lualatex. My answer here, however, was just because I were bored :-) –  Ipsen Jun 29 '13 at 14:23
    
thanks for the reference, that syntax is really nice! –  giordano Jun 29 '13 at 14:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.