summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/s-cdr-01.tex
blob: b0bced9da0901124915d5f4dbbe23aea0ed6890a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
%D \module
%D   [      file=s-cdr-01,
%D        version=2001.2.07, % maybe earlier
%D          title=\CONTEXT\ Style File,
%D       subtitle=CDROM Cover,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\startmodule[cdr-01]

\setupmodule[cdr-01][option=]

\def\PDFMPformoffset{20cm}

\definepapersize
  [CDcover]
  [width=12.5cm,
   height=12.4cm]

\definelayout
  [CDcover]
  [topspace=5mm,
   backspace=5mm,
   header=0pt,
   footer=0pt,
   width=middle,
   height=middle]

\setuparranging
  [2SIDE]

\setuppapersize
  [CDcover]
  [A4,landscape]

\setuplayout
  [CDcover]

\setuplayout
  [location=middle]

\setupcolors
  [state=start]

\setupbackgrounds
  [leftpage]
  [background=leftcover]

\setupbackgrounds
  [rightpage]
  [background=rightcover]

\setuppagenumbering
  [alternative=doublesided]

\defineoverlay[leftcover] [\useMPgraphic{leftcover}]
\defineoverlay[rightcover][\useMPgraphic{rightcover}]

\definecolor  [cd-color]    [s=0]
\definemeasure[cd-linewidth][.4pt]

\doif {\moduleparameter{cdr-01}{option}} {light} {
    \definecolor  [cd-color]    [s=.85]
    \definemeasure[cd-linewidth][.2pt]
}

\startuseMPgraphic{leftcover}
  StartPage ;
    pickup pencircle scaled \measure{cd-linewidth} ;
    draw
      bottomboundary Page &
      rightboundary  Page &
      topboundary    Page withcolor \MPcolor{cd-color} ;
    draw
      bottomboundary (Page enlarged 3mm) &
      rightboundary  (Page enlarged 3mm) &
      topboundary    (Page enlarged 3mm) dashed evenly withcolor \MPcolor{cd-color} ;
  StopPage ;
\stopuseMPgraphic

\startuseMPgraphic{rightcover}
  StartPage ;
    pickup pencircle scaled \measure{cd-linewidth} ;
    draw
      topboundary    Page &
      leftboundary   Page &
      bottomboundary Page withcolor \MPcolor{cd-color} ;
    draw
      topboundary    (Page enlarged 3mm) &
      leftboundary   (Page enlarged 3mm) &
      bottomboundary (Page enlarged 3mm) dashed evenly withcolor \MPcolor{cd-color} ;
    draw
      bottomboundary Page --
      lrcorner Page shifted (-5mm,-1cm) --
      llcorner Page shifted ( 5mm,-1cm) -- cycle withcolor \MPcolor{cd-color} ;
    draw
      topboundary Page --
      ulcorner Page shifted ( 5mm, 1cm) --
      urcorner Page shifted (-5mm, 1cm) -- cycle withcolor \MPcolor{cd-color} ;
  StopPage ;
  setbounds currentpicture to Page ;
\stopuseMPgraphic

\setupmakeup
  [standard]
  [doublesided=no,page=]

\setuplayout
  [topspace=5mm,
   backspace=5mm,
   header=0pt,
   footer=0pt,
   width=middle,
   height=middle]

\defineframedtext
  [maintext]
  [background={foreground,color},
   backgroundcolor=a-bit-white,
   frame=off,
   before=,
   after=,
   align=right,
   strut=no,
   height=fit,
   width=\textheight]

\stopmodule

\doifnotmode{demo}{\endinput}

\starttext
    \startstandardmakeup
        page 1
    \stopstandardmakeup

    \startstandardmakeup
        page 2
    \stopstandardmakeup
\stoptext