Beamer初次使用

来源:互联网 发布:软件架构管理工具 编辑:程序博客网 时间:2024/06/06 18:16

一直觊觎Latex的排版效果,但是一方面因为office用起来还算比较顺手,对于使用了多年的东西,一旦放弃还是比较难的,就像当初逼着自己把机器上的XP卸掉而只能用Debian的时候所经历的那种难熬的感觉一样;另一方面是因为听身边的人说Latex的命令很多,要记住比记linux shell命令还要麻烦。所以一直在享受着office所带来的便利和忍受着难看的文章排版效果之间煎熬着。

废话不再多说,昨儿把CTEX装上了,然后看了没几页的Latex用户指南,突然想起来用latex写PPT应该比写article, report之类的麻烦,所以又google了一把,发现beamer不错,然后又开始倒腾,在MikTex package manager中安装了beamer, pgf, xcolor三个包。Beamer能用了,搜到了一堆关于如何使用beamer的介绍,我参考了如下两个:

http://faq.ktug.or.kr/wiki/uploads/beamer_guide.pdf

http://www.uncg.edu/cmp/reu/presentations/Charles%20Batts%20-%20Beamer%20Tutorial.pdf

经过一个下午的努力,我尝试写了我的第一个用Beamer做的presentation,简单的代码如下:

/documentclass[slidestop, compress, mathserif]{beamer}/usetheme{Antibes} % THIS THEME WILL GENERATE THE TREE STRUCTURE OF THE MENU/usecolortheme{lily}    % COLOR THEME SETUP/usefonttheme{serif} % FONT THEME USED IN THIS PRESENTATION/author{William Chan}/title{Formalization of XXXX}/institute{CHINA}/usefoottemplate{/vbox{/tinycolouredline{structure} {/color{white}/textbf{/insertshorttitle/hfill /insertpagenumber} } }}%/tinycolouredline{structure!25}%{/color{white}/textbf{/insertshortauthor/hfill /insertshortinstitute}}/begin{document}/beamertemplateshadingbackground{green}{yellow}% THE HEADER FRAME WITH TITLE/begin{frame}/titlepage/end{frame}% THE SECOND FRAME/section{Introduction}/begin{frame}/frametitle{Introduction}xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. ///pauseThe analysis framework including: ///begin{itemize} /pause/item xxxxxxxxxxxxxxxxxxxxxxx /pause/item xxxxxxxxxxxxxxxxxxxxxxx /pause/item xxxxxxxxxxxxxxxxxxxxxxx /begin{itemize} /item ````````````` /item ````````````` /item ````````````` /item ````````````` /end{itemize}/end{itemize}/end{frame}% THE THIRD FRAME/section{Introduction}/subsection{Background}/begin{frame}/frametitle{Background}/textrm{/quad Currently, we still analysis the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.////quad Bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}/end{frame}% THE FOURTH FRAME/section{Design}/subsection{Formalization}/begin{frame}The formalization of xxxxxxxxxxxxxxx can be divided to be /emph{THREE} parts.//////fbox{PART I}///setbeamercolor{uppercol}{fg=black, bg=brown}/setbeamercolor{lowercol}{fg=blue, bg=green!30}/begin{beamerboxesrounded}[upper=uppercol, lower=lowercol, shadow=true]{DEFINITION}/[(method)/hfill /quad /zeta /in /mathbb{M}=/{main, m_{create}, m_{join}, m_{exit}, /ldots/} /]/[(local / var)/hfill /quad /upsilon /in /mathbb{V} /]/[(alloc / site) /quad s /in /mathbb{S} /]/[(abstract/ object) /quad o /in /mathbb{O} = /mathbb{S}^{0} /cup /mathbb{S}^{1} /cup /mathbb{S}^{2} /cup /ldots /]/end{beamerboxesrounded}/end{frame}% THE FIFTH FRAME/section{Design}/subsection{Formalization}/begin{frame}/fbox{PART II} ////setbeamercolor{uppercol}{fg=black, bg=brown}/setbeamercolor{lowercol}{fg=blue, bg=green!30}/begin{beamerboxesrounded}[upper=uppercol, lower=lowercol, shadow=true]{RELATION}/[(call/ graph) /quad cg /subseteq (/mathbb{C} /times /mathbb{C}) /]/[(syn) /quad syc /subseteq /mathbb{C} /rightharpoonup /mathbb{V} /]/end{beamerboxesrounded}/end{frame}% THE SIXTH FRAME/section{Design}/subsection{Formalization}/begin{frame}/fbox{PART III} ////setbeamercolor{uppercol}{fg=black, bg=brown}/setbeamercolor{lowercol}{fg=blue, bg=green!30}/begin{beamerboxesrounded}[upper=uppercol, lower=lowercol, shadow=true]{DESCRIPTION}/[ locas /subseteq /{ x | /exists n: x /in locas_n/} /]/end{beamerboxesrounded}/end{frame}/end{document}

 

上述代码的文本内容进行了删减

上述代码中用到若干基本的beamer中的命令:

1 首先在文档开头指定beamer文件的格式和主题:

  文档主题: /usetheme{Antibes} % THIS THEME WILL GENERATE THE TREE STRUCTURE OF THE MENU  

  颜色主题: /usecolortheme{lily}  % COLOR THEME SETUP

  字体主题: /usefonttheme{serif} % FONT THEME USED IN THIS PRESENTATION

 

2 指定页脚格式:

  使用页脚的模板,模板参数是在页脚的左下部列出本文档的题目,在右下角中列出页码:

   /usefoottemplate{/vbox{/tinycolouredline{structure} {/color{white}/textbf{/insertshorttitle/hfill /insertpagenumber} } }}

 

3 指定背景色:

 /beamertemplateshadingbackground{green}{yellow} 本文档采用底部是绿色,顶部是黄色的渐变色(shading)作为背景

 

4 指定当前frame在文档中的位置,亦即在每一张slide顶部列出文档的树状结构图:

/section{Introduction}

/subsection{Background}

 

5 罗列item:/pause用于定时,表现一定的动画效果

/begin{itemize}

/pause/item xxxx

/pause/item xxxx

/end{itemize}

 

6 指定一个block:本文档中的block形状为beamerboxesrounded,用命令/setbeamercolor设置其背景色和前景色

/setbeamercolor{uppercol}{fg=black, bg=brown}

/setbeamercolor{lowercol}{fg=blue, bg=green!30}

/begin{beamerboxesrounded}[upper=uppercol, lower=lowercol, shadow=true]{DESCRIPTION}

/[ locas /subseteq /{ x | /exists n: x /in locas_n/} /]

/end{beamerboxesrounded}

 

上述这些内容对于书写一般的presentation已经基本够用了,对于更加复杂的应用和命令,像使用更加复杂的动画等等,还需要深入研究。