Difference between revisions of "Command/getmarking"
< Command
Jump to navigation
Jump to search
m (cleanup) |
(keywords "top" and "bottom" were missing; Hans’ description of keywords) |
||
Line 15: | Line 15: | ||
<tr valign="top" class="second"> | <tr valign="top" class="second"> | ||
<td class="cmd">[...]</td> | <td class="cmd">[...]</td> | ||
− | <td>first last previous both all current </td> | + | <td>first last top bottom previous both all current </td> |
</tr> | </tr> | ||
</table> | </table> | ||
Line 21: | Line 21: | ||
== Description == | == Description == | ||
+ | |||
+ | Marks are somewhat special in the sense that they can be loners or part of a chain (chapter-section-...) with special reset requirements. | ||
+ | |||
+ | As TeX’s natural model has some limitations, in mkIV we do things a bit different (but rather well defined). When a set of marks on a page is identified, the following keywords can be used: | ||
+ | |||
+ | previous : last before sync | ||
+ | next : first after sync | ||
+ | |||
+ | top : first in sync | ||
+ | bottom : last in sync | ||
+ | |||
+ | first : first not top in sync | ||
+ | last : last not bottom in sync | ||
+ | |||
+ | When the chain is to be ignored, one can append ":nocheck" to the keyword. There’s also a 'current' method. | ||
+ | |||
== Example == | == Example == | ||
+ | Example of usage for each column in columnsets: | ||
<texcode> | <texcode> | ||
− | |||
\startsetups S | \startsetups S | ||
Line 105: | Line 121: | ||
== See also == | == See also == | ||
− | + | [[cmd:definemarking|\definemarking]] | |
+ | [[cmd:marking|\marking]] | ||
[[Category:Reference/en|getmarking]] | [[Category:Reference/en|getmarking]] |
Revision as of 18:10, 20 December 2011
\getmarking
Syntax
\getmarking[...][...] | |
[...] | name |
[...] | first last top bottom previous both all current |
Description
Marks are somewhat special in the sense that they can be loners or part of a chain (chapter-section-...) with special reset requirements.
As TeX’s natural model has some limitations, in mkIV we do things a bit different (but rather well defined). When a set of marks on a page is identified, the following keywords can be used:
previous : last before sync next : first after sync
top : first in sync bottom : last in sync
first : first not top in sync last : last not bottom in sync
When the chain is to be ignored, one can append ":nocheck" to the keyword. There’s also a 'current' method.
Example
Example of usage for each column in columnsets:
\startsetups S [p=(\getmarking[M][1][previous]) f=(\getmarking[M][1][first]) l=(\getmarking[M][1][last])]\quad [p=(\getmarking[M][2][previous]) f=(\getmarking[M][2][first]) l=(\getmarking[M][2][last])]\quad [p=(\getmarking[M][3][previous]) f=(\getmarking[M][3][first]) l=(\getmarking[M][3][last])] \global\mofcolumns\plusone \stopsetups \setupheadertexts[\setups{S}] \definecolumnset[C][n=3] \definemarking[M] \startbuffer \section{Knuth} [k1]\marking[M]{k1} [k2]\marking[M]{k2} \input knuth \section{Zapf} [z]\marking[M]{z} \input zapf \stopbuffer \starttext \startcolumnset[C] \dorecurse{10}{\getbuffer} \stopcolumnset \stoptext
Example
\definemarking[M] \startsetups S default=(\getmarking[M])~ first=(\getmarking[M][first])~ last=(\getmarking[M][last])~ previous=(\getmarking[M][previous])~ both=(\getmarking[M][both])~ all=(\getmarking[M][all])~ current=(\getmarking[M][current]) \stopsetups \setupheadertexts[text] [\setups{S}][] [\setups{S}][] \setuppagenumbering[location=footer] \starttext \startbuffer \section{Knuth} [k1]\marking[M]{k1}[k2]\marking[M]{k2} \input knuth \section{Zapf} [z]\marking[M]{z} \input zapf \stopbuffer \dorecurse{10}{\getbuffer} \stoptext