git.iko.soy/typeable/pandoc
on 39153ea help sign in
typeable/pandoc/data/templates/default.context
177 lines 4.9 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\setupthinrules[width=15em] % width of horizontal rules
105\setupxtable[frame=off]
106\setupxtable[head][topframe=on,bottomframe=on]
107\setupxtable[body][]
108\setupxtable[foot][bottomframe=on]
110$if(csl-refs)$
111\definemeasure[cslhangindent][1.5em]
112\definenarrower[hangingreferences][left=\measure{cslhangindent}]
113\definestartstop [cslreferences] [
114 $if(csl-hanging-indent)$
115 before={%
116 \starthangingreferences[left]
117 \setupindenting[-\leftskip,yes,first]
118 \doindentation
119 },
120 after=\stophangingreferences,
121 $endif$
123$endif$
124$if(includesource)$
125$for(sourcefile)$
126\attachment[file=$curdir$/$sourcefile$,method=hidden]
127$endfor$
128$endif$
129$for(header-includes)$
130$header-includes$
131$endfor$
133\starttext
134$if(title)$
135\startalignment[middle]
136 {\tfd\setupinterlinespace $title$}
137$if(subtitle)$
138 \smallskip
139 {\tfa\setupinterlinespace $subtitle$}
140$endif$
141$if(author)$
142 \smallskip
143 {\tfa\setupinterlinespace $for(author)$$author$$sep$\crlf $endfor$}
144$endif$
145$if(date)$
146 \smallskip
147 {\tfa\setupinterlinespace $date$}
148$endif$
149 \bigskip
150\stopalignment
151$endif$
152$if(abstract)$
153\midaligned{\it Abstract}
154\startnarrower[2*middle]
155$abstract$
156\stopnarrower
157\blank[big]
158$endif$
159$for(include-before)$
160$include-before$
161$endfor$
162$if(toc)$
163\completecontent
164$endif$
165$if(lot)$
166\completelistoftables
167$endif$
168$if(lof)$
169\completelistoffigures
170$endif$
172$body$
174$for(include-after)$
175$include-after$
176$endfor$
177\stoptext