Debian Codegraph @

texmf-dist/doc/latex/texpower/slidesdemo.tex

raw
1 %%
2 %% This is file `slidesdemo.tex',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% texpower-doc.dtx (with options: `slidesdemo')
8 %%
9 %% --------------------------------------------------------------
10 %% TeXPower bundle - dynamic online presentations with LaTeX
11 %% Copyright (C) 1999-2004 Stephan Lehmke
12 %% Copyright (C) 2003-2005 Hans Fredrik Nordhaug
13 %%
14 %% This program is free software; you can redistribute it and/or
15 %% modify it under the terms of the GNU General Public License
16 %% as published by the Free Software Foundation; either version 2
17 %% of the License, or (at your option) any later version.
18 %%
19 %% This program is distributed in the hope that it will be useful,
20 %% but WITHOUT ANY WARRANTY; without even the implied warranty of
21 %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 %% GNU General Public License for more details.
23 %% --------------------------------------------------------------
24 %%
25 %% The list of all files belonging to the TeXPower bundle is
26 %% given in the file `00readme.txt'.
27 %%
28 \ProvidesFile{slidesdemo.tex}%
29 [2005/04/07 TeXPower example file]
30 %-----------------------------------------------------------------------------------------------------------------
31 %
32 % Simple examples the for combining the slides class with the dynamic features provided by the package texpower.sty.
33 %
34 %-----------------------------------------------------------------------------------------------------------------
35
36 \documentclass[landscape]{slides}
37
38 % slides understands the landscape option, but to get it through to pdflatex, we need to set \pdfpageheight etc. The
39 % package fixseminar does this.
40
41 \usepackage{fixseminar}
42
43 % We need to set this page style globally so all dynamically built slides have the right headers.
44
45 \pagestyle{slide}
46
47
48 %-----------------------------------------------------------------------------------------------------------------
49 % The texpower package is loaded.
50 % We give the display option so dynamic features are enabled.
51 %
52 \usepackage[display]{texpower}
53
54
55 \begin{document}
56
57 \begin{slide}
58 \title{The \code{texpower} Package\\{\normalfont \texttt{slides} Demo}}
59 \author{Stephan Lehmke\\\code{mailto:[email protected]}}
60 \maketitle
61 \end{slide}
62
63 \begin{slide}
64 \begin{center}
65 \textbf{A list environment}
66 \end{center}
67
68 % The \pause command `splits' the current page at the place it appears, producing two pages, one with everything which
69 % came before the \pause command, one containing this and additionally the stuff coming after \pause. When these pages
70 % are presented with acrobar reader in full screen mode (or any other viewer with this capability), the presentation
71 % will appear to `stop' at the point the \pause command was issued and `resume' in the moment the presenter switches to
72 % the next page.
73
74 \pause
75
76 % As \pause forces a paragraph break, it can not be used to separate a description label from the associated text. For
77 % this, we use the (very flexible) \stepwise command. Inside the argument of \stepwise, an arbitrary number of \step
78 % commands may occur. \stepwise will produce as many pages as there are \step commands, making the arguments of the
79 % \step commands appear ``one by one''.
80
81 \stepwise
82 {%
83 \begin{description}
84 \item[foo.] \step{bar.}
85 \step{\item[baz.]} \step{qux.}
86 \end{description}
87 }
88
89 \end{slide}
90
91
92 \begin{slide}
93 \begin{center}
94 \textbf{An aligned equation}
95 \end{center}
96
97 \pause
98
99 % Normally for \stepwise, if a \step is not yet active, its argument is ignored completely. This would disturb
100 % alignments, because the width changes with every new activated \step.
101 % \parstepwise is a variant of \stepwise where the argument of an inactive \step is put into a \phantom, leaving the
102 % proper amount of white space.
103
104 \parstepwise
105 {%
106 % Using eqnarray with equation numbers here means all equation numbers will be visible from the outset, because only
107 % the contents of the lines are `filled in'. See the full demo for an example of aligned equations where equation
108 % numbers `appear'.
109 \begin{eqnarray}
110 %
111 % When the argument of \step is put into a box (as it happens with \parstepwise), tabulators can not go in there. As
112 % we want the equals sign to appear at the same time as the right side of the equation, we use \restep for the
113 % latter. \restep is like \step, but it appears at the same time as the previous \step command.
114 %
115 \sum_{i=1}^{n} i & \step{=} & \restep{1 + 2 + \cdots + (n-1) + n}\\
116 %
117 & \step{=} & \restep{1 + n + 2 + (n-1) + \cdots}\\
118 %
119 & \step{=} & \restep
120 {% We can nest \step commands inside each other. The order of execution is just the
121 % order of appearance, independent of nesting.
122 % \switch is a variant of \step which takes two arguments and toggles between them on
123 % activation. This way, we can make the \underbrace `appear'.
124 % We insert a \vphantom in the first argument so that the equation numbers will be
125 % placed correctly whether or not the underbrace is didplayed.
126 \switch
127 {%
128 \vphantom{\underbrace{(1 + n) + \cdots + (1 + n)}_{\times\frac{n}{2}}}%
129 (1 + n) + \cdots + (1 + n)%
130 }
131 {\underbrace{(1 + n) + \cdots + (1 + n)}_{\times\frac{n}{2}}}%
132 }
133 \\
134 %
135 % This is another nested application of \step. Note that the spacing of \cdot has to be corrected manually by
136 % inserting {} left of it, because otherwise it would behave like a prefix operator.
137 %
138 & \step{=} & \restep{\frac{(1 + n)\step{{}\cdot n}}{\restep{2}}}
139 \end{eqnarray}
140 }
141 \end{slide}
142
143 \begin{slide}
144 \begin{center}
145 \textbf{An array}
146 \end{center}
147
148 \stepwise
149 {% With arrays, beware of problems with automatic calculation of cell widths.
150 %
151 % If you want all widths to be calculated automatically, you need to use \parstepwise, with the consequence that
152 % a) tabulators or newlines can not go into the argument of \step,
153 % b) the array `structure' (rules) will be completely visible right from the beginning.
154 %
155 % If you want to use \stepwise for being able to build the `structure' (like \hilne's) dynamically (as done in the
156 % following), you have to make sure that the cell widths are correct from the very first line, because otherwise the
157 % array will expand horizontally, destroying the dynamic effect. This can be assured by
158 % a) using only p cells,
159 % b) making sure all the cells in the first line are at least as wide as the widest cell which will appear later. If
160 % you are using the calc package, this is easiest by putting \makebox[\widthof{widest entry}]{first entry} into
161 % the first cell. Otherwise, you can use \settowidth.
162 %
163 \begin{displaymath}
164 \begin{array}{rrrrr}
165 \step
166 {%
167 n & \log n & n\log n & \lefteqn{n^2}\phantom{25} & \lefteqn{2^n}\phantom{32} \\
168 \hline%
169 }%
170 \step{0 &} \step{\textrm{---} &} \step{\textrm{---} &} \step{0 &} \step{1 \\}%
171 \step{1 &} \step{0\phantom{.6} &} \step{0\phantom{.8} &} \step{1 &} \step{2 \\}%
172 \step{2 &} \step{1\phantom{.6} &} \step{2\phantom{.8} &} \step{4 &} \step{4 \\}%
173 \step{3 &} \step{1.6 &} \step{4.8 &} \step{9 &} \step{8 \\}%
174 \step{4 &} \step{2\phantom{.6} &} \step{8\phantom{.8} &} \step{16 &} \step{16 \\}%
175 \step{5 &} \step{2.3 &} \step{11.6 &} \step{25 &} \step{32 }%
176 \end{array}
177 \end{displaymath}
178 }
179 \end{slide}
180
181 \begin{slide}
182 \begin{center}
183 \textbf{A picture}
184 \end{center}
185
186 \pause
187
188 \begin{center}%
189 \stepwise
190 {%
191 \setlength{\unitlength}{1.6cm}%
192 \delimitershortfall-1sp% Just for the nested braces
193 \begin{picture}(14,2)
194 \put(0,1){\vector(1,0){1}}
195 \put(0.5,0.5){\makebox(0,0){\small $x(t)$}}
196 \put(13,1){\vector(1,0){1}}
197 \put(13.5,0.5){\makebox(0,0){\small $y(t)$}}
198 \step
199 {
200 \put(1,1){\line(3,2){1.5}}
201 \put(1,1){\line(3,-2){1.5}}
202 \put(2.5,0){\line(0,1){2}}
203 \put(2,1){\makebox(0,0){\large $\varphi$}}
204 }
205 \step
206 {
207 \put(2.5,1){\vector(1,0){3.5}}
208 \put(4.25,0.5){\makebox(0,0){\small $F_t = \varphi\left(x(t)\right)$}}
209 }
210 \step
211 {
212 \put(6,0){\framebox(2,2){\large $\Phi$}}
213 }
214 \step
215 {
216 \put(8,1){\vector(1,0){3.5}}
217 %
218 % Here, we find another nested use of \step inside \step.
219 % \bstep is a variant of \step which _always_ puts its argument into a box for leaving the correct amount of
220 % white space. We cannot use \parstepwise here because \put can't go into a box. Hence, just using \step for
221 % building the nested formula on the next line would give the wrong size for the nested braces.
222 %
223 \put(9.75,0.5){\makebox(0,0){\small $G_t = \Phi\left(\bstep{\varphi\left(\bstep{x(t)}\right)}\right)$}}
224 }
225 \step
226 {
227 \put(13,1){\line(-3,2){1.5}}
228 \put(13,1){\line(-3,-2){1.5}}
229 \put(11.5,0){\line(0,1){2}}
230 \put(12,1){\makebox(0,0){\large $\delta$}}
231 }
232 \end{picture}%
233 }%
234 \end{center}%
235 \end{slide}
236 \end{document}
237 \endinput
238 %%
239 %% End of file `slidesdemo.tex'.