Debian Codegraph @

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

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