git.iko.soy/typeable/pandoc
on 3645607 help sign in
typeable/pandoc/data/templates/default.context
175 lines 4.8 kB history raw
1$if(context-lang)$
2\mainlanguage[$context-lang$]
3$endif$
4$if(context-dir)$
5\setupalign[$context-dir$]
6\setupdirections[bidi=on,method=two]
7$endif$
8% Enable hyperlinks
9\setupinteraction
10 [state=start,
11$if(title)$
12 title={$title$},
13$endif$
14$if(subtitle)$
15 subtitle={$subtitle$},
16$endif$
17$if(author)$
18 author={$for(author)$$author$$sep$; $endfor$},
19$endif$
20$if(keywords)$
21 keyword={$for(keywords)$$keywords$$sep$; $endfor$},
22$endif$
23 style=$linkstyle$,
24 color=$linkcolor$,
25 contrastcolor=$linkcontrastcolor$]
27% make chapter, section bookmarks visible when opening document
28\placebookmarks[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][chapter, section]
29\setupinteractionscreen[option=bookmark]
31$if(papersize)$
32\setuppapersize[$for(papersize)$$papersize$$sep$,$endfor$]
33$endif$
34$if(layout)$
35\setuplayout[$for(layout)$$layout$$sep$,$endfor$]
36$endif$
37$if(pagenumbering)$
38\setuppagenumbering[$for(pagenumbering)$$pagenumbering$$sep$,$endfor$]
39$else$
40\setuppagenumbering[location={footer,middle}]
41$endif$
42$if(pdfa)$
43% attempt to generate PDF/A
44\setupbackend
45 [format=PDF/A-$pdfa$,
46 profile={$if(pdfaiccprofile)$$for(pdfaiccprofile)$$pdfaiccprofile$$sep$,$endfor$$else$sRGB.icc$endif$},
47 intent=$if(pdfaintent)$$pdfaintent$$else$sRGB IEC61966-2.1$endif$]
48$endif$
49\setupbackend[export=yes]
50\setupstructure[state=start,method=auto]
52% use microtypography
53\definefontfeature[default][default][script=latn, protrusion=quality, expansion=quality, itlc=yes, textitalics=yes, onum=yes, pnum=yes]
54\definefontfeature[smallcaps][script=latn, protrusion=quality, expansion=quality, smcp=yes, onum=yes, pnum=yes]
55\setupalign[hz,hanging]
56\setupitaliccorrection[global, always]
58\setupbodyfontenvironment[default][em=italic] % use italic as em, not slanted
60\definefallbackfamily[mainface][rm][CMU Serif][preset=range:greek, force=yes]
61\definefontfamily[mainface][rm][$if(mainfont)$$mainfont$$else$Latin Modern Roman$endif$]
62\definefontfamily[mainface][mm][$if(mathfont)$$mathfont$$else$Latin Modern Math$endif$]
63\definefontfamily[mainface][ss][$if(sansfont)$$sansfont$$else$Latin Modern Sans$endif$]
64\definefontfamily[mainface][tt][$if(monofont)$$monofont$$else$Latin Modern Typewriter$endif$][features=none]
65\setupbodyfont[mainface$if(fontsize)$,$fontsize$$endif$]
67\setupwhitespace[$if(whitespace)$$whitespace$$else$medium$endif$]
68$if(indenting)$
69\setupindenting[$for(indenting)$$indenting$$sep$,$endfor$]
70$endif$
71$if(interlinespace)$
72\setupinterlinespace[$for(interlinespace)$$interlinespace$$sep$,$endfor$]
73$endif$
75\setuphead[chapter] [style=\tfd\setupinterlinespace,header=empty]
76\setuphead[section] [style=\tfc\setupinterlinespace]
77\setuphead[subsection] [style=\tfb\setupinterlinespace]
78\setuphead[subsubsection] [style=\bf]
79\setuphead[subsubsubsection] [style=\sc]
80\setuphead[subsubsubsubsection][style=\it]
82$if(headertext)$
83\setupheadertexts$for(headertext)$[$headertext$]$endfor$
84$endif$
85$if(footertext)$
86\setupfootertexts$for(footertext)$[$footertext$]$endfor$
87$endif$
88$if(number-sections)$
89$else$
90\setuphead[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][number=no]
91$endif$
93\definedescription
94 [description]
95 [headstyle=bold, style=normal, location=hanging, width=broad, margin=1cm, alternative=hanging]
97\setupitemize[autointro] % prevent orphan list intro
98\setupitemize[indentnext=no]
100\setupfloat[figure][default={here,nonumber}]
101\setupfloat[table][default={here,nonumber}]
103\setupxtable[frame=off]
104\setupxtable[head][topframe=on,bottomframe=on]
105\setupxtable[body][]
106\setupxtable[foot][bottomframe=on]
108$if(csl-refs)$
109\definemeasure[cslhangindent][1.5em]
110\definenarrower[hangingreferences][left=\measure{cslhangindent}]
111\definestartstop [cslreferences] [
112 $if(csl-hanging-indent)$
113 before={%
114 \starthangingreferences[left]
115 \setupindenting[-\leftskip,yes,first]
116 \doindentation
117 },
118 after=\stophangingreferences,
119 $endif$
121$endif$
122$if(includesource)$
123$for(sourcefile)$
124\attachment[file=$curdir$/$sourcefile$,method=hidden]
125$endfor$
126$endif$
127$for(header-includes)$
128$header-includes$
129$endfor$
131\starttext
132$if(title)$
133\startalignment[middle]
134 {\tfd\setupinterlinespace $title$}
135$if(subtitle)$
136 \smallskip
137 {\tfa\setupinterlinespace $subtitle$}
138$endif$
139$if(author)$
140 \smallskip
141 {\tfa\setupinterlinespace $for(author)$$author$$sep$\crlf $endfor$}
142$endif$
143$if(date)$
144 \smallskip
145 {\tfa\setupinterlinespace $date$}
146$endif$
147 \bigskip
148\stopalignment
149$endif$
150$if(abstract)$
151\midaligned{\it Abstract}
152\startnarrower[2*middle]
153$abstract$
154\stopnarrower
155\blank[big]
156$endif$
157$for(include-before)$
158$include-before$
159$endfor$
160$if(toc)$
161\completecontent
162$endif$
163$if(lot)$
164\completelistoftables
165$endif$
166$if(lof)$
167\completelistoffigures
168$endif$
170$body$
172$for(include-after)$
173$include-after$
174$endfor$
175\stoptext