Changes

Jump to navigation Jump to search
no edit summary
< [[Structurals]] |  == Headers with centered content ==
ConTeXt offers the possibility to have mirrored headers (for odd and even pages); content can be in two parts, at the inner and outer margin of each page. But how do you get a header that will have one part of its content centered and one part in the outer margin? (This is a common setup for books: chapter title centered, page number in outer margin.) Hans posted this solution to the list:
</texcode>
The use of the TeX macros {{cmd|rlap }} and {{cmd|llap }} allows centering of content. Note that \{{cmd|pagenumber }} gets you the number prior to conversion; if you're using \{{cmd|setupuserpagenumber}}[numberconversion=...] then you'll want to use \{{cmd|userpagenumber }} instead.
== Using capitals ==
In the previous example, the chapter title and the section title were fetched with the macro <{{cmd>|getmarking</cmd> }} which wraps around <{{cmd>|fetchmark</cmd>}}.
However, in case you need a raw version of the mark, say for instance to put it uppercase, you may use this setup instead:
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>
== Skipping headers or footers ==
You can suppress or bypass a header or footer on a chapter page like this:
<texcode>
\setuphead[chapter][header=high,footer=none] % with header=high the text area of the page will extend up % into the space where the header normaly sits% or:\setuphead[chapter][header=emptyhigh,footer=none]  % header=empty leaves the header area intact, % but does not fill it with any text\setuphead[chapter][header=empty,footer=none]
</texcode>
Works only if the head title starts a new page. Since section does not do this by default, then you must write
The options for 'header=' and 'footer=' are none,empty,high,nomarking.
== Adding Substituting a shorter lemma for a line below the ''section'' header ==There are two ways to achieve this:Given a global setup such as 
<texcode>
\setupbackgroundssetupheadertexts%[header][textsection][chapter][bottomframe=on]
</texcode>
The above method will require Sometimes the header=high option if you want ''section'' title is too long to skip fit in the line on pages where a chapter begins (with header=empty the line will still be there but with no text). The second method allows skipping the header (including the line) with both the header={empty|high} option.Instead of manually inserting a new \setupheadertexts comamnd you may use something like 
<texcode>
\setupheaderstartsection [text][aftertitle={\blackrule[width=\textwidthHere is a section title too long to fit in the header},height marking=\linewidth,depth=0pt]{Here is a section title}]
</texcode>
 
Similarly, you can send shorter lemmas to the table of contents or to bookmarks. So the relevant keys include
 
<texcode>
title marking list bookmark
</texcode>
 
= Further reading =
 
* [[Page numbering in words]]
 
[[Category:Basics]]

Navigation menu