Beamer学习笔记(转)

Beamer学习笔记(转)

http://bbs.ctex.org/viewthread.php?tid=42374
http://www.math-linux.com/spip.php?article77
Beamer相关资料

Slides和Presentation的重要性就不必说了。 
A Beamer Quickstart (推荐) :http://heather.cs.ucdavis.edu/~matloff/beamer.html 
A practical guide to beamer: http://faq.ktug.or.kr/wiki/uploads/beamer_guide.pdf 
黄正华老师的总结: http://bbs.ctex.org/viewthread.php?tid=27695&extra=&page=1 
Beamer的在线教程: http://www.math.umbc.edu/~rouben/beamer/quickstart.html 
Beamer的安装:http://dsec.math.pku.edu.cn/~yuhj/wiki/TeXSlides.html#sec-1 
一个即刻上手的模板:http://www.bossh.net/forums/index.php?showtopic=1638 
推荐一个好的Beamer模板库-非常简洁: http://www.math.sinica.edu.tw/www/tex/beamer_template.jsp 
Beamer Tips: http://xueruini.myipcn.org/publish/TeX/Beamer.html 
用 Beamer 做相册:  http://linux.cs.nthu.edu.tw/~clark/nb/archives/2008-02-03T23_32_45.php

Beamer的安装配置 

1、下载beamer:http://sourceforge.net/projects/latex-beamer/
下载pgf:http://sourceforge.net/projects/pgf/ 
下载xcolor:http://sourceforge.net/projects/xcolor/
2、解压到各自文件夹beamer、pgf、xcolor
3、将beamer、pgf、xcolor复制到TeXHOMEctexlocaltextmf exlatex,并删除 TeXHOME/texmf/tex/latex/ 下的beamer、pgf、xcolor 
4、进入TeXHOME exlocaltextmf exlatexxcolor,用“记事本”打开 xcolor.ins,启动cmd,定位到这个文件夹 
5、 运行命令: `latex xcolor.ins',`latex xcolor.dtx',`latex xcolor.dtx',`makeindex -s gind.ist xcolor.idx',`latex xcolor.dtx',`latex xcolor.dtx'
(这些命令在xcolor.ins文件里都写出来了)
6、测试安装是否成功,运行命令:`latex xcolor1.tex', `latex xcolor1.tex'
7、然后运行 WinEdt 的 Accessories 菜单下 MikTex options 的 refresh now 即可。

注意事项: 当beamer做幻灯片时,需要使用 usepackage[square, authoryear, comma]{natbib} 和 citep{xxx} 做文章引用。因为用 natbib 和 citep 才能在beamer下很好的显示 square bracket。另外,做幻灯时,推荐用 ibliographystyle{authordate1}。这样方便通过引用标记(作者+年份)看到该引文的分量。

Beamer Template 使用方式http://www.math.sinica.edu.tw/www/tex/beamer_template.jsp

  • Download mathas_theme.zip
    解壓縮到 C: exmf exlatexeamer hemes 目錄
  • 於 Dos 指令 shell(cmd) 下執行 initexmf --dump 及 initexmf --update-fndb
  • 下載 mathas-template.zip , 解壓縮 (包含 mathas_templates.tex, mathas_4_16.tex, five icons)
  • 增加圖檔時, 按滑鼠右鍵, 儲存 jpg 圖檔(與 math_template.tex 同一目錄)
  • 於文件中選擇 theme 
    mode 
    {
    %usetheme{IAS_sidebar} % only a simple left side bar
    usetheme{IAS_sidebar2_10pt} % only a simple side bar
    %usetheme{IAS_sidebar2_11pt} % As above only changed to fit 11pt fonts.
    ......
    setbeamercovered{transparent}
    }
  • 引用圖檔設定(filename.jpg 不需填入副檔名)
    pgfdeclareimage[height=0.8cm]{institution-logo}{filename}
  • 需要製作 table of contents, 必須 compiler 兩次


在使用beamer 制作PPT时,发现了很多有意思的设置,汇总如下:


1. 默认定理环境是不显示编号的,通过导言区使用开始使用定理编号

  1. setbeamertemplate{theorems}[numbered]

2.图和表格的标题显示标号

  1. setbeamertemplate{caption}[numbered]  

3. 取消导航条

  1. setbeamertemplate{navigation symbols}{}

4. 使用 metapost 动画

  1. usepackage{xmpmulti}
  2. DeclareGraphicsRule{*}{mps}{*}{}  

5. 通过使用如下命令使得一段不编译

  1. iffalse
  2.    ....
  3.     fi

6.  改变列表标号计数器

  1.   egin{enumerate}
  2.    addtocounter{enumi}{3} 改变列表标号计数器
  3.      ......
  4.   end{enumerate}

7. 项目列表

  1.   egin{enumerate}
  2.    item  直接显示,带编号
  3.    item<4->  显示为第四张,带编号
  4.    item<4->[]  显示为第四张,不带编号
  5.    item<4->[在这里输入你的符号]  显示为第四张,带编号“在这里输入你的符号”  %可以在[]内随意定义符号
  6.    item<4->[在这里输入你的符号]  显示为第四张,带编号“在这里输入你的符号”
  7.    item<-4>[在这里输入你的符号]  显示为第四张,带编号“在这里输入你的符号”,然后该条目隐藏
  8.      ......
  9.   end{enumerate}

8. 以下代码用以整体缩小表格

  1. usepackage{graphicx} %Put this in the preamble.
  2. .....
  3. ewsavebox{ ablebox}
  4. egin{lrbox}{ ablebox}
  5. egin{tabular}{||l||l||l||l||}
  6.    hlinehline{ extbf{Geographic Location}} &
  7. { extbf{Site}} &
  8. { extbf{IP Address}} &
  9. { extbf{Top Level Directory}} \
  10.   hlinehline
  11. United States & t ftp.shsu.edu & 192.92.115.10 & it /tex-archive\
  12.   hlinehline
  13. England & t ftp.tex.ac.uk & 131.151.79.32 & it /tex-archive\
  14.   hlinehline
  15. Germany & t ftp.uni-stuttgart.de & 129.69.8.13 & it /tex-archive\
  16.    hlinehline
  17. end{tabular}
  18. end{lrbox}

然后

  1. scalebox{0.5}{usebox{ ablebox}}

或者

  1. esizebox{0.8 extwidth}{!}{usebox{ ablebox}}

9 使用beamer制作幻灯片时,若用pdflatex编译,一定编译两次,才可以使得标签正确显示;pdflatex支持除eps以外的各种格式的图片,插图方式与论文一样。
10. 将图、表标题等使用中文(

  1. enewcommandcontentsname{目 录}
  2. enewcommandlistfigurename{插图目录}
  3. enewcommandlisttablename{表格目录}
  4. % enewcommandabstractname{摘 要}  %err undefined
  5. % enewcommand efname{参考文献}         %article类型
  6. enewcommandibname{参 考 文 献}    %book类型
  7. enewcommandindexname{索 引}
  8. enewcommandfigurename{图}
  9. enewcommand ablename{表}
  10. enewcommandpartname{部分}

11 使用如下命令定制定理等,显示“定理”等,编号按照节标题独立编号

  1. ewtheorem{mythl}{hei 引理}[section]
  2. ewtheorem{mytht}{hei 定理}[section]
  3. ewtheorem{mythr}{hei 注}[section]
  4. ewtheorem{mythc}{hei 推论}[section]
  5. ewtheorem{mythd}{hei 定义}[section]
  6. ewtheorem{mytha}{hei 公理}
  7. ewtheorem{mythp}{hei 命题}
  8. ewtheorem{mythe}{hei 练习}
  9. ewtheorem{myli}{hei 例}[section]

例如定理,代码为:

  1. egin{mytht}
  2. .......
  3. end{mytht}

12. 定义颜色

  1. definecolor{beamer@blendedred}{rgb}{0.7,0.2,0.2} % use structure theme to change
  2. definecolor{beamer@blendedblue}{rgb}{0.2,0.2,0.7} % use structure theme to change

设定 结构 的前景色

  1. setbeamercolor{structure}{fg=beamer@blendedred}

13.使用继承方式来批量改变block标题颜色和block主干颜色,利用“<颜色>!<数字>!<颜色>”来进行混合

  1. setbeamercolor{block title}{use=structure,fg=structure.fg,bg=structure.fg!20!bg}
  2. setbeamercolor{block title alerted}{use=alerted text,fg=alerted text.fg,bg=alerted text.fg!20!bg}
  3. setbeamercolor{block title example}{use=example text,fg=example text.fg,bg=example text.fg!20!bg}
  4. setbeamercolor{block body}{parent=normal text,use=block title,bg=block title.bg!50!bg}
  5. setbeamercolor{block body alerted}{parent=normal text,use=block title alerted,bg=block title alerted.bg!50!bg}
  6. setbeamercolor{block body example}{parent=normal text,use=block title example,bg=block title example.bg!50!bg}
  7. setbeamercolor{titlelike}{parent=structure,bg=white!90!red}

14.设置使用衬线字体做正文(默认全是无衬线,按这个设置,仅标题是无衬线)

  1. usefonttheme[stillsansseriflarge,stillsansserifsmall]{serif}

15.设置半透明化尚未出现的内容(方便提醒自己下面要讲什么)

  1. setbeamercovered{transparent}

16.取消导航条

  1. setbeamertemplate{navigation symbols}{}   

17.以下命令中通过选择show或者hide控制相应节的显示

  1. ableofcontents[currentsection,currentsubsection,subsectionstyle=show/show/hide]

18. 同一个位置动态显示两个block,用下面方法

  1. egin{frame}
  2.      only<1>{egin{itemize}
  3.      item item1
  4.      item item2
  5.      end{itemize}}
  6.      only<2>{egin{itemize}
  7.      item item3
  8.      item item4
  9.      end{itemize}}
  10. end{frame}

19. 利用onslide<2-> 可以将某个段落实现在按顺序出现,< >的用法参见 item< >,呵呵
20.加入动画的命令,不过还没试验,等我试了再说

    1. egin{frame}{平板压实的应用ding{223} 亨特机}
    2. vskip-.2cm
    3. includemovie[poster,text=(Hunter Machinery),mouse,repeat]{11cm}{7.4cm}{./image/pro.swf}
    4. end{frame}