aboutsummaryrefslogtreecommitdiff
path: root/templates/context.template
blob: 3981d1c51028dbbbc2b586bfd92baca5973ecd18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
$if(legacy-header)$
$legacy-header$
$else$
\enableregime[utf]  % use UTF-8

\setupcolors[state=start]
\setupinteraction[state=start, color=middleblue] % needed for hyperlinks

\setuppapersize[letter][letter]  % use letter paper
\setuplayout[width=middle, backspace=1.5in, cutspace=1.5in,
             height=middle, header=0.75in, footer=0.75in] % page layout
\setuppagenumbering[location={footer,center}]  % number pages
\setupbodyfont[11pt]  % 11pt font
\setupwhitespace[medium]  % inter-paragraph spacing

\setuphead[section][style=\tfc]
\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,
  width=broad,margin=1cm]

% prevent orphaned list intros
\setupitemize[autointro]

% define defaults for bulleted lists 
\setupitemize[1][symbol=1][indentnext=no]
\setupitemize[2][symbol=2][indentnext=no]
\setupitemize[3][symbol=3][indentnext=no]
\setupitemize[4][symbol=4][indentnext=no]

\setupthinrules[width=15em]  % width of horizontal rules

% for block quotations
\unprotect

\startvariables all
blockquote: blockquote
\stopvariables

\definedelimitedtext
[\v!blockquote][\v!quotation]

\setupdelimitedtext
[\v!blockquote]
[\c!left=,
\c!right=,
before={\blank[medium]},
after={\blank[medium]},
]

\protect
$endif$
$for(header-includes)$
$header-includes$
$endfor$

$if(title)$
\doctitle{$title$}
$endif$
\author{$for(author)$$author$$sep$\\$endfor$}
$if(date)$
\date{$date$}
$endif$
\starttext
\maketitle
$if(toc)$
\placecontent
$endif$

$body$

\stoptext