From: Biblio--- via ntg-context <ntg-context@ntg.nl>
To: ntg-context@ntg.nl
Cc: "Biblio@mail.de" <Biblio@mail.de>
Subject: [NTG-context] \getmarking for top at the current page
Date: Mon, 15 Apr 2024 12:03:56 +0200 [thread overview]
Message-ID: <c2d7db87-4819-4fbd-886d-e9ad15faf4bc@mail.de> (raw)
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 other threads:[~2024-04-15 10:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c2d7db87-4819-4fbd-886d-e9ad15faf4bc@mail.de \
--to=ntg-context@ntg.nl \
--cc=Biblio@mail.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).