summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/texpower/panelexample.tex
blob: 75a83b7e7a50fb1ecc6415764adaf6570ae7f28d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
%%
%% This is file `panelexample.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% texpower-doc.dtx  (with options: `panelexample')
%% 
%% --------------------------------------------------------------
%% TeXPower bundle - dynamic online presentations with LaTeX
%% Copyright (C) 1999-2004 Stephan Lehmke
%% 
%% This program is free software; you can redistribute it and/or
%% modify it under the terms of the GNU General Public License
%% as published by the Free Software Foundation; either version 2
%% of the License, or (at your option) any later version.
%% 
%% This program is distributed in the hope that it will be useful,
%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%% GNU General Public License for more details.
%% --------------------------------------------------------------
%% 
%% The list of all files belonging to the TeXPower bundle is
%% given in the file `00readme.txt'.
%% 
\ProvidesFile{panelexample.tex}%
      [2004/07/27 TeXPower example file]
%------------------------------------------------------------------------------
% File: panelexample.tex
%
% Example for the panel facilities of TeXPower.
%
% This file can be compiled with pdfLaTeX or (standard) LaTeX. When
% using standard LaTeX, the dvi file produced should
% be converted to pdf afterwards (using dvips+distill/ps2pdf or
% dvipdf, for instance).
%
% The resulting pdf file is meant for presenting `interactively' with
% Adobe Acrobat Reader.
%
%------------------------------------------------------------------------------
% Author: Stephan Lehmke <Stephan.Lehmke@cs.uni-dortmund.de>
%
% v0.1 Nov 14, 2000: First version for the pre-alpha release of TeXPower.
%
% v0.2 May 02, 2003: English version.
%

%------------------------------------------------------------------------------
% Enable all color emphasis and highlighting options. Use white
% background and slifonts.

\PassOptionsToPackage{coloremph,colormath,colorhighlight,whitebackground}
{texpower}

% Input the generic preamble.

\input{__TPpreamble}

\usepackage{tpslifonts}

\hypersetup{pdftitle={texpower panel example}}

%------------------------------------------------------------------------------
% Settings individual for this example.

\renewcommand{\buttonsep}{2pt}
\renewcommand{\buttonshadowhshift}{1pt}
\renewcommand{\buttonshadowvshift}{-1pt}

\usepackage{graphicx}
% The mps extension isn't supported out-of-the-box for latex+dvips
\ifthenelse{\boolean{psspecialsallowed}}{%
\DeclareGraphicsExtensions{.mps}}{}

\newcounter{typed}

\makeatletter
\newcommand{\storehead}[3]
{%
  \global\let\@typed=\empty
  \setcounter{typed}{0}%
  \def\@typeto{#2}%
  \let\type@next=\@typeit
  \type@next#3\@nil
  \global\let#1=\@typed
}

\newcommand{\@typeit}[1]
{%
  \ifx\@nil#1
   \else
    \stepcounter{typed}%
    \ifthenelse{\value{typed}>\@typeto}
    {\let\type@next=\@gobbletail}
    {\g@addto@macro\@typed{#1}}%
    \expandafter\type@next
  \fi
}

\long\def\@gobbletail#1\@nil{}

\newcounter{i}

\newsavebox\logobox
\newsavebox\hookbox

\makeatother

\mklength{\slidetopmargin}{\ht\logobox*\ratio{1cm}{\semcm}}

\newlength{\buttonwidth}

\newcommand{\mybutton}[2]
{\raisebox{\depth}{\makebox[\buttonwidth][l]{\button[\buttonwidth]{#1}{#2}}}}

\slidesonlyfalse\notestrue\noxcomment

\begin{document}

% Because the Context Support Macros are loaded at BeginDocument
\savebox\hookbox{\includegraphics[width=1cm]{fig-2}}
\makeatletter
\savebox\logobox{\includegraphics[width=\strip@pt\paperwidth truept]{fig-3}}
\makeatother
\savebox\logobox{\raisebox{0cm}[\height-2ex][0pt]{\rlap{\usebox{\logobox}}}}

\pageDuration{0.01}

\begingroup
\loop
 \ifnum\value{i}<76
  \stepcounter{i}%
  \storehead{\partialtext}{\value{i}}
  {%
    Panels\space automatically\space adapt\space to\space the\space
    size\space of\space their\space contents.\par
    They\space can\space be\space placed
  }%
  \DeclarePanel{left}
  {%
    \leavevmode\scriptsize
    \mbox{\usebox{\logobox}}

    {\bfseries Stephan Lehmke

      Lehr\-stuhl Informatik~I}

    \vfill

    \nointerlineskip
    \rule{\linewidth}{\fboxrule}

    \nointerlineskip\kern1ex
    \partialtext

    \nointerlineskip\kern1ex
    \rule{\linewidth}{\fboxrule}

    \vfill

    \ifthenelse{\lengthtest{\linewidth>2cm}}
    {\setlength{\buttonwidth}{.5\linewidth-.5ex}}
    {\setlength{\buttonwidth}{\linewidth}}%
    %
    \lineskip1ex\relax
    %
    \mybutton{\Acrobatmenu{FirstPage}}{Start}\hfill
    \mybutton{\Acrobatmenu{LastPage}}{End}\hfill
    \mybutton{\Acrobatmenu{PrevPage}}{Prev}\hfill
    \mybutton{\Acrobatmenu{NextPage}}{Next}

    \mbox{\usebox{\hookbox}}
  }%

  \backgroundstyle{plain}

  \mklength{\slideleftmargin}{\leftpanelwidth*\ratio{1cm}{\semcm}+.5cm}
  \setlength{\slidewidth}{\paperwidth-\slideleftmargin-\sliderightmargin}

  \begin{slide}
    \makeslidetitle{\TeX Power Example: panels}
  \end{slide}

\repeat
\endgroup

\DeclarePanel*{left}{}
\setcounter{i}{0}

\setlength{\buttonwidth}{1.5cm}

\DeclarePanel*{bottom}
{%
  \leavevmode\scriptsize\smash{\usebox{\hookbox}}\hfill%
  \mybutton{\Acrobatmenu{FirstPage}}{Start}~%
  \mybutton{\Acrobatmenu{LastPage}}{End}~%
  \mybutton{\Acrobatmenu{PrevPage}}{Prev}~%
  \mybutton{\Acrobatmenu{NextPage}}{Next}%
}

\mklength{\slidebottommargin}{\bottompanelheight*\ratio{1cm}{\semcm}+.5cm}

\begingroup
\loop
 \ifnum\value{i}<24
  \stepcounter{i}%
  \storehead{\partialtext}{\value{i}}
  {%
    on\space any\space side\space of\space the\space page.
  }%
  \DeclarePanel{top}
  {%
    \leavevmode\scriptsize\parskip0pt\relax
    \mbox{\usebox{\logobox}}

    \medskip

    \parbox[t]{\widthof{\bfseries Lehrstuhl Informatik~I}}
    {\bfseries Stephan Lehmke\\ Lehrstuhl Informatik~I}\quad
    \parbox[t]{\linewidth-\widthof{\bfseries Lehrstuhl Informatik~I}-3cm}
    {%
      Panels\space automatically\space adapt\space to\space the\space
      size\space of\space their\space contents.\par
      They\space can\space be\space placed
      \partialtext
    }
  }%

  \backgroundstyle{plain}

  \mklength{\slidetopmargin}{\toppanelheight*\ratio{1cm}{\semcm}+.5cm}
  \setlength{\slideheight}{\paperheight-\slidetopmargin-\slidebottommargin}

  \begin{slide}
    \small\makeslidetitle{\TeX Power Example: panels}
  \end{slide}

\repeat
\endgroup

\DeclarePanel*{top}{}
\setlength{\slideheight}{\paperheight-\slidetopmargin-\slidebottommargin}

\setcounter{i}{0}

\makeatletter
\savebox\logobox
{%
  \raisebox{0cm}[\height-1.5ex][0pt]
  {\llap{\includegraphics[width=\strip@pt\paperwidth truept-1cm]{fig-3}}}%
}
\makeatother

\mklength{\slidetopmargin}{\ht\logobox*\ratio{1cm}{\semcm}}

\begingroup
\loop
 \ifnum\value{i}<146
  \stepcounter{i}%
  \storehead{\partialtext}{\value{i}}
  {%
    Normally,\space automatic\space line\space breaks\space are\space
    not\space needed\space inside\space panels,\space but\space
    it\space is\space nice\space that\space the\space size\space
    automatically\space adapts\space to\space the\space size\space
    of\space logos,\space buttons\space etc.
  }%
  \DeclarePanel{right}
  {%
    \leavevmode\scriptsize
    \hspace*{\fill}\mbox{\usebox{\logobox}}\hspace*{-1.5ex}

    \medskip

    {\bfseries Stephan Lehmke

      Lehr\-stuhl Informatik~I}

    \vfill

    \nointerlineskip
    \rule{\linewidth}{\fboxrule}

    \nointerlineskip\kern1ex
    Panels\space automatically\space adapt\space to\space the\space
    size\space of\space their\space contents.\par
    They\space can\space be\space placed on\space any\space side\space
    of\space the\space page.

    \partialtext
  }%

  \backgroundstyle[hpanels=false]{plain}

  \mklength{\sliderightmargin}{\rightpanelwidth*\ratio{1cm}{\semcm}+.5cm}
  \setlength{\slidewidth}{\paperwidth-\slideleftmargin-\sliderightmargin}

  \begin{slide}
    \makeslidetitle{\TeX Power Example: panels}
  \end{slide}

\repeat
\endgroup

\hypersetup{pdfpageduration={}}


\end{document}
\endinput
%%
%% End of file `panelexample.tex'.