当我将以下代码从我的文章中复制粘贴到我的 Beamer 演示文稿中的一个框架中(以及所有软件包)时,我收到 11 个错误,其中大部分是“未定义的控制序列”和“缺少数字,视为零”。您能解释一下哪里出了问题以及我可能必须在序言中包含哪些其他软件包吗?
\documentclass{beamer}
\usetheme{Warsaw}
\title{HH Decisions}
\author{Abhimanyu Arora}
\institute{Doctoral workshop}
\date{}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{comment}
\usepackage{graphicx}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{pgfplots}
\usepackage[capposition=top]{floatrow}
\pgfplotsset{compat=newest}
\usetikzlibrary{pgfplots.groupplots}
\usetikzlibrary{positioning}
\newtheorem{proposition}[theorem]{Proposition}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}{Results (contd.)}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
title=Share of expenditure,
xlabel={$z$},
ylabel={$S(z)$},
]
\addplot [blue,domain=0:10]{(2*(0.45+x*0.55))/(2*(0.45+x*0.55)+0.55+x*0.45)};
\addplot [red,domain=0:10]{(2*(0.1+x*0.9))/(2*(0.1+x*0.9)+0.9+x*0.1)};
\legend{Case 1, Case 2}
\end{axis}
\end{tikzpicture}
\floatfoot{Case 1:$\alpha_W=\beta_H=0.55=1-\alpha_H=1-\beta_W$, Case 2:$\alpha_W=\beta_H=0.9=1-\alpha_H=1-\beta_W$}
\label{fig:share}
\end{figure}
\end{frame}
\end{document}
答案1
该floatrow
包与不兼容beamer
;不要将beamer
文档类加载到此包中;在这种情况下,您不能使用\floatfoot
,但可以\caption
改用或仅使用一段简单的文本:
\documentclass{beamer}
\usepackage{comment}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usetikzlibrary{pgfplots.groupplots}
\usetikzlibrary{positioning}
\usetheme{Warsaw}
\newtheorem{proposition}[theorem]{Proposition}
\title{HH Decisions}
\author{Abhimanyu Arora}
\institute{Doctoral workshop}
\date{}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}{Results (contd.)}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
title=Share of expenditure,
xlabel={$z$},
ylabel={$S(z)$},
height=6cm
]
\addplot [blue,domain=0:10]{(2*(0.45+x*0.55))/(2*(0.45+x*0.55)+0.55+x*0.45)};
\addplot [red,domain=0:10]{(2*(0.1+x*0.9))/(2*(0.1+x*0.9)+0.9+x*0.1)};
\legend{Case 1, Case 2}
\end{axis}
\end{tikzpicture}
\caption{Case 1:$\alpha_W=\beta_H=0.55=1-\alpha_H=1-\beta_W$, Case 2:$\alpha_W=\beta_H=0.9=1-\alpha_H=1-\beta_W$}
\label{fig:share}
\end{figure}
\end{frame}
\begin{frame}{Results (contd.)}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
title=Share of expenditure,
xlabel={$z$},
ylabel={$S(z)$},
height=6cm
]
\addplot [blue,domain=0:10]{(2*(0.45+x*0.55))/(2*(0.45+x*0.55)+0.55+x*0.45)};
\addplot [red,domain=0:10]{(2*(0.1+x*0.9))/(2*(0.1+x*0.9)+0.9+x*0.1)};
\legend{Case 1, Case 2}
\end{axis}
\end{tikzpicture}\par
Case 1:$\alpha_W=\beta_H=0.55=1-\alpha_H=1-\beta_W$, Case 2:$\alpha_W=\beta_H=0.9=1-\alpha_H=1-\beta_W$
\end{figure}
\end{frame}
\end{document}