Beamer:始終將第一個表格覆蓋在同一幀上

Beamer:始終將第一個表格覆蓋在同一幀上

類似的問題這個,但現在我不想覆蓋列表項,而是希望能夠覆蓋table浮動。雖然這可以解決塊的問題:

\begin{frame}[fragile]

\begin{block}<only@+>{First block}
%stuff
\end{block}

\begin{block}<only@+>{Second block}
%more stuff
\end{block}

\end{frame}

不幸的是,它不適用於表:

\begin{frame}[fragile]

\begin{table}[!h]<only@+>
    \begin{tabular}{} %column specs
    %first table
    \end{tabular}
    \caption{} %some caption
\end{table}

\begin{table}[!h]<only@+>
    \begin{tabular}{} %column specs
    %second table
    \end{tabular}
    \caption{} %some caption
\end{table}

\end{frame}

輸出:同一張投影片上的兩張表格,上面寫著亂碼(¡only@+¿)。在這種情況下,正確的語法是什麼?乾杯。

PS 如果還有比我想出的更好的疊加塊語法,我洗耳恭聽! :) 理想情況下,我正在尋找類似的東西\begin{framebody}[<only@+>],以便框架內的所有內容(區塊、表或環境)繼承該行為itemizeenumerate

答案1

下面似乎達到了預期目的。

\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{overprint}
\onslide*<1>{
\begin{table}[h]
    \begin{tabular}{cc} %column specs
    f & f%first table
    \end{tabular}
    \caption{1} %some caption
\end{table}
}
%
\onslide*<2>{
\begin{table}[h]
    \begin{tabular}{cc} %column specs
    c & c
    %second table
    \end{tabular}
    \caption{2} %some caption
\end{table}
}
\end{overprint}
\end{frame}
%
\begin{frame}
%
\begin{block}<only@+>{First block}
b
\end{block}
%
\begin{block}<only@+>{Second block}
f
\end{block}
%
\end{frame} 
\end{document}

相關內容