Difference between revisions of "Command/setupheader"
< Command
m (Text replace - "Reference/en|" to "Commands|") |
|||
(17 intermediate revisions by 6 users not shown) | |||
Line 3: | Line 3: | ||
|attributes= | |attributes= | ||
}} | }} | ||
+ | |||
+ | == [[Help:Reference|Syntax]] (autogenerated) == | ||
+ | <syntax>setupheader</syntax> | ||
== [[Help:Reference|Syntax]] == | == [[Help:Reference|Syntax]] == | ||
+ | |||
+ | <syntax>setupheader</syntax> | ||
+ | |||
<table cellspacing="4" cellpadding="2" class="cmd"> | <table cellspacing="4" cellpadding="2" class="cmd"> | ||
<tr> | <tr> | ||
Line 14: | Line 20: | ||
</tr> | </tr> | ||
<tr valign="top" class="second"> | <tr valign="top" class="second"> | ||
− | <td class="cmd">[[ | + | <td class="cmd">[[Command/keyword:state|state]]</td> |
− | <td>[[ | + | <td>[[Command/value:normal|normal]] [[Command/value:stop|stop]] [[Command/value:start|start]] [[Command/value:empty|empty]] [[Command/value:high|high]] [[Command/value:none|none]] [[Command/value:nomarking|nomarking]] [[Command/value:name|name]] </td> |
</tr> | </tr> | ||
<tr valign="top" class="second"> | <tr valign="top" class="second"> | ||
− | <td class="cmd">[[ | + | <td class="cmd">[[Command/keyword:strut|strut]]</td> |
− | <td>[[ | + | <td>[[Command/value:yes|yes]] [[Command/value:no|no]] </td> |
</tr> | </tr> | ||
<tr valign="top" class="second"> | <tr valign="top" class="second"> | ||
− | <td class="cmd">[[ | + | <td class="cmd">[[Command/keyword:style|style]]</td> |
− | <td>[[ | + | <td>[[Command/value:normal|normal]] [[Command/value:bold|bold]] [[Command/value:slanted|slanted]] [[Command/value:boldslanted|boldslanted]] [[Command/value:type|type]] [[Command/value:cap|cap]] [[Command/value:small...|small...]] [[Command/value:command|command]] </td> |
</tr> | </tr> | ||
<tr valign="top" class="second"> | <tr valign="top" class="second"> | ||
− | <td class="cmd">[[ | + | <td class="cmd">[[Command/keyword:leftstyle|leftstyle]]</td> |
− | <td>[[ | + | <td>[[Command/value:normal|normal]] [[Command/value:bold|bold]] [[Command/value:slanted|slanted]] [[Command/value:boldslanted|boldslanted]] [[Command/value:type|type]] [[Command/value:cap|cap]] [[Command/value:small...|small...]] [[Command/value:command|command]] </td> |
</tr> | </tr> | ||
<tr valign="top" class="second"> | <tr valign="top" class="second"> | ||
− | <td class="cmd">[[ | + | <td class="cmd">[[Command/keyword:rightstyle|rightstyle]]</td> |
− | <td>[[ | + | <td>[[Command/value:normal|normal]] [[Command/value:bold|bold]] [[Command/value:slanted|slanted]] [[Command/value:boldslanted|boldslanted]] [[Command/value:type|type]] [[Command/value:cap|cap]] [[Command/value:small...|small...]] [[Command/value:command|command]] </td> |
</tr> | </tr> | ||
<tr valign="top" class="second"> | <tr valign="top" class="second"> | ||
− | <td class="cmd">[[ | + | <td class="cmd">[[Command/keyword:leftwidth|leftwidth]]</td> |
− | <td>[[ | + | <td>[[Command/value:dimension|dimension]]<br /><!-- |
+ | -->Limit the text inside the header to a certain dimension. <!-- | ||
+ | -->Setting this value may interfere with any additional {{cmd|delimitatetext}} or {{cmd|doboundtext}} performed inside the headers | ||
+ | </td> | ||
</tr> | </tr> | ||
<tr valign="top" class="second"> | <tr valign="top" class="second"> | ||
− | <td class="cmd">[[ | + | <td class="cmd">[[Command/keyword:rightwidth|rightwidth]]</td> |
− | <td>[[ | + | <td>[[Command/value:dimension|dimension]] </td> |
</tr> | </tr> | ||
<tr valign="top" class="second"> | <tr valign="top" class="second"> | ||
− | <td class="cmd">[[ | + | <td class="cmd">[[Command/keyword:before|before]]</td> |
− | <td>[[ | + | <td>[[Command/value:command|command]] </td> |
</tr> | </tr> | ||
<tr valign="top" class="second"> | <tr valign="top" class="second"> | ||
− | <td class="cmd">[[ | + | <td class="cmd">[[Command/keyword:after|after]]</td> |
− | <td>[[ | + | <td>[[Command/value:command|command]] </td> |
</tr> | </tr> | ||
</table> | </table> | ||
Line 53: | Line 62: | ||
== Description == | == Description == | ||
+ | The first argument is assumed to be "text" when it is left out. Text sets the position of the header and/or footer directly over or under the pagebody. Margin places the content in the margin of the document. | ||
+ | |||
The different <tt>state</tt>s and their effects: | The different <tt>state</tt>s and their effects: | ||
{| | {| | ||
Line 65: | Line 76: | ||
|- | |- | ||
|<tt>high</tt> | |<tt>high</tt> | ||
− | |no heading on the first chapter page + expand textarea about space occupied by heading | + | |no heading on the first chapter page + expand textarea about space occupied by heading. |
|- | |- | ||
|<tt>text</tt> | |<tt>text</tt> | ||
Line 79: | Line 90: | ||
|} | |} | ||
− | == | + | Note that when setting the state, before or after each applies to all parts of the page and it is therefore best to set these by themselves as the first example below shows. For this reason state=high also affects the footer in that it removes the footer leaving no whitespace. |
+ | |||
+ | == Examples == | ||
+ | <texcode>\setupheader[state=empty]</texcode> | ||
+ | <texcode>\setupheader[strut=yes,style=bold]</texcode> | ||
+ | <texcode>\setupheader[text][after=\vskip 4pt \hrule]</texcode> | ||
+ | |||
+ | === Header with thin line below === | ||
+ | |||
+ | This is how to define header with thin line below, which does not appear on empty/blank page: | ||
− | == | + | <context mode=mkiv source=yes> |
− | < | + | \setupheader |
+ | [text] | ||
+ | [before={\startframed[frame=off,bottomframe=on,framecolor=blue,]}, | ||
+ | after={\stopframed}, | ||
+ | ] | ||
+ | \setupheadertexts[Text left][Text right] | ||
+ | |||
+ | \starttext | ||
+ | Page 1 | ||
+ | \page[empty,blank] | ||
+ | Page 2 | ||
+ | \stoptext | ||
+ | </context> | ||
== See also == | == See also == | ||
− | <!-- something like | + | <!-- something like {{cmd|goto}} --> |
+ | * {{cmd|setuplayouttext}} | ||
+ | * {{cmd|setupheadertexts}} | ||
+ | * {{cmd|setupfooter}} | ||
+ | * {{cmd|setupfootertexts}} | ||
− | + | == Help from ConTeXt-Mailinglist/Forum == | |
+ | All issues with: | ||
+ | {{Forum|{{SUBPAGENAME}}}} | ||
− | [[Category: | + | [[Category:Command/Layout|setupheader]] |
Latest revision as of 16:08, 12 November 2019
\setupheader
Syntax (autogenerated)
\setupheader[...][...=...,...] | |
[...] | text margin edge |
state | start stop empty high none normal nomarking name |
style | style command |
color | color |
strut | yes no |
n | number |
before | command |
after | command |
lefttext | text |
middletext | text |
righttext | text |
leftstyle | style command |
middlestyle | style command |
rightstyle | style command |
leftcolor | color |
middlecolor | color |
rightcolor | color |
width | dimension |
leftwidth | dimension |
middlewidth | dimension |
rightwidth | dimension |
Syntax
\setupheader[...][...=...,...] | |
[...] | text margin edge |
state | start stop empty high none normal nomarking name |
style | style command |
color | color |
strut | yes no |
n | number |
before | command |
after | command |
lefttext | text |
middletext | text |
righttext | text |
leftstyle | style command |
middlestyle | style command |
rightstyle | style command |
leftcolor | color |
middlecolor | color |
rightcolor | color |
width | dimension |
leftwidth | dimension |
middlewidth | dimension |
rightwidth | dimension |
\setupheader[...][...,...=...,...] | |
[...] | text margin edge |
state | normal stop start empty high none nomarking name |
strut | yes no |
style | normal bold slanted boldslanted type cap small... command |
leftstyle | normal bold slanted boldslanted type cap small... command |
rightstyle | normal bold slanted boldslanted type cap small... command |
leftwidth | dimension Limit the text inside the header to a certain dimension. Setting this value may interfere with any additional \delimitatetext or \doboundtext performed inside the headers |
rightwidth | dimension |
before | command |
after | command |
Description
The first argument is assumed to be "text" when it is left out. Text sets the position of the header and/or footer directly over or under the pagebody. Margin places the content in the margin of the document.
The different states and their effects:
start, stop | switch headings on and off |
none | switch off for whole chapter |
empty | no heading on the first chapter page |
high | no heading on the first chapter page + expand textarea about space occupied by heading. |
text | some 'text' defined by
\definetext[text][footer][pagenumber] or \definetext[text][footer][left][right] which is valid on the first chapter page |
Note that when setting the state, before or after each applies to all parts of the page and it is therefore best to set these by themselves as the first example below shows. For this reason state=high also affects the footer in that it removes the footer leaving no whitespace.
Examples
\setupheader[state=empty]
\setupheader[strut=yes,style=bold]
\setupheader[text][after=\vskip 4pt \hrule]
Header with thin line below
This is how to define header with thin line below, which does not appear on empty/blank page:
\setupheader [text] [before={\startframed[frame=off,bottomframe=on,framecolor=blue,]}, after={\stopframed}, ] \setupheadertexts[Text left][Text right] \starttext Page 1 \page[empty,blank] Page 2 \stoptext
See also
Help from ConTeXt-Mailinglist/Forum
All issues with: