我有一篇论文,其中我的费曼图可以正常工作,但是当我将其传输到 Beamer .tex 文件时,它给出了以下错误:
**LaTeX Error: Can not include graphics of type: mps.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.xxx \end{frame}**
我使用的代码如下:
\documentclass[10pt]{beamer}
\usetheme[progressbar=frametitle]{metropolis}
\usepackage{booktabs}
\usepackage[scale=2]{ccicons}
\usepackage{verbatim} %comment environment
\usepackage{amsmath}
\usepackage{feynmp}
\usepackage{graphicx}
\DeclareGraphicsRule{*}{mps}{*}{}
\usepackage{textcase}
\usepackage{placeins}
\usepackage[customcolors]{hf-tikz}
\usepackage{pgfplots}
\usepgfplotslibrary{dateplot}
\newcommand\scalemath[2]{\scalebox{#1}{\mbox{\ensuremath{\displaystyle #2}}}}
\usepackage{xspace}
\newcommand{\themename}{\textbf{\textsc{metropolis}}\xspace}
\title{Tetraquarks}
\subtitle{SU(3) symmetry breaking}
\date{\today}
\author{A}
\institute{UB}
\titlegraphic{\hfill\includegraphics[height=2cm]{UB.png}}
\begin{document}
\maketitle
\begin{frame}{QQ Interaction}
\begin{equation*}
\hspace{-3mm}i\mu =\bar v\left(p_2,\sigma_2\right)\gamma^{\mu}v(q_2,\tau_2) ig(\Lambda)(T^{\gamma})_{jl}\Big(\frac{-ig\mu\Lambda}{k^2}\Big)(T^{\alpha})_{ki}ig(\Lambda)\bar u\left(q_1,\sigma_1\right)\gamma^{\Lambda}u(p_1,\sigma_1)
\end{equation*}
\begin{figure}[H]
\begin{center}
\begin{fmffile}{simple_labels}
\begin{fmfgraph*}(140,80)
\fmfleft{i1,i2}
\fmfright{o1,o2}
\fmflabel{$p_1,\sigma_1,i$}{i1}
\fmflabel{$q_1,\tau_1,k$}{i2}
\fmflabel{$p_2,\sigma_2,j$}{o1}
\fmflabel{$q_2,\tau_2,l$}{o2}
\fmflabel{$\gamma$}{v1}
\fmflabel{$\alpha$}{v2}
\fmf{fermion}{i1,v2,i2}
\fmf{fermion}{o2,v1,o1}
\fmf{gluon,label=$(T_{\alpha ' \alpha}^{a})(T_{\gamma \gamma '}^{a})$}{v1,v2}
\end{fmfgraph*}
\end{fmffile}
\end{center}
\caption{Feynman diagram for the quark-quark interaction.}
\end{figure}
\begin{equation*}
(T_a)^{\alpha}_{\alpha '}(T_a)^{\gamma '}_{\gamma}=\frac{1}{2}({\delta}^{\gamma '}_{\alpha '}{\delta}^{\alpha}_{\gamma}-\frac{1}{N_c}{\delta}^{\alpha}_{\alpha '}{\delta}^{\gamma '}_{\gamma})
\end{equation*}
\end{frame}
\end{document}
我希望有人能给我一个建议。
提前致谢。
答案1
我建议使用feynmp-auto
,这样 Metapost 就会自动运行和问题.mps
解决了。请注意fragile
带图的框架选项。
\documentclass[10pt]{beamer}
\usetheme[progressbar=frametitle]{metropolis}
\usepackage{booktabs}
\usepackage[scale=2]{ccicons}
\usepackage{verbatim} %comment environment
\usepackage{amsmath}
\usepackage{feynmp-auto}
\usepackage{graphicx}
\usepackage{textcase}
\usepackage{placeins}
\usepackage[customcolors]{hf-tikz}
\usepackage{pgfplots}
\usepgfplotslibrary{dateplot}
\newcommand\scalemath[2]{\scalebox{#1}{\mbox{\ensuremath{\displaystyle #2}}}}
\usepackage{xspace}
\newcommand{\themename}{\textbf{\textsc{metropolis}}\xspace}
\title{Tetraquarks}
\subtitle{SU(3) symmetry breaking}
\date{\today}
\author{A}
\institute{UB}
%\titlegraphic{\hfill\includegraphics[height=2cm]{UB.png}} % I haven't it
\begin{document}
\maketitle
\begin{frame}[fragile]
\frametitle{QQ Interaction}
\begin{equation*}
\hspace{-3mm}
i\mu =\bar v(p_2,\sigma_2\gamma^{\mu}v(q_2,\tau_2)
ig(\Lambda)(T^{\gamma})_{jl}\left(\frac{-ig\mu\Lambda}{k^2}\right)
(T^{\alpha})_{ki}ig(\Lambda)\bar u(q_1,\sigma_1)\gamma^{\Lambda}u(p_1,\sigma_1)
\end{equation*}
\begin{figure}
\centering
\begin{fmffile}{simple_labels}
\begin{fmfgraph*}(140,80)
\fmfleft{i1,i2}
\fmfright{o1,o2}
\fmflabel{$p_1,\sigma_1,i$}{i1}
\fmflabel{$q_1,\tau_1,k$}{i2}
\fmflabel{$p_2,\sigma_2,j$}{o1}
\fmflabel{$q_2,\tau_2,l$}{o2}
\fmflabel{$\gamma$}{v1}
\fmflabel{$\alpha$}{v2}
\fmf{fermion}{i1,v2,i2}
\fmf{fermion}{o2,v1,o1}
\fmf{gluon,label=$(T_{\alpha ' \alpha}^{a})(T_{\gamma \gamma '}^{a})$}{v1,v2}
\end{fmfgraph*}
\end{fmffile}
\bigskip
\caption{Feynman diagram for the quark-quark interaction.}
\end{figure}
\begin{equation*}
(T_a)^{\alpha}_{\alpha '}(T_a)^{\gamma '}_{\gamma}=
\frac{1}{2}({\delta}^{\gamma '}_{\alpha '}{\delta}^{\alpha}_{\gamma}-
\frac{1}{N_c}{\delta}^{\alpha}_{\alpha '}{\delta}^{\gamma '}_{\gamma})
\end{equation*}
\end{frame}
\end{document}
答案2
作为替代方案,有一个名为的新包钛钾费曼(加拿大运输安全局) 在 Beamer 演示文稿中运行良好。它还支持动量箭头,这对你的情况可能很有用(但与此同时,太多的信息会使图表看起来很混乱)。
无论如何,我已经调整了你给出的示例以使用 Ti钾Z-Feynman 并展示如何使用动量箭头。当然请注意,这在 Beamer 中完美运行,无需脆弱框架。
\documentclass[10pt]{beamer}
\usetheme[progressbar=frametitle]{metropolis}
\usepackage{amsmath}
\newcommand\scalemath[2]{\scalebox{#1}{\mbox{\ensuremath{\displaystyle #2}}}}
\usepackage{xspace}
\usepackage[compat=1.1.0]{tikz-feynman}
\newcommand{\themename}{\textbf{\textsc{metropolis}}\xspace}
\begin{document}
\begin{frame}{QQ Interaction}
\begin{figure}[H]
\centering
\feynmandiagram [horizontal=a to b] {
i1 [particle={\(\sigma_{1}, i\)}]
-- [fermion, momentum=\(p_{1}\)] a
-- [fermion, rmomentum=\(q_{1}\)] i2 [particle={\(\tau_{1}, k\)}],
a [label=180:\(\alpha\)] -- [gluon] b [label=0:\(\gamma\)],
f1 [particle={\(\sigma_{2}, j\)}]
-- [fermion, rmomentum'=\(p_{2}\)] b
-- [fermion, momentum'=\(q_{2}\)] f2 [particle={\(\tau_{2}, l\)}],
};
\end{figure}
\begin{figure}[H]
\centering
\feynmandiagram [horizontal=a to b] {
i1 [particle={\(p_{1}, \sigma_{1}, i\)}]
-- [fermion] a
-- [fermion] i2 [particle={\(q_{1}, \tau_{1}, k\)}],
a [label=180:\(\alpha\)]
-- [gluon, edge label=\(T^{a}_{\alpha'\alpha} \quad T^{a}_{\gamma\gamma'}\)]
b [label=0:\(\gamma\)],
f1 [particle={\(p_{2}, \sigma_{2}, j\)}]
-- [fermion] b
-- [fermion] f2 [particle={\(q_{2}, \tau_{2}, l\)}],
};
\end{figure}
\end{frame}
\end{document}