Difference between revisions of "Command/getmarking"

From ConTeXt wiki
Jump to navigationJump to search
 
Line 5: Line 5:
  
 
== [[Help:Reference|Syntax]]  (autogenerated) ==
 
== [[Help:Reference|Syntax]]  (autogenerated) ==
 
 
<syntax>getmarking</syntax>
 
<syntax>getmarking</syntax>
  

Latest revision as of 22:20, 14 November 2019

\getmarking

Syntax (autogenerated)

\getmarking[...][...][...]
[...]mark
[...]page name
[...]first last current previous next top bottom default both all first:nocheck last:nocheck previous:nocheck next:nocheck top:nocheck bottom:nocheck


Syntax

\getmarking[...][...]
[...] name
[...] first last top bottom previous next both all


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
 both     : equivalent to first + last
 all      : equivalent to previous + first + last
 current  : ?

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


See also

\definemarking \marking

Help from ConTeXt-Mailinglist/Forum

All issues with: