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\unprotect
27
28\newbox \presentationstack
29\newcounter \presentationcounter
30\newdimen \presentationheight
31
32\appendtoks\doglobal\newcounter\presentationcounter\to\everyshipout
33
34\defineframedtext
35 [presentationshield]
36
37\setupframedtexts
38 [presentationshield]
39 [\c!background=\v!color,
40 \c!backgroundcolor=StepColor,
41 \c!offset=\v!overlay,
42 \c!frame=\v!off]
43
44\definecolor[StepColor][white]
45
46\def\enablepresentationstep
47 {\let\enablepresentationstep\relax
48 \useJSpreamblenow{presentation}
49 \setuptexttexts
50 [\vbox to \textheight
51 {\dopresentationstep1\box\presentationstack\vfill}]}
52
53\def\presentationstep
54 {\dopresentationstep0}
55
56\def\dopresentationstep#1
57 {\global\setbox\presentationstack=\vbox
58 {\ifnum\presentationcounter=0
59 \global\presentationheight=\!!zeropoint
60 \fi
61 \ifcase#1\relax
62 \scratchdimen=\pagetotal
63 \else
64 \scratchdimen=\textheight
65 \fi
66 \advance\scratchdimen by \presentationheight
67 \edef\presentationstepheight{\the\scratchdimen}
68 \global\presentationheight=\pagetotal
69 \forgetall
70 \offinterlineskip
71 \dontcomplain
72 \box\presentationstack
73 \doglobal\increment\presentationcounter
74 \scratchcounter=\realpageno \multiply\scratchcounter by 100
75 \advance\scratchcounter by \presentationcounter
76 \edef\presentationtag{presentation:\the\scratchcounter}
77 \setupfield
78 [presentation]
79 [\c!width=\v!fit,\c!height=\v!fit,\c!offset=\v!overlay,
80 \c!strut=\v!no,\c!frame=\v!off,\c!option=\v!readonly]
81 \definesymbol
82 [\presentationtag]
83 [\presentationshade]
84 \def\presentationshade
85 {\presentationshield
86 [\c!width=\textwidth,\c!height=\presentationstepheight]{}}
87 \definefield[\presentationtag][check][presentation][\presentationtag,\v!none][\presentationtag]
88 \fitfield[\presentationtag]}}
89
90\startJSpreamble {presentation} used later
91 var presentation = new Array() ;
92 for (i=1;i<=\lastpage;i)
93 { presentation[i] = 0 }
94 this.dirty = false ;
95 function NextPresentation (pagenumber)
96 {
97 presentation[pagenumber] = presentation[pagenumber] 1 ;
98 var dummy = 100*pagenumber presentation[pagenumber] ;
99 var v = this.getField("presentation:"dummy) ;
100 if (v)
101 { v.hidden = true }
102
103 else
104 { pagenumber ;
105 if (pagenumber<=\lastpage)
106 { presentation[pagenumber] = presentation[pagenumber] 1 ;
107 dummy = 100*(pagenumber) presentation[pagenumber] ;
108 v = this.getField("presentation:"dummy) ;
109 if (v) { v.hidden = true }
110
111 this.pageNum } }
112 this.dirty = false }
113\stopJSpreamble
114
115\definereference[NextStep][JS(NextPresentation{\realfolio})]
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\newif\ifautopresentationstep
192
193\appendtoks \ifautopresentationstep\presentationstep\fi \to \everypar
194
195\doifmode{step} {\enablepresentationstep}
196\doifmode{autostep}{\autopresentationsteptrue\enablepresentationstep}
197
198
199
200
201
202\doifmode{comment}{\setuppagecomment[state=start,location=bottom]}
203
204\protect \endinput
205 |