From: Wolfgang Schuster <schuster.wolfgang@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: markings and syncing
Date: Thu, 22 Oct 2015 17:59:45 +0200 [thread overview]
Message-ID: <562907F1.10102@gmail.com> (raw)
In-Reply-To: <5628CDBA.1040108@uni-bonn.de>
[-- Attachment #1.1: Type: text/plain, Size: 1292 bytes --]
> Thomas A. Schmitz <mailto:thomas.schmitz@uni-bonn.de>
> 22. Oktober 2015 um 13:51
> Hi,
>
> I'm trying to set up a header: if a page contains only one marking, it
> should display this, if it has more than one, display the first and
> last. Here's what I tried, unsuccessfully:
>
> \definemarking [test]
>
> \startsetups [test header]
> \doifelse {\expanded{\getmarking[test][top]}}
> {\expanded{\getmarking[test][bottom]}}
> {\getmarking[test][top]}
> {\getmarking[test][top] and \getmarking[test][bottom]}
> \stopsetups
>
> \setupheadertexts [\setups{test header}]
>
> \starttext
>
> \marking[test] {One}
>
> \input knuth
>
> \marking [test] {Two}
>
> \page
>
> \marking [test] {Three}
>
> \input tufte
>
> \stoptext
>
> How can I make the \doifelse work? I'm not sure I understand the
> keywords top/bottom, first/last, and previous/next.
You have to use the \fetchmark command (which is currently broken but I
sent a fix to the dev list)
to check the content of both marks because \getmarking isn’t expandable.
\startsetups [test header]
\doifelse{\fetchmark[test][top]}{\fetchmark[test][bottom]}
{\getmarking[test][top]}
{\getmarking[test][top] and \getmarking[test][bottom]}
\stopsetups
Wolfgang
[-- Attachment #1.2: Type: text/html, Size: 2380 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
next prev parent reply other threads:[~2015-10-22 15:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-22 11:51 Thomas A. Schmitz
2015-10-22 15:59 ` Wolfgang Schuster [this message]
2015-10-22 17:59 ` Thomas A. Schmitz
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=562907F1.10102@gmail.com \
--to=schuster.wolfgang@gmail.com \
--cc=ntg-context@ntg.nl \
/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).