Debian Codegraph @

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

raw
1 %%
2 %% This is file `panelexample.tex',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% texpower-doc.dtx (with options: `panelexample')
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{panelexample.tex}%
29 [2005/04/07 TeXPower example file]
30 %------------------------------------------------------------------------------
31 %
32 % Example for the panel facilities of TeXPower.
33 %
34 %------------------------------------------------------------------------------
35 % Enable all color emphasis and highlighting options. Use white
36 % background and slifonts.
37
38 \PassOptionsToPackage{coloremph,colormath,colorhighlight,whitebackground}
39 {texpower}
40
41 % Input the generic preamble.
42
43 \input{__TPpreamble}
44
45 \usepackage{tpslifonts}
46
47 \hypersetup{pdftitle={texpower panel example}}
48
49 %------------------------------------------------------------------------------
50 % Settings individual for this example.
51
52 \renewcommand{\buttonsep}{2pt}
53 \renewcommand{\buttonshadowhshift}{1pt}
54 \renewcommand{\buttonshadowvshift}{-1pt}
55
56 \usepackage{graphicx}
57 % The mps extension isn't supported out-of-the-box for latex+dvips
58 \ifthenelse{\boolean{psspecialsallowed}}{%
59 \DeclareGraphicsExtensions{.mps}}{}
60
61 \newcounter{typed}
62
63 \makeatletter
64 \newcommand{\storehead}[3]
65 {%
66 \global\let\@typed=\empty
67 \setcounter{typed}{0}%
68 \def\@typeto{#2}%
69 \let\type@next=\@typeit
70 \type@next#3\@nil
71 \global\let#1=\@typed
72 }
73
74 \newcommand{\@typeit}[1]
75 {%
76 \ifx\@nil#1
77 \else
78 \stepcounter{typed}%
79 \ifthenelse{\value{typed}>\@typeto}
80 {\let\type@next=\@gobbletail}
81 {\g@addto@macro\@typed{#1}}%
82 \expandafter\type@next
83 \fi
84 }
85
86 \long\def\@gobbletail#1\@nil{}
87
88 \newcounter{i}
89
90 \newsavebox\logobox
91 \newsavebox\hookbox
92
93 \makeatother
94
95 \mklength{\slidetopmargin}{\ht\logobox*\ratio{1cm}{\semcm}}
96
97 \newlength{\buttonwidth}
98
99 \newcommand{\mybutton}[2]
100 {\raisebox{\depth}{\makebox[\buttonwidth][l]{\button[\buttonwidth]{#1}{#2}}}}
101
102 \slidesonlyfalse\notestrue\noxcomment
103
104 \begin{document}
105
106 % Because the Context Support Macros are loaded at BeginDocument
107 \savebox\hookbox{\includegraphics[width=1cm]{fig-2}}
108 \makeatletter
109 \savebox\logobox{\includegraphics[width=\strip@pt\paperwidth truept]{fig-3}}
110 \makeatother
111 \savebox\logobox{\raisebox{0cm}[\height-2ex][0pt]{\rlap{\usebox{\logobox}}}}
112
113 \pageDuration{0.01}
114
115 \begingroup
116 \loop
117 \ifnum\value{i}<76
118 \stepcounter{i}%
119 \storehead{\partialtext}{\value{i}}
120 {%
121 Panels\space automatically\space adapt\space to\space the\space
122 size\space of\space their\space contents.\par
123 They\space can\space be\space placed
124 }%
125 \DeclarePanel{left}
126 {%
127 \leavevmode\scriptsize
128 \mbox{\usebox{\logobox}}
129
130 {\bfseries Stephan Lehmke
131
132 Lehr\-stuhl Informatik~I}
133
134 \vfill
135
136 \nointerlineskip
137 \rule{\linewidth}{\fboxrule}
138
139 \nointerlineskip\kern1ex
140 \partialtext
141
142 \nointerlineskip\kern1ex
143 \rule{\linewidth}{\fboxrule}
144
145 \vfill
146
147 \ifthenelse{\lengthtest{\linewidth>2cm}}
148 {\setlength{\buttonwidth}{.5\linewidth-.5ex}}
149 {\setlength{\buttonwidth}{\linewidth}}%
150 %
151 \lineskip1ex\relax
152 %
153 \mybutton{\Acrobatmenu{FirstPage}}{Start}\hfill
154 \mybutton{\Acrobatmenu{LastPage}}{End}\hfill
155 \mybutton{\Acrobatmenu{PrevPage}}{Prev}\hfill
156 \mybutton{\Acrobatmenu{NextPage}}{Next}
157
158 \mbox{\usebox{\hookbox}}
159 }%
160
161 \backgroundstyle{plain}
162
163 \mklength{\slideleftmargin}{\leftpanelwidth*\ratio{1cm}{\semcm}+.5cm}
164 \setlength{\slidewidth}{\paperwidth-\slideleftmargin-\sliderightmargin}
165
166 \begin{slide}
167 \makeslidetitle{\TeX Power Example: panels}
168 \end{slide}
169
170 \repeat
171 \endgroup
172
173 \DeclarePanel*{left}{}
174 \setcounter{i}{0}
175
176 \setlength{\buttonwidth}{1.5cm}
177
178 \DeclarePanel*{bottom}
179 {%
180 \leavevmode\scriptsize\smash{\usebox{\hookbox}}\hfill%
181 \mybutton{\Acrobatmenu{FirstPage}}{Start}~%
182 \mybutton{\Acrobatmenu{LastPage}}{End}~%
183 \mybutton{\Acrobatmenu{PrevPage}}{Prev}~%
184 \mybutton{\Acrobatmenu{NextPage}}{Next}%
185 }
186
187 \mklength{\slidebottommargin}{\bottompanelheight*\ratio{1cm}{\semcm}+.5cm}
188
189 \begingroup
190 \loop
191 \ifnum\value{i}<24
192 \stepcounter{i}%
193 \storehead{\partialtext}{\value{i}}
194 {%
195 on\space any\space side\space of\space the\space page.
196 }%
197 \DeclarePanel{top}
198 {%
199 \leavevmode\scriptsize\parskip0pt\relax
200 \mbox{\usebox{\logobox}}
201
202 \medskip
203
204 \parbox[t]{\widthof{\bfseries Lehrstuhl Informatik~I}}
205 {\bfseries Stephan Lehmke\\ Lehrstuhl Informatik~I}\quad
206 \parbox[t]{\linewidth-\widthof{\bfseries Lehrstuhl Informatik~I}-3cm}
207 {%
208 Panels\space automatically\space adapt\space to\space the\space
209 size\space of\space their\space contents.\par
210 They\space can\space be\space placed
211 \partialtext
212 }
213 }%
214
215 \backgroundstyle{plain}
216
217 \mklength{\slidetopmargin}{\toppanelheight*\ratio{1cm}{\semcm}+.5cm}
218 \setlength{\slideheight}{\paperheight-\slidetopmargin-\slidebottommargin}
219
220 \begin{slide}
221 \small\makeslidetitle{\TeX Power Example: panels}
222 \end{slide}
223
224 \repeat
225 \endgroup
226
227 \DeclarePanel*{top}{}
228 \setlength{\slideheight}{\paperheight-\slidetopmargin-\slidebottommargin}
229
230 \setcounter{i}{0}
231
232 \makeatletter
233 \savebox\logobox
234 {%
235 \raisebox{0cm}[\height-1.5ex][0pt]
236 {\llap{\includegraphics[width=\strip@pt\paperwidth truept-1cm]{fig-3}}}%
237 }
238 \makeatother
239
240 \mklength{\slidetopmargin}{\ht\logobox*\ratio{1cm}{\semcm}}
241
242 \begingroup
243 \loop
244 \ifnum\value{i}<146
245 \stepcounter{i}%
246 \storehead{\partialtext}{\value{i}}
247 {%
248 Normally,\space automatic\space line\space breaks\space are\space
249 not\space needed\space inside\space panels,\space but\space
250 it\space is\space nice\space that\space the\space size\space
251 automatically\space adapts\space to\space the\space size\space
252 of\space logos,\space buttons\space etc.
253 }%
254 \DeclarePanel{right}
255 {%
256 \leavevmode\scriptsize
257 \hspace*{\fill}\mbox{\usebox{\logobox}}\hspace*{-1.5ex}
258
259 \medskip
260
261 {\bfseries Stephan Lehmke
262
263 Lehr\-stuhl Informatik~I}
264
265 \vfill
266
267 \nointerlineskip
268 \rule{\linewidth}{\fboxrule}
269
270 \nointerlineskip\kern1ex
271 Panels\space automatically\space adapt\space to\space the\space
272 size\space of\space their\space contents.\par
273 They\space can\space be\space placed on\space any\space side\space
274 of\space the\space page.
275
276 \partialtext
277 }%
278
279 \backgroundstyle[hpanels=false]{plain}
280
281 \mklength{\sliderightmargin}{\rightpanelwidth*\ratio{1cm}{\semcm}+.5cm}
282 \setlength{\slidewidth}{\paperwidth-\slideleftmargin-\sliderightmargin}
283
284 \begin{slide}
285 \makeslidetitle{\TeX Power Example: panels}
286 \end{slide}
287
288 \repeat
289 \endgroup
290
291 \hypersetup{pdfpageduration={}}
292
293
294 \end{document}
295 \endinput
296 %%
297 %% End of file `panelexample.tex'.