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