请问有什么线索吗?
以下 MWE 无法编译。行小页面所用环境似乎是罪魁祸首。忽略这一点,编译就可以了。
\documentclass{beamer}
\usepackage{catoptions}
\usepackage[shellescape,latex, everymp=input metaobj; input boxes;
input rboxes; input latexmp;]{gmp}
\usempxclass{article}
\usetheme{Montpellier} \title{Something} \date{\today}
\begin{document}
\frame{\titlepage}
\begin{frame} \frametitle{Frame 1} \begin{figure}
\begin{mpost}[name=networkA]
numeric d; d:= 100;
boxit.mx(btex M U X etex rotated -90);
mx.c = origin;
drawboxed(mx);
boxit.dmx("DMX"); dmx.dy=.2d; dmx.c = mx.e + (d,0); drawboxed(dmx);
drawarrow mx.e--dmx.w;
circleit.tx("Tx"); circleit.rx("Rx");
tx.c = mx.c -.5d*dir(0) +.2d*dir(90); drawboxed(tx);
rx.c = dmx.c +.5d*dir(0) +.2d*dir(90); drawboxed(rx);
\end{mpost} \centering\usempost{networkA} \end{figure} \end{frame}
\begin{frame} \frametitle{Frame 2} \begin{figure}
\begin{mpost}[name=networkB]
numeric d; d:= 100;
boxit.mx(\btex \begin{minipage}[t]{1em}M U X\end{minipage} etex); mx.c
= origin; drawboxed(mx);
boxit.dmx("DMX"); dmx.dy=.2d; dmx.c = mx.e + (d,0); drawboxed(dmx);
drawarrow mx.e--dmx.w;
circleit.tx("Tx"); circleit.rx("Rx");
tx.c = mx.c -.5d*dir(0) +.2d*dir(90); drawboxed(tx);
rx.c = dmx.c +.5d*dir(0) +.2d*dir(90); drawboxed(rx);
\end{mpost} \centering\usempost{networkB} \end{figure} \end{frame}
\end{document}
答案1
解决方法很简单:
boxit.mx(\btex {\begin{minipage}[t]{1em}M U X\end{minipage}} etex);
文档告诉我们,当mpost
用作命令的参数时,环境周围的括号是必要的,而 总是如此beamer
。