本次升级了beamer的一些代码。带有动画,视频链接等。
\documentclass{beamer}
\usepackage{multimedia}
\usepackage{xcolor}
\usepackage[UTF8,heading=true]{ctex}
\usepackage{animate}
%%%%%%下面的命令可以让超链接具有颜色,便于识别%%%%%%%%%%%%%%%%%%%%
\usepackage{hyperref}
\hypersetup{
colorlinks=true,
linkcolor=cyan,
filecolor=blue,
urlcolor=red,
citecolor=green,
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usetheme{Berkeley}
\usecolortheme{default}
\usefonttheme{professionalfonts}
\usenavigationsymbolstemplate{}
%\useoutertheme{smoothbars}
\setbeamertemplate{footline}[frame number]
\usefonttheme[onlymath]{serif}
\renewcommand{\tablename}{表}
\begin{document}
\kaishu
\title[监督学习算法]{K-Nearest-Neighbor Algorithm}
\author{作者}
\titlegraphic{\includegraphics[width=0.55\textwidth]{logo.jpg}}
\institute{理学院数学系}
\date{\today}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}
\tableofcontents
\end{frame}
\AtBeginSection{
\begin{frame}{目录}
\tableofcontents[currentsection,hideallsubsections]
\end{frame}
}
\section{知识背景}
\begin{frame}{KNN手写数字识别代码解释网址}
随便找一个网址,可以链接它 \par
\href{https://blog.csdn.net/ldy__cwx/article/details/122714004?spm=1001.2014.3001.5501}{KNN手写数字识别}
\end{frame}
\begin{frame}{枚举}
\begin{itemize}
\item first
\pause
\item second
\pause
\item asd
\end{itemize}
\end{frame}
\subsection{1.2}
\begin{frame}{1.2章}
这就是1.2章第一章幻灯片
\end{frame}
\begin{frame}{T}
\frametitle{emu}
验证一
\end{frame}
\subsection{分栏}
\begin{frame}{分栏}
column可以用来给内容分栏 。
\begin{columns}[t]
\column{0.45\textwidth}
这里是第一栏。大家可以看到这里的对齐方式是顶端对齐。你可以选择t,c,or b
\column{0.45\textwidth}
这里是第二栏。
\end{columns}
\end{frame}
\subsection{图片、表格、视频和应用程序}
\begin{frame}{插入图片}
你可以插入各种各样的图片
\begin{center}
\includegraphics[width=0.4\textwidth]{综合图.png}
\end{center}
\end{frame}
\begin{frame}{演示数据}
\LaTeX{}的表格在这里仍然可以使用。
\begin{center}
$$\frac{dy}{dx}=\Sigma_{i=1}^n$$
\end{center}
\begin{center}
\begin{tabular}{cc}
\hline
符号 & 表示含义\\ \hline
$f(x)$ & 函数1 \\
$\theta$ & 参数1 \\
\hline
\end{tabular}
\end{center}
\end{frame}
\begin{frame}
你可以使用movie命令:\\
\movie[externalviewer]{\includegraphics[width=3cm]{综合图.png}}{1.mp4}\\
当然你也可以使用href,这个更为常见,无论是视频还是网页文本都可以:\\
\href{run:1.mp4}{\includegraphics[width=3cm]{综合图.png}}
\end{frame}
\section[动态显示]{动态多层:pause,visible,uncover and only}
\begin{frame}{pause实现动画}
pause命令已经很熟悉了。\\
\begin{block}{pause命令}
\begin{enumerate}
\item 这是第一点
\pause
\item 这是第二点
\pause
\item 这是第三点
\end{enumerate}
\end{block}
\end{frame}
\subsection[Numpy应用]{Numpy}
\begin{frame}{动态多层:onslide,uncover and only}
逐个显示覆盖图片,举例:\\[0.3cm]
\begin{columns}[t]
\column{0.45\textwidth}
可以描述一些概念的语句\\
\onslide<2->{ %%%%从二个开始显示
\begin{enumerate}
\item
第一点
\onslide<3->{
\item
第二点
\item
第三点
\onslide<5->{
\item
第四点
}
}
\end{enumerate}
}
\column{0.5\textwidth}
\mbox{}\\
\begin{overlayarea}{\textwidth}{0.4\textheight}
\only<4-5>{\includegraphics[width=0.9\textwidth]{logo.jpg}}
\only<6->{\includegraphics[width=0.9\textwidth]{综合图.png}}
\only<4-5>{\centering{图一}}
\only<6->{\centering{图二}}
\end{overlayarea}
\end{columns}
\end{frame}
\section[Handout]{演示稿的Handout选项}
\subsection{Handout选项}
\begin{frame}{如何使用Handout}
由于我们在演示文稿中使用了很多pause命令,因此会有很多重复的幻灯片会被创造出来。这个时候我们可以使用handout选项来使演示稿的
pause选项失去作用。
只需要在开头的documentclass前面加上{\heiti{handout}}即可
\end{frame}
\end{document}
效果如下: