Dear list,

I've got a problem. Not the first one, but the first one to contribute to the 
list. ;)

system> ConTeXt  ver: 2024.04.01 08:59 LMTX  fmt: 2024.4.12  int: 
english/english
system> 'cont-new.mkxl' loaded

%==========
%==========
\definehead[Datum][subsubsubject]

\startsetups[Test]
  Pr=(\getmarking[Datum][previous])~
  Nx=(\getmarking[Datum][next])~
  Fi=(\getmarking[Datum][first])~
  La=(\getmarking[Datum][last])~
  Tp=(\getmarking[Datum][top])~
  Bt=(\getmarking[Datum][bottom])~
  Cu=(\getmarking[Datum][current])~
\stopsetups

\setupheadertexts[text]
  [\setups{Test}][]
  [\setups{Test}][]

\setuppagenumbering[location=footer]

\starttext

\startDatum[title={secA}]%

  \dorecurse{50}{aaa }

  \pagebreak
 
  \dorecurse{50}{aaa }

\stopDatum

\startDatum[title={secB}]%

  \dorecurse{630}{bbb }

\stopDatum

\startDatum[title={secC}]%

  \dorecurse{50}{ccc }

\stopDatum

\startDatum[title={secD}]%

  \dorecurse{50}{ddd }

\stopDatum

\startDatum[title={secE}]%

  \dorecurse{50}{eee }

\stopDatum


\stoptext
%==========
%==========


I'd like to write the marking of the very first text at the current page to the 
header. That seems to be a bit tricky, at least for me. (I'm afraid that 
\getmarking[xxx][top] was intended for that and it is not feasible at all.)

At page 1 the header should read "secA", at page 2 again "secA" (because the 
very first text belongs to "secA"), and at page 3 "secC" (because the very 
first text (the section title) belongs to "secC"). Unfortunatly \getmarking[][] 
does not behave like I expacted.

I understand the keywords of \getmarking in the wiki 
(https://wiki.contextgarden.net/Command/getmarking) as listed below:
• previous: marking at the bottom of the page BEFORE the current page (no page 
before then empty)
• next: marking at the top of the page AFTER the current page (no page after 
then bottom of current page)

• top: marking at the top of the current page
• bottom: marking at the bottom of the current page

• first: first marking that starts at the current page (no first than behaving 
like top)
• last: last marking that starts at the current page (no last than behaving 
like bottom)

• current: last stored marking while deciding on pagebreaking between the 
current page and the (potential) following page
• default: first

According to these thoughts, I started with \getmarking[Datum][top]. But "top" 
seems not to work, there is no difference between "top" and "first", "top" 
behaves like "first".

My second thought: Generally \getmarking[Datum][first] would be perfect, so 
I've thought something like

    \doifelse{\fetchmark[Datum][next] of the page before the current 
page}{\fetchmark[Datum][previous]}
      {\getmarking[Datum][previous]}
      {\getmarking[Datum][first]}

could work. (Honestly I don't know how to do "\fetchmark[Datum][next] of the 
page before the current page}". The first page would need a special treatment 
too.)

But: At page 2 \getmarking[Datum][next] (Nx) contains "secB" but at top of page 
3 is not "secB" but "secC". So \getmarking[Datum][next] does not seem to 
contain the correct information I need, therefore I don't get any further.


Any ideas: How do I write the marking of the very first text at the current 
page to the header?


Thank you in advance, Matthias

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to