git.iko.soy/typeable/pandoc
on a444321 help sign in
typeable/pandoc/data/templates/default.context
155 lines 4.1 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]
30\setuptagging[state=start]
32$if(papersize)$
33\setuppapersize[$for(papersize)$$papersize$$sep$,$endfor$]
34$endif$
35$if(layout)$
36\setuplayout[$for(layout)$$layout$$sep$,$endfor$]
37$endif$
38$if(pagenumbering)$
39\setuppagenumbering[$for(pagenumbering)$$pagenumbering$$sep$,$endfor$]
40$endif$
41$if(pdfa)$
42% attempt to generate PDF/A
43\setupbackend
44 [format=PDF/A-1b:2005,
45 intent=sRGB IEC61966-2.1,
46 profile=sRGB.icc]
47$endif$
49% use microtypography
50\definefontfeature[default][default][script=latn, protrusion=quality, expansion=quality, itlc=yes, textitalics=yes, onum=yes, pnum=yes]
51\definefontfeature[smallcaps][script=latn, protrusion=quality, expansion=quality, smcp=yes, onum=yes, pnum=yes]
52\setupalign[hz,hanging]
53\setupitaliccorrection[global, always]
55\setupbodyfontenvironment[default][em=italic] % use italic as em, not slanted
57\definefallbackfamily[mainface][rm][CMU Serif][preset=range:greek, force=yes]
58\definefontfamily[mainface][rm][$if(mainfont)$$mainfont$$else$Latin Modern Roman$endif$]
59\definefontfamily[mainface][mm][$if(mathfont)$$mathfont$$else$Latin Modern Math$endif$]
60\definefontfamily[mainface][ss][$if(sansfont)$$sansfont$$else$Latin Modern Sans$endif$]
61\definefontfamily[mainface][tt][$if(monofont)$$monofont$$else$Latin Modern Typewriter$endif$][features=none]
62\setupbodyfont[mainface$if(fontsize)$,$fontsize$$endif$]
64\setupwhitespace[$if(whitespace)$$whitespace$$else$medium$endif$]
65$if(indenting)$
66\setupindenting[$for(indenting)$$indenting$$sep$,$endfor$]
67$endif$
68$if(interlinespace)$
69\setupinterlinespace[$for(interlinespace)$$interlinespace$$sep$,$endfor$]
70$endif$
72\setuphead[chapter] [style=\tfd,header=empty]
73\setuphead[section] [style=\tfc]
74\setuphead[subsection] [style=\tfb]
75\setuphead[subsubsection] [style=\bf]
76\setuphead[subsubsubsection] [style=\sc]
77\setuphead[subsubsubsubsection][style=\it]
79$if(headertext)$
80\setupheadertexts$for(headertext)$[$headertext$]$endfor$
81$endif$
82$if(footertext)$
83\setupfootertexts$for(footertext)$[$footertext$]$endfor$
84$endif$
85$if(number-sections)$
86$else$
87\setuphead[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][number=no]
88$endif$
90\definedescription
91 [description]
92 [headstyle=bold, style=normal, location=hanging, width=broad, margin=1cm, alternative=hanging]
94\setupitemize[autointro] % prevent orphan list intro
95\setupitemize[indentnext=no]
97\setupfloat[figure][default={here,nonumber}]
98\setupfloat[table][default={here,nonumber}]
100\setupthinrules[width=15em] % width of horizontal rules
102\setupxtable[frame=off]
103\setupxtable[head][topframe=on,bottomframe=on]
104\setupxtable[body][]
105\setupxtable[foot][bottomframe=on]
107$for(header-includes)$
108$header-includes$
109$endfor$
111\starttext
112$if(title)$
113\startalignment[middle]
114 {\tfd $title$}
115$if(subtitle)$
116 \smallskip
117 {\tfa $subtitle$}
118$endif$
119$if(author)$
120 \smallskip
121 {\tfa $for(author)$$author$$sep$\crlf $endfor$}
122$endif$
123$if(date)$
124 \smallskip
125 {\tfa $date$}
126$endif$
127 \bigskip
128\stopalignment
129$endif$
130$if(abstract)$
131\midaligned{\it Abstract}
132\startnarrower[2*middle]
133$abstract$
134\stopnarrower
135\blank[big]
136$endif$
137$for(include-before)$
138$include-before$
139$endfor$
140$if(toc)$
141\completecontent
142$endif$
143$if(lot)$
144\completelistoftables
145$endif$
146$if(lof)$
147\completelistoffigures
148$endif$
150$body$
152$for(include-after)$
153$include-after$
154$endfor$
155\stoptext