aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2010-03-07 19:35:33 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2010-03-07 19:35:33 +0000
commitc5e718ce9e45d152c11fecd17c239dab8ab71f64 (patch)
treec6853c3b28cc629c88b39eb170a520ed0ca61351 /templates
parent9eebaac7cf2c501dfef97220a718575d367a6b80 (diff)
downloadpandoc-c5e718ce9e45d152c11fecd17c239dab8ab71f64.tar.gz
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
Diffstat (limited to 'templates')
-rw-r--r--templates/context.template35
1 files changed, 12 insertions, 23 deletions
diff --git a/templates/context.template b/templates/context.template
index 3981d1c51..adfaec494 100644
--- a/templates/context.template
+++ b/templates/context.template
@@ -17,24 +17,6 @@ $else$
\setuphead[subsection][style=\tfb]
\setuphead[subsubsection][style=\bf]
-% define title block commands
-\unprotect
-\def\doctitle#1{\gdef\@title{#1}}
-\def\author#1{\gdef\@author{#1}}
-\def\date#1{\gdef\@date{#1}}
-\date{\currentdate} % Default to today unless specified otherwise.
-\def\maketitle{%
- \startalignment[center]
- \blank[2*big]
- {\tfd \@title}
- \blank[3*medium]
- {\tfa \@author}
- \blank[2*medium]
- {\tfa \@date}
- \blank[3*medium]
- \stopalignment}
-\protect
-
% define descr (for definition lists)
\definedescription[descr][
headstyle=bold,style=normal,align=left,location=hanging,
@@ -75,15 +57,22 @@ $for(header-includes)$
$header-includes$
$endfor$
+\starttext
$if(title)$
-\doctitle{$title$}
+\startalignment[center]
+ \blank[2*big]
+ {\tfd $title$}
+$if(author)$
+ \blank[3*medium]
+ {\tfa $for(author)$$author$$sep$\crlf $endfor$}
$endif$
-\author{$for(author)$$author$$sep$\\$endfor$}
$if(date)$
-\date{$date$}
+ \blank[2*medium]
+ {\tfa $date$}
+$endif$
+ \blank[3*medium]
+\stopalignment
$endif$
-\starttext
-\maketitle
$if(toc)$
\placecontent
$endif$