From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/93870 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Controlling \at output Date: Wed, 24 Feb 2016 14:35:48 +0100 Message-ID: <56CDB1B4.7060608@gmail.com> References: <83CFD74F-5EA2-4F7D-B1D8-8044185F7556@nicholware.co.uk> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6894334486332066933==" X-Trace: ger.gmane.org 1456321208 3668 80.91.229.3 (24 Feb 2016 13:40:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Feb 2016 13:40:08 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Feb 24 14:39:56 2016 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aYZfY-0005oZ-La for gctc-ntg-context-518@m.gmane.org; Wed, 24 Feb 2016 14:39:56 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 484CA71D7; Wed, 24 Feb 2016 14:36:04 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hfptr4ESOcTP; Wed, 24 Feb 2016 14:36:03 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 02C4971E7; Wed, 24 Feb 2016 14:36:03 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 1BC1571E5 for ; Wed, 24 Feb 2016 14:36:02 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FzHfba5JT8Tm for ; Wed, 24 Feb 2016 14:36:01 +0100 (CET) Original-Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 989AC71D7 for ; Wed, 24 Feb 2016 14:35:51 +0100 (CET) Original-Received: by mail-wm0-f54.google.com with SMTP id c200so269846818wme.0 for ; Wed, 24 Feb 2016 05:35:51 -0800 (PST) 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=zVbDjDsyxMlgR/UIJ+CV7SjipMSj3zM5xpkRH6O+KEU=; b=I/Nhv3eleAHYI3KGcI3tCLrHTlq03n54HSn5/Zy9dbc7HT2GfYkOHt+LK68x8m4yVJ WSFCW7cAXvpzIOom34ltT9Mx8C7RWRrMSo/lV7J3lm7euNka3FKB1bNMWBEFc61dBFkR djzp1MFW/ariQAjlhr+qJc9KHghEBCvvc54fhrcP7e+xEgpYctNpJCOxl0KpBwBElPzQ pylaP9m95xVnVlb8RaoPd5nv3zlw2DlOoLEI9pGaGTKOtaMc1nU90Ml9TxSlY1wtMiSY BDXU0AIcCHj2RI/c9rXTR7XFzUCacTlRF35fKnYK32sZ9Ine0vxevwBtb3gOqdq31raH GLsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type; bh=zVbDjDsyxMlgR/UIJ+CV7SjipMSj3zM5xpkRH6O+KEU=; b=HEr7AaSyh2S1K5Tcm45HAA9TGVkSKlTKZE2/RuiXOvnIWIMYNJiJSK4frONFk/ZS8L jjWTryS6liXcOPt5H1+Sax1rMKA5kNxobPJaeygru2q0lXLFfrY1dyHkPQiQ6arS9xF7 Mn0gQ3smaL34Ir8VBu+0rE7Kxd4tPP09KxpLg8Kbvmrv2upW1IviErMzzMxSBJUlccNc kJVRknqC4sFXPJEOE3cLL6jlUYUsR6RXYvff2EXpT1WWtGBG1h73NwlBrKRKNKiVQh9E nlO43m1uU4Iq42q6v9sZ4k0+NFbwA54qG2LUGPZ0TCYHvTmF9yJHtGq6Vbg8j6OvWt8c VEKw== X-Gm-Message-State: AG10YOTel/PZgtZyHW5ZW6boEQgnA/8eT26aNNTRd9amQKHB9ZrpFrMkxwKLt/cvQqklIQ== X-Received: by 10.28.210.73 with SMTP id j70mr23116220wmg.8.1456320951061; Wed, 24 Feb 2016 05:35:51 -0800 (PST) Original-Received: from keima.localdomain (x2f2a877.dyn.telefonica.de. [2.242.168.119]) by smtp.gmail.com with ESMTPSA id bg1sm3077405wjc.27.2016.02.24.05.35.49 for (version=TLSv1/SSLv3 cipher=OTHER); Wed, 24 Feb 2016 05:35:50 -0800 (PST) User-Agent: Postbox 4.0.8 (Macintosh/20151105) In-Reply-To: <83CFD74F-5EA2-4F7D-B1D8-8044185F7556@nicholware.co.uk> 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:93870 Archived-At: This is a multi-part message in MIME format. --===============6894334486332066933== Content-Type: multipart/alternative; boundary="------------090601030704020207020006" This is a multi-part message in MIME format. --------------090601030704020207020006 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable > Aidan Nichol > 24. Februar 2016 um 12:47 > I=E2=80=99m trying to create something (like varioref in latex) that=20 > suppresses \at output if the referenced item is on the current page.=20 > The main decision point is with > > \doifelse{\at[ref2]}{\rawcountervalue[page]}{ same page }{ different=20 > page } > > no matter what I try (expdoifelse and other ways to get the current=20 > page) the values never match. > > \doifelse{\at[ref2]}{\at[ref1]}=E2=80=A6.. (ref1 and ref2 are on the sa= me page=20 > but don=E2=80=99t match > > \doifelse{\rawcountervalue[page]}{1}=E2=80=A6 it is page 1 but always f= ails. > > The only match I get is with > > \doifelse{\at[ref2]}{\at[ref2]}=E2=80=A6. which is pretty useless > > Presumably I=E2=80=99m doing something stupid. Or do i have to go for a= much=20 > lower level approach \startsetups[referenceformat:thispage] \doifelse{\filterreference{page}}{\rawcountervalue[userpage]} {{\tttf !?}} {\filterreference{page}} \stopsetups \definereferenceformat[thispage][setups=3Dreferenceformat:thispage] \starttext \chapter[one]{First chapter} First: \thispage[one] Second: \thispage[two] \chapter[two]{Second chapter} First: \thispage[one] Second: \thispage[two] \stoptext Wolfgang --------------090601030704020207020006 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
24= .=20 Februar 2016 um 12:47
I=E2=80=99m trying to c= reate=20 something (like varioref in latex) that suppresses \at output if the=20 referenced item is on the current page. The main decision point is with
\doifelse{\at[ref2]}{\rawcountervalue[page]}{ same page }{ different page }

no matter what I try (expdoifelse=20 and other ways to get the current page) the values never match.

\d= oifelse{\at[ref2]}{\at[ref1]}=E2=80=A6.. (ref1 and ref2 are on the same page but don=E2=80=99t match

\doif= else{\rawcountervalue[page]}{1}=E2=80=A6 it is page 1 but always fails.

The only match I get is with
<= br>\doifelse{\at[ref2]}{\at[ref2]}=E2=80=A6. which is pretty useless

Presumably I=E2=80=99m doing something s= tupid.=20 Or do i have to go for a much lower level approach
\startsetups[referenceformat:thispage]
=C2=A0=C2=A0=C2=A0 \doifelse{\filterreference{page}}{\rawcountervalue[use= rpage]}
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 {{\tttf !?}}
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 {\filterreference{page}}
\stopsetups

\definereferenceformat[thispage][setups=3Dreferenceformat:thispage]

\starttext

\chapter[one]{First chapter}

First: \thispage[one]

Second: \thispage[two]

\chapter[two]{Second chapter}

First: \thispage[one]

Second: \thispage[two]

\stoptext

Wolfgang
--------------090601030704020207020006-- --===============6894334486332066933== 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= --===============6894334486332066933==--