簡介
Beamer主要功能
itemize
pause
創(chuàng)建目錄頁
突出當前章節(jié)標題
突出當前副章節(jié)標題
標題頁
目錄頁
添加特效
高亮
自定義演示文稿
字體大小
字體類型
字體主題
從系統(tǒng)導入字體
主題/顏色主題
字體
分欄
顯示中文
LaTeX快速入門:Learn LaTeX in 30 minutes
我的博客:LaTeX Beamer 筆記
Beamer
是一個功能強大且靈活的LaTeX類,可用于創(chuàng)建美觀的演示文稿。
\documentclass{beamer} %Information to be included in the title page: \title{Sample title} \author{Anonymous} \institute{Overleaf} \date{2021} \begin{document} \frame{\titlepage} \begin{frame} \frametitle{Sample frame title} This is some text in the first frame. This is some text in the first frame. This is some text in the first frame. \end{frame} \end{document}
用TeXStudio編譯預覽,可生成文檔如下:
編譯后,將生成一個兩頁的PDF文件。第一頁是標題頁,第二頁包含示例內(nèi)容。
\documentclass{Beamer}
- 聲明Beamer演示文稿
\document
- 文檔
\frame
- 文檔中的頁
變量以\
為開頭
注釋以%
為開頭
單行內(nèi)容 - \frame{xxx}
多行內(nèi)容 - \begin{frame}
xxx \end{frame}
可以通過\usetheme{xxx}
指定使用的主題
\begin{document}
前的區(qū)域叫做導言區(qū)
標題頁的選項比簡介中提供的選項多。下面是一個完整示例,大多數(shù)命令都是可選的:
\title[About Beamer] %optional {About the Beamer class in presentation making} \subtitle{A short story} \author[Arthur, Doe] % (optional, for multiple authors) {A.~B.~Arthur\inst{1} \and J.~Doe\inst{2}} \institute[VFU] % (optional) { \inst{1}% Faculty of Physics\ Very Famous University \and \inst{2}% Faculty of Chemistry\ Very Famous University } \date[VLC 2021] % (optional) {Very Large Conference, April 2021} \logo{\includegraphics[height=1cm]{overleaf-logo}}
\title[About Beamer] {About the Beamer class...}
主標題,{}
中的內(nèi)容為標題,[]
是可選的,其中的內(nèi)容為標題縮寫
縮寫中的內(nèi)容出現(xiàn)在演示文稿最底部(不同主題位置可能不同)
\subtitle
副標題(可以沒有)
\author[Arthur, Doe]{A.~B.~Arthur\inst{1} \and J.~Doe\inst{2}}
作者。多個作者用\and
分隔,\inst{1}
- 上標
\institute[VFU]{\inst{1}Faculty...
作者所屬的機構,多個機構用\and
分隔
\date[VLC 2021]{Very Large Conference, April 2021}
日期/活動名稱,顯示在標題頁的底部
\logo{\includegraphics...}
logo??梢允褂梦谋?,也可以包含圖像。在此主題中,logo設置在右下角(不同主題不一樣)
\begin{frame} \frametitle{Table of Contents} \tableofcontents \end{frame}
使用
/section{xxx}
來分章節(jié),其中xxx為章節(jié)標題
也可以在文檔前添加如下代碼,用于生成目錄,并突出當前章節(jié)標題。
\AtBeginSection[] { \begin{frame} \frametitle{Table of Contents} \tableofcontents[currentsection] \end{frame} }
也可以為 副章節(jié) \subsection{xxx}
添加目錄
\AtBeginSubsection[]{ \begin{frame} \frametitle{Table of Contents} \tableofcontents[currentsubsection] \end{frame} }
逐項列出:
\begin{frame} \frametitle{Sample frame title} This is a text in second frame. For the sake of showing an example. \begin{itemize} \item<1-> Text visible on slide 1 \item<2-> Text visible on slide 2 \item<3> Text visible on slide 3 \item<4-> Text visible on slide 4 \end{itemize} \end{frame}
[外鏈圖片轉(zhuǎn)存失敗,源站可能有防盜鏈機制,建議將圖片保存下來直接上傳(img-arv6xJGo-1633669562937)(http://image.taqini.space/img/20211008082516.png)]
上述代碼中有一個列表,由\begin{itemize}
和 \end{itemize}
聲明,每個項前面都有一個數(shù)字編號,用<>
括起來。編號表示元素將出現(xiàn)在哪張幻燈片中,如果在編號的末尾添加-
,則該項在后續(xù)幻燈片繼續(xù)顯示,否則它將僅出現(xiàn)在該幻燈片中。
\pause
命令也可以實現(xiàn)特效:
\begin{frame} In this slide \pause the text will be partially visible \pause And finally everything will be there \end{frame}
注:加入特效后,一個frame可以生成多頁pdf
在演示文稿中,突出重點是一種很好的做法,可以讓聽眾更容易地確定主題。
\begin{frame} \frametitle{Sample frame title} In this slide, some important text will be \alert{highlighted} because it's important. Please, don't abuse it. \begin{block}{Remark} Sample text \end{block} \begin{alertblock}{Important theorem} Sample text in red box \end{alertblock} \begin{examples} Sample text in green box. The title of the block is ``Examples". \end{examples} \end{frame}
\alert{highlighted}
- 高亮文本
三種高亮塊:
\begin{block}{Remark} \end{block}
\begin{alertblock}{Important theorem} \end{alertblock}
\begin{examples} \end{examples}
在文檔前加入\usetheme
即可:
\usetheme{Madrid}
一個主題可以與一個顏色主題相結(jié)合,以改變不同元素使用的顏色。
\documentclass{beamer} \usetheme{Madrid} \usecolortheme{beaver}
Madrid主題的默認的藍色變成了紅色
TeXStudio中有多種主題可選(Wizard - Quick Beamer Presentation)
字體大小可以通過beamer類進行設置: \documentclass[17pt]{beamer}
.
可用的字體大小有8pt、9pt、10pt、11pt、12pt、14pt、17pt、20pt。默認字體大小為11pt(對應于全屏模式下的22pt)。
改變beamer演示文稿中的字體類型有兩種方法,一種是使用字體主題,另一種是直接從系統(tǒng)導入字體。
\documentclass{beamer} \usefonttheme{structuresmallcapsserif} \usetheme{Madrid}
\usefonttheme{}
是自描述性的。可用的主題有:structurebold、structurebolditalic、StructureSallCapsSerif、StructureTalicsSerif、serif和default。
除此以外,還可以導入系統(tǒng)中安裝的字體:
\documentclass{beamer} \usepackage{bookman} \usetheme{Madrid}
通過\usepackage{bookman}
導入要在演示文稿中使用的bookman系列字體??捎米煮w取決于你安裝的LATEX,常見字體有:mathptmx、helvet、avat、bookman、chancery、charter、culer、mathtime、mathptm、newcent、palatino和pifont。
有時,演示文稿中的信息以兩列格式顯示會更好:
\begin{frame} \frametitle{Two-column slide} \begin{columns} \column{0.5\textwidth} This is a text in first column. $$E=mc^2$$ \begin{itemize} \item First item \item Second item \end{itemize} \column{0.5\textwidth} This text will be in the second column and on a second thoughts, this is a nice looking layout in some cases. \end{columns} \end{frame}
\begin{columns}
xxx \end{columns}
- 使用分欄
\column{0.5\textwidth}
- 聲明每列的寬度
LaTeXstudio默認的編譯器不支持中文,改為XeLaTeX即可:
若LaTeXstudio的pdf預覽不顯示中文,在導言區(qū)加入以下代碼即可:
\usepackage{ctex}
[外鏈圖片轉(zhuǎn)存失敗,源站可能有防盜鏈機制,建議將圖片保存下來直接上傳(img-cqCUDPDe-1633669562950)(http://image.taqini.space/img/20211008124441.png)]