我使用该类beamer
进行演示,并amsmath
使用包进行数学模式。如果我以以下方式打开公式,公式会在幻灯片之间跳转,这不是预期的。
\begin{frame}
\only<1>{
\begin{multline*}
S(1,\dots,s) = \underbrace{\sum_{m=1}^{m_t} (-1)^{m+1} \sum_{i_1<\dots<i_m} I(i_1,\dots,i_m)}_{\text{entropy estimate with correlation order}\, m_t} \\
+ \underbrace{\sum_{m=m_t+1}^{s} (-1)^{m+1} \sum_{i_1<\dots<i_m} I(i_1,\dots,i_m)}_{\text{correlations of order higher than}\, m_t}
\end{multline*}}
\only<2->{
\begin{multline*}
S(1,\dots,s) = \underbrace{\sum_{m=1}^{m_t} (-1)^{m+1} \sum_{i_1<\dots<i_m} I(i_1,\dots,i_m)}_{\text{entropy estimate with correlation order}\, m_t} \\
\xcancel{+ \underbrace{\sum_{m=m_t+1}^{s} (-1)^{m+1} \sum_{i_1<\dots<i_m} I(i_1,\dots,i_m)}_{\text{correlations of order higher than}\, m_t} }
\end{multline*}}
\end{frame}
如果我直接发现它的特定部分,则第一张幻灯片的对齐将失败,并且仅在第二张幻灯片中正确(我也尝试过\shoveright
:():
\begin{frame}
\begin{multline*}
S(1,\dots,s) = \underbrace{\sum_{m=1}^{m_t} (-1)^{m+1} \sum_{i_1<\dots<i_m} I(i_1,\dots,i_m)}_{\text{entropy estimate with correlation order}\, m_t} \\
\uncover<1>{+ \underbrace{\sum_{m=m_t+1}^{s} (-1)^{m+1} \sum_{i_1<\dots<i_m} I(i_1,\dots,i_m)}_{\text{correlations of order higher than}\, m_t}}
\uncover<2->{\xcancel{+ \underbrace{\sum_{m=m_t+1}^{s} (-1)^{m+1} \sum_{i_1<\dots<i_m} I(i_1,\dots,i_m)}_{\text{correlations of order higher than}\, m_t}}}
\end{multline*}
\end{frame}
所以我的问题是:如何发现其中的多线方程beamer
?
答案1
您不应该使用\only
s 来显示独家材料,而应该将overprint
环境与 一起使用\onslide
。它确保在任何幻灯片上都保留所需的大小,从而避免大多数文本跳跃问题:
\documentclass{beamer}
\usepackage{amsmath}
\usepackage{cancel}
\begin{document}
\begin{frame}%
\begin{overprint}
\onslide<1>
\begin{multline*}
S(1,\dots,s) = \underbrace{\sum_{m=1}^{m_t} (-1)^{m+1} \sum_{i_1<\dots<i_m} I(i_1,\dots,i_m)}_{\text{entropy estimate with correlation order}\, m_t} \\
+ \underbrace{\sum_{m=m_t+1}^{s} (-1)^{m+1} \sum_{i_1<\dots<i_m} I(i_1,\dots,i_m)}_{\text{correlations of order higher than}\, m_t}
\end{multline*}
\onslide<2>
\begin{multline*}
S(1,\dots,s) = \underbrace{\sum_{m=1}^{m_t} (-1)^{m+1} \sum_{i_1<\dots<i_m} I(i_1,\dots,i_m)}_{\text{entropy estimate with correlation order}\, m_t} \\
\xcancel{+ \underbrace{\sum_{m=m_t+1}^{s} (-1)^{m+1} \sum_{i_1<\dots<i_m} I(i_1,\dots,i_m)}_{\text{correlations of order higher than}\, m_t} }
\end{multline*}
\end{overprint}
\end{frame}%
\end{document}
这应该可以回答您关于如何在 beamer 中发现多行方程的问题。但是,\xcancel
宏仍然会导致第二行跳起,这是一个不同的问题。
答案2
我必须承认,我讨厌多次输入内容,所以我不喜欢目前提出的任何解决方案!因此,这是 Hendrik 解决方案的一个变体,通过使命令可\xxcancel
感知覆盖来实现。
\documentclass{beamer}
\usepackage{amsmath}
\usepackage{cancel}
\newcommand<>{\xxcancel}[1]{\alt#2{\xcancel{#1}\vphantom{#1}}{#1}}
\begin{document}
\begin{frame}
\begin{multline*}
S(1,\dots,s) = \underbrace{\sum_{m=1}^{m_t} (-1)^{m+1} \sum_{i_1<\dots<i_m} I(i_1,\dots,i_m)}_{\text{entropy estimate with correlation order}\, m_t} \\
\xxcancel<2->{{} + \underbrace{\sum_{m=m_t+1}^{s} (-1)^{m+1} \sum_{i_1<\dots<i_m} I(i_1,\dots,i_m)}_{\text{correlations of order higher than}\, m_t} }
\end{multline*}
\end{frame}
\end{document}
答案3
Martin 基本上满足了你的要求。下面介绍如何防止第二行跳出:
\documentclass{beamer}
\usepackage{amsmath}
\usepackage{cancel}
\newcommand\xxcancel[1]{\xcancel{#1}\vphantom{#1}}
\begin{document}
\begin{frame}
\begin{overprint}
\onslide<1>
\begin{multline*}
S(1,\dots,s) = \underbrace{\sum_{m=1}^{m_t} (-1)^{m+1} \sum_{i_1<\dots<i_m} I(i_1,\dots,i_m)}_{\text{entropy estimate with correlation order}\, m_t} \\
+ \underbrace{\sum_{m=m_t+1}^{s} (-1)^{m+1} \sum_{i_1<\dots<i_m} I(i_1,\dots,i_m)}_{\text{correlations of order higher than}\, m_t}
\end{multline*}
\onslide<2>
\begin{multline*}
S(1,\dots,s) = \underbrace{\sum_{m=1}^{m_t} (-1)^{m+1} \sum_{i_1<\dots<i_m} I(i_1,\dots,i_m)}_{\text{entropy estimate with correlation order}\, m_t} \\
\xxcancel{{} + \underbrace{\sum_{m=m_t+1}^{s} (-1)^{m+1} \sum_{i_1<\dots<i_m} I(i_1,\dots,i_m)}_{\text{correlations of order higher than}\, m_t} }
\end{multline*}
\end{overprint}
\end{frame}
\end{document}
制作第二行不是jump 显示+
第二行的 移动了;为了防止这种情况,我{}
在它前面添加了 。