summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/metapost/slideshow
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-11 22:58:36 +0000
committerKarl Berry <karl@freefriends.org>2006-01-11 22:58:36 +0000
commitac3c55a3216b5988f0e48ba9414ddb059f19a699 (patch)
treea752ab12de05a9ac4511903abc09675172018fd6 /Master/texmf-dist/metapost/slideshow
parentd087712418726a64822e40ce1c0627a514d17975 (diff)
trunk/Master/texmf-dist/metapost
git-svn-id: svn://tug.org/texlive/trunk@104 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/metapost/slideshow')
-rw-r--r--Master/texmf-dist/metapost/slideshow/pathalong.mp53
-rw-r--r--Master/texmf-dist/metapost/slideshow/slideshow.mp387
-rw-r--r--Master/texmf-dist/metapost/slideshow/sshowex.mp42
-rw-r--r--Master/texmf-dist/metapost/slideshow/sshowex2.mp36
-rw-r--r--Master/texmf-dist/metapost/slideshow/sshowex3.mp23
-rw-r--r--Master/texmf-dist/metapost/slideshow/sshowintro.mp206
6 files changed, 747 insertions, 0 deletions
diff --git a/Master/texmf-dist/metapost/slideshow/pathalong.mp b/Master/texmf-dist/metapost/slideshow/pathalong.mp
new file mode 100644
index 00000000000..bc57cd6e262
--- /dev/null
+++ b/Master/texmf-dist/metapost/slideshow/pathalong.mp
@@ -0,0 +1,53 @@
+%% draw some text (t) along a curve (p)
+
+vardef pathalong (expr _p, t) =
+ save l, ll, del,let, pos, p;
+ picture let, ll;
+ path del, p;
+
+ l := length(t) - 1;
+ pos = 0;
+ p := _p;
+
+ ll := nullpicture;
+
+ for i := 0 upto l:
+
+ let := substring (i,i+1) of t infont defaultfont scaled defaultscale;
+
+ addto ll also (let rotated(angle(direction pos of p)))
+ shifted point pos of p;
+
+ del := (((xpart urcorner let, infinity)--(xpart urcorner let, -infinity))
+ rotated(angle(direction pos of p)))
+ shifted point pos of p;
+
+ p := subpath(pos,length(p)) of p;
+ pos := ypart (del intersectiontimes p);
+ exitif pos <= 0;
+
+ endfor;
+
+ ll
+enddef;
+
+%% draw the text contained in t so that the bottoms of the letters are on
+%% the base-line and the tops abut path p
+vardef textunder(expr p,t) =
+ save l, ll, pos, h, i;
+ picture l, ll;
+ numeric pos, h, i;
+ ll := nullpicture;
+ pos := 0;
+ for i = 0 upto (length t - 1):
+ l := substring(i, i+1) of t infont defaultfont scaled defaultscale;
+ h := ypart urcorner l;
+ if h > 0:
+ addto ll also (l yscaled ((ypart (((pos,-infinity)--(pos,infinity)) intersectionpoint p)) / ypart ulcorner l)) shifted (pos, 0);
+ fi;
+ pos := pos + xpart lrcorner l;
+ endfor;
+
+ ll
+enddef;
+
diff --git a/Master/texmf-dist/metapost/slideshow/slideshow.mp b/Master/texmf-dist/metapost/slideshow/slideshow.mp
new file mode 100644
index 00000000000..f7afbfadb4c
--- /dev/null
+++ b/Master/texmf-dist/metapost/slideshow/slideshow.mp
@@ -0,0 +1,387 @@
+%% simple metapost slide show
+%%
+%% Copyright 2001, Patrick TJ McPhee
+%% everyone is welcome to use this code for any purpose, to modify it, and
+%% to copy it in whole or in part for use in other macro sets, with the
+%% conditions that this copyright notice be preserved with any significant
+%% portion of the code, and that modifications to this file be clearly
+%% marked.
+%%
+%% see the file slideshow.txt for documentation
+%% $Header: /usr/home/ptjm/texmf/metapost/RCS/slideshow.mp 1.8 2001/08/06 18:48:17 pmcphee Exp $
+
+newinternal slideshowversion;
+slideshowversion := 1.0;
+
+%%
+%% basic figure handling
+%%
+
+picture lastpicture, background;
+
+% set the aspect ratio of the picture to match a 640x480 screen
+if not known lawidth:
+ lawidth := 6.4in;
+ laheight := 4.8in;
+fi;
+
+% make a sophisticated gradient background -- note that this can be done
+% natively in pdf 1.3 if you know how....
+def drawgradient(expr topcolour, botcolour) :=
+ save pw,l,r,t,b,shade,grad;
+
+ numeric l,r,t,b,pw;
+ color shade, grad;
+
+ % we will draw 100 coloured stripes across the screen
+ pw = laheight/100;
+ pickup pensquare scaled pw;
+ lft l = 0 = bot b;
+ rt r = lawidth;
+ t = laheight; % don't say `top t' because I want to over-extend
+
+ % shade is the colour of the current stripe, while grad
+ % is the amount to change on each stripe
+ shade := botcolour;
+ grad := (1/100)*(topcolour - botcolour);
+
+ for ypos := b step pw until t:
+ draw (l, ypos)--(r, ypos) withcolor shade;
+ shade := shade + grad;
+ endfor;
+enddef;
+
+% draw the background -- we'll make it blue, just like power point
+background := image(drawgradient((0,0,.3), (0,0,.5)););
+
+% `keep track' of figure numbers
+def nextfig := beginfig(charcode+1) enddef;
+
+% always save the current picture at the end of each figure,
+% so it can be used in the next one
+extra_endfig := extra_endfig & "lastpicture := currentpicture; currentpicture := background; if known lastpicture: draw lastpicture; fi;";
+
+% continue overlays the current picture with the last picture shipped out
+% this allows slides to be built up
+newinternal continuations;
+continuations := 0;
+def docontinue = if known lastpicture and (continuations = 1): currentpicture := lastpicture; bpos := bpos.prev; else: bpos := 0; fi; enddef;
+extra_beginfig := extra_beginfig & "docontinue;";
+
+% one might want to do that by default
+def continue = continuations := 1; enddef;
+% or not
+def endcontinue = continuations := 0; enddef;
+
+% break in continuation
+def discontinue = clearit; lastpicture := nullpicture; bpos := 0; bpos.prev := 0; enddef;
+
+
+%%
+%% drawing assists
+%%
+
+
+% we'll use two pens to draw figures
+pickup pencircle xscaled 5 pt yscaled 4 pt rotated 20;
+thick nib := savepen;
+
+pickup pencircle xscaled 2 pt yscaled 1 pt rotated 20;
+thin nib := savepen;
+
+%%
+%% text manipulation assists
+%%
+
+
+% and we'll make the text yellow, just like power-point
+color textcolour;
+textcolour := red+green;
+defaultfont := "phvr8r";
+
+
+% this is the thing we use as a bullet
+picture bulletpic;
+bulletpic := image(draw char(226) infont "pzdr" withcolor textcolour;);
+
+pair headerpos, footerpos, boff, borigin, borigin.in, blimit;
+numeric baselineskip, parskip, parskip.in, bpos;
+
+% positions of the bottom left corner of the header, and the bottom right
+% corner of the footer
+headerpos = (1in, 4in);
+footerpos = (6in, .2in);
+
+% offset of text from the bullet
+boff = (20bp, 0);
+
+% upper-left start position for bulletted text
+borigin = (1.5in,3.4in);
+
+% upper-left start position for indented bulletted text
+borigin.in = borigin + boff;
+
+% lower-right limit of bulletted text
+blimit = (4.4in,1in);
+
+% distance between baselines in bulletted text
+baselineskip = 11bp;
+
+% distance between bullet points for normal bullets
+parskip = 5 pt;
+
+% distance between bullet points for indented bullets
+parskip.in = 1pt;
+
+% current bullet position
+bpos = 0;
+
+% internal use - bullet position at the end of the last slide
+bpos.prev = 0;
+
+vardef breaktowidth(expr s, w)(text sheight) =
+ save p;
+ picture p;
+
+ p := s infont defaultfont scaled defaultscale;
+ % if the string is too long to fit within bounds, we break it up on
+ % word boundaries.
+ if xpart(lrcorner p - llcorner p) > w:
+ save q, offs, len, goodlen; picture q; numeric offs, len, goodlen;
+ picture q;
+ p := nullpicture;
+ offs := 0;
+ len := 1;
+ goodlen := 0;
+ forever:
+ exitunless len < length(s);
+ q := (substring(offs, len) of s) infont defaultfont scaled defaultscale;
+ if xpart (lrcorner q - llcorner q) > w:
+ sheight := sheight + baselineskip;
+ p := image(draw p shifted (0, baselineskip);
+ draw (substring(offs, goodlen) of s) infont defaultfont
+ scaled defaultscale;);
+ offs := goodlen + 1;
+ len := offs + 1;
+ fi;
+ if substring(len, len+1) of s = " ": goodlen := len; fi;
+ len := len + 1;
+ endfor;
+
+ p := image(draw p shifted (0, baselineskip);
+ draw (substring(offs, length s) of s) infont defaultfont
+ scaled defaultscale;);
+ fi;
+ p
+enddef;
+
+% bullet(text) or bullet(picture) writes bulletpic and text or picture
+% in the next bullet position on the screen
+% bullet.in(text) does the same thing, but indented. This can be
+% extended for arbitrary suffix tag by defining a pair called borigin.tag,
+% and a numeric called parskip.tag. Note that bpos is shared, so this really
+% only works for additional levels of indentation
+vardef bullet@#(expr s) =
+ save p, sheight;
+ numeric sheight;
+ picture p;
+
+ % add the parskip for this bullet type, unless we're at the top
+ if bpos > 0: bpos := bpos + parskip@#; fi
+
+ if picture s:
+ p := s;
+ sheight := ypart(ulcorner p - llcorner p) - baselineskip;
+ else:
+ sheight := 0;
+ p := image(draw breaktowidth(s, xpart(blimit - borigin@#))(sheight)
+ withcolor textcolour;);
+ fi;
+
+ % start a new slide if this bullet won't fit. If we're in continuation mode,
+ % the previous slide already has the previous bullets, so just clear this
+ % slide and put the bullet at the top. In discontinous mode, we need to end
+ % the figure, but this causes some problems as it ends the group started by
+ % vardef, so we lose p and sheight (which were saved).
+ if ypart borigin@# - sheight - bpos < ypart blimit:
+ if continuations = 1: discontinue;
+ else:
+ begingroup;
+ endfig;
+ bpos.prev := 0;
+ nextfig;
+ endgroup;
+ fi;
+ fi;
+ draw bulletpic shifted (borigin@# - (0, bpos));
+ draw p shifted (borigin@# + boff - (0, bpos+sheight));
+ bpos := bpos + sheight + baselineskip;
+ bpos.prev := bpos;
+enddef;
+
+% handy abbreviation for a common paradigm
+vardef bpoint@#(expr s) = nextfig; bullet@#(s); endfig; enddef;
+
+% the same as the plain metapost label, but using textcolour
+vardef blabel@#(expr s,z) = draw thelabel@#(s,z) withcolor textcolour; enddef;
+
+vardef dotblabel@#(expr s,z) =
+ blabel@#(s,z);
+ interim linecap:=rounded;
+ draw z withpen pencircle scaled dotlabeldiam withcolor textcolour;
+enddef;
+
+% a label which is also a hyperlink
+def dolink(expr p, n) =
+ special "[ /Rect [ " & decimal xpart llcorner p & " " &
+ decimal ypart llcorner p & " " &
+ decimal xpart urcorner p & " " &
+ decimal ypart urcorner p & " ] /Dest /" & n &
+ " /Border [ 0 0 0 ] /Subtype /Link /ANN pdfmark";
+enddef;
+
+vardef hyperlabel@#(expr s,z, n) =
+ save p;
+ picture p;
+ p := thelabel@#(s,z);
+ dolink(p, n);
+ draw p withcolor textcolour;
+enddef;
+
+vardef hyperbullet@#(expr s, n) =
+ save p;
+ picture p;
+ p := image(bullet@#(s););
+ dolink(p, n);
+ draw p;
+enddef;
+
+def hyperdest(expr n) = special "[ /Dest /" & n & " /View [ /Fit ] /DEST pdfmark"; enddef;
+
+
+picture headerpic, footerpic;
+
+% header saves a string or picture which will be displayed at headerpos
+% on each slide. The header is added after the slide is saved to lastpicture
+def header(expr s) =
+ if picture s: headerpic := s;
+ else: headerpic := image(
+ draw s infont defaultfont scaled (defaultscale*magstep1)
+ shifted headerpos
+ withcolor textcolour;);
+ fi;
+enddef;
+
+def drawheader = if known headerpic: draw headerpic; fi; enddef;
+
+% header saves a string or picture which will be displayed to the left of
+% footerpos on each slide. The footer is added after the slide is saved
+% to lastpicture
+def footer(expr s) =
+ if picture s: footerpic := s;
+ else: footerpic := s infont defaultfont scaled defaultscale;
+ footerpic := image(
+ draw footerpic
+ shifted (footerpos - (lrcorner footerpic - llcorner footerpic))
+ withcolor textcolour;);
+ fi;
+enddef;
+
+def drawfooter = if known footerpic: draw footerpic; fi; enddef;
+extra_endfig := extra_endfig & "drawheader; drawfooter;";
+
+% current slide number
+def folio = decimal charcode enddef;
+
+%%
+%% font encoding -- currently, only to 8r (I just couldn't bear putting this in
+%% a source file)
+%%
+def encodefont(expr tfm, fn) =
+ special "/" & tfm & " /" & fn & "8r def";
+ special "/" & fn & " findfont dup length dict copy dup /Encoding";
+ special "[ /.notdef /dotaccent /fi /fl /fraction /hungarumlaut /Lslash /lslash";
+ special "/ogonek /ring /.notdef /breve /minus /.notdef /Zcaron /zcaron /caron /dotlessi";
+ special "/dotlessj /ff /ffi /ffl /.notdef /.notdef /.notdef /.notdef";
+ special "/.notdef /.notdef /.notdef /.notdef /grave /quotesingle /space /exclam /quotedbl /numbersign";
+ special "/dollar /percent /ampersand /quoteright /parenleft /parenright /asterisk /plus /comma /hyphen /period /slash";
+ special "/zero /one /two /three /four /five /six /seven /eight /nine /colon /semicolon /less /equal /greater /question";
+ special "/at /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z";
+ special "/bracketleft /backslash /bracketright /asciicircum /underscore /quoteleft";
+ special "/a /b /c /d /e /f /g /h /i /j /k /l /m /n /o /p /q /r /s /t /u /v /w /x /y /z";
+ special "/braceleft /bar /braceright /asciitilde /.notdef /.notdef /.notdef /quotesinglbase /florin";
+ special "/quotedblbase /ellipsis /dagger /daggerdbl /circumflex /perthousand /Scaron /guilsinglleft";
+ special "/OE /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /quotedblleft /quotedblright /bullet /endash /emdash";
+ special "/tilde /trademark /scaron /guilsinglright /oe /.notdef /.notdef /Ydieresis /.notdef";
+ special "/exclamdown /cent /sterling /currency /yen /brokenbar /section /dieresis /copyright /ordfeminine /guillemotleft";
+ special "/logicalnot /hyphen /registered /macron /degree /plusminus /twosuperior /threesuperior";
+ special "/acute /mu /paragraph /periodcentered /cedilla /onesuperior /ordmasculine /guillemotright";
+ special "/onequarter /onehalf /threequarters /questiondown /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla";
+ special "/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis";
+ special "/Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply /Oslash /Ugrave /Uacute /Ucircumflex";
+ special "/Udieresis /Yacute /Thorn /germandbls /agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla";
+ special "/egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis";
+ special "/eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide /oslash /ugrave /uacute /ucircumflex";
+ special "/udieresis /yacute /thorn /ydieresis ] put /" & fn & "8r exch definefont pop";
+enddef;
+
+%%
+%% pdf macros and assists
+%%
+
+
+% maintain a ps file which loads all the slides in order
+% this is specific to gs
+string psfile;
+psfile := jobname & ".ps";
+
+extra_endfig := extra_endfig & "write " & ditto & "(" & ditto & "& jobname &"
+ & ditto & "." & ditto
+ & "& folio &" & ditto & ") run" & ditto & " to psfile;";
+
+% put the viewer into full screen mode by default, and define a document-default
+% page transition (I'm using the random transition with 1/2 second duration)
+% since there is no way to specify a document-default, the transition has to be
+% added to each page dictionary
+special "[ /PageMode /FullScreen /DOCVIEW pdfmark";
+
+special "[ /_objdef {mytrans} /type /dict /OBJ pdfmark";
+special "[ {mytrans} << /Type /Trans /D .5 /S /Random /Dm /H /M /O /Di 315 >> /PUT pdfmark ";
+
+extra_endfig := extra_endfig & "special " & ditto
+ & "[ {ThisPage} << /Trans {mytrans} >> /PUT pdfmark" & ditto & ";";
+
+special "[ /CropBox [ 0 0 " & decimal(lawidth) & " " & decimal(laheight) & " ] /PAGES pdfmark";
+
+% allow the user to specify document info
+def author(expr s) :=
+ special "[ /Author (" & s & ") /DOCINFO pdfmark";
+enddef;
+def title(expr s) :=
+ special "[ /Title (" & s & ") /DOCINFO pdfmark";
+enddef;
+def subject(expr s) :=
+ special "[ /Subject (" & s & ") /DOCINFO pdfmark";
+enddef;
+def keywords(expr s) :=
+ special "[ /Keywords (" & s & ") /DOCINFO pdfmark";
+enddef;
+def copyright(expr s) :=
+ special "[ /Copyright (" & s & ") /DOCINFO pdfmark";
+enddef;
+
+def moddate(expr s) :=
+ special "[ /ModificationDate (" & s & ") /DOCINFO pdfmark";
+enddef;
+
+def createdate(expr s) :=
+ special "[ /CreationDate (" & s & ") /DOCINFO pdfmark";
+enddef;
+
+% except for the document info we specify ourselves
+createdate("D:" & decimal year & decimal month & if day < 10: "0" fi & decimal(day) & decimal time);
+special "[ /Creator (Metapost " & base_name & " base, version " & base_version & ") /DOCINFO pdfmark";
+
+% gs will need this
+prologues:=2;
+
diff --git a/Master/texmf-dist/metapost/slideshow/sshowex.mp b/Master/texmf-dist/metapost/slideshow/sshowex.mp
new file mode 100644
index 00000000000..dc1414ced8e
--- /dev/null
+++ b/Master/texmf-dist/metapost/slideshow/sshowex.mp
@@ -0,0 +1,42 @@
+ input slideshow;
+ pair points[];
+ nextfig;
+ points0 = (.5lawidth, .9laheight);
+ ypart points1 = ypart points2 = .1laheight;
+ xpart points1 = lawidth - xpart points2 = .3lawidth;
+
+ pickup thin nib;
+
+ draw points1..points0 withcolor textcolour;
+ hyperdest("start");
+ endfig;
+
+ % build on previous slide for next few
+ continue;
+ nextfig;
+ pickup thin nib;
+
+ draw points0..points2 withcolor textcolour;
+ endfig;
+ nextfig;
+ pickup thin nib;
+
+ draw points2..points1 withcolor textcolour;
+ endfig;
+
+ nextfig;
+ blabel.top("A", points0);
+ endfig;
+ nextfig;
+ blabel.lft("B", points1);
+ endfig;
+ nextfig;
+ blabel.rt("C", points2);
+ endfig;
+
+ % new sequence of slides ...
+ discontinue;
+ nextfig;
+ hyperlabel("The End" infont defaultfont scaled magstep 2, (.5lawidth, .5laheight), "start");
+ endfig;
+ end
diff --git a/Master/texmf-dist/metapost/slideshow/sshowex2.mp b/Master/texmf-dist/metapost/slideshow/sshowex2.mp
new file mode 100644
index 00000000000..788bbf55b9e
--- /dev/null
+++ b/Master/texmf-dist/metapost/slideshow/sshowex2.mp
@@ -0,0 +1,36 @@
+%%
+%% slide-show example which demonstrates text wrapping, and changing the background
+%% on the fly
+%%
+
+
+input slideshow;
+
+% start with a blue to red gradient, then `gradually' shift it to red to blue
+noslides := 11;
+def doback =
+ background := image(drawgradient((charcode/noslides)[blue,red], (charcode/noslides)[red,blue]););
+enddef;
+
+doback;
+
+extra_endfig := extra_endfig & "doback;";
+
+continue;
+nextfig;
+ header("A Walk in the Park");
+endfig;
+bpoint("I was walking in the park one day, when the most remarkable thing happened.");
+bpoint("There was a lady there, well, I say lady because I was brought up to believe one should use this term to refer to adult members of the fair sex, but from her behaviour, I'm not sure it's the right term at all.");
+bpoint("This lady, as I call her, was conveying herself by way of two-wheeled roller skates, and she was wearing a tiny pair of short pants, and a top which, although it completely covered her torso, was extremely revealing as to her form.");
+bpoint("Well, she noticed that she had my attention, and behaved in a manner which I can only describe as provacative in the extreme.");
+bpoint(ditto & "Do you want a closer look, Jack?" & ditto & " she asked (but my name is not Jack, nor John for that matter), and then she lifted her top, exposing the most disgusting protuberances.");
+bpoint("Needless to say, I was shocked.");
+bpoint("I quickly found a park warden and reported the vixen (I can't bring myself to call her a lady again).");
+bpoint(ditto & "What, the one in the white spandex top?" & ditto & " he exclaimed.");
+bpoint("I supposed that's what that material was, and he assured me that he would seek her out and speak to her about the matter.");
+bpoint("It seemed to me that more severe handling was suggested by the circumstances, but he was eager to do the job, so I left him to it.");
+
+
+
+end
diff --git a/Master/texmf-dist/metapost/slideshow/sshowex3.mp b/Master/texmf-dist/metapost/slideshow/sshowex3.mp
new file mode 100644
index 00000000000..7e65e918bdf
--- /dev/null
+++ b/Master/texmf-dist/metapost/slideshow/sshowex3.mp
@@ -0,0 +1,23 @@
+%%
+%% slide-show example which demonstrates text wrapping in discontinous mode
+%%
+
+input slideshow;
+
+nextfig;
+ header("A Walk in the Park");
+
+bullet("I was walking in the park one day, when the most remarkable thing happened.");
+bullet("There was a lady there, well, I say lady because I was brought up to believe one should use this term to refer to adult members of the fair sex, but from her behaviour, I'm not sure it's the right term at all.");
+bullet("This lady, as I call her, was conveying herself by way of two-wheeled roller skates, and she was wearing a tiny pair of short pants, and a top which, although it completely covered her torso, was extremely revealing as to her form.");
+bullet("Well, she noticed that she had my attention, and behaved in a manner which I can only describe as provacative in the extreme.");
+bullet(ditto & "Do you want a closer look, Jack?" & ditto & " she asked (but my name is not Jack, nor John for that matter), and then she lifted her top, exposing the most disgusting protuberances.");
+bullet("Needless to say, I was shocked.");
+bullet("I quickly found a park warden and reported the vixen (I can't bring myself to call her a lady again).");
+bullet(ditto & "What, the one in the white spandex top?" & ditto & " he exclaimed.");
+bullet("I supposed that's what that material was, and he assured me that he would seek her out and speak to her about the matter.");
+bullet("It seemed to me that more severe handling was suggested by the circumstances, but he was eager to do the job, so I left him to it.");
+endfig;
+
+
+end
diff --git a/Master/texmf-dist/metapost/slideshow/sshowintro.mp b/Master/texmf-dist/metapost/slideshow/sshowintro.mp
new file mode 100644
index 00000000000..7dd856ec52e
--- /dev/null
+++ b/Master/texmf-dist/metapost/slideshow/sshowintro.mp
@@ -0,0 +1,206 @@
+%%
+%% A quick presentation about the macros
+%%
+
+input pathalong;
+input slideshow;
+
+author("Patrick TJ McPhee");
+title("Introducing slide-show macros");
+keywords("presentations metapost");
+copyright("Copyright 2001 Patrick TJ McPhee. You may redistribute and modify for any purpose, but must acknowledge significant quotation.");
+
+continue;
+
+nextfig;
+ defaultscale := 2;
+ draw textunder((0,.5in){up}..{right}(2in,1in), "Introducing") shifted (1in,3in) withcolor textcolour;
+endfig;
+
+nextfig;
+ blabel.rt("Slide Show Macros", (2in,2in));
+endfig;
+
+defaultscale := 1;
+
+nextfig;
+ draw pathalong((0,.5in){up}..{right}(2in,1in), "by Patrick TJ McPhee") shifted (1in,3in) withcolor textcolour;
+ hyperdest("Start");
+endfig;
+
+discontinue;
+
+header("Rationale");
+
+bpoint("Primarily an intellectual exercise");
+bpoint("But may be useful for graphics-intensive presentations which don't use much text");
+bpoint("Slideshow provides support for this irritating style of bullet presentation");
+bpoint("And writes out some pdfmarks, which you would otherwise have to look up yourself");
+
+picture dimtieb;
+dimtieb := image(draw pathalong((0,.5in){up}..(.5in,1in){right}..(.5in, 0in){-1,-1}..{.1,-1}(.5in,-.5in),
+ "Did I mention the intellectual exercise bit?") withcolor textcolour;);
+dimtieb := dimtieb rotatedaround(center dimtieb, 90);
+dimtieb := dimtieb shifted - llcorner dimtieb;
+
+bpoint(dimtieb);
+
+discontinue;
+
+header("Current practice");
+
+bpoint("A presentation might have several components:");
+
+vardef procbox(expr s) =
+ save p;
+ picture p;
+
+ p := s infont defaultfont scaled defaultscale;
+ pickup thin nib;
+ addto p doublepath bbox p withpen currentpen;
+ p
+enddef;
+
+vardef resultbox(expr s) =
+ save p;
+ picture p;
+
+ p := s infont defaultfont scaled defaultscale;
+ pickup thin nib;
+ addto p doublepath (ulcorner p)..tension 2..(urcorner p)..(lrcorner p)..
+ tension 2..(llcorner p)..cycle
+ withpen currentpen;
+ p
+enddef;
+
+picture lt, mp, dvi, gs, postp, vres, pres, fpres;
+
+lt := procbox("laTeX") shifted (.05 lawidth, .2laheight);
+mp := procbox("metapost") shifted (.05 lawidth, .1laheight);
+dvi := procbox("DVI processor") shifted (.2 lawidth, .15laheight);
+vres := resultbox("viewable result") shifted (.4 lawidth, .15 laheight);
+gs := procbox("distiller") shifted (.65 lawidth, .15laheight);
+pres := resultbox("presentation") shifted (.8 lawidth, .15laheight);
+postp := procbox("post-processor") shifted (.7 lawidth, .3laheight);
+fpres := resultbox("final presentation") shifted (.45 lawidth, .3laheight);
+
+nextfig;
+ bullet.in("text prepared with laTeX");
+ draw lt withcolor white;
+endfig;
+
+nextfig;
+ bullet.in("graphics prepared with metapost (okay, 2 components)");
+ draw mp withcolor red;
+endfig;
+
+nextfig;
+ bullet.in("which are combined with dvi processing software");
+ pickup thin nib;
+ drawarrow (.5[lrcorner mp,urcorner mp]){right}..{right}(.5[llcorner dvi,ulcorner dvi])
+ withcolor .25[red,white];
+ drawarrow (.5[lrcorner lt,urcorner lt]){right}..{right}(.5[llcorner dvi,ulcorner dvi])
+ withcolor .25[white,red];
+
+ draw dvi withcolor .5[white,red];
+endfig;
+
+nextfig;
+ bullet.in("the resulting postscript is viewable, but must be distilled into the presentation");
+ pickup thin nib;
+ drawarrow (.5[lrcorner dvi,urcorner dvi])..(.5[llcorner vres,ulcorner vres])
+ withcolor .1[.5[red,white],green];
+ draw vres withcolor .5[.5[white,red],green];
+endfig;
+
+nextfig;
+ pickup thin nib;
+ drawarrow (.5[lrcorner vres,urcorner vres])..(.5[llcorner gs,ulcorner gs])
+ withcolor .6[.5[red,white],green];
+ draw gs withcolor .75[.5[white,red],green];
+endfig;
+
+nextfig;
+ pickup thin nib;
+ drawarrow (.5[lrcorner gs,urcorner gs])..(.5[llcorner pres,ulcorner pres])
+ withcolor .75[.5[white,red],green];
+ draw pres withcolor green;
+endfig;
+
+nextfig;
+ pickup thin nib;
+ bullet.in("and it's often post-processed to make it slick and professional-looking like this one");
+ pickup thin nib;
+ drawarrow (.5[lrcorner pres,urcorner pres]){right}..{left}(.5[lrcorner postp,urcorner postp])
+ withcolor .5[green,white];
+ draw postp withcolor .75[green,white];
+endfig;
+
+nextfig;
+ pickup thin nib;
+ drawarrow (.5[llcorner postp,ulcorner postp])..(.5[lrcorner fpres,urcorner fpres])
+ withcolor .95[green,white];
+ draw fpres withcolor white;
+endfig;
+
+discontinue;
+
+header("The slideshow advantage");
+bpoint("With the slideshow macros:");
+
+nextfig;
+ bullet.in("Only one input format is possible");
+ draw mp withcolor red;
+endfig;
+
+nextfig;
+ bullet.in("Which converts rapidly into viewable output");
+ pickup thick nib;
+ drawarrow (.5[lrcorner mp,urcorner mp]){right}..{right}(.5[llcorner vres,ulcorner vres])
+ withcolor .5[red,.5[.5[white,red],green]];
+ % I hope it's clear by this point that I'm playing this for laughs
+ draw vres withcolor .5[.5[white,red],green];
+endfig;
+
+nextfig;
+ bullet.in("And then distills into the presentation");
+ pickup thick nib;
+ drawarrow (.5[lrcorner vres,urcorner vres]){right}
+ ..{right}(.5[llcorner fpres,ulcorner fpres])
+ withcolor .5[.5[.5[white,red],green],white];
+ draw fpres withcolor white;
+endfig;
+
+nextfig;
+ bullet.in("From which no post-processing is needed, since there are no post-processors supporting these macros");
+endfig;
+
+discontinue;
+header("Limitations");
+
+bpoint("Metapost doesn't handle text very well");
+bpoint("It's difficult to include non-metapost graphics (e.g., bit-maps)");
+bpoint("There's no provision for producing print-only versions of the information");
+bpoint("There's no concept of presentation styles");
+bpoint("It generally requires some configuration of ghostscript and metapost, especially if you use math");
+bpoint("The other methods for producing presentations using TeX-family tools aren't as complicated as I suggested");
+bpoint.in("I personally use my own plain-TeX style with just TeX, metapost, and dvipdfm");
+
+discontinue;
+header("Strengths");
+
+bpoint("Measurably less complex than metaobj");
+bpoint("Small and simple, so shouldn't conflict with too many truly useful metapost packages");
+bpoint("The ability to build up drawings can be helpful");
+bpoint("And so are the pdfmarks");
+bpoint("It's useful for cases where laTeX is used as a framework for a bunch of metapost slides");
+bpoint("So it was worth uploading to CTAN, but it's not going to change the world");
+
+discontinue;
+header(nullpicture);
+
+nextfig;
+ hyperlabel(breaktowidth("Thanks for sticking to the end. Click on this text to start over.", .5lawidth)(ignore), (.5lawidth, .5laheight), "Start");
+endfig;
+
+end