git.iko.soy/typeable/pandoc
on master help sign in
Improved and simplified title block in context template.
c5e718cfiddlosopher
templates/context.template+12−23
@@ -17,24 +17,6 @@ $else$
17\setuphead[subsection][style=\tfb]
17\setuphead[subsection][style=\tfb]
18\setuphead[subsubsection][style=\bf]
18\setuphead[subsubsection][style=\bf]
19
19
20−% define title block commands
21−\unprotect
22−\def\doctitle#1{\gdef\@title{#1}}
23−\def\author#1{\gdef\@author{#1}}
24−\def\date#1{\gdef\@date{#1}}
25−\date{\currentdate} % Default to today unless specified otherwise.
26−\def\maketitle{%
27− \startalignment[center]
28− \blank[2*big]
29− {\tfd \@title}
30− \blank[3*medium]
31− {\tfa \@author}
32− \blank[2*medium]
33− {\tfa \@date}
34− \blank[3*medium]
35− \stopalignment}
36−\protect
37−
38% define descr (for definition lists)
20% define descr (for definition lists)
39\definedescription[descr][
21\definedescription[descr][
40 headstyle=bold,style=normal,align=left,location=hanging,
22 headstyle=bold,style=normal,align=left,location=hanging,
@@ -75,15 +57,22 @@ $for(header-includes)$
75$header-includes$
57$header-includes$
76$endfor$
58$endfor$
77
59
60+\starttext
78$if(title)$
61$if(title)$
62+\startalignment[center]
63+ \blank[2*big]
79−\doctitle{$title$}
64+ {\tfd $title$}
65+$if(author)$
66+ \blank[3*medium]
67+ {\tfa $for(author)$$author$$sep$\crlf $endfor$}
80$endif$
68$endif$
81−\author{$for(author)$$author$$sep$\\$endfor$}
82$if(date)$
69$if(date)$
70+ \blank[2*medium]
83−\date{$date$}
71+ {\tfa $date$}
72+$endif$
73+ \blank[3*medium]
74+\stopalignment
84$endif$
75$endif$
85−\starttext
86−\maketitle
87$if(toc)$
76$if(toc)$
88\placecontent
77\placecontent
89$endif$
78$endif$