我的 Beamer 演示文稿中有一个例子,我在另一页中提到过。我想以自动方式包含该示例的页面。这是我的代码。对示例的引用在最后一页。
谢谢。
\documentclass[]{beamer}
\usetheme{Madrid}
\usenavigationsymbolstemplate{}
\title{Main Title}
\author{Jane Doe}
\institute{University A}
\date{\today}
\begin{document}
\begin{frame}
\titlepage % Print the title page as the first slide
\end{frame}
\begin{frame}
\frametitle{First Page}
\begin{exampleblock}{Example}
This is an example which will be used later.
\end{exampleblock}
\end{frame}
\begin{frame}
\frametitle{Second Page}
\begin{itemize}
\item Item 1
\item Item 2
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Third Page}
\begin{itemize}
\item In this slide, we are going to use the sample example on page 2. % Here I want to reference the page of the example automatically.
\end{itemize}
\end{frame}
\end{document}
答案1
将标签放置在您想要交叉引用的框架上,然后使用\ref
:
\documentclass[]{beamer}
\usetheme{Madrid}
\usenavigationsymbolstemplate{}
\title{Main Title}
\author{Jane Doe}
\institute{University A}
\date{\today}
\begin{document}
\begin{frame}
\titlepage % Print the title page as the first slide
\end{frame}
\begin{frame}
\frametitle{First Page}
\begin{exampleblock}{Example}
This is an example which will be used later.
\end{exampleblock}
\end{frame}
\begin{frame}[label={important}]
\frametitle{Second Page}
\begin{itemize}
\item Item 1
\item Item 2
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Third Page}
\begin{itemize}
\item In this slide, we are going to use the sample example on slide~\ref{important}.
\end{itemize}
\end{frame}
\end{document}
答案2
经典命令\label{}
也有效。
\documentclass[]{beamer}
\usetheme{Madrid}
\usenavigationsymbolstemplate{}
\title{Main Title}
\author{Jane Doe}
\institute{University A}
\date{\today}
\begin{document}
\begin{frame}
\titlepage % Print the title page as the first slide
\end{frame}
\begin{frame}
\frametitle{First Page}
\begin{exampleblock}{Example}
This is an example which will be used later.
\end{exampleblock}
\end{frame}
\begin{frame}
\frametitle{Second Page}
\label{important}
\begin{itemize}
\item Item 1
\item Item 2
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Third Page}
\begin{itemize}
\item In this slide, we are going to use the sample example on slide~\ref{important}.
\end{itemize}
\end{frame}
\end{document}
答案3
一个更好的方法是写作。
...
\item In this slide, we are going to use the sample example on \hyperlink{important}{\beamergotobutton{Second Page}}
...
“第二页”通常是您所指的幻灯片的标题。