1%D \module 2%D [ file=s-present-original, % was s-pre-01 3%D version=1997.07.22, 4%D title=\CONTEXT\ Style File, 5%D subtitle=Presentation Environment Original, 6%D author=Hans Hagen, 7%D date=\currentdate, 8%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] 9%C 10%C This module is part of the \CONTEXT\ macro||package and is 11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for 12%C details. 13 14%D This environment can be used to typeset interactive presentations. This module 15%D was first used at the 1997 \TUG\ meeting. The \MKIV\ variant is mostly the same 16%D but we adapted the colors a bit. 17 18\usemodule[present-general] 19 20\startmodule[present-original] 21 22%D \macros 23%D {language} 24%D 25%D Because this module is defined in english, we default to the english hyphenation 26%D patterns and labels too. This is default anyway. 27 28\mainlanguage 29 [en] 30 31%D \macros 32%D {setupbodyfont,setuplayout} 33%D 34%D For screen reading, a Lucida Bright font looks nice. We use a 14.4 point bodyfont 35%D for the main text, but switch back to 12 points for ornaments. 36 37\doifelsemode {asintended} { 38 \setupbodyfont[ludicaot,14.4pt] 39} { 40 \setupbodyfont[pagella,14.4pt] 41} 42 43\setuplayout 44 [style=smallbodyfont] 45 46\setupalign 47 [tolerant,stretch] 48 49%D \macros 50%D {definecolor} 51%D 52%D Screen presentations without color just look dull, so we enable color support. We 53%D define ourselves a yellowish backgroundcolor and a not too dark blue 54%D interactioncolor. 55 56% \definecolor [BackgroundColor] [r=1, g=1, b=.7] 57% \definecolor [InteractionColor] [r=.1, g=.5, b=.8] 58% \definecolor [ContrastColor] [r=.9, g=.5, b=.2] 59 60\definecolor [BackgroundColor] [r=.7, g=.7, b=.3] 61\definecolor [InteractionColor] [r=.1, g=.5, b=.8] 62\definecolor [ContrastColor] [r=.9, g=.5, b=.2] 63 64%D \macros 65%D {setuppapersize,setuplayout,setupinteractionscreen} 66%D 67%D We use a nice large screen, and dedicate the right edge and bottom part to 68%D navigational tools. We automatically set the width and height of the page and 69%D start up full screen. 70 71\setuppapersize 72 [S6][S6] 73 74\setuplayout 75 [topspace=12pt, 76 header=0pt, 77 footer=0pt, 78 height=402pt, % 450 - 12 - 15 - 12 - 12 + 3 79 bottomdistance=15pt, 80 bottom=12pt, 81 backspace=12pt, 82 margin=0pt, 83 width=fit, 84 edgedistance=12pt, 85 rightedge=96pt] 86 87\setupinteractionscreen 88 [option=max] 89 90%D \macros 91%D {setupbackgrounds} 92%D 93%D We set the pagecolor to yellow except the part of the screen that is used to 94%D display the running text. By seting the offset to 3pt the text will not touch the 95%D yellow parts. We do not set the depth. 96 97\setupbackgrounds 98 [page] 99 [background=color, 100 backgroundcolor=BackgroundColor] 101 102\setupbackgrounds 103 [text][text] 104 [background=color, 105 backgroundcolor=white, 106 backgroundoffset=3pt] 107 108%D I considered the next setup too, but finaly decided to 109%D comment it out. 110%D 111%D \starttyping 112%D \setupbackgrounds 113%D [bottom][text] 114%D [frame=on, 115%D framecolor=white] 116%D \stoptyping 117 118%D \macros 119%D {setupinteraction} 120%D 121%D We did not enable interactive text support yet, so let's do that now. We force 122%D page reference to circumvent problems with named destinations in buggy viewers. 123 124\setupinteraction 125 [page=yes, 126 color=InteractionColor, 127 contrastcolor=ContrastColor, 128 menu=on, 129 state=start] 130 131%D \macros 132%D {setupinteractionmenu,startinteractionmenu} 133%D 134%D At the bottom of the screen we show two navigational bars. At the left we show 135%D the subpage bar, at the right we use a non default backward|/|forward bar. 136 137\setupinteractionmenu 138 [bottom] 139 [leftoffset=3pt, 140 rightoffset=3pt] 141 142\startinteractionmenu[bottom] 143 \startcom \InteractionBar \stopcom 144 \hfill 145 \startcom \InteractionButtons \stopcom 146\stopinteractionmenu 147 148%D \macros 149%D {interactionbar} 150%D 151%D The left bar gets a white border (on the yellow background). Because we don't 152%D want to typeset an empty frame when no subpage bar is shown, we check for the 153%D number of subpages. 154 155\unexpanded\def\InteractionBar 156 {\ifnum\nofsubpages>\plusone 157 \framed 158 [framecolor=white, 159 rulethickness=1pt, 160 height=\bottomheight, 161 strut=no] 162 {\interactionbar[alternative=f,width=.5\makeupwidth,height=1ex]} 163 \fi} 164 165%D \macros 166%D {setupinteractionbar, interactionbuttons} 167%D 168%D The right hand buttons enable us to jump backward and forward, as well as to the 169%D previous and next jump. We also enable to close the presentation. 170 171\setupinteractionbar 172 [framecolor=white, 173 rulethickness=1pt, 174 height=\bottomheight, 175 strut=no] 176 177\unexpanded\def\InteractionButtons 178 {\interactionbuttons 179 [width=15em, 180 framecolor=white, 181 rulethickness=1pt, 182 height=\bottomheight, 183 strut=no, 184 distance=.5em] 185 [PreviousJump,NextJump, 186 firstpage, 187 firstsubpage,previouspage,nextpage,lastsubpage, 188 lastpage, 189 CloseDocument]} 190 191%D \macros 192%D {StartTitlePage, TitlePage} 193%D 194%D The titlepage is rather simple and can be typeset in two ways: 195%D 196%D \starttyping 197%D \StartTitlePage 198%D text \\ text \\ text 199%D \StopTitlepage 200%D \stoptyping 201%D 202%D or more straightforward: 203%D 204%D \starttyping 205%D \TitlePage{text\\text\\text} 206%D \stoptyping 207%D 208%D The first alternative can be used for more complicated title pages. 209 210\unexpanded\def\StartTitlePage 211 {\startstandardmakeup 212 \bfd 213 \setupinterlinespace 214 \setupalign[middle] 215 \vfil 216 \enforced\let\\\vfil} 217 218\unexpanded\def\StopTitlePage 219 {\vfil\vfil\vfil 220 \stopstandardmakeup} 221 222\unexpanded\def\TitlePage#1% 223 {\StartTitlePage#1\StopTitlePage} 224 225%D \macros 226%D {TitlePage, Topics, Topic, Subject} 227%D 228%D A presentation after loading this module looks like: 229%D 230%D \starttyping 231%D \TitlePage {About Whatever\\Topics} 232%D 233%D \Topics {Todays Talk} 234%D 235%D \Topic {Some topic} 236%D 237%D \Subject {Alfa} 238%D 239%D ..... 240%D 241%D \Subject {Beta} 242%D 243%D ..... 244%D \stoptyping 245 246%D \macros 247%D {definehead} 248%D 249%D The commands \type{\Topic} and \type{\Subject} are defined as copies of head. We 250%D use \type{\Nopic} for internal purposes. 251 252\definehead [Topic] [chapter] 253\definehead [Subject] [section] 254 255\definehead [Nopic] [title] 256 257%D \macros 258%D {setuphead} 259%D 260%D Because chapters and sections do not make sense in presentations, we use our own 261%D command for typesetting the titles. Sectionnumbers are of course hidden from 262%D viewing. Each topic is followed by a list of subjects that belong to the topic. 263 264\setuphead 265 [Topic,Nopic,Subject] 266 [command=\HeadLine, 267 page=yes, 268 style=\bfb, 269 after=\blank, 270 sectionnumber=no] 271 272\setuphead 273 [Topic] 274 [after=\PlaceSubjectList] 275 276\setuphead 277 [Subject] 278 [continue=no] 279 280%D \macros 281%D {framed, midalined} 282%D 283%D The command used to typeset the head lines is rather simple. We just center the 284%D framed title. The frame macro optimizes the alignment and at the same time 285%D enables us to typeset a nice colored rule. 286 287\unexpanded\def\HeadLine#1#2% 288 {\midaligned 289 {\framed 290 [framecolor=BackgroundColor, 291 rulethickness=1pt, 292 width=.8\hsize, 293 align=middle, 294 strut=no] 295 {#2}}} 296 297%D \macros 298%D {setuplist} 299%D 300%D The subject list is automatically placed. We center each subject line by using 301%D one of the default alternatives (g). We could have said: 302%D 303%D \starttyping 304%D \setuplist 305%D [Subject] 306%D [alternative=none, 307%D command=\SubjectListLine, 308%D interaction=all] 309%D 310%D \def\SubjectListLine#1#2#3% 311%D {\midaligned{#2}} 312%D \stoptyping 313%D 314%D But why should we complicate things when we can use alternative~\type{g}. The 315%D test is only needed if one does not automatically goes a new page with each 316%D subject. 317 318\unexpanded\def\PlaceSubjectList 319 {\blank 320 \determinelistcharacteristics[Subject] 321 \doifmode{*list}{\placelist[Subject]}} 322 323\setuplist 324 [Subject,Topic] 325 [alternative=g, 326 interaction=all, 327 before=, 328 after=] 329 330% %D \macros 331% %D {setuptexttexts} 332% %D 333% %D The topics will be listed in the right edge, using: 334% 335% \setuptexttexts 336% [edge] 337% [][\TopicList] 338 339%D \macros 340%D {setuplist, placelist,startinteractionmenu} 341%D 342%D The actual topic list is typeset using a \type{\vbox}. We have to specify 343%D \type{criteriumcriterium=all} because otherwise no list will be typeset. (By 344%D default lists are typeset locally.) 345 346\startinteractionmenu[right] 347 \placelist 348 [Topic] 349 [alternative=f, % command, % none, 350 maxwidth=\hsize, 351 width=\hsize, 352 offset=0pt, 353 criterium=all, 354 align=left, 355 style=\smallbodyfont\bfx] 356\stopinteractionmenu 357 358\unexpanded\def\Topics#1% temporary hack 359 {\Nopic{#1} 360 \placelist[Topic][criterium=all]} 361 362\unexpanded\def\Subjects 363 {} 364 365%D \macros 366%D {setupbackgrounds, overlaybutton} 367%D 368%D During a presentation, we want to use the cursor to point to parts of the text. 369%D Furthermore we want to be able to jump to the next page, without the need to move 370%D the cursor on buttons. Therefore we make the text part of the screen into an 371%D invisible button. 372%D 373%D In \MKII\ we put a button in he texttextsm here we just use an extra background. 374 375\defineoverlay[nextpage][\overlaybutton{nextpage}] 376 377\setupbackgrounds 378 [text][text] 379 [background={color,nextpage}] 380 381%D \macros 382%D {setupsubpagenumber} 383%D 384%D The left bottom navigation bar shows the subpages, which will be counted by text. 385%D One can change this in the preentation itself by saying \type {[way=byTopic]}. 386 387\setupsubpagenumber 388 [way=bytext, % byTopic, 389 state=start] 390 391\stopmodule 392 393\continueifinputfile{s-present-original.mkiv} 394 395\usemodule[present-common] 396 397\inputpresentationfile{examples/present-original-001.tex} 398 |