Difference between revisions of "Command/setupheadertexts"

From Wiki
Jump to navigation Jump to search
(→‎Syntax: added info about \setupheadertexts[middle text] variant)
m (activate example)
 
(One intermediate revision by one other user not shown)
Line 3: Line 3:
 
|attributes=
 
|attributes=
 
}}
 
}}
 +
 +
== [[Help:Reference|Syntax]] (autogenerated) ==
 +
<syntax>setupheadertexts</syntax>
  
 
== [[Help:Reference|Syntax]] ==
 
== [[Help:Reference|Syntax]] ==
Line 76: Line 79:
 
=== Multiline header ===
 
=== Multiline header ===
  
<texcode>
+
<context source="yes">
 +
\setuppapersize[A7,landscape]
 
\startsetups[headertext]
 
\startsetups[headertext]
 
   \startframed[frame=off,align=flushleft,width=fit]
 
   \startframed[frame=off,align=flushleft,width=fit]
Line 89: Line 93:
  
 
\starttext
 
\starttext
 +
\showframe
 
   aaa
 
   aaa
 
\stoptext
 
\stoptext
</texcode>
+
</context>
 
 
(The result is not shown as headers - here, on Wiki - are trimmed out from the produced .pdf, so there is nothing to show.)
 
  
 
== See also ==
 
== See also ==

Latest revision as of 08:07, 20 March 2024

\setupheadertexts

Syntax (autogenerated)

\setupheadertexts[...][...][...][...][...]
[...]text margin edge
[...]date pagenumber mark text command
[...]date pagenumber mark text command
[...]date pagenumber mark text command
[...]date pagenumber mark text command


Syntax

\setupheadertexts[...][...][...][...]
[...] text on the left handed side of odd pages
[...] text on the right handed side of odd pages
[...] text on the right handed side of even pages
[...] text on the left handed side of even pages

or

\setupheadertexts[...]
[...] text in the middle of the header

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:

\setupheadertexts[middle text]
\setupheadertexts[on the left][on the right]

There are predefined keywords for popular values, like chapter and pagenumber,

eg:

\setupheadertexts[chapter]
\setupheadertexts[][pagenumber][pagenumber][]

Description

Place headers and footers with the commands \setupheadertexts and \setupfootertexts.

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.

Example

This example produces the same header on odd and even pages.

\setupheadertexts
        [{\getmarking[chapter]}]    [{page \pagenumber}]
        [{page \pagenumber}]        [{\getmarking[chapter]}]
\setuppagenumbering[location=]

Note: \setuppagenumbering[location=] supresses the default output (i.e. centered in header) of the page number on every page.

Multiline header

\setuppapersize[A7,landscape]
\startsetups[headertext]
  \startframed[frame=off,align=flushleft,width=fit]
    abc\\
    def\\
    ghi\\
    jkl
  \stopframed
\stopsetups

\setupheadertexts[\directsetup{headertext}]

\starttext
\showframe
  aaa
\stoptext

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: