我正在嘗試使用 feynmf 套件創建費曼圖。我的最小例子是
\documentclass{article}
\usepackage{feynmf}
\begin{document}
\begin{fmffile}{diagram}
\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}
\end{document}
編譯一次後,我有了圖表,但沒有標籤(正如預期的那樣,我猜...)。我收到錯誤
pdflatex> feynmf: Label file diagram.t1 not found:
pdflatex> feynmf: Process diagram.mf with METAFONT and then reprocess this file.
好的,所以我按照指示進行,並嘗試在我的終端機(使用 Xubuntu)中使用 Metafont 處理 .mf 文件
mpost diagram.mf
然後我就陷入困境了。它開始然後以問號停止,我不知道如何繼續或 Metapost 試圖告訴我什麼:
This is MetaPost, version 1.803 (kpathsea version 6.1.1)
(mpost.mp (/usr/share/texlive/texmf-dist/metapost/base/plain.mp
Preloading the plain mem file, version 1.004) ) (./diagram.mf
(/usr/share/texmf/metafont/feynmf/feynmf.mf
>> mode_setup
! Isolated expression.
<to be read again>
;
l.117 mode_setup;
?
有人可以幫忙嗎?我如何獲得我的標籤?多謝!
答案1
呼叫的程式不是Metapost,而是Metafont:
mf diagram.mf
但是,最好使用feynmp
具有相同語法並產生 Metapost 檔案的檔案:您將獲得diagram.mp
並運行mpost diagram.mp
即可。
還有另一種可能:
\documentclass{article}
\usepackage{feynmp-auto} % or \usepackage{feynmp}
\begin{document}
\begin{fmffile}{diagram}
\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}
\end{document}
該套件feynmp-auto
(我是其作者)甚至避免了手動運行的需要mpost
:該圖在運行結束時編譯(pdflatex
僅當源已在當前 LaTeX 運行中被修改時),並將其正確放置在下一次運行 LaTeX。