在 Beamer 演示文稿中垂直对齐或锁定文本

在 Beamer 演示文稿中垂直对齐或锁定文本

我理解,通过在演示文稿中使用叠加层beamer,人们能够将文本锁定在框架内,并继续显示其他项目,而不会影响正在显示的先前项目的位置。但是,我想要做的是用另一个特定的叠加层替换一个特定的叠加层,而不会影响正在显示的先前叠加层的位置。我不太清楚如何做到这一点。我能想到的最好的办法是以下代码示例,我试图在单独的幻灯片中保留定义和矩阵的位置。

\documentclass[11pt,xcolor=pdftex,dvipsnames,table]{beamer}

\usepackage{multirow}
\usepackage{beamerthemesplit}
\usetheme{Berkeley}
\usecolortheme{dolphin}
\usepackage{graphicx}
\usepackage{epsf}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}

\title[Short Title]{Longer Presentation Title}
\author[John Doe]{John Doe}
\institute{University of Nowhere}
\date{July 7, 2011}

\begin{document}

\maketitle

\begin{frame}
  \frametitle{Introduction}
  \setbeamercovered{dynamic}
  \framesubtitle{Definitions (Cont...)}
    \textit{Definition 5:} If $A$ is an $m \times n$ matrix, $I$ is a subset of $\{1, ..., m\}$ with $k$ elements, and $J$ is a subset of $\{1, ..., n\}$ with $k$ elements, then the matrix for the $k \times k$ minor of $A$ that corresponds to the rows with index in $I$ and the columns with index in $J$, is written as $[A]_{I,J}$. \pause
    \newline
    \newline
    If $I = J$, then $[A]_{I,J}$ is called a \textit{principal minor}.
    \newline
    \newline
    \[A =
      \left(
        \begin{array}{rrr}
          \multicolumn{1}{r}{1} & \multicolumn{1}{r}{4} & \multicolumn{1}{r}{7} \\
          \cline{2-3}
          \multicolumn{1}{r}{3} & \multicolumn{1}{|r}{0} & \multicolumn{1}{r|}{5} \\
          \multicolumn{1}{r}{-1} & \multicolumn{1}{|r}{9} & \multicolumn{1}{r|}{11} \\
          \cline{2-3}
        \end{array}
      \right), \mbox{~where~} I = \{2, 3\} \mbox{~and~} J = \{2,3\}
    \]
\end{frame}

\begin{frame}
  \frametitle{Introduction}
  \setbeamercovered{dynamic}
  \framesubtitle{Definitions (Cont...)}
    \textit{Definition 5:} If $A$ is an $m \times n$ matrix, $I$ is a subset of $\{1, ..., m\}$ with $k$ elements, and $J$ is a subset of $\{1, ..., n\}$ with $k$ elements, then the matrix for the $k \times k$ minor of $A$ that corresponds to the rows with index in $I$ and the columns with index in $J$, is written as $[A]_{I,J}$.
    \newline
    \newline
    If the matrix consists of elements in rows and columns from $1$ to $k$, then the principal minor is called a \textit{leading principal minor}.
    \[A =
      \left(
        \begin{array}{rrr}
          \cline{1-2}
          \multicolumn{1}{|r}{1} & \multicolumn{1}{r|}{4} & \multicolumn{1}{r}{7} \\
          \multicolumn{1}{|r}{3} & \multicolumn{1}{r|}{0} & \multicolumn{1}{r}{5} \\
          \cline{1-2}
          \multicolumn{1}{r}{-1} & \multicolumn{1}{r}{9} & \multicolumn{1}{r}{11} \\
        \end{array}
      \right), \mbox{~where~} I = \{1,2\} \mbox{~and~} J = \{1,2\}
    \]
\end{frame}

\end{document}

如能就如何做到这一点提供任何帮助/建议,我将不胜感激。

答案1

您可以使用overlayarea(参见9.5 动态更改文本或图像手册),\onslide以及\only

\documentclass[11pt,xcolor=pdftex,dvipsnames,table]{beamer}

\usepackage{multirow}
\usepackage{beamerthemesplit}
\usetheme{Berkeley}
\usecolortheme{dolphin}
\usepackage{graphicx}
\usepackage{epsf}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}

\title[Short Title]{Longer Presentation Title}
\author[John Doe]{John Doe}
\institute{University of Nowhere}
\date{July 7, 2011}

\begin{document}

\maketitle

\begin{frame}
  \frametitle{Introduction}
  \framesubtitle{Definitions (Cont...)}
\textit{Definition 5:} If $A$ is an $m \times n$ matrix, $I$ is a subset of $\{1, ..., m\}$ with $k$ elements, and $J$ is a subset of $\{1, ..., n\}$ with $k$ elements, then the matrix for the $k \times k$ minor of $A$ that corresponds to the rows with index in $I$ and the columns with index in $J$, is written as $[A]_{I,J}$.\\[1\baselineskip]


\begin{overlayarea}{\textwidth}{1cm}
\only<1>{If $I = J$, then $[A]_{I,J}$ is called a \textit{principal minor}.}
\only<2>{If the matrix consists of elements in rows and columns from $1$ to $k$, then the principal minor is called a \textit{leading principal minor}.}
\end{overlayarea}

\begin{overlayarea}{\textwidth}{3cm}
\only<1>{%
\[A =
      \left(
        \begin{array}{rrr}
          \multicolumn{1}{r}{1} & \multicolumn{1}{r}{4} & \multicolumn{1}{r}{7} \\
          \cline{2-3}
          \multicolumn{1}{r}{3} & \multicolumn{1}{|r}{0} & \multicolumn{1}{r|}{5} \\
          \multicolumn{1}{r}{-1} & \multicolumn{1}{|r}{9} & \multicolumn{1}{r|}{11} \\
          \cline{2-3}
        \end{array}
      \right), \mbox{~where~} I = \{2, 3\} \mbox{~and~} J = \{2,3\}
    \]
}
\only<2>{%
    \[A =
      \left(
        \begin{array}{rrr}
          \cline{1-2}
          \multicolumn{1}{|r}{1} & \multicolumn{1}{r|}{4} & \multicolumn{1}{r}{7} \\
          \multicolumn{1}{|r}{3} & \multicolumn{1}{r|}{0} & \multicolumn{1}{r}{5} \\
          \cline{1-2}
          \multicolumn{1}{r}{-1} & \multicolumn{1}{r}{9} & \multicolumn{1}{r}{11} \\
        \end{array}
      \right), \mbox{~where~} I = \{1,2\} \mbox{~and~} J = \{1,2\}
    \]
}
\end{overlayarea}
\end{frame}

\end{document}

相关内容