在 beamer 中使用 \itemize 时未定义控制序列。如果我将其从 beamer 更改为 article,它就可以正常工作

在 beamer 中使用 \itemize 时未定义控制序列。如果我将其从 beamer 更改为 article,它就可以正常工作
\documentclass{beamer}
\usepackage{bookmark}
\usepackage[utf8]{inputenc}
\usepackage{multicol}
\usepackage{graphicx}
\begin{document}
.\\
\vspace{3.5cm}
\centering{\Huge\textbf{DELIMITERS}}

\newpage
.\vspace{1cm}
\\ A \textbf{Delimiter} act as a symbol that acts
logically like parenthesis, with a pair of delimiters enclosing an expression.

They can only be used in Math mode.\\The delimiters recognized by \textit{LaTeX} includes:
\newpage
.\\
\vspace{1cm}
Delimiters in Formula should be big enough to fit around the formula they delimit (for example around arrays).To obtain "Stretchable" delimiters type \verb+\left +or \verb+\right+ command

For Example by writing :\hspace{10pt}
\verb+\left( + $x^2$ \verb+ \right) + \\we will get output as: \hspace{10pt}
$\left(x^2 \right)$
\newpage
.\\
\vspace{1cm}
The two \verb+\left+ and \verb+\right+ commands must come in matching pair but the matching delimiters need not to be the same.\vspace{0.5cm}
\begin{minipage}{0.5\textwidth}
$x+y+z=\left(\begin{array}{c}a\\ b\end{array}\right[$\\
\end{minipage}\begin{minipage}{0.5\textwidth}
\verb^ $x+y+z=\left(\begin{array}^\hspace{3pt}
\verb^{c}a\\ b\end{array}\right[$^
\end{minipage}\vspace{0.5cm}
Some formula require delimiter on one side only.So we can hide a delimiter by adding "." after the \verb+\left+ or \verb+\right+ command.\\
\vspace{1cm}
\begin{minipage}{0.5\textwidth}
$x=\left\{\begin{array}{ll}
y  &  \mbox{if $y>0$}\\
x+y   & \mbox{otherwise}
\end{array}
\right[$
\end{minipage}\begin{minipage}{0.5\textwidth}
\verb%$x=\left\{\begin{array}{ll}%
\verb%\mbox{if$y>0$}\\%
\verb%& \mbox{otherwise}\end{array}%
\verb% \right[% 
\end{minipage}

\newpage
.\\
\vspace{1cm}
{\huge \textbf{EXAMPLE}}
\begin{flushleft}
\verb+$\left[\begin{array}{ccc}x_1 & x_2 &+\\ \verb+x_3\\y_1 & y_2 & y_3\\ z_1 & z_2 &+\\ \verb+z_3\end{array}\right]$+\\ \vspace{1cm}
  \textbf{  Will show output as:-}
  $$\left[\begin{array}{ccc}
   x_1     & x_2  &  x_3 \\
    y_1    & y_2  &   y_3  \\
    z_1    &  z_2 &   z_3
   \end{array}
   \right]$$
   \end{flushleft}


\newpage
.\\
\vspace{3.5cm}
\centering\textbf{\Huge ELLIPSES}
\newpage
.\\
\vspace{1cm}
\textbf{Ellipses} are small dots used in typesetting Mathematical Equations to denote continuation of something. 
\begin{itemize}
 \item abab\\
 \item jdhd
\end{itemize}
nsns
\newpage
.\\
\vspace{.8cm}
{\huge \textbf{EXAMPLE}}
\begin{flushleft}
\verb+$\left[ \begin{array}{cccc}+
\verb+\mathbf{x{_11}}&  \mathbf{x_{12}}& + \verb+\mathbf{\cdots}&+
\verb+\mathbf{x_{1n}}& \\+
\verb+\mathbf{x_{21}}& \mathbf{$x_{22}}$+
\verb+ & \mathbf{\cdots}& \mathbf{x_{2n}} \\+
\verb+\mathbf{\vdots}&  \mathbf{vdots}&+
\verb+\mathbf{\ddots}& \mathbf{\vdots}\\+
\verb+\mathbf{x_{m1}}&  mathbf{ x_{m2}}+
\verb+ & mathbf{\cdots}&+ 
\verb+\mathbf{x_{mn}} \end{array}\right]$+\\
\vspace{0.5cm}
\textbf{Will show output as:}
$\left[\begin{array}{cccc}
   \mathbf{X_{11}} & \mathbf{X_{12}} &  \mathbf{\cdots}  & \mathbf{X_{1n}} \\
  \mathbf{X_{21}}   & \mathbf{X_{22}}    & \mathbf{\cdots}      &  \mathbf{X_{2n}}   \\
  \mathbf{\vdots}   & \mathbf{\vdots}    &  \mathbf{\ddots}    & \mathbf{\vdots}    \\
   \mathbf{X_{m1}}  & \mathbf{X_{m2}}    & \mathbf{\cdots}     & \mathbf{X_{mn}}
\end{array}        \right]$
\end{flushleft}
\end{document}

答案1

这是示例文档转换为 的最后一页beamer。在第一个 中frame,我没有更改 的使用,\verb而在第二帧中,我将其替换为lstlisting来自包的环境。在第三帧中,我结合listings使用及其库,以便获得逐字代码以及输出,而无需两次输入相同的代码:tcolorboxlisting

在此处输入图片描述

\documentclass{beamer}
\usepackage{listings}
\usepackage{tcolorbox}
\tcbuselibrary{listings}


\begin{document}

\begin{frame}[fragile]
{\huge \textbf{EXAMPLE}}
\begin{flushleft}
\verb+$\left[ \begin{array}{cccc}+
\verb+\mathbf{x{_11}}&  \mathbf{x_{12}}& + \verb+\mathbf{\cdots}&+
\verb+\mathbf{x_{1n}}& \\+
\verb+\mathbf{x_{21}}& \mathbf{$x_{22}}$+
\verb+ & \mathbf{\cdots}& \mathbf{x_{2n}} \\+
\verb+\mathbf{\vdots}&  \mathbf{vdots}&+
\verb+\mathbf{\ddots}& \mathbf{\vdots}\\+
\verb+\mathbf{x_{m1}}&  mathbf{ x_{m2}}+
\verb+ & mathbf{\cdots}&+ 
\verb+\mathbf{x_{mn}} \end{array}\right]$+\\
\vspace{0.5cm}
\textbf{Will show output as:}
$\left[\begin{array}{cccc}
   \mathbf{X_{11}} & \mathbf{X_{12}} &  \mathbf{\cdots}  & \mathbf{X_{1n}} \\
  \mathbf{X_{21}}   & \mathbf{X_{22}}    & \mathbf{\cdots}      &  \mathbf{X_{2n}}   \\
  \mathbf{\vdots}   & \mathbf{\vdots}    &  \mathbf{\ddots}    & \mathbf{\vdots}    \\
   \mathbf{X_{m1}}  & \mathbf{X_{m2}}    & \mathbf{\cdots}     & \mathbf{X_{mn}}
\end{array}        \right]$
\end{flushleft}
\end{frame}

\begin{frame}[fragile]
\frametitle{Example}
\begin{lstlisting}[breaklines=true]
$\left[\begin{array}{cccc}
   \mathbf{X_{11}} & \mathbf{X_{12}} & \mathbf{\cdots} & \mathbf{X_{1n}}  \\
   \mathbf{X_{21}} & \mathbf{X_{22}} & \mathbf{\cdots} &  \mathbf{X_{2n}} \\
   \mathbf{\vdots} & \mathbf{\vdots} & \mathbf{\ddots} & \mathbf{\vdots}  \\
   \mathbf{X_{m1}} & \mathbf{X_{m2}} & \mathbf{\cdots} & \mathbf{X_{mn}}
\end{array}\right]$
\end{lstlisting}

\textbf{Will show output as:}
$\left[\begin{array}{cccc}
   \mathbf{X_{11}} & \mathbf{X_{12}} &  \mathbf{\cdots}  & \mathbf{X_{1n}} \\
  \mathbf{X_{21}}   & \mathbf{X_{22}}    & \mathbf{\cdots}      &  \mathbf{X_{2n}}   \\
  \mathbf{\vdots}   & \mathbf{\vdots}    &  \mathbf{\ddots}    & \mathbf{\vdots}    \\
   \mathbf{X_{m1}}  & \mathbf{X_{m2}}    & \mathbf{\cdots}     & \mathbf{X_{mn}}
\end{array}        \right]$
\end{frame}

\begin{frame}[fragile]
\frametitle{Example}
\begin{tcblisting}{colback=white,colframe=gray}
$\left[\begin{array}{cccc}
   \mathbf{X_{11}} & \mathbf{X_{12}} & \mathbf{\cdots} & \mathbf{X_{1n}}  \\
   \mathbf{X_{21}} & \mathbf{X_{22}} & \mathbf{\cdots} &  \mathbf{X_{2n}} \\
   \mathbf{\vdots} & \mathbf{\vdots} & \mathbf{\ddots} & \mathbf{\vdots}  \\
   \mathbf{X_{m1}} & \mathbf{X_{m2}} & \mathbf{\cdots} & \mathbf{X_{mn}}
\end{array}\right]$
\end{tcblisting}
\end{frame}

\end{document}

与问题本身无关beamer,但更多地与此特定框架的内容有关:\mathbf{...}我不会重复输入,而是使用\boldmath。我还会替换\left[\begin{array}{cccc}为,\begin{bmatrix}如以下示例所示:

\boldmath{\[\begin{bmatrix}
   X_{11} & X_{12} & \cdots & X_{1n}  \\
   X_{21} & X_{22} & \cdots &  X_{2n} \\
   \vdots & \vdots & \ddots & \vdots  \\
   X_{m1} & X_{m2} & \cdots & X_{mn}
\end{bmatrix}\]}

相关内容