1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20\setupbodyfont
21 [dejavu]
22
23\setuppapersize
24 [HD]
25
26\setuplayout
27 [location=middle,
28 header=0pt,
29 footer=0pt,
30 backspace=2.25cm,
31 topspace=2.25cm,
32 width=middle,
33 height=middle]
34
35\setupcolors
36 [state=start]
37
38\startreusableMPgraphic{page}
39 StartPage ;
40 picture p ; path s ;
41 fill Page withcolor .5red ;
42 draw Page withpen pensquare scaled 2cm withcolor .75[.5red,white] ;
43 s := (Field[Text][Text] enlarged .5cm) squeezed (.1cm,.15cm) ;
44 fill s withcolor .75[.5red,white] ;
45 if false :
46 p := image (graphictext "\ss TIP" withfillcolor .2white ;) ;
47 else :
48 p := textext.raw("\ss TIP") ;
49 setbounds p to (boundingbox p rightenlarged -0.025bbwidth(p)) ;
50 fi ;
51 p := p xysized(PaperWidth-1cm,PaperHeight-1cm) ;
52 p := p shifted .5(bbwidth(Page)bbwidth(p),bbheight(Page)bbheight(p)) ;
53 draw p withcolor .2white ;
54 clip p to s ;
55 draw p withcolor .875[.5red,white] ; ;
56 StopPage ;
57\stopreusableMPgraphic
58
59\defineoverlay
60 [page]
61 [\reuseMPgraphic{page}]
62
63\setupbackgrounds
64 [page]
65 [background=page,
66 state=repeat]
67
68\definecolor[red][r=.5]
69
70\setuphead
71 [chapter]
72 [style=\tfb,
73 before=,
74 after={\blank[line]}]
75
76\setupblank
77 [halfline]
78
79
80
81\startxmlsetups xml:tips
82 \xmlflush{#1}
83\stopxmlsetups
84
85\startxmlsetups xml:tip
86 \startstandardmakeup
87 \startnamedsection[title][title=\xmlfirst{#1}{title}]
88 \xmlall{#1}{(remarkcommand)}
89 \vfill
90 \stopnamedsection
91 \stopstandardmakeup
92\stopxmlsetups
93
94\startxmlsetups xml:remark
95 \blank
96 \xmlflush{#1}
97 \blank
98\stopxmlsetups
99
100\definehighlight
101 [command]
102 [style=mono,
103 color=red,
104 command=no]
105
106\startxmlsetups xml:command
107 \blank
108 \starthighlight[command]
109 \xmlflush{#1}
110 \stophighlight
111 \blank
112\stopxmlsetups
113
114\startxmlsetups xml:reference
115 \vfill
116 \hfill\strut see:\space
117 \xmlflush{#1}
118\stopxmlsetups
119
120\startxmlsetups xml:initialize
121 \xmlsetsetup {#1} {
122 tipstipremarkcommandreference
123 } {xml:*}
124\stopxmlsetups
125
126\xmlregisterdocumentsetup{main}{xml:initialize}
127
128\starttext
129
130 \xmlprocessfile{main}{tiptrick.xml}{}
131
132\stoptext
133 |