\setuppapersize
[S6][S6]
\setuplayout
[width=middle,
height=middle,
header=0pt,
footer=0pt,
bottomdistance=.5cm,
bottom=1cm,
topspace=2cm,
backspace=2cm]
\startmode[asintended] \setupbodyfont[lbr,hw] \stopmode
\setupcolors
[state=start]
\definecolor[PageColor] [s=.6]
\definecolor[TextColor] [s=.8]
\definecolor[LineColor] [g=.4]
\definecolor[SymbolColor][r=.4]
\setupinteractionscreen
[option=max]
\setupinteractionmenu
[bottom]
[state=start,
height=1cm,
middle=\hskip1cm]
\setupinteraction
[state=start,
menu=on,
display=new,
click=no,
color=SymbolColor,
contrastcolor=SymbolColor]
\startinteractionmenu[bottom]
\hfill
\got [previouspage] \symbol[prevmark] \\
\got [nextpage] \symbol[nextmark] \\
\got [CloseDocument] \symbol[stopmark] \\
\txt \tfd \SymbolColor \pagenumber \\
\stopinteractionmenu
\definesymbol[itemmark][\useMPgraphic{itemmark}]
\definesymbol[stopmark][\useMPgraphic{stopmark}]
\definesymbol[nextmark][\useMPgraphic{nextmark}]
\definesymbol[prevmark][\useMPgraphic{prevmark}]
\defineoverlay [page] [\useMPgraphic{page}]
\defineoverlay [next] [\overlaybutton{forward}]
\defineoverlay [prev] [\overlaybutton{PreviousJump}]
\setupbackgrounds
[page]
[background={page,prev}]
\setupbackgrounds
[text]
[background=next]
\setuphead
[chapter]
[alternative=middle,
number=no,
color=SymbolColor,
style=\tfc]
\setupwhitespace
[big]
\setupitemize
[1]
[symbol=itemmark,
width=3\bodyfontsize]
\def\StartTitlePage
{\setupinteractionmenu[bottom][state=stop]
\startstandardmakeup
\setupalign[middle]
\def\\
{\stopcolor
\vfil
\bfb\setupinterlinespace
\startcolor[black]}
\bfd\setupinterlinespace
\vfil
\startcolor[SymbolColor]}
\def\StopTitlePage
{\stopcolor
\vfil\vfil
\stopstandardmakeup
\setupinteractionmenu[bottom][state=start]}
\def\TitlePage#1
{\StartTitlePage#1\StopTitlePage}
\definehead[Topic][chapter]
\definehead[Nopic][title]
\setuplist
[Topic]
[criterium=all,
alternative=g,
interaction=all,
after=\blank]
\def\Topics#1
{\Nopic{#1}
\bgroup
\setupinteraction
[color=,
contrastcolor=]
\determinelistcharacteristics[Topic]
\ifnum\utilitylistlength>12
\startcolumns[n=2]
\placelist[Topic]
\stopcolumns
\else
\placelist[Topic]
\fi
\egroup}
\let\Subject \Topic
\let\Subjects\relax
\startuseMPgraphic{page}
width := \overlaywidth ;
height := \overlayheight ;
d := 15 ; dd := d ; dd := 10 ;
def fuzzy (expr p,dx,dy) =
(xpart p +dx-uniformdeviate dx,ypart p+dy-uniformdeviate dy)
enddef ;
pair ll, lr, ur, ul ;
ll := (d,d) ;
lr := (width-d,d) ;
ur := (width-d,height-d) ;
ul := (d,height-d) ;
path p, q, r, s ;
p := ll.. for i=.1 step .1 until .9 : fuzzy (i[ll,lr],0,+dd).. endfor lr ;
q := lr.. for i=.1 step .1 until .9 : fuzzy (i[lr,ur],-dd,0).. endfor ur ;
r := ur.. for i=.1 step .1 until .9 : fuzzy (i[ur,ul],0,-dd).. endfor ul ;
s := ul.. for i=.1 step .1 until .9 : fuzzy (i[ul,ll],+dd,0).. endfor ll ;
fill unitsquare xscaled width yscaled height withcolor \MPcolor{PageColor} ;
fill p & q & r & s -- cycle withcolor \MPcolor{TextColor} ;
color c ; c := \MPcolor{LineColor} ;
draw p withpen pencircle xscaled 20 yscaled 5 rotated 30 withcolor c ;
draw q withpen pencircle xscaled 5 yscaled 20 rotated 30 withcolor c ;
draw r withpen pencircle xscaled 20 yscaled 5 rotated 30 withcolor c ;
draw s withpen pencircle xscaled 5 yscaled 20 rotated 30 withcolor c ;
\stopuseMPgraphic
\startuseMPgraphic{itemmark}
width := BodyFontSize ; height := width/4 ;
maxheight := StrutHeight ; line := 3width/2 ;
def fuzzy = -(height/4)+uniformdeviate (height/2) enddef ;
draw
((0,0+fuzzy)--(width,height+fuzzy/2))
shifted (line/2,0)
withpen pencircle
xscaled line yscaled (line/4)
rotated (25+uniformdeviate 10) withcolor \MPcolor{SymbolColor} ;
setbounds currentpicture to unitsquare xyscaled(width,maxheight) ;
\stopuseMPgraphic
\startuseMPgraphic{nextmark}
LoadPageState ; width := BottomHeight ; height := line := width/2 ;
def fuzzy = -(height/8)+uniformdeviate (height/4) enddef ;
z1 = (0,0+fuzzy) ; z2 = (width,height/2+fuzzy/2) ; z3 = (0,height+fuzzy) ;
draw
(z1..{right}z2 & z2{left}..z3)
withpen pencircle
xscaled line yscaled (line/4)
rotated 30 withcolor \MPcolor{SymbolColor} ;
setbounds currentpicture to unitsquare xyscaled(width,height) ;
\stopuseMPgraphic
\startuseMPgraphic{prevmark}
LoadPageState ; width := BottomHeight ; height := line := width/2 ;
def fuzzy = -(height/8)+uniformdeviate (height/4) enddef ;
z1 = (width,0+fuzzy) ; z2 = (0,height/2+fuzzy/2) ; z3 = (width,height+fuzzy) ;
draw
(z1..{left}z2 & z2{right}..z3)
withpen pencircle
xscaled line yscaled (line/4)
rotated 30 withcolor \MPcolor{SymbolColor} ;
setbounds currentpicture to unitsquare xyscaled(width,height) ;
\stopuseMPgraphic
\startuseMPgraphic{stopmark}
LoadPageState ; width := BottomHeight ; height := line := width/2 ;
def fuzzy = -(height/8)+uniformdeviate (height/4) enddef ;
z1 = (0,0+fuzzy) ;
z2 = (width,height+fuzzy) ;
z3 = (width,0+fuzzy) ;
z4 = (0,height+fuzzy) ;
z5 = (width/2,height/2) ;
drawoptions
(withpen pencircle
xscaled line yscaled (line/4)
rotated 30 withcolor \MPcolor{SymbolColor}) ;
draw z1..{right}z5..z2 ; draw z3..{left}z5..z4 ;
setbounds currentpicture to unitsquare xyscaled(width,height) ;
\stopuseMPgraphic
\doifnotmode{demo}{\endinput}
\starttext
\TitlePage{Title Page\\pre-writing}
\Topics{Some Nice Quotes}
\Topic{A Few}
\Subject{Knuth} \input knuth
\Subject{Tufte} \input tufte
\Topic{Some More}
\Subject{Zapf} \input zapf
\Subject{Bryson} \input bryson
\stoptext