参考. beamer 从入门到放弃, 因为beamer只能导出pdf

文档类选项

  • beamer 默认字体为 11pt, 可选 8-20pt.
  • aspectratio=43aspectratio=169, 设置屏幕纵横比
  • mathserif 设置衬线字体
  • table 加载与表格相关的宏包
  • compress 压缩导航栏的排版, 多行变单行
  • notes 演讲者视图, 在每一页后添加 notes

文档结构

beamer 不支持 \chapter, 使用\section{}, \subsection{} (或\section*{}\subsection*{}) 来划分结构

标题页

  • \title: 主标题
  • \subtitle: 子标题
  • \author: 多个作者间用 and 连接. 用 ~ 连接可保证姓名不会被换行符分开First~Author
  • \date: 当前日期使用 \date{today}
  • \institute: 机构

目录页

1
2
3
\begin{frame}{Outline} % or Contents
\tableofcontents
\end{frame}

使用以下命令在进入每一个章节前复现一次目录

1
2
3
4
5
6
\AtBeginSection[ ]
{
\begin{frame}{Outline}
\tableofcontents[currentsection]
\end{frame}
}

beamer 默认不会给 seciton 和 subsection 编号, 下面代码可以开启编号

1
2
\setbeamertemplate{section in toc}[sections numbered]
\setbeamertemplate{subsection in toc}[subsections numbered]

完整配置,

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
\AtBeginSection[]
{
\begin{frame}{Outline}
\tableofcontents[currentsection,currentsubsection,
hideothersubsections,
sectionstyle=show/shaded
]
\end{frame}
}

\begin{frame}{Outline}
\tableofcontents[sectionstyle=show,
subsectionstyle=show/shaded/hide,
subsubsectionstyle=show/shaded/hide
]
\end{frame}

frame 环境

1
2
3
4
5
6
7
8
% Frame environment
\begin{frame}
\frametitle{<Frame Title>}
\framesubtitle{<Frame subtitle>}

content
\end{frame}

  • [t][c][b] 分别代表页面中竖直方向的对齐方式: 向上, 居中或向下, 默认居中
  • [plain] 设置移除当前 frame 顶部和底部细节, 可用于标题页展示纯净页面
  • [allowframebreaks] 允许多余内容自动排版到下一页, 可用于单独展示参考文献列表

columns 环境

用于竖向拆分两列, 分别添加不同的文字或者图文进行对比, 也可以用来并列两个图片. 各列宽度和不超过 \textwidth, 和 latex 一样的

1
2
3
4
5
6
7
8
9
10
\begin{columns}
\column{0.4\textwidth}
This is an example of text and image in the same slide using columns environment.
\column{0.6\textwidth}
\begin{figure}
\centering
\includegraphics[width=\textwidth]{xxx.jpg}
\caption{Neural Network with 5 neurons in the hidden layer. }
\end{figure}
\end{columns}

blocl/定理类环境