Changes
Jump to navigation
Jump to search
no edit summary
You can replace <cmd>uppercase</cmd> by <cmd>WORD</cmd> and so on.
'''Marginal headings and centered headings'''
The following file gives a way to achieve marginal and centered headings for doublesided documents. Experiment to achieve other effects!
<texcode>
% output=pdf interface=en
\setuppapersize [A5][A4]
\newdimen\Margin
\Margin=3cm
\newdimen\MarginRaise
\MarginRaise=56ex
\setuplayout[width=middle,
height=middle,
footer=3\bodyfontsize,
header=\bodyfontsize,
headerdistance=\bodyfontsize,
bottom=3\bodyfontsize,
location={middle,doublesided},
margin=\Margin,
marking=on]
\setuppagenumbering[alternative=doublesided,
location={footer,middle}]
\setuptexttexts[margin][][\setups{text a}][\setups{text b}][]
\setuptext[style=\tf,state=high]
\startsetups[text a]
\raise\MarginRaise\hbox{\vbox{\hsize=\Margin%
\startalignment[right]
\getmarking[chapter]
\stopalignment
}}
\stopsetups
\startsetups[text b]
\raise\MarginRaise\hbox{\vbox{\hsize=\Margin%
\startalignment[left]
\getmarking[section]
\stopalignment
}}
\stopsetups
\setupbottomtexts[pagenumber]
\setupbottom[style=\tf,state=high]
\setupfootertexts%
[][\setups{text c}][\setups{text d}][]
\setupfooter[style=\tf,
state=high]
\startsetups[text c]
\midaligned{\raise2\bodyfontsize\hbox{\getmarking[chapter]}}
\stopsetups
\startsetups[text d]
\midaligned{\raise2\bodyfontsize\hbox{\getmarking[section]}}
\stopsetups
\setupinmargin[align=inner,
style=\tfx\setupinterlinespace]
\showframe
\showsetups
\starttext
\chapter{Chapter Knuth Testing}
\section{Section Knuth Testing}
\dorecurse{20}{\input knuth\par\ }
\stoptext
</texcode>