分享

Beamer学习笔记(1)——Beamer常见设置汇总

 LibraryPKU 2021-12-15

原文链接:http://hi.baidu.com/jerry_916/blog/item/b8f9f396c4dedf6054fb9661.html

Beamer相关资料

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

Beamer的安装配置 

1、下载beamer:http:///projects/latex-beamer/
下载pgf:http:///projects/pgf/ 
下载xcolor:http:///projects/xcolor/
2、解压到各自文件夹beamer、pgf、xcolor
3、将beamer、pgf、xcolor复制到TeXHOME\ctex\localtextmf\tex\latex,并删除 TeXHOME/texmf/tex/latex/ 下的beamer、pgf、xcolor 
4、进入TeXHOME\tex\localtextmf\tex\latex\xcolor,用“记事本”打开 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。另外,做幻灯时,推荐用 \bibliographystyle{authordate1}。这样方便通过引用标记(作者+年份)看到该引文的分量。

Beamer Template 使用方式

http://www.math./www/tex/beamer_template.jsp
  • Download mathas_theme.zip
    解壓縮到 C:\texmf\tex\latex\beamer\themes 目錄

  • 於 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.   \begin{enumerate}

  2.    \addtocounter{enumi}{3} 改变列表标号计数器

  3.      ......

  4.   \end{enumerate}

7. 项目列表
  1.   \begin{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. \newsavebox{\tablebox}

  4. \begin{lrbox}{\tablebox}

  5. \begin{tabular}{||l||l||l||l||}

  6.    \hline\hline{\textbf{Geographic Location}} &

  7. {\textbf{Site}} &

  8. {\textbf{IP Address}} &

  9. {\textbf{Top Level Directory}} \\

  10.   \hline\hline

  11. United States & \tt ftp.shsu.edu & 192.92.115.10 & \it /tex-archive\\

  12.   \hline\hline

  13. England & \tt ftp.tex.ac.uk & 131.151.79.32 & \it /tex-archive\\

  14.   \hline\hline

  15. Germany & \tt ftp.uni-stuttgart.de & 129.69.8.13 & \it /tex-archive\\

  16.    \hline\hline

  17. \end{tabular}

  18. \end{lrbox}

然后
  1. \scalebox{0.5}{\usebox{\tablebox}}

或者
  1. \resizebox{0.8\textwidth}{!}{\usebox{\tablebox}}

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

10. 将图、表标题等使用中文
  1. \renewcommand\contentsname{目\ 录}

  2. \renewcommand\listfigurename{插图目录}

  3. \renewcommand\listtablename{表格目录}

  4. %\renewcommand\abstractname{摘\ 要}  %err undefined

  5. %\renewcommand\refname{参考文献}         %article类型

  6. \renewcommand\bibname{参\ 考\ 文\ 献}    %book类型

  7. \renewcommand\indexname{索\ 引}

  8. \renewcommand\figurename{图}

  9. \renewcommand\tablename{表}

  10. \renewcommand\partname{部分}

11 使用如下命令定制定理等,显示“定理”等,编号按照节标题独立编号
  1. \newtheorem{mythl}{\hei 引理}[section]

  2. \newtheorem{mytht}{\hei 定理}[section]

  3. \newtheorem{mythr}{\hei 注}[section]

  4. \newtheorem{mythc}{\hei 推论}[section]

  5. \newtheorem{mythd}{\hei 定义}[section]

  6. \newtheorem{mytha}{\hei 公理}

  7. \newtheorem{mythp}{\hei 命题}

  8. \newtheorem{mythe}{\hei 练习}

  9. \newtheorem{myli}{\hei 例}[section]

例如定理,代码为:
  1. \begin{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. \tableofcontents[currentsection,currentsubsection,subsectionstyle=show/show/hide]

18. 同一个位置动态显示两个block,用下面方法
  1. \begin{frame}

  2.      \only<1>{\begin{itemize}

  3.      \item item1

  4.      \item item2

  5.      \end{itemize}}

  6.      \only<2>{\begin{itemize}

  7.      \item item3

  8.      \item item4

  9.      \end{itemize}}

  10. \end{frame}

19. 利用\onslide<2-> 可以将某个段落实现在按顺序出现,< >的用法参见 \item< >,呵呵

20.加入动画的命令,不过还没试验,等我试了再说
  1. \begin{frame}{平板压实的应用\ding{223} 亨特机}

  2. \vskip-.2cm

  3. \includemovie[poster,text=(Hunter Machinery),mouse,repeat]{11cm}{7.4cm}{./image/pro.swf}

  4. \end{frame}

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约