Beamer,包括侧边栏中的链接

Beamer,包括侧边栏中的链接

我需要从演示文稿中的多个位置访问链接。

我没有在那几个位置重复插入链接,而是把它们放在最后一张幻灯片中,需要时,只需转到最后一张幻灯片即可访问它们。

为了更轻松地访问这些链接,是否可以将它们插入侧边栏,而不是放在最后一张幻灯片中!

另一个问题是,为什么当我取消注释该行时

\label{linka}

编译停止?

\documentclass{beamer}
\usetheme{PaloAlto}
\setbeamertemplate{navigation symbols}{}
% begin Section/Subsection pages control -----------------
\setbeamertemplate{section page}
{
 \begingroup
 \begin{beamercolorbox}[sep=10pt,center,rounded=true,shadow=true]{section title}
   \usebeamerfont{section title}\insertsection\par
 \end{beamercolorbox}
 \endgroup
}
%
\setbeamertemplate{subsection page}
{
 \begingroup
 \begin{beamercolorbox}[sep=2pt,center,rounded=true,shadow=true]{section title}
   \usebeamerfont{section title}\insertsection\par
 \end{beamercolorbox}
 \vspace*{-2.5pt}
 \begin{beamercolorbox}[sep=8pt,center,rounded=true,shadow=true]{subsection title}
   \usebeamerfont{subsection title}\insertsubsection\par
 \end{beamercolorbox}
\endgroup
}
%
\setbeamerfont{section title}{size=\large,series=\bfseries}
\setbeamerfont{subsection title}{size=\large,series=\bfseries}
% end Section/Subsection pages control -----------------
\begin{document}
% begin Section
\section
[sec1]{Section1}
\frame{\sectionpage}
% begin frame
\begin{frame}[t]
 \frametitle
{Cross Section at a}
hello {\textcolor{green}{linka}}
\hypertarget{linka}
%    \label{linka}
hello
\end{frame} 
% end frame
%
% begin Section
\section
[sec2]{Section2}
\frame{\sectionpage}
% begin frame
\begin{frame}[t]
 \frametitle
{Cross Section at b}
hello {\textcolor{blue}{linkb}}
\hypertarget{linkb}
%    \label{linkb}
hello
\end{frame} 
% end frame
%
% begin Section
\section
[sec3]{Section3}
\frame{\sectionpage}
% begin frame
\begin{frame}[t]
 \frametitle
{Cross Section at c}
hello {\textcolor{brown}{linkc}}
\hypertarget{linkc}
%    \label{linkc}
hello
\end{frame} 
% end frame
%
% begin Section
\section
[sec4]{Section4}
\frame{\sectionpage}
% begin frame
\begin{frame}[t]
 \frametitle
{Cross Section at d}
hello {\textcolor{red}{linkd}}
\hypertarget{linkd}
%    \label{linkd}
hello
\end{frame} 
% end frame
%
% begin frame
\begin{frame}[t]
 \frametitle
{Links}
{\hyperlink{linka}{\textcolor{green}{linka}}}

{\hyperlink{linkb}{\textcolor{blue}{linkb}}}

{\hyperlink{linkc}{\textcolor{brown}{linkc}}}

{\hyperlink{linkd}{\textcolor{red}{linkd}}}
\end{frame} 
% end frame
\end{document}

在此处输入图片描述

在此处输入图片描述

在此处输入图片描述

答案1

如果您只是想向现有侧边栏添加一些内容,您可以使用\addtobeamertemplate{sidebar left}{<stuff before the existing sidebar>}{<stuff after the existing sidebar>}

\documentclass{beamer}

\usetheme{PaloAlto}

\addtobeamertemplate{sidebar left}{}{%
  \usebeamerfont{section in sidebar}%
  ~\hyperlink{linka}{\textcolor{green}{linka}}\par\medskip
  ~\hyperlink{linkb}{\textcolor{cyan}{linkb}}\par\medskip
  ~\hyperlink{linkc}{\textcolor{brown}{linkc}}\par\medskip
  ~\hyperlink{linkd}{\textcolor{red}{linkd}}\par
  \vfill
}

\begin{document}

\section[sec1]{Section1}

\begin{frame}[t]
 \frametitle{Cross Section at a}
  hello \textcolor{green}{linka}
  \hypertarget{linka}
  hello
\end{frame} 

\section[sec2]{Section2}
\begin{frame}[t]
 \frametitle{Cross Section at b}
  hello \textcolor{blue}{linkb}
  \hypertarget{linkb}
  hello
\end{frame} 

\section[sec3]{Section3}
\begin{frame}[t]
 \frametitle{Cross Section at c}
  hello \textcolor{brown}{linkc}
  \hypertarget{linkc}
  hello
\end{frame} 

\section[sec4]{Section4}
\begin{frame}[t]
 \frametitle{Cross Section at d}
  hello \textcolor{red}{linkd}
  \hypertarget{linkd}
  hello
\end{frame} 

\end{document}

在此处输入图片描述

相关内容