Merge pull request #138 from adunning/patch-1
Expand ConTeXt variables; drop MkII support.
This commit is contained in:
commit
69ccb94916
1 changed files with 71 additions and 26 deletions
|
@ -1,7 +1,3 @@
|
||||||
\startmode[*mkii]
|
|
||||||
\enableregime[utf-8]
|
|
||||||
\setupcolors[state=start]
|
|
||||||
\stopmode
|
|
||||||
$if(context-lang)$
|
$if(context-lang)$
|
||||||
\mainlanguage[$context-lang$]
|
\mainlanguage[$context-lang$]
|
||||||
$endif$
|
$endif$
|
||||||
|
@ -9,25 +5,68 @@ $if(context-dir)$
|
||||||
\setupalign[$context-dir$]
|
\setupalign[$context-dir$]
|
||||||
\setupdirections[bidi=on,method=two]
|
\setupdirections[bidi=on,method=two]
|
||||||
$endif$
|
$endif$
|
||||||
|
|
||||||
% Enable hyperlinks
|
% Enable hyperlinks
|
||||||
\setupinteraction[state=start, color=middleblue]
|
\setupinteraction
|
||||||
|
[state=start$if(style)$,
|
||||||
\setuppapersize [$if(papersize)$$papersize$$else$letter$endif$][$if(papersize)$$papersize$$else$letter$endif$]
|
style=$style$$endif$$if(linkcolor)$,
|
||||||
\setuplayout [width=middle, backspace=1.5in, cutspace=1.5in,
|
color=$linkcolor$,
|
||||||
height=middle, topspace=0.75in, bottomspace=0.75in]
|
contrastcolor=$linkcolor$$endif$$if(title)$,
|
||||||
|
title=$title$$endif$$if(subtitle)$,
|
||||||
\setuppagenumbering[location={footer,center}]
|
subtitle=$subtitle$$endif$$if(author)$,
|
||||||
|
author=$author$$endif$$if(keywords)$,
|
||||||
\setupbodyfont[11pt]
|
keyword=$keywords$$endif$]
|
||||||
|
% make chapter, section bookmarks visible when opening document
|
||||||
|
\placebookmarks[chapter,section,subsection,subsubsection][chapter,section]
|
||||||
|
\setupinteractionscreen[option=bookmark]
|
||||||
|
|
||||||
|
$if(papersize)$
|
||||||
|
\setuppapersize[$for(papersize)$$papersize$$sep$,
|
||||||
|
$endfor$]
|
||||||
|
$endif$
|
||||||
|
$if(layout)$
|
||||||
|
\setuplayout[$for(layout)$$layout$$sep$,
|
||||||
|
$endfor$]
|
||||||
|
$endif$
|
||||||
|
$if(pagenumbering)$
|
||||||
|
\setuppagenumbering[$for(pagenumbering)$$pagenumbering$$sep$,
|
||||||
|
$endfor$]
|
||||||
|
$endif$
|
||||||
|
\definefontfeature[default][default][protrusion=quality,expansion=quality,onum=yes] % use microtypography
|
||||||
|
\setupalign[hz,hanging]
|
||||||
|
\setupbodyfontenvironment[default][em=italic] % use italic as em, not slanted
|
||||||
|
$if(mainfont)$
|
||||||
|
\definefontfamily[mainfont][serif][$mainfont$]
|
||||||
|
$endif$
|
||||||
|
$if(sansfont)$
|
||||||
|
\definefontfamily[sansfont][sans][$sansfont$]
|
||||||
|
$endif$
|
||||||
|
$if(monofont)$
|
||||||
|
\definefontfamily[monofont][mono][$monofont$][features=none]
|
||||||
|
$endif$
|
||||||
|
$if(mathfont)$
|
||||||
|
\definefontfamily[mathfont][math][$mathfont$]
|
||||||
|
$endif$
|
||||||
|
\setupbodyfont[mainfont$if(fontsize)$,$fontsize$$endif$]
|
||||||
|
$if(whitespace)$
|
||||||
|
\setupwhitespace[$whitespace$]
|
||||||
|
$else$
|
||||||
\setupwhitespace[medium]
|
\setupwhitespace[medium]
|
||||||
|
$endif$
|
||||||
|
$if(interlinespace)$
|
||||||
|
\setupinterlinespace[$interlinespace$]
|
||||||
|
$endif$
|
||||||
|
|
||||||
\setuphead[chapter] [style=\tfd]
|
\setuphead[chapter] [style=\tfd]
|
||||||
\setuphead[section] [style=\tfc]
|
\setuphead[section] [style=\tfc]
|
||||||
\setuphead[subsection] [style=\tfb]
|
\setuphead[subsection] [style=\tfb]
|
||||||
\setuphead[subsubsection][style=\bf]
|
\setuphead[subsubsection][style=\bf]
|
||||||
|
|
||||||
|
$if(headertext)$
|
||||||
|
\setupheadertexts[$headertext$]
|
||||||
|
$endif$
|
||||||
|
$if(footertext)$
|
||||||
|
\setupfootertexts[$footertext$]
|
||||||
|
$endif$
|
||||||
$if(number-sections)$
|
$if(number-sections)$
|
||||||
$else$
|
$else$
|
||||||
\setuphead[chapter, section, subsection, subsubsection][number=no]
|
\setuphead[chapter, section, subsection, subsubsection][number=no]
|
||||||
|
@ -45,17 +84,6 @@ $endif$
|
||||||
|
|
||||||
\setupthinrules[width=15em] % width of horizontal rules
|
\setupthinrules[width=15em] % width of horizontal rules
|
||||||
|
|
||||||
\setupdelimitedtext
|
|
||||||
[blockquote]
|
|
||||||
[before={\blank[medium]},
|
|
||||||
after={\blank[medium]},
|
|
||||||
indentnext=no,
|
|
||||||
]
|
|
||||||
|
|
||||||
$if(toc)$
|
|
||||||
\setupcombinedlist[content][list={$placelist$}]
|
|
||||||
|
|
||||||
$endif$
|
|
||||||
$for(header-includes)$
|
$for(header-includes)$
|
||||||
$header-includes$
|
$header-includes$
|
||||||
$endfor$
|
$endfor$
|
||||||
|
@ -65,6 +93,10 @@ $if(title)$
|
||||||
\startalignment[center]
|
\startalignment[center]
|
||||||
\blank[2*big]
|
\blank[2*big]
|
||||||
{\tfd $title$}
|
{\tfd $title$}
|
||||||
|
$if(subtitle)$
|
||||||
|
\blank[3*medium]
|
||||||
|
{\tfa $subtitle$}
|
||||||
|
$endif$
|
||||||
$if(author)$
|
$if(author)$
|
||||||
\blank[3*medium]
|
\blank[3*medium]
|
||||||
{\tfa $for(author)$$author$$sep$\crlf $endfor$}
|
{\tfa $for(author)$$author$$sep$\crlf $endfor$}
|
||||||
|
@ -76,11 +108,24 @@ $endif$
|
||||||
\blank[3*medium]
|
\blank[3*medium]
|
||||||
\stopalignment
|
\stopalignment
|
||||||
$endif$
|
$endif$
|
||||||
|
$if(abstract)$
|
||||||
|
\midaligned{\bf Abstract}
|
||||||
|
\startnarrower[2*middle]
|
||||||
|
$abstract$
|
||||||
|
\stopnarrower
|
||||||
|
\blank[big]
|
||||||
|
$endif$
|
||||||
$for(include-before)$
|
$for(include-before)$
|
||||||
$include-before$
|
$include-before$
|
||||||
$endfor$
|
$endfor$
|
||||||
$if(toc)$
|
$if(toc)$
|
||||||
\placecontent
|
\completecontent
|
||||||
|
$endif$
|
||||||
|
$if(lot)$
|
||||||
|
\completelistoftables
|
||||||
|
$endif$
|
||||||
|
$if(lof)$
|
||||||
|
\completelistoffigures
|
||||||
$endif$
|
$endif$
|
||||||
|
|
||||||
$body$
|
$body$
|
||||||
|
|
Loading…
Add table
Reference in a new issue