summaryrefslogtreecommitdiff
path: root/doc/context/sources/general/manuals/lowlevel/lowlevel-style.tex
blob: 9d3bcdbb337689369b8e12f0405ed675033fd4b7 (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
% language=us runpath=texruns:manuals/lowlevel

% I started this series in June 2019 and I bet that it will never be complete or
% extensive enough. But I'll do my best to make it as useful as possible ConTeXt
% users out there who like to know about such details. Feel free to ask for more
% explanations.

\startenvironment lowlevel-style

\usemodule[abbreviations-logos]
\usemodule[scite]

\setvariables
  [document]
  [title=No Title,
   author=No Author,
   color=NoColor]

\setupbodyfont
  [dejavu,11pt]

\setuplayout
  [width=middle,
   height=middle,
   backspace=2cm,
   topspace=15mm]

\setupwhitespace
  [big]

\setuphead
  [chapter]
  [style=\bfc,
   color=darkgray]

\setuphead
  [section]
  [style=\bfb,
  %page=right,
   color=darkgray]

\setuphead
  [subsection]
  [style=\bfa,
   color=darkgray]

\setuplist
  [chapter]
  [style=bold]

\setupfootertexts
  [section] % [\documentvariable{title}]

\setupfooter
  [style=bold,
   color=darkgray]

\startuseMPgraphic{titlepage}
    fill Page
        withcolor "\documentvariable{color}" ;

    numeric d ; d := 2mm ;

    picture p ; p := textext.llft("\tex{}")
        xysized (.1PaperWidth-2d,.1PaperHeight-2d)
        shifted (.1PaperWidth- d,.1PaperHeight -d)
    ;

    draw image (
        for i = 0 step .1 PaperWidth until PaperWidth :
            for j = 0 step .1 PaperHeight until PaperHeight :
                draw p shifted (i,j) ;
            endfor ;
        endfor ;
    ) withcolor .5resolvedcolor("middlegray") ;

    draw textext.d("\strut low level")
        xsized (.8PaperWidth)
        shifted center topboundary Page
        shifted -(0,.2PaperHeight)
        withcolor "white" ;
    draw textext.d("\strut \TeX")
        xsized (.4PaperWidth)
        shifted center topboundary Page
        shifted -(0,.4PaperHeight)
        withcolor "white" ;
    draw textext.d("\strut\documentvariable{title}")
        ysized 3cm
        shifted center bottomboundary Page
        shifted (0,.1PaperHeight)
        withcolor "white" ;
\stopuseMPgraphic

\definesectionlevels
  [default]
  [%{chapter,title},
   {section,subject},
   {subsection,subsubject},
   {subsubsection,subsubsubject},
   {subsubsubsection,subsubsubject},
   {subsubsubsubsection,subsubsubject}]

\startsetups document:start

    \startMPpage
    StartPage;
        \includeMPgraphic{titlepage} ;
    StopPage;
    \stopMPpage

    \page

    \startsubjectlevel[title=Contents]
        \placelist[chapter,section] [criterium=previous]
    \stopsubjectlevel

\stopsetups

\startsetups document:stop

\testpage[6]

%startsubjectlevel[title=Colofon]
\startsectionlevel[title=Colofon,number=no,saveinlist=no]

    \starttabulate
        \NC Author      \NC Hans Hagen         \NC \NR
        \NC \CONTEXT    \NC \contextversion    \NC \NR
        \NC \LUAMETATEX \NC \texengineversion  \NC \NR
        \NC Support     \NC www.pragma-ade.com \NC \NR
        \NC             \NC contextgarden.net  \NC \NR
    \stoptabulate

\stopsectionlevel
%stopsubjectlevel

\stopsetups

\stopenvironment