This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| latex:feynman_equation_file [2017/12/07 16:40] – iwn | latex:feynman_equation_file [2023/02/04 15:46] (current) – iwn | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | This file show how you can typset a text with Feynman diagrams in equations. | + | This file show how you can typset a text with Feynman diagrams in equations. |
| - | {{ latex: | + | {{ latex:feynman: |
| <code latex feynman_equations.tex> | <code latex feynman_equations.tex> | ||
| + | % !TEX program = pdflatexmk | ||
| + | % !TEX parameter = -shell-escape | ||
| % Author: Izaak Neutelings (July 2017) | % Author: Izaak Neutelings (July 2017) | ||
| - | + | \documentclass[a4paper,12pt]{article} | |
| - | \documentclass[10pt,a4paper]{article} | + | |
| \usepackage[margin=2.4cm]{geometry} % margins | \usepackage[margin=2.4cm]{geometry} % margins | ||
| \usepackage{amsmath} | \usepackage{amsmath} | ||
| \usepackage{graphicx} | \usepackage{graphicx} | ||
| - | \usepackage{feynmp} | + | \usepackage{feynmp-auto} |
| - | + | ||
| - | % macro to compile Feynman graphs without extra scripts | + | |
| - | \DeclareGraphicsRule{*}{mps}{*}{} | + | |
| - | \makeatletter | + | |
| - | \def\endfmffile{ | + | |
| - | \fmfcmd{\p@rcent\space the end.^^J end.^^J endinput; | + | |
| - | \if@fmfio | + | |
| - | \immediate\closeout\@outfmf | + | |
| - | \fi | + | |
| - | %\ifnum\pdfshellescape=\@ne | + | |
| - | \ifnum\pdfshellescape> | + | |
| - | \immediate\write18{mpost \thefmffile} | + | |
| - | \fi} | + | |
| - | \makeatother | + | |
| \begin{document} | \begin{document} | ||
| - | |||
| - | |||
| \section{Typesetting equations with Feynman diagrams} | \section{Typesetting equations with Feynman diagrams} | ||
| Line 150: | Line 135: | ||
| Another tip: use \verb|\\[10pt]| instead of just \verb|\\| at the end of a line in the \verb|aligned| environment to add extra vertical white space between two lines of equations. | Another tip: use \verb|\\[10pt]| instead of just \verb|\\| at the end of a line in the \verb|aligned| environment to add extra vertical white space between two lines of equations. | ||
| - | |||
| \end{document} | \end{document} | ||
| </ | </ | ||