User Tools

Site Tools


latex:feynman_file

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
latex:feynman_file [2023/02/04 16:35] iwnlatex:feynman_file [2023/02/04 16:41] iwn
Line 34: Line 34:
  
 \begin{figure}[h] \begin{figure}[h]
-  \vspace{10mm} +\vspace{10mm} 
-  \centering +\centering 
-  \begin{fmffile}{feynman-compton}+\begin{fmffile}{feynman-compton}
   \begin{fmfgraph*}(150,100)   \begin{fmfgraph*}(150,100)
     \fmfleft{i1,i2}     \fmfleft{i1,i2}
- \fmfright{o1,o2} +    \fmfright{o1,o2} 
- \fmflabel{$\gamma$}{i2} +    \fmflabel{$\gamma$}{i2} 
- \fmflabel{$e^-$}{i1} +    \fmflabel{$e^-$}{i1} 
- \fmflabel{$\gamma$}{o1} +    \fmflabel{$\gamma$}{o1} 
- \fmflabel{$e^-$}{o2} +    \fmflabel{$e^-$}{o2} 
- \fmf{photon}{i2,v2} +    \fmf{photon}{i2,v2} 
- \fmf{fermion}{i1,v1,v2,o2} +    \fmf{fermion}{i1,v1,v2,o2} 
- \fmf{photon}{v1,o1}+    \fmf{photon}{v1,o1}
   \end{fmfgraph*}   \end{fmfgraph*}
-  \end{fmffile} +\end{fmffile} 
-  \vspace{5mm} +\vspace{5mm} 
-  \caption{Feynman diagram for Compton scattering} %\label{compton}+\caption{Feynman diagram for Compton scattering} %\label{compton}
 \end{figure} \end{figure}
  
Line 73: Line 73:
 \fmfframe(0,15)(0,15){ % padding (LTRB) \fmfframe(0,15)(0,15){ % padding (LTRB)
 \begin{fmffile}{feynman-compton} \begin{fmffile}{feynman-compton}
-\begin{fmfgraph*}(150,100+  \begin{fmfgraph*}(110,80
-  \fmfleft{i1,i2} +    \fmfleft{i1,i2} 
- \fmfright{o1,o2} +    \fmfright{o1,o2} 
- \fmflabel{$\gamma$}{i2} +    \fmflabel{$\gamma$}{i2} 
- \fmflabel{$e^-$}{i1} +    \fmflabel{$e^-$}{i1} 
- \fmflabel{$\gamma$}{o1} +    \fmflabel{$\gamma$}{o1} 
- \fmflabel{$e^-$}{o2} +    \fmflabel{$e^-$}{o2} 
- \fmf{photon}{i2,v2} +    \fmf{photon}{i2,v2} 
- \fmf{fermion}{i1,v1,v2,o2} +    \fmf{fermion}{i1,v1,v2,o2} 
- \fmf{photon}{v1,o1} +    \fmf{photon}{v1,o1} 
-\end{fmfgraph*}+  \end{fmfgraph*}
 \end{fmffile} \end{fmffile}
 } }
Line 127: Line 127:
 Simply include the macro in the preamble. (Tested only in TeXShop on a Mac.) Simply include the macro in the preamble. (Tested only in TeXShop on a Mac.)
  
-<code latex feynman_script.tex>+<code latex feynman_macro.tex>
 % !TEX program = pdflatexmk % !TEX program = pdflatexmk
 % !TEX parameter = -shell-escape % !TEX parameter = -shell-escape
Line 157: Line 157:
  
 \begin{figure}[h] \begin{figure}[h]
-  \vspace{10mm} +\vspace{10mm} 
-  \centering +\centering 
-  \begin{fmffile}{feynman-compton}+\begin{fmffile}{feynman-compton}
   \begin{fmfgraph*}(150,100)   \begin{fmfgraph*}(150,100)
     \fmfleft{i1,i2}     \fmfleft{i1,i2}
- \fmfright{o1,o2} +    \fmfright{o1,o2} 
- \fmflabel{$\gamma$}{i2} +    \fmflabel{$\gamma$}{i2} 
- \fmflabel{$e^-$}{i1} +    \fmflabel{$e^-$}{i1} 
- \fmflabel{$\gamma$}{o1} +    \fmflabel{$\gamma$}{o1} 
- \fmflabel{$e^-$}{o2} +    \fmflabel{$e^-$}{o2} 
- \fmf{photon}{i2,v2} +    \fmf{photon}{i2,v2} 
- \fmf{fermion}{i1,v1,v2,o2} +    \fmf{fermion}{i1,v1,v2,o2} 
- \fmf{photon}{v1,o1}+    \fmf{photon}{v1,o1}
   \end{fmfgraph*}   \end{fmfgraph*}
-  \end{fmffile} +\end{fmffile} 
-  \vspace{5mm} +\vspace{5mm} 
-  \caption{Feynman diagram for Compton scattering} %\label{compton}+\caption{Feynman diagram for Compton scattering} %\label{compton}
 \end{figure} \end{figure}
  
latex/feynman_file.txt · Last modified: 2023/02/04 16:45 by iwn