From c5e718ce9e45d152c11fecd17c239dab8ab71f64 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Sun, 7 Mar 2010 19:35:33 +0000 Subject: 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 --- templates/context.template | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-) (limited to 'templates') 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$ -- cgit v1.2.3