-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtemplate.ctx
130 lines (107 loc) · 3.42 KB
/
template.ctx
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
◊(require "../lib/targets/ctx.rkt")
◊(define title (select-from-metas 'title metas))
◊(define subtitle (select-from-metas 'subtitle metas))
◊(define topic (select-from-metas 'topic metas))
\mainlanguage[◊(current-lang)]
\setupinteraction
[state=start,
title={◊(txexpr->ctx title)},
author={◊(current-author)}
color=black,
contrastcolor=black]
\setuplayout
[width=fit,
height=fit,
backspace=3.6cm,
topspace=1.4cm]
\placebookmarks[chapter, section, subsection][chapter, section]
\setupinteractionscreen[option=bookmark]
\setuppagenumbering[location={footer,middle},style={\ss}]
\setupbackend[export=yes]
\setupstructure[state=start,method=auto]
\definefontfeature[default][default]
[script=latn,
protrusion=quality,
expansion=quality,
itlc=yes,
textitalics=yes,
onum=yes,
pnum=yes]
\definefontfeature[smallcaps]
[script=latn,
protrusion=quality,
expansion=quality,
smcp=yes,
onum=yes,
pnum=yes]
\setupalign[hz,hanging]
\setupitaliccorrection[global, always]
% use italic as em, not slanted
\setupbodyfontenvironment[default][em=italic]
\definefallbackfamily[mainface][rm][CMU Serif][preset=range:greek, force=yes]
\definefontfamily[mainface][rm][◊(or (select 'font-family metas) "Libre Caslon Text")] % Roman
\definefontfamily[mainface][mm][Latin Modern Math] % Math
\definefontfamily[mainface][ss][Ysabeau] % Sans serif
\definefontfamily[mainface][tt][IBM Plex Mono][features=none] % Typewriter (monospace)
\setupbodyfont[mainface,◊(or (select 'font-size metas) "10pt")]
\setupinterlinespace[line=3ex]
◊(case (select-from-metas 'paragraph-mode metas)
[(space) ◊string-append{\setupwhitespace[medium]}]
[else ◊string-append{\setupindenting[yes,medium]}])
\setuphead[title,chapter,section,subsection]
[number=no,
page=no,
align=flushleft]
\setuphead[title,chapter]
[before={\blank[quarterline]},
after={\blank[quarterline]},
style={\tfb\bf\unhyphenated\setupinterlinespace[line=3.2ex]}]
\setuphead[section][style={\bf},after={\blank[halfline]}]
\setuphead[subsection][style={\bf}]
\setuplist[section][style=bold]
\setuplist[subsection][margin=1cm]
\setuplist[section, subsection, subsubsection][width=1cm]
\setupcombinedlist[content][list={section,subsection}]
\setupnote[footnote][textstyle=\ss]
\setupnotation[footnote][style=\ss,numbercommand=\ss\high]
\definedescription
[description]
[headstyle=bold,
style=normal,
location=hanging,
width=broad,
margin=1cm,
alternative=hanging]
\setupitemize[autointro]% prevent orphan list intro
\setupitemize[indentnext=no]
\setupfloat[figure][default={here,nonumber}]
\setupfloat[table][default={here,nonumber}]
\setupxtable[frame=off]
\setupxtable[head][topframe=on,bottomframe=on]
\setupxtable[body][]
\setupxtable[foot][bottomframe=on]
\definemeasure[cslhangindent][1.5em]
\definenarrower[hangingreferences][left=\measure{cslhangindent}]
\definestartstop[cslreferences]
[before={%
\starthangingreferences[left]
\setupindenting[-\leftskip,yes,first]
\doindentation
},
after=\stophangingreferences]
\setupdelimitedtext[blockquote]
[before={\blank[line]},
after={\blank[line]},
style={\ss},
leftmargin=1cm,
rightmargin=1cm,
indenting=no,
indentnext=no]
\starttext
{\setupindenting[no]
{◊(if topic ◊string-append{{\ss\bf ◊|topic|}} "") \hfill {\ss ◊|author|}}
\title{◊(txexpr->ctx title)}
◊(if subtitle ◊string-append{{\ss\it ◊|subtitle|}} "")}
\blank[3*line]
◊(txexpr->ctx doc)
\stoptext