https://wiki.contextgarden.net/api.php?action=feedcontributions&user=Kerryland&feedformat=atomWiki - User contributions [en]2024-03-29T06:34:41ZUser contributionsMediaWiki 1.34.1https://wiki.contextgarden.net/index.php?title=Command/setupheadertexts&diff=24969Command/setupheadertexts2019-11-08T22:50:45Z<p>Kerryland: /* Syntax */ added info about \setupheadertexts[middle text] variant</p>
<hr />
<div>{{Reference<br />
|name=setupheadertexts<br />
|attributes=<br />
}}<br />
<br />
== [[Help:Reference|Syntax]] ==<br />
<table cellspacing="4" cellpadding="2" class="cmd"><br />
<tr><br />
<td colspan="2" class="cmd">\setupheadertexts<span class="first" style="color:red;">[...]</span><span class="second" >[...]</span><span class="third" >[...]</span><span class="fourth" style="background-color:yellow;">[...]</span></td><br />
</tr><br />
<tr valign="top" class="first"><br />
<td class="cmd">[...]</td><br />
<td><strong>text</strong> on the left handed side of odd pages </td><br />
</tr><br />
<tr valign="top" class="second"><br />
<td class="cmd">[...]</td><br />
<td><strong>text</strong> on the right handed side of odd pages </td><br />
</tr><br />
<tr valign="top" class="third"><br />
<td class="cmd">[...]</td><br />
<td><strong>text</strong> on the right handed side of even pages </td><br />
</tr><br />
<tr valign="top" class="fourth" style="background-color:yellow;"><br />
<td class="cmd">[...]</td><br />
<td><strong>text</strong> on the left handed side of even pages </td><br />
</tr><br />
</table><br />
<br />
or<br />
<br />
<table cellspacing="4" cellpadding="2" class="cmd"><br />
<tr><br />
<td colspan="2" class="cmd">\setupheadertexts<span class="first" style="color:red;">[...]</span></td><br />
</tr><br />
<tr valign="top" class="first"><br />
<td class="cmd">[...]</td><br />
<td><strong>text</strong> in the middle of the header</td><br />
</tr><br />
</table><br />
<br />
Note that these can be combined, so if you want a header with text on the left, middle, and right of the page you can use:<br />
<br />
<texcode><br />
\setupheadertexts[middle text]<br />
\setupheadertexts[on the left][on the right]<br />
</texcode><br />
<br />
There are predefined keywords for popular values, like <code>chapter</code> and <code>pagenumber</code>,<br />
<br />
eg:<br />
<br />
<texcode><br />
\setupheadertexts[chapter]<br />
\setupheadertexts[][pagenumber][pagenumber][]<br />
</texcode><br />
<br />
== Description ==<br />
Place headers and footers with the commands \setupheadertexts and {{cmd|setupfootertexts}}.<br />
<br />
These commands take 4 arguments. The first is for the left handed side on odd pages, the second for the right handed side on odd pages, the third for the right handed side on even pages, and the fourth for the left handed side on even pages.<br />
<br />
== Example ==<br />
<!-- Please fill in an example if you can --><br />
<br />
This example produces the same header on odd and even pages.<br />
<br />
<texcode><br />
\setupheadertexts<br />
[{\getmarking[chapter]}] [{page \pagenumber}]<br />
[{page \pagenumber}] [{\getmarking[chapter]}]<br />
\setuppagenumbering[location=]<br />
</texcode><br />
<br />
'''Note:''' '''\setuppagenumbering[location=]''' supresses the default output (i.e. centered in header) of the page number on every page.<br />
<br />
=== Multiline header ===<br />
<br />
<texcode><br />
\startsetups[headertext]<br />
\startframed[frame=off,align=flushleft,width=fit]<br />
abc\\<br />
def\\<br />
ghi\\<br />
jkl<br />
\stopframed<br />
\stopsetups<br />
<br />
\setupheadertexts[\directsetup{headertext}]<br />
<br />
\starttext<br />
aaa<br />
\stoptext<br />
</texcode><br />
<br />
(The result is not shown as headers - here, on Wiki - are trimmed out from the produced .pdf, so there is nothing to show.)<br />
<br />
== See also ==<br />
<!-- something like {{cmd|goto}} --><br />
<br />
*{{cmd|setupfootertexts}}<br />
*{{cmd|setupheader}}<br />
<br />
== Help from ConTeXt-Mailinglist/Forum ==<br />
All issues with:<br />
{{Forum|{{SUBPAGENAME}}}}<br />
<br />
[[Category:Command/Texts|setupheadertexts]]</div>Kerryland