From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/92747 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: markings and syncing Date: Thu, 22 Oct 2015 17:59:45 +0200 Message-ID: <562907F1.10102@gmail.com> References: <5628CDBA.1040108@uni-bonn.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0750556030==" X-Trace: ger.gmane.org 1445529673 8523 80.91.229.3 (22 Oct 2015 16:01:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 22 Oct 2015 16:01:13 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Oct 22 18:00:58 2015 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZpIIG-0003uS-Mz for gctc-ntg-context-518@m.gmane.org; Thu, 22 Oct 2015 18:00:44 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D5729101F6 for ; Thu, 22 Oct 2015 18:00:43 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id fIMoNKHE47tN for ; Thu, 22 Oct 2015 18:00:40 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 5283F10230 for ; Thu, 22 Oct 2015 17:59:54 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 1DED1101F6 for ; Thu, 22 Oct 2015 17:59:51 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ST92FmFiC5gG for ; Thu, 22 Oct 2015 17:59:50 +0200 (CEST) Original-Received: from filter3-utr.mf.surf.net (filter3-utr.mf.surf.net [195.169.124.154]) by balder.ntg.nl (Postfix) with ESMTP id 08344101E8 for ; Thu, 22 Oct 2015 17:59:50 +0200 (CEST) Original-Received: from mail-wi0-x230.google.com (mail-wi0-x230.google.com [IPv6:2a00:1450:400c:c05::230]) by filter3-utr.mf.surf.net (8.14.4/8.14.4/Debian-4) with ESMTP id t9MFxmRe017588 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 22 Oct 2015 17:59:49 +0200 Original-Received: by wijp11 with SMTP id p11so39132985wij.0 for ; Thu, 22 Oct 2015 08:59:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=c5WQLdYXpLu6nf2JpxwPNh+W3YpYxdLQrJ4B4F+w6V4=; b=SDbyQw4uIYTMKmMAyAX/4gDOj70BEJD9BqN8kDrSTtzaaxV4QtvveoHZri89hghy8Z 638Gr+ePK7zHn5u6wTde9vrlXx6s4sBk1F1boGwxy7UzRD6FVAD0Jt0HRgs3hoWiSBkm mKzi6NXga9/fIPFAJLP+Uqeo9bE6f/ByAV/hqnbqYUgEUSYphCWqiwOrhZ/Zzag7Objn 3HD2Y3BXwGpr4AVbS64M155esiOjlQ0USGrzK9aUU0dc+af9r1iUXT6WIerlIwcm5GXu iobdl1fKNBAV5rqbUyhizXwHdBQx14iz/6PKRs6hFiF1NkVPQPPVcmslCmoGL68RFvjm ttWg== X-Received: by 10.194.86.66 with SMTP id n2mr18526275wjz.53.1445529588743; Thu, 22 Oct 2015 08:59:48 -0700 (PDT) Original-Received: from keima.localdomain (x2f22c34.dyn.telefonica.de. [2.242.44.52]) by smtp.googlemail.com with ESMTPSA id gl9sm17631095wjb.10.2015.10.22.08.59.47 for (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Oct 2015 08:59:48 -0700 (PDT) User-Agent: Postbox 4.0.5 (Macintosh/20150923) In-Reply-To: <5628CDBA.1040108@uni-bonn.de> X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2a00:1450:400c:c05::230; country=BE; region=Brussels Capital; city=Brussels; latitude=50.8466; longitude=4.3528; http://maps.google.com/maps?q=50.8466,4.3528&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 08PwfXNpl - 07e55ec0fab9 - 20151022 (trained as not-spam) Received-SPF: pass (filter3-utr.mf.surf.net: domain of schuster.wolfgang@gmail.com designates 2a00:1450:400c:c05::230 as permitted sender) receiver=filter3-utr.mf.surf.net; client-ip=2a00:1450:400c:c05::230; envelope-from=; helo=mail-wi0-x230.google.com; identity=mailfrom X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:92747 Archived-At: This is a multi-part message in MIME format. --===============0750556030== Content-Type: multipart/alternative; boundary="------------060401040802090501050401" This is a multi-part message in MIME format. --------------060401040802090501050401 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable > Thomas A. Schmitz > 22. Oktober 2015 um 13:51 > Hi, > > I'm trying to set up a header: if a page contains only one marking, it=20 > should display this, if it has more than one, display the first and=20 > last. Here's what I tried, unsuccessfully: > > \definemarking [test] > > \startsetups [test header] > \doifelse {\expanded{\getmarking[test][top]}}=20 > {\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=20 > keywords top/bottom, first/last, and previous/next. You have to use the \fetchmark command (which is currently broken but I=20 sent a fix to the dev list) to check the content of both marks because \getmarking isn=E2=80=99t expa= ndable. \startsetups [test header] \doifelse{\fetchmark[test][top]}{\fetchmark[test][bottom]} {\getmarking[test][top]} {\getmarking[test][top] and \getmarking[test][bottom]} \stopsetups Wolfgang --------------060401040802090501050401 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
22= .=20 Oktober 2015 um 13:51
Hi,

I'm trying to set up a header: if a page contains only one marking,=20 it=20 should display this, if it has more than one, display the first and=20 last. Here's what I tried, unsuccessfully:

\definemarking [test]

\startsetups [test header]
\doifelse {\expanded{\getmarking[test][top]}}=20 {\expanded{\getmarking[test][bottom]}}
=C2=A0=C2=A0=C2=A0=C2=A0{\getmarking[test][top]}
=C2=A0=C2=A0=C2=A0=C2=A0{\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=20 keywords top/bottom, first/last, and previous/next.
You have to use the \fetchmark command (which is currently broken but I=20 sent a fix to the dev list)
to check the content of both marks because \getmarking isn=E2=80=99t expa= ndable.

\startsetups [test header]
=C2=A0=C2=A0=C2=A0 \doifelse{\fetchmark[test][top]}{\fetchmark[test][bott= om]}
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 {\getmarking[test][top]}
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 {\getmarking[test][top] and \getmar= king[test][bottom]}
\stopsetups

Wolfgang
--------------060401040802090501050401-- --===============0750556030== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============0750556030==--