canbedone-style.tex /size: 3191 b    last modification: 2024-01-16 10:21
1% language=us runpath=texruns:manuals/canbedone
2
3% I started this series in June 2023 when I found for the n\high{th} time that we
4% already had a feature that users requested in the mailing list, but that I had
5% completely forgotten about it being around for about 6 years.
6
7\startenvironment canbedone-style
8
9\usemodule[abbreviations-logos]
10\usemodule[scite]
11
12\setvariables
13  [document]
14  [title=No Title,
15   author=No Author,
16   color=NoColor]
17
18\setupbodyfont
19  [dejavu,11pt]
20
21\setuplayout
22  [width=middle,
23   height=middle,
24   backspace=2cm,
25   topspace=15mm]
26
27\setupwhitespace
28  [big]
29
30\setuphead
31  [chapter]
32  [style=\bfc,
33   color=darkgray]
34
35\setuphead
36  [section]
37  [style=\bfb,
38  %page=right,
39   color=darkgray]
40
41\setuphead
42  [subsection]
43  [style=\bfa,
44   color=darkgray]
45
46\setuplist
47  [chapter]
48  [style=bold]
49
50\setupfootertexts
51  [section] % [\documentvariable{title}]
52
53\setupfooter
54  [style=bold,
55   color=darkgray]
56
57\startuseMPgraphic{titlepage}
58    fill Page
59        withcolor "\documentvariable{color}" ;
60
61    numeric d ; d := 2mm ;
62
63    picture p ; p := textext.llft("!") ;
64    p := p
65        rotatedaround(llcorner p, 30) % different from lowlevel
66        xysized (.1PaperWidth-2d,.1PaperHeight-2d)
67        shifted (.1PaperWidth- d,.1PaperHeight -d)
68        shifted (d,-2d) % different from lowlevel
69    ;
70
71    draw image (
72        for i = 0 step .1 PaperWidth until PaperWidth :
73            for j = 0 step .1 PaperHeight until PaperHeight :
74                draw p shifted (i,j) ;
75            endfor ;
76        endfor ;
77    ) withcolor .4resolvedcolor("middlegray") ; % different from lowlevel
78
79    draw textext.d("\strut it can be done")
80        xsized (.8PaperWidth)
81        shifted center topboundary Page
82        shifted -(0,.2PaperHeight)
83        withcolor "white" ;
84  % draw textext.d("\strut YES")
85    draw textext.d("\strut \TeX")
86        xsized (.4PaperWidth)
87        shifted center topboundary Page
88        shifted -(0,.4PaperHeight)
89        withcolor "white" ;
90    draw textext.d("\strut\documentvariable{title}")
91        ysized 3cm
92        shifted center bottomboundary Page
93        shifted (0,.1PaperHeight)
94        withcolor "white" ;
95\stopuseMPgraphic
96
97\definesectionlevels
98  [default]
99  [%{chapter,title},
100   {section,subject},
101   {subsection,subsubject},
102   {subsubsection,subsubsubject},
103   {subsubsubsection,subsubsubject},
104   {subsubsubsubsection,subsubsubject}]
105
106\startsetups document:start
107
108    \startMPpage
109    StartPage;
110        \includeMPgraphic{titlepage} ;
111    StopPage;
112    \stopMPpage
113
114    \page
115
116    \startsubjectlevel[title=Contents]
117        \placelist[chapter,section] [criterium=previous]
118    \stopsubjectlevel
119
120\stopsetups
121
122\startsetups document:stop
123
124\testpage[6]
125
126%startsubjectlevel[title=Colofon]
127\startsectionlevel[title=Colofon,number=no,saveinlist=no]
128
129    \starttabulate
130        \NC Author      \NC Hans Hagen         \NC \NR
131        \NC \CONTEXT    \NC \contextversion    \NC \NR
132        \NC \LUAMETATEX \NC \texengineversion  \NC \NR
133        \NC Support     \NC www.pragma-ade.com \NC \NR
134        \NC             \NC contextgarden.net  \NC \NR
135    \stoptabulate
136
137\stopsectionlevel
138%stopsubjectlevel
139
140\stopsetups
141
142\stopenvironment
143