lowlevel-style.tex /size: 3179 b    last modification: 2023-12-21 09:43
1% language=us runpath=texruns:manuals/lowlevel
2
3% I started this series in June 2019 and I bet that it will never be complete or
4% extensive enough. But I'll do my best to make it as useful as possible ConTeXt
5% users out there who like to know about such details. Feel free to ask for more
6% explanations.
7
8\startenvironment lowlevel-style
9
10\usemodule[abbreviations-logos]
11\usemodule[scite]
12
13\setvariables
14  [document]
15  [title=No Title,
16   author=No Author,
17   coauthor=,
18   color=NoColor]
19
20\setupbodyfont
21  [dejavu,11pt]
22
23\setuplayout
24  [width=middle,
25   height=middle,
26   backspace=2cm,
27   topspace=15mm]
28
29\setupwhitespace
30  [big]
31
32\setuphead
33  [chapter]
34  [style=\bfc,
35   color=darkgray]
36
37\setuphead
38  [section]
39  [style=\bfb,
40  %page=right,
41   color=darkgray]
42
43\setuphead
44  [subsection]
45  [style=\bfa,
46   color=darkgray]
47
48\setuplist
49  [chapter]
50  [style=bold]
51
52\setupfootertexts
53  [section] % [\documentvariable{title}]
54
55\setupfooter
56  [style=bold,
57   color=darkgray]
58
59\startuseMPgraphic{titlepage}
60    fill Page
61        withcolor "\documentvariable{color}" ;
62
63    numeric d ; d := 2mm ;
64
65    picture p ; p := textext.llft("\tex{}")
66        xysized (.1PaperWidth-2d,.1PaperHeight-2d)
67        shifted (.1PaperWidth- d,.1PaperHeight -d)
68    ;
69
70    draw image (
71        for i = 0 step .1 PaperWidth until PaperWidth :
72            for j = 0 step .1 PaperHeight until PaperHeight :
73                draw p shifted (i,j) ;
74            endfor ;
75        endfor ;
76    ) withcolor .5resolvedcolor("middlegray") ;
77
78    draw textext.d("\strut low level")
79        xsized (.8PaperWidth)
80        shifted center topboundary Page
81        shifted -(0,.2PaperHeight)
82        withcolor "white" ;
83    draw textext.d("\strut \TeX")
84        xsized (.4PaperWidth)
85        shifted center topboundary Page
86        shifted -(0,.4PaperHeight)
87        withcolor "white" ;
88    draw textext.d("\strut\documentvariable{title}")
89        ysized 3cm
90        shifted center bottomboundary Page
91        shifted (0,.1PaperHeight)
92        withcolor "white" ;
93\stopuseMPgraphic
94
95\definesectionlevels
96  [default]
97  [%{chapter,title},
98   {section,subject},
99   {subsection,subsubject},
100   {subsubsection,subsubsubject},
101   {subsubsubsection,subsubsubject},
102   {subsubsubsubsection,subsubsubject}]
103
104\startsetups document:start
105
106    \startMPpage
107    StartPage;
108        \includeMPgraphic{titlepage} ;
109    StopPage;
110    \stopMPpage
111
112    \page
113
114    \startsubjectlevel[title=Contents]
115        \placelist[chapter,section] [criterium=previous]
116    \stopsubjectlevel
117
118\stopsetups
119
120\startsetups document:stop
121
122\testpage[6]
123
124%startsubjectlevel[title=Colofon]
125\startsectionlevel[title=Colofon,number=no,saveinlist=no]
126
127    \starttabulate
128        \NC Author      \NC Hans Hagen
129                           \doifdocumentvariable{coauthor}{ & \documentvariable{coauthor}}
130                                               \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