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