我正在编写演示文稿,但在将小页面放入 tikz 演示文稿时遇到了问题。
\begin{frame}[plain]
\begin{tikzpicture}
\useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);
\node (lemma) at (9.5cm,1.2cm) [lemma] {
\begin{minipage}{0.65\textwidth}\scriptsize\\
$\ $\\
\noindent\textbf{Lemma.} This is a lemma
\[Math\]
End of the lemma\\
\end{minipage}
};
\end{tikzpicture}
\end{frame}
我无法编译它。错误是“缺少插入的 \endcsname。\end{frame}”。我不知道这里发生了什么,而且我找不到类似的东西。
编辑我使用这种引理是因为我想放在一个精确的位置。为了做这样的事情: 最小代码:
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath, amssymb, amsthm, amsfonts}
\usepackage{tikz}
\usepackage{tikz-cd}
\usetikzlibrary{shapes.geometric, arrows}
\tikzstyle{lemma} = [rectangle, minimum width=1cm, minimum height=1cm, text centered, draw=black, line width=2pt,fill=black,fill opacity=.45,text opacity=1]
\begin{document}
\begin{frame}[plain]
\begin{tikzpicture}
\useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);
\node (lemma) at (9.5cm,1.2cm) [lemma] {
\begin{minipage}{0.65\textwidth}\scriptsize\\
$\ $\\
\noindent\textbf{Lemma.} This is a lemma
\[Math\]
End of the lemma\\
\end{minipage}
};
\end{tikzpicture}
\end{frame}
\end{document}
答案1
太长了,无法评论。这是我在 TeXLive 2020 上编译的。我刚刚删除了\\
's 和不相关的$\ $\\
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath, amssymb, amsthm, amsfonts}
\usepackage{tikz}
\usepackage{tikz-cd}
\usetikzlibrary{shapes.geometric, arrows}
\tikzstyle{lemma} = [rectangle, minimum width=1cm, minimum height=1cm, text centered, draw=black, line width=2pt,fill=black,fill opacity=.45,text opacity=1]
\begin{document}
\begin{frame}[plain]
\begin{tikzpicture}
\useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);
\node (lemma) at (9.5cm,1.2cm) [lemma] {
\begin{minipage}{0.65\textwidth}\scriptsize
\noindent\textbf{Lemma.} This is a lemma
\[Math\]
End of the lemma
\end{minipage}
};
\end{tikzpicture}
\end{frame}
\end{document}