git.iko.soy/typeable/pandoc
on master help sign in
Improved and simplified title block in context template.

Previously it caused an error if there was no title. This method should also be easier for users to customize. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1867 788f1e2b-df1e-0410-8736-df70ead52e1b

commitc5e718ce9e45d152c11fecd17c239dab8ab71f64 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSun 7 Mar 2010, 19:35 (17 years ago) parent9eebaac
1 file changed+12−23
templates/context.template+12−23
templates/context.template+12−23
@@ -17,24 +17,6 @@ $else$
1717\setuphead[subsection][style=\tfb]
1818\setuphead[subsubsection][style=\bf]
1919
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−
3820% define descr (for definition lists)
3921\definedescription[descr][
4022 headstyle=bold,style=normal,align=left,location=hanging,
@@ -75,15 +57,22 @@ $for(header-includes)$
7557$header-includes$
7658$endfor$
7759
60+\starttext
7861$if(title)$
79−\doctitle{$title$}
62+\startalignment[center]
63+ \blank[2*big]
64+ {\tfd $title$}
65+$if(author)$
66+ \blank[3*medium]
67+ {\tfa $for(author)$$author$$sep$\crlf $endfor$}
8068$endif$
81−\author{$for(author)$$author$$sep$\\$endfor$}
8269$if(date)$
83−\date{$date$}
70+ \blank[2*medium]
71+ {\tfa $date$}
72+$endif$
73+ \blank[3*medium]
74+\stopalignment
8475$endif$
85−\starttext
86−\maketitle
8776$if(toc)$
8877\placecontent
8978$endif$