我正在使用 beamer 和 TexStudio。我试图找出错误的原因,但失败了。问题似乎非常局部化,正如其他有相同问题的帖子所表明的那样。错误出现了三次,指向\end{frame}
。
梅威瑟:
\documentclass[10pt,aspectratio=169,hideothersubsections]{beamer}
\usetheme{default}
\usefonttheme[onlymath]{serif}
\usepackage[british]{babel}
\usepackage{amsmath,amsfonts,amssymb,appendixnumberbeamer,array,caption,subcaption,enumerate,lmodern,microtype,multirow,multicol,setspace,pgfplots,tikz,textpos}
\setbeamertemplate{footline}{}
\setbeamertemplate{headline}{}
\usepgfplotslibrary{fillbetween}
\setbeamertemplate{navigation symbols}{}
\setcounter{tocdepth}{1}
\pgfplotsset{
labels at axis tips/.style 2 args={
compat=1.12,
xlabel=#1,
x label style={
at={(current axis.right of origin)},
anchor=west
},
ylabel=#2,
y label style={
at={(current axis.above origin)},
anchor=south,rotate=-90,
},
},
labels at axis tips/.default={$x$}{$y$}
}
\begin{document}
\newcommand\lognormal[2]{1/(x*#2*sqrt(2*pi))*exp(-((ln(x)-#1)^2)/(2*#2^2))} % Log-normal function, parameters mu and sigma
\begin{frame}{Test}
\framesubtitle{\hfill}
\only<1>{
Test
}
\only<2>{
\begin{column}[t]{.33\textwidth}
\begin{figure}
\centering
\caption*{1 task}
\begin{tikzpicture}[scale=0.6]
\begin{axis}[
samples=100,
smooth,
axis x line=bottom,
axis y line=left,
ytick=\empty,
xtick=\empty,
%xticklabels={0,$\mu$},
labels at axis tips={$\eta_{m}$}{$f(\eta_{m})$},
enlargelimits=upper]
\addplot[name path=A,thick,domain=0:10] {\lognormal{1}{0.5}};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{column}
\begin{column}[t]{.33\textwidth}
\begin{figure}
\centering
\caption*{2 task}
\begin{tikzpicture}[scale=0.6]
\begin{axis}[
samples=100,
smooth,
axis x line=bottom,
axis y line=left,
ytick=\empty,
xtick=\empty,
%xticklabels={0,$\mu$},
labels at axis tips={$\eta_{r}$}{$f(\eta_{r})$},
enlargelimits=upper]
\addplot[name path=A,thick,domain=0.5:7] {\lognormal{1}{0.3}};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{column}
\begin{column}[t]{.33\textwidth} % each column can also be its own environment
\begin{figure}
\centering
\caption*{3 task}
\begin{tikzpicture}[scale=0.6]
\begin{axis}[
samples=200,
smooth,
axis x line=bottom,
axis y line=left,
ytick=\empty,
xtick=\empty,
%xticklabels={0,$\mu$},
labels at axis tips={$\eta_{a}$}{$f(\eta_{a})$},
enlargelimits=upper]
\addplot[name path=A,thick,domain=-15:15] {\lognormal{1}{0.8}};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{column}
}
\end{frame}
\end{document}
答案1
您缺少列周围\begin{columns}
的\end{columns}