当前位置: 首页 > news >正文

LaTeX-2:PPT的编制

文章目录

  • LaTeX-2:PPT的编制
    • 选择PPT模板
    • 设置主题和颜色
    • 添加幻灯片
    • 幻灯片的最小工作示例
    • 一个完整示例
      • 文档类和编码设置
      • 主题和颜色主题设置
      • 标题页信息设置
      • 目录设置
      • 文档主体

LaTeX-2:PPT的编制

选择PPT模板

查询这个网址:
作为入门,我们统一使用beamer做PPT模板,其结果如下:

\documentclass{beamer}

设置主题和颜色

beamer模板中,主题和颜色可以自定义。我们列举在beamer模板中的一些常用主题和颜色,更详细的请见链接: https://hartwork.org/beamer-theme-matrix/

  • 主题:
    default
    Berlin
    CambridgeUS
    Madrid
    Warsaw
  • 颜色:
    default
    beaver
    dolphin
    whale
    使用如下代码即可设置主题颜色:
\usetheme{主题名称}
\usecolortheme{颜色名称}

添加幻灯片

在添加幻灯片,我们可以有以下的命令:
\frame:用于添加一张一张的幻灯片。
\frametitle:用于设置幻灯片标题。
\frame命令中,可以添加幻灯片的内容。

  • 添加代码:要通过verbatim环境实现。
  • 添加图片:使用\column{}命令


以上内容是了解幻灯片的基础内容,下面我们对幻灯片的内容做详细介绍

幻灯片的最小工作示例

\documentclass{beamer}
%Information to be included in the title page:
\title{Sample title}
\author{Ai Xiao Yang}
\institute{Tsinghua University}
\date{\today}

\begin{document}

\frame{\titlepage} %生成标题页

\begin{frame}
\frametitle{The first step of beamer}
Do yourself!
\end{frame}

\end{document}

一个完整示例

\documentclass{beamer}
\usepackage[utf8]{inputenc}

\usetheme{Madrid}
\usecolortheme{default}

%------------------------------------------------------------
%This block of code defines the information to appear in the
%Title page
\title[About Beamer] %optional
{About the Beamer class in presentation making}

\subtitle{A short story}

\author[Arthur, Doe] % (optional)
{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}}

%End of title page configuration block
%------------------------------------------------------------



%------------------------------------------------------------
%The next block of commands puts the table of contents at the 
%beginning of each section and highlights the current section:

\AtBeginSection[]
{
  \begin{frame}
    \frametitle{Table of Contents}
    \tableofcontents[currentsection]
  \end{frame}
}
%------------------------------------------------------------


\begin{document}

%The next statement creates the title page.
\frame{\titlepage}


%---------------------------------------------------------
%This block of code is for the table of contents after
%the title page
\begin{frame}
\frametitle{Table of Contents}
\tableofcontents
\end{frame}
%---------------------------------------------------------


\section{First section}

%---------------------------------------------------------
%Changing visivility of the text
\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 slides 3
    \item<4-> Text visible on slide 4
\end{itemize}
\end{frame}

%---------------------------------------------------------


%---------------------------------------------------------
%Example of the \pause command
\begin{frame}
In this slide \pause

the text will be partially visible \pause

And finally everything will be there
\end{frame}
%---------------------------------------------------------

\section{Second section}

%---------------------------------------------------------
%Highlighting text
\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}
%---------------------------------------------------------


%---------------------------------------------------------
%Two columns
\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 tought this is a nice looking
layout in some cases.
\end{columns}
\end{frame}
%---------------------------------------------------------


\end{document}

这段LaTeX代码用于创建一个使用 beamer 文档类的演示文稿,以下是对代码的详细解析:

文档类和编码设置

\documentclass{beamer}
\usepackage[utf8]{inputenc}
  • \documentclass{beamer}:指定文档类为 beamer,用于创建演示文稿。
  • \usepackage[utf8]{inputenc}:加载 inputenc 宏包,并设置字符编码为 utf8,以支持各种字符输入。

主题和颜色主题设置

\usetheme{Madrid}
\usecolortheme{default}
  • \usetheme{Madrid}:选择 Madrid 主题,它决定了演示文稿的整体外观,包括字体、布局等。
  • \usecolortheme{default}:选择默认的颜色主题,用于设置演示文稿的颜色方案。

标题页信息设置

\title[About Beamer] %optional
{About the Beamer class in presentation making}

\subtitle{A short story}

\author[Arthur, Doe] % (optional)
{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 in presentation making}:设置演示文稿的标题。方括号内 About Beamer 是可选的短标题,用于在空间有限的地方显示,如页眉;花括号内是完整标题。
    • \subtitle{A short story}:设置副标题。
  • 作者
    • \author[Arthur, Doe]{A.~B.~Arthur\inst{1} \and J.~Doe\inst{2}}:设置作者信息。方括号内是短作者列表,花括号内 A.~B.~Arthur\inst{1}J.~Doe\inst{2} 是完整作者信息,\inst{1}\inst{2} 表示作者所属机构编号。
  • 机构
    • \institute[VFU]{...}:设置作者所属机构。方括号内 VFU 是可选的短机构名,花括号内分别定义了编号为 12 的机构信息。
  • 日期
    • \date[VLC 2021]{Very Large Conference, April 2021}:设置日期。方括号内是短日期,花括号内是完整日期说明。
  • 徽标
    • \logo{\includegraphics[height=1cm]{overleaf-logo}}:在标题页和其他页面添加徽标,这里假设当前目录下有 overleaf - logo 图片文件,并设置其高度为 1cm

目录设置

\AtBeginSection[]
{
  \begin{frame}
    \frametitle{Table of Contents}
    \tableofcontents[currentsection]
  \end{frame}
}

\AtBeginSection[] 命令会在每个新的 \section 开始时,自动插入一个包含目录的幻灯片,并且突出显示当前章节。\tableofcontents[currentsection] 表示显示目录并突出当前章节。

文档主体

\begin{document}

\frame{\titlepage}

\begin{frame}
\frametitle{Table of Contents}
\tableofcontents
\end{frame}

\section{First section}

\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 slides 3
    \item<4-> Text visible on slide 4
\end{itemize}
\end{frame}

\begin{frame}
In this slide \pause

the text will be partially visible \pause

And finally everything will be there
\end{frame}

\section{Second section}

\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}

\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 tought this is a nice looking
layout in some cases.
\end{columns}
\end{frame}

\end{document}
  • 标题页生成\frame{\titlepage} 创建标题页,显示前面设置的标题、作者、日期等信息。
  • 目录页
    • \begin{frame}\frametitle{Table of Contents}\tableofcontents\end{frame} 创建一个包含完整目录的幻灯片。
  • 第一部分(First section
    • 第一个 \begin{frame} 展示了如何使用 <> 语法控制列表项的显示时机。例如,\item<1-> 表示该项从第1张幻灯片开始显示,\item<2-> 表示从第2张幻灯片开始显示。
    • 第二个 \begin{frame} 使用 \pause 命令,使文本逐段显示。每遇到一个 \pause,幻灯片会暂停,直到用户切换到下一页。
  • 第二部分(Second section
    • 第一个 \begin{frame} 展示了文本强调和不同类型文本块的使用。\alert{highlighted} 用于突出显示文本;\begin{block}{Remark} 创建一个普通文本块,\begin{alertblock}{Important theorem} 创建一个红色突出显示的文本块,\begin{examples} 创建一个绿色文本块,并带有标题 “Examples”。
    • 第二个 \begin{frame} 使用 \begin{columns} 创建两列布局。\column{0.5\textwidth} 定义每列宽度为页面宽度的一半,分别在两列中放置文本、公式和列表。

通过这些设置和内容,该LaTeX代码生成了一个具有特定主题、标题页、目录、不同文本展示效果和页面布局的演示文稿。

相关文章:

  • Python说课内容介绍
  • 使用右侧值现象来处理一个word导入登记表的需求
  • 【认证授权FAQ】SSL/TLS证书过期导致的CLS认证失败
  • ArcGISPro 新建shp+数据结构
  • STM32 Flash详解教程文章
  • uniapp商城之首页模块
  • rancher on k3s
  • kafka介绍,kafka集群环境搭建,kafka命令测试,C++实现kafka客户端
  • 机器学习数学基础:24.随机事件与概率
  • 黑马SpringCloud微服务课程总结(二)
  • Stable Diffusion 安装教程(附安装包) 【SD三种安装方式,Win+Mac一篇文章讲明白】
  • JVM——类的生命周期
  • 【Getting Started】-时间复杂度-Time Complexity
  • 前瞻技术:塑造未来生活的新趋势
  • 【ISO 14229-1:2023 UDS诊断全量测试用例清单系列:第八节】
  • 宠物企业宣传网站静态模板 – 前端静态页面开发实例
  • 国密算法SM1、SM2、SM3和SM4 具体的使用和区别
  • 【物联网】电子电路基础知识
  • Linux执行一条命令并自动重试直到成功,自动化脚本
  • 无人机遥感图像拼接软件有哪些?无人机遥感图像采集流程;遥感图像拼接的一般流程
  • 春秋航空:如果供应链持续改善、油价回落到合理水平,公司补充运力的需求将会增长
  • 上海“世行对标改革”的税务样本:设立全国首个税务审判庭、制定首个税务行政复议简易程序
  • 同为“东部重要中心城市”后交出首份季报:宁杭苏表现如何?
  • 湖北十堰市委副秘书长管聪履新丹江口市代市长
  • 云南昆磨高速发生交通事故致3辆车起火,昆明消防:幸无人员伤亡
  • 网友建议平顶山请刘昊然任旅游宣传大使,市委:有此设想,正申请经费