免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
1234下一页
最近访问板块 发新帖
查看: 32739 | 回复: 34
打印 上一主题 下一主题

beamer制作幻灯片 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-05-29 15:25 |只看该作者 |倒序浏览
beamer_taiwan.pdf (270.47 KB, 下载次数: 1746)
beamer_guide.pdf (1.86 MB, 下载次数: 4589)

beamer是latex带的一个制作幻灯片的宏包,非常好用。

[ 本帖最后由 haoji 于 2008-5-29 15:27 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2008-05-29 16:33 |只看该作者
Contents

Prologue
1  Prologue
2  What is new
Getting started
3  A bare-bones sample
4  Compiling into pdf
5  A complete presentation
Themes
6  Themes
7  Customizing themes
7.1  The structure color
7.2  Specifying RGB colors
7.3  Direct use of the structure color
7.4  Changing the itemization markers
7.5  Rounded boxes and shadows
7.6  Getting rid of the navigation icons
7.7  Adding an informative footline
8  UMBC themes
9  The UMBC footline
10  The UMBC tribullet markers
11  UMBC boxes
Bits and Pieces
12  The title page
13  Including graphics
14  Overlays
15  Navigating with hyperlinks
16  Theorems and such
17  Splitting a slide into columns
18  Vertical alignment within slides
19  The default font size
20  The default text color
21  The structure font and font themes
22  Shrinking to make things fit
23  Changing margin widths
24  All about colors
25  Colored text, highlights and boxes
26  Setting a slide's background
Epilogue
27  Acrobat Reader usage
28  Xpdf usage
29  Beamer on the Web
Gallery
30  A gallery of Beamer slides
31  Complete set of Beamer themes

论坛徽章:
0
3 [报告]
发表于 2008-05-29 16:33 |只看该作者
1  Prologue

Beamer is a LaTeX documentclass for producing slides. The default output is a pdf file which is suitable for on-screen viewing.

The aim of this document is to get you started quickly with Beamer. It gives you enough of the basics to let you begin using Beamer in a productive way. I have avoided calling this a "Tutorial" because a tutorial implies a certain thoroughness which this limited presentation lacks.

Beamer's manual is over 200 printed pages. When you feel the need to go beyond the basics, you should consider reading the manual. There is more to Beamer than what appears here.

These pages were created in December 2004. The information herein is based on version 3.01 of Beamer. See Beamer on the Web for references and web resources.

The Gallery page shows a sampler of slides produced by Beamer.

I have written this Quickstart primarily for the use of graduate students in the Department of Mathematics and Statistics at UMBC. I have assumed throughout, without elaboration, that the underlying operating system is Linux or something unix-like, because that's what we have in the department.

I have also assumed throughout that you know the ins and outs of LaTeX; this is certainly not a LaTeX tutorial.

LaTeX and Beamer are platform-independent, therefore examples and advice given here should carry over to other platforms, in principle. The specifics of compilation and execution may vary; you will have to consult with your local TeXnician if you need help with these.

How to read this Quickstart

If you are completely new to Beamer, I suggest that you begin at the beginning, that is, at A bare-bones sample. Examine the file small.tex presented there to get a feel about Beamer's syntax. Then read the subsequent section where you are told how to compile a Beamer source file into pdf.

Then download small.tex and compile and view the result. Verify that what you see corresponds to what I have shown in A bare-bones sample.

Then begin experimenting with small.tex to see if you can create slides the way you want them. If there are things that you feel you should be able to do but you don't know how, then look through the Table of Contents or the Index. Chances are that you will find there what you are looking for.

论坛徽章:
0
4 [报告]
发表于 2008-05-29 16:34 |只看该作者
2  What is new

In this section I will attempt to maintain a history of changes to this website.


2005-03-06
Added new theme, umbc3. Inserted samples in UMBC themes and Gallery. Updated beamer-umbc.tar.gz accordingly.

2005-11-03
Added reference to Norm Matloff's site in Beamer on the Web.

2006-05-13
Changed "background" to "background canvas" in section An image for a background.

2007-05-05
Added section Complete set of Beamer themes.

2007-11-08
Following a suggestion from Andrzej Jan Kutylowski, renamed the files hfc.tgz and beamer-umbc.tgz to hfc.tar.gz and beamer-umbc.tar.gz to make downloading easier under Windows.

论坛徽章:
0
5 [报告]
发表于 2008-05-29 16:35 |只看该作者
3  A bare-bones sample

The basic structure of a Beamer input file is pretty simple. Consider the file small.tex, the content of which is shown below:

% small.tex
\documentclass{beamer}
\usetheme{default}
\begin{document}

\begin{frame}
  \frametitle{A sample slide}

A displayed formula:

\[
  \int_{-\infty}^\infty e^{-x^2} \, dx = \sqrt{\pi}
\]

An itemized list:

\begin{itemize}
  \item itemized item 1
  \item itemized item 2
  \item itemized item 3
\end{itemize}

\begin{theorem}
  In a right triangle, the square of hypotenuse equals
  the sum of squares of two other sides.
\end{theorem}

\end{frame}

\end{document}


The input file above produces the following slide:








Remark: In Beamer, a frame is what you would normally call a "slide". The image shown above is the realization of a single "frame". In what follows, I use the terms "frame" and "slide" interchangeably.1

The \begin{frame}...\end{frame} block may be repeated any number of times to produce a sequence of slides.


Remark: The \frametitle{...} command puts a title on the slide. Although its use is optional, it is only in very rare cases where omitting a slide title would make sense.

论坛徽章:
0
6 [报告]
发表于 2008-05-29 16:36 |只看该作者
4  Compiling into pdf

To compile the previous section's LaTeX source file, small.tex, into a pdf file for on-screen viewing, do:

pdflatex small.tex  


This will run the source file small.tex through pdflatex and, if all's well, produce a file named small.pdf.

The resulting file may be viewed with a pdf viewer. The most common pdf viewer is Adobe's Acrobat Reader which is available for free for use on essentially any computer platform.

An alternative is Glyph & Cog, LLC's Xpdf which runs under the X Window System on unix, vms, and os/2.

See Acrobat Reader usage and Xpdf usage pages for usage tips for these viewers.

论坛徽章:
0
7 [报告]
发表于 2008-05-29 16:37 |只看该作者
5  A complete presentation

The file hfc.tar.gz contains the source of slides for an hour-long talk that I gave in the department some time ago. You may find it useful as an example of a real-life Beamer presentation.

Download the compressed archive hfc.tar.gz and unpack it. On unix-like systems you will probably unpack the archive by executing the command:
tar xfz hfc.tar.gz

This will expand the archive into a directory named hfc.2 That directory will contain about 20 files, most being images, and one Beamer source file named hfc.tex.

To compile, change to the hfc directory, then do:
pdflatex hfc.tex
pdflatex hfc.tex


This will create the presentation file hfc.pdf.

Two passes of pdflatex are needed to let LaTeX determine the presentation's total page count, otherwise page numbers in footlines may be wrong.


论坛徽章:
0
8 [报告]
发表于 2008-05-29 16:39 |只看该作者
6  Themes


The overall appearance of a Beamer slide may be altered drastically by applying a Beamer theme to the slide.

To illustrate the effects of various themes, I will use the file sample.tex which is a slightly modified version of the previous small.tex.

Here is what the preamble of sample.tex and the resulting slide look like:

\documentclass{beamer}
\usetheme{default}




The line \usetheme{default} loads Beamer's default theme. If we replace that line with: \usetheme{Boadilla}, we will obtain the Boadilla theme which looks like this:

\documentclass{beamer}
\usetheme{Boadilla}




Compare this with the previous slide and note the drastic changes, including the added frame around the theorem, the 3D rounded markers for itemized and enumerated lists, and the footline that includes date and slide number, among other things.

Standard Beamer themes

Beamer comes with a large selection of themes. Themes are named after various cities, such as Boadilla, Madrid, Copenhagen, and Singapore, where Beamer's author and his collaborators have given Beamer presentations.

In UMBC's Department of Mathematics and Statistics computer network, the Beamer themes are located in the directory:
/usr/local/share/texmf/tex/latex/beamer/themes/theme/


In my opinion, the following themes are more interesting than others. You can find complete set of images for all Beamer themes in Complete set of Beamer themes. Additional images, corresponding to customized versions of selected themes, are in Gallery.


default

Boadilla

Madrid

Pittsburgh

Rochester         [ works best as \usetheme[height=7mm]{Rochester} ]

Copenhagen

Warsaw

Singapore

Malmoe


Experiment to see which one is more to your liking.

Inner and outer themes, etc.

Beamer themes which are named after cities, such as Boadilla and Pittsburgh, are complete themes in the sense that they control just about every aspect of a slide's appearance. Think of this as major themes. These themes are invoked with the \usetheme command, as in \usetheme{Pittsburgh}.

Beamer also provides what may be thought of as minor themes. These control somewhat narrowly defined aspects of a slide's appearance. You may invoke one or more of these minor themes in conjunction with a major theme to alter/modify the major theme's characteristics.

Beamer's "minor themes" fall into 4 categories:


outer themes
control a slide's decorations, such as text and graphics that appear in a slide's header and footer sections. For example, \useoutertheme{shadow} adds a 3-D shadow to some header elements.

See Adding an informative footline and The UMBC footline for examples of \useoutertheme.

inner themes
control a slide's inner area, such as markers/bullets for itemization lists and boxes placed around theorems. For example, \useinnertheme{rounded} gives a rounded and 3-D look to theorem-containing boxes and itemization markers.

See The UMBC tribullet markers and UMBC boxes for examples of \useinnertheme.

font themes
control font shapes and sizes of various elements of a slide show. For example, \usefonttheme{serif} changes the document's fonts to serif. (The default is sans-serif.)

See The structure font and font themes for examples of \usefonttheme.

color themes
control the colors of title, frametitle, itemization bullets, and many other elements of a slide show. For example, \usecolorheme{albatross} changes the Beamer's default colors in quite a drastic way.

See The structure color and Specifying RGB colors for examples of \usecolorheme.



On department's machines, you will find the style files corresponding to Beamer's themes in the directories:
/usr/local/share/texmf/tex/latex/beamer/themes/theme/   % the major themes
/usr/local/share/texmf/tex/latex/beamer/themes/inner/   % inner themes
/usr/local/share/texmf/tex/latex/beamer/themes/outer/   % outer themes
/usr/local/share/texmf/tex/latex/beamer/themes/color/   % color themes
/usr/local/share/texmf/tex/latex/beamer/themes/font/    % font themes

论坛徽章:
0
9 [报告]
发表于 2008-05-29 16:44 |只看该作者
7  Customizing themes

There are a great number of ways in which you can fine-tune the general appearance of a Beamer theme. Here I will describe a few ideas which you may find useful.

Throughout this section, I use the Beamer theme Rochester. You may apply these ideas to any other Beamer theme.

I will start with the plain Rochester theme, and gradually add various options to show their cumulative effect. You don't have to use all the options at once. Pick the ones that suit your needs.


Remark: The option [height=7mm] (see samples below) specifies the thickness of the horizontal stripe that runs along a Rochester slide's top edge. Please note that this option is specific to Rochester. It does not apply to other themes.

7.1  The structure color

Most colored parts of a Beamer slide are drawn in an abstract color named the structure. You can change the overall color of a Beamer presentation by changing the structure.

The default structure in the Rochester theme corresponds to a certain shade of blue as you can see here:

\documentclass{beamer}
\usetheme[height=7mm]{Rochester}





Let's change Rochester's structure to Brown:

\documentclass[xcolor=dvipsnames]{beamer}
\usecolortheme[named=Brown]{structure}
\usetheme[height=7mm]{Rochester}


The slide changes to:





Remark: Note how the structure affects many items, including bullets and navigation icons.


Remark: The color "Brown" is one of a large number of color names defined in the file:

/usr/share/texmf/tex/latex/graphics/dvipsnam.def


The xcolor=dvipsnames option to \documentclass brings these color names into Beamer. See All about colors for details.

Experiment with various colors to find one that fits best with your style.

7.2  Specifying RGB colors

Should you find the set of colors defined in dvipsnam.def too limited, you may define your own colors by specifying their RGB components. Each RGB component should be in the 0-255 range.

For instance, with RGB={205,173,0} we get a dark shade of gold:

\documentclass{beamer}
\usecolortheme[RGB={205,173,0}]{structure}
\usetheme[height=7mm]{Rochester}





Remark: On the Department of Mathematics and Statistics machines, the command xcolorsel brings up a very nice tool that shows you a large number of color patches and their RGB components.


Remark: RGB components may be given either as integers in the 0-255 range or as fractional numbers in the 0.00-1.00 range. To specify the latter, use the lowercase version of the rgb option, as in: rgb={0.2264,0.1561,0.0000}.

7.3  Direct use of the structure color

The command \textcolor{red}{a colored text} produces a colored text. Here, the text's color, red, is hard-coded into our LaTeX source therefore the color is always red -- it's static.

A more interesting dynamic effect is achieved by using the command \structure{a colored text}. The given text will be colored according to the structure color. When you change the structure color, say from blue to gold, the text's color will change accordingly.

See the section A complete presentation for a sample presentation in which I use the \structure{...} command to produce colored text in several places.

7.4  Changing the itemization markers

The Rochester theme uses square markers for itemized and enumerated lists. The command \setbeamertemplate{items}[ball] changes the markers to simulated 3-dimensional balls, as shown the the following code and the corresponding output:

\documentclass[xcolor=dvipsnames]{beamer}
\usecolortheme[named=Plum]{structure}
\usetheme[height=7mm]{Rochester}
\setbeamertemplate{items}[ball]





Possible options to \setbeamertemplate{items} are:
ball:
3-dimensional balls
circle:
2-dimensional (flat) circles
rectangle:
rectangles
default:
triangles


7.5  Rounded boxes and shadows

To add rounded corners and a shadow to the box that surrounds the theorem in the sample slides shown above, do:

\documentclass[xcolor=dvipsnames]{beamer}
\usecolortheme[named=OliveGreen]{structure}
\usetheme[height=7mm]{Rochester}
\setbeamertemplate{items}[ball]
\setbeamertemplate{blocks}[rounded][shadow=true]





To get rounded corners but no shadows, set [shadow=false].

7.6  Getting rid of the navigation icons

Most Beamer themes put a row of navigation icons on slides. (See the little marks along the bottom edge of the slide shown above.) I consider these pretty useless and distracting. To disable the drawing of navigation icons, add the command: \setbeamertemplate{navigation symbols}{} to your document, as in:

\documentclass[xcolor=dvipsnames]{beamer}
\usecolortheme[named=Apricot]{structure}
\usetheme[height=7mm]{Rochester}
\setbeamertemplate{items}[ball]
\setbeamertemplate{blocks}[rounded][shadow=true]
\setbeamertemplate{navigation symbols}{}





OK, good, they are gone!

7.7  Adding an informative footline

A footline is a narrow strip along the bottom edge of a slide that shows the name of the author, the title of the presentation, slide number, and other useful information.

Beamer themes Boadilla and Madrid provide such a footline by default. Other themes don't. However it is possible to add a footline to any theme by using the \useoutertheme{infolines} command, as in:

\documentclass[xcolor=dvipsnames]{beamer}
\usecolortheme[named=Apricot]{structure}
\useoutertheme{infolines}
\usetheme[height=7mm]{Rochester}
\setbeamertemplate{items}[ball]
\setbeamertemplate{blocks}[rounded][shadow=true]
\setbeamertemplate{navigation symbols}{}
\author{Rouben Rostamian}
\title{Beamer tutorial}
\institute{UMBC}





Remark: It is a Beamer idiosyncrasy (a polite way of saying a bug) that \useoutertheme{infolines} must come before \usetheme[height=7mm]{Rochester}. If you reverse the order, the slide's title will be cut off.


Remark: Most of the footline information is culled from the data provided in the preamble, such as \author, \title, etc.





I have written an alternative footline theme called umbcfootline. You will find the details of umbcfootline in The UMBC footline. Here is what it looks like:

\documentclass[xcolor=dvipsnames]{beamer}
\usecolortheme[named=Apricot]{structure}
\usetheme[height=7mm]{Rochester}
\setbeamertemplate{items}[ball]
\setbeamertemplate{blocks}[rounded][shadow=true]
%\setbeamertemplate{navigation symbols}{}  % see Remark below
\useoutertheme{umbcfootline}
\author{Rouben Rostamian}
\title{Beamer tutorial}
\institute{UMBC}






Remark: The umbcfootline theme disables the navigation symbols, therefore the \setbeamertemplate{navigation symbols}{} is no more needed. That's why I have commented it out in the shown code fragment.

论坛徽章:
0
10 [报告]
发表于 2008-05-29 16:46 |只看该作者
8  UMBC themes

I have created four themes which you may use just like any other Beamer theme.3 These are named: umbc1, umbc2, umbc3 and umbc4.

The umbc1 theme

\documentclass{beamer}
\usetheme{umbc1}





The umbc2 theme

This is a slight variation on Beamer 3.01's Singapore theme or Beamer 2.21's Classic theme.

\documentclass{beamer}
\usetheme{umbc2}





The umbc3 theme

This is inspired by a PowerPoint theme.

\documentclass{beamer}
\usetheme{umbc3}





The umbc4 theme

This is inspired by a well-known PowerPoint theme.

\documentclass{beamer}
\usetheme{umbc4}





Customizing the umbc themes

Beamer customization options described in Customizing themes apply to UMBC themes as well. For instance, here is what umbc2 looks like in the RawSienna color and centered title in italics:

\documentclass[xcolor=dvipsnames]{beamer}
\usetheme{umbc2}
\usecolortheme[named=RawSienna]{structure}
\setbeamerfont{frametitle}{family=\rmfamily,shape=\itshape}
\setbeamertemplate{frametitle}[default][center]






Remark: If you have a department account, you don't need to do anything special to use the UMBC themes -- they are already installed. If you don't have a department account, you may download the UMBC theme collection beamer-umbc.tar.gz and install alongside Beamer's own theme files. Here is the beamer-umbc.readme file from that collection.







3 UMBC themes do not provide navigation bars. I haven't mentioned navigation bars in these notes because I don't like them. In my opinion, navigation bars are distracting and unnecessary. Sectioning commands are ignored in UMBC themes but \tableofcontents still works.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP