tiptrick.tex /size: 3323 b    last modification: 2023-12-21 09:43
1% language=us runpath=texruns:manuals/tiptrick
2
3% author    : Hans Hagen
4% copyright : ConTeXt Development Team
5% license   : Creative Commons Attribution ShareAlike 4.0 International
6% reference : pragma-ade.nl | contextgarden.net | texlive (related) distributions
7% origin    : the ConTeXt distribution
8%
9% comment   : Because this manual is distributed with TeX distributions it comes with a rather
10%             liberal license. We try to adapt these documents to upgrades in the (sub)systems
11%             that they describe. Using parts of the content otherwise can therefore conflict
12%             with existing functionality and we cannot be held responsible for that. Many of
13%             the manuals contain characteristic graphics and personal notes or examples that
14%             make no sense when used out-of-context.
15%
16% comment   : Some chapters might have been published in TugBoat, the NTG Maps, the ConTeXt
17%             Group journal or otherwise. Thanks to the editors for corrections. Also thanks
18%             to users for testing, feedback and corrections.
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% xml interface
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}{/(remark|command)}
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        tips|tip|remark|command|reference
123    } {xml:*}
124\stopxmlsetups
125
126\xmlregisterdocumentsetup{main}{xml:initialize}
127
128\starttext
129
130    \xmlprocessfile{main}{tiptrick.xml}{}
131
132\stoptext
133