未知的“缺少 $ 插入”错误

未知的“缺少 $ 插入”错误

我收到一个未知错误“缺少 $ 插入”,但似乎找不到原因。代码如下:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%  This Beamer template was created by Cameron Bracken.
%%  Anyone can freely use or modify it for any purpose
%%  without attribution.
%%
%%  Last Modified: January 9, 2009
%%

\documentclass[xcolor=x11names,compress]{beamer}

%% General document %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{amssymb,amsmath,amsthm,amsfonts}
\usepackage{accents}
\usepackage{multirow}
\usepackage{array}
\usepackage{natbib}
\usepackage[brazilian]{babel}
\usepackage[utf8]{inputenc}
\usetikzlibrary{decorations.fractals}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{xcolor}
\usepackage{framed}

\colorlet{shadecolor}{blue!15}


%% Beamer Layout %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\useoutertheme[subsection=false,shadow]{miniframes}
\useinnertheme{default}
\usefonttheme{serif}
\usepackage{palatino}

\setbeamerfont{title like}{shape=\scshape}
\setbeamerfont{frametitle}{shape=\scshape}

\setbeamercolor*{lower separation line head}{bg=DeepSkyBlue4} 
\setbeamercolor*{normal text}{fg=black,bg=white} 
\setbeamercolor*{alerted text}{fg=red} 
\setbeamercolor*{example text}{fg=black} 
\setbeamercolor*{structure}{fg=black} 

\setbeamercolor*{palette tertiary}{fg=black,bg=black!10} 
\setbeamercolor*{palette quaternary}{fg=black,bg=black!10} 

\renewcommand{\(}{\begin{columns}}
\renewcommand{\)}{\end{columns}}
\newcommand{\<}[1]{\begin{column}{#1}}
    \renewcommand{\>}{\end{column}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\newcommand{\propnumber}{} % initialize
\newtheorem*{prop}{Proposição \propnumber :}
\newenvironment{propc}[1]
{\renewcommand{\propnumber}{#1}%
    \begin{shaded}\begin{prop}}
        {\end{prop} \end{shaded}}

\DeclareMathOperator{\vect}{vec}
\DeclareMathOperator{\var}{Var}

\begin{document}

\begin{frame}    

    \begin{equation}
    \begin{array}{cccc}
    & & \multicolumn{2}{c}{S_t} \\
    \multirow{3}{*}{S_{t-1}} & \multicolumn{1}{c|}{} & 1 & 0 \\ \cline{2-4}
    & \multicolumn{1}{c|}{1} & p & 1-p\\
    & \multicolumn{1}{c|}{0} & q & 1-q
    \end{array}
    \end{equation}
\end{frame}

\end{document}

任何帮助都将受到赞赏。

答案1

多行条目$显然需要:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%  This Beamer template was created by Cameron Bracken.
%%  Anyone can freely use or modify it for any purpose
%%  without attribution.
%%
%%  Last Modified: January 9, 2009
%%

\documentclass[xcolor=x11names,compress]{beamer}

%% General document %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{amssymb,amsmath,amsthm,amsfonts}
\usepackage{accents}
\usepackage{multirow}
\usepackage{array}
\usepackage{natbib}
\usepackage[brazilian]{babel}
\usepackage[utf8]{inputenc}
\usetikzlibrary{decorations.fractals}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{xcolor}
\usepackage{framed}

\colorlet{shadecolor}{blue!15}


%% Beamer Layout %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\useoutertheme[subsection=false,shadow]{miniframes}
\useinnertheme{default}
\usefonttheme{serif}
\usepackage{palatino}

\setbeamerfont{title like}{shape=\scshape}
\setbeamerfont{frametitle}{shape=\scshape}

\setbeamercolor*{lower separation line head}{bg=DeepSkyBlue4} 
\setbeamercolor*{normal text}{fg=black,bg=white} 
\setbeamercolor*{alerted text}{fg=red} 
\setbeamercolor*{example text}{fg=black} 
\setbeamercolor*{structure}{fg=black} 

\setbeamercolor*{palette tertiary}{fg=black,bg=black!10} 
\setbeamercolor*{palette quaternary}{fg=black,bg=black!10} 

\renewcommand{\(}{\begin{columns}}
\renewcommand{\)}{\end{columns}}
\newcommand{\<}[1]{\begin{column}{#1}}
    \renewcommand{\>}{\end{column}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\newcommand{\propnumber}{} % initialize
\newtheorem*{prop}{Proposição \propnumber :}
\newenvironment{propc}[1]
{\renewcommand{\propnumber}{#1}%
    \begin{shaded}\begin{prop}}
        {\end{prop} \end{shaded}}

\DeclareMathOperator{\vect}{vec}
\DeclareMathOperator{\var}{Var}

\begin{document}

\begin{frame}    

    \begin{equation}
    \begin{array}{cccc}
    & & \multicolumn{2}{c}{S_t} \\
    \multirow{3}{*}{$S_{t-1}$} & \multicolumn{1}{c|}{} & 1 & 0 \\ \cline{2-4}
    & \multicolumn{1}{c|}{1} & p & 1-p\\
    & \multicolumn{1}{c|}{0} & q & 1-q
    \end{array}
    \end{equation}
\end{frame}

\end{document}

相关内容