summaryrefslogtreecommitdiff
path: root/tex/context/base/s-pre-05.tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/s-pre-05.tex')
-rw-r--r--tex/context/base/s-pre-05.tex127
1 files changed, 64 insertions, 63 deletions
diff --git a/tex/context/base/s-pre-05.tex b/tex/context/base/s-pre-05.tex
index a25dd6040..88d69f6e2 100644
--- a/tex/context/base/s-pre-05.tex
+++ b/tex/context/base/s-pre-05.tex
@@ -11,23 +11,22 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\usemodule[pre-general] % mdode=step
+\usemodule[pre-general]
-%D Yet undocumented, mostly copied from s-pre-04; much can be
-%D moved to s-pre-00!
+%D As all styles sofar, this one has the same structuring
+%D commands.
-\setupbodyfont
- [lbr,14.4pt]
+\startmode[asintended] \setupbodyfont[lbr] \stopmode
+
+\setupbodyfont[14.4pt]
\setupcolors [state=start]
-\definecolor [FrameColor] [r=.6,g=.7,b=.8]
\definecolor [BackgroundColor] [s=.95]
-\definecolor [GotoColor] [FrameColor]
-\definecolor [NoneColor] [blank]
+\definecolor [OrnamentColor] [r=.6,g=.7,b=.8]
\setuppapersize
- [S6]
+ [S6][S6]
\setuplayout
[width=430pt,
@@ -41,9 +40,7 @@
rightedge=110pt]
\setupinteractionscreen
- [option=max,
- width=600pt, % fit
- height=450pt] % fit
+ [option=max]
\setupbackgrounds
[state=repeat]
@@ -59,40 +56,47 @@
\defineoverlay
[HashFrameA]
- [\HashFrame\overlaywidth\overlayheight{15pt}]
+ [\useMPgraphic{HashFrameA}]
\defineoverlay
[HashFrameB]
- [\HashFrame\overlaywidth\overlayheight{5pt}]
+ [\useMPgraphic{HashFrameB}]
\setupinteraction
[state=start,
menu=on,
- color=GotoColor,
- contrastcolor=NoneColor]
+ color=OrnamentColor,
+ contrastcolor=OrnamentColor]
+
+%D Watch how we use a list alternative that matches the
+%D menu.
+
+\setupinteractionmenu
+ [right]
+ [background=HashFrameB,
+ style=smallbold,
+ frame=off,
+ offset=10pt,
+ height=35pt,
+ before=,
+ after=,
+ inbetween=\endgraf,
+ width=\rightedgewidth]
\startinteractionmenu[right]
- \setupbuttons
- [background=HashFrameB,
- frame=off,
- offset=10pt,
- height=30pt,
- width=\rightedgewidth]
\placelist
[Topic]
[criterium=all,
- alternative=e,
- background=HashFrameB,
- frame=off,
- offset=10pt,
- style=smallbold,
- width=\rightedgewidth,
+ alternative=right,
maxwidth=.8\rightedgewidth,
interaction=all,
before=,
after=]
\vfill
- \button{Close}[CloseDocument]
+ \setupinteractionmenu
+ [right]
+ [height=30pt]
+ \but [CloseDocument] Close \\
\stopinteractionmenu
\setupwhitespace
@@ -108,13 +112,8 @@
%D done, it makes sense to define and tune some structuring
%D commands. First we build the titlepage.
-\defineoverlay [TitleGraphic] [\TitleGraphic\overlaywidth\overlayheight]
-\defineoverlay [NextPage] [\NextPageButton]
-
-\def\NextPageButton%
- {\button
- [width=\overlaywidth,height=\overlayheight,frame=off]
- {}[forward]}
+\defineoverlay [TitleGraphic] [\useMPgraphic{TitleGraphic}]
+\defineoverlay [NextPage] [\overlaybutton{forward}]
\def\StartTitlePage%
{\setupbackgrounds[page][background={color,TitleGraphic,NextPage}]
@@ -142,16 +141,19 @@
{\StartTitlePage#1\StopTitlePage}
%D \macros
-%D {Topics}
+%D {Topics,Subjects}
%D
-%D ...
+%D Since the lists are in the menu, we don't honor list
+%D placement macros.
\def\Topics#1{}
+\def\Subjects{}
%D \macros
%D {Topic, Nopic, Subject}
%D
-%D ...
+%D Since t his style is meant for rather flat structured
+%D documents, only \type {\Topic} makes sense.
\definehead [Topic] [chapter]
\definehead [Nopic] [title]
@@ -173,6 +175,9 @@
continue=no,
style=\tfa]
+%D We use only one kind of base graphic, which is sligthly
+%D tuned for the different usage.
+
\startMPinclusions
def random_hash_frame (expr width, height, offset, linewidth ) =
@@ -182,38 +187,34 @@
drawoptions(withpen pencircle scaled linewidth withcolor \MPcolor{BackgroundColor}) ;
fill z1--(x2,y1)--z2--(x1,y2)--cycle ;
- drawoptions(withpen pencircle scaled linewidth withcolor \MPcolor{FrameColor}) ;
+ drawoptions(withpen pencircle scaled linewidth withcolor \MPcolor{OrnamentColor}) ;
draw (x1-delta,y1)--(x2+delta,y1) ;
draw (x2,y1-delta)--(x2,y2+delta) ;
draw (x2+delta,y2)--(x1-delta,y2) ;
draw (x1,y2+delta)--(x1,y1-delta) ;
+ drawoptions();
setbounds currentpicture to unitsquare xscaled width yscaled height ;
enddef ;
\stopMPinclusions
-\def\HashFrame#1#2#3%
- {\startuseMPgraphic{HashFrame}
- random_hash_frame(#1,#2,#3,2pt) ;
- \stopuseMPgraphic
- \useMPgraphic{HashFrame}}
-
-\def\TitleGraphic#1#2%
- {\startuseMPgraphic{title}
- picture savedpicture ;
- savedpicture := nullpicture ;
- def MakeOne =
- offset := uniformdeviate 10pt ;
- width := 2*offset + 30pt + uniformdeviate 30pt ;
- height := 2*offset + 10pt + uniformdeviate 10pt ;
- random_hash_frame(width,height,offset,1pt) ;
- addto savedpicture also (currentpicture shifted
- (uniformdeviate #1, uniformdeviate #2)) ;
- currentpicture := nullpicture ;
- enddef ;
- for i=1 upto 300 : MakeOne ; endfor ;
- currentpicture := savedpicture ;
- \stopuseMPgraphic
- \useMPgraphic{title}}
+\startuseMPgraphic{HashFrameA}
+ random_hash_frame(OverlayWidth,OverlayHeight,15pt,2pt) ;
+\stopuseMPgraphic
+
+\startuseMPgraphic{HashFrameB}
+ random_hash_frame(OverlayWidth,OverlayHeight, 5pt,2pt) ;
+\stopuseMPgraphic
+
+\startuseMPgraphic{TitleGraphic}
+ for i=1 upto 300 :
+ offset := uniformdeviate 10pt ;
+ width := 2*offset + 30pt + uniformdeviate 30pt ;
+ height := 2*offset + 10pt + uniformdeviate 10pt ;
+ addto currentpicture also
+ image(random_hash_frame(width,height,offset,1pt)) shifted
+ (uniformdeviate OverlayWidth, uniformdeviate OverlayHeight) ;
+ endfor ;
+\stopuseMPgraphic
\endinput