From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/93359 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: pagereferences Date: Sun, 17 Jan 2016 20:59:52 +0100 Message-ID: <569BF2B8.9000507@gmail.com> References: <569BC47F.2010107@gmail.com> <50141C9E-4337-4197-96A8-0B679371618B@uva.nl> <569BDF4E.2020800@gmail.com> <730102E8-820B-4952-A87B-193ADBB7168A@uva.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3182675980909898713==" X-Trace: ger.gmane.org 1453060837 24693 80.91.229.3 (17 Jan 2016 20:00:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 17 Jan 2016 20:00:37 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Jan 17 21:00:23 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 1aKtUs-0003C6-Ao for gctc-ntg-context-518@m.gmane.org; Sun, 17 Jan 2016 21:00:22 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 98C7B605A; Sun, 17 Jan 2016 21:00:07 +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 544vDFaLU0Ek; Sun, 17 Jan 2016 21:00:06 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id DDF356061; Sun, 17 Jan 2016 21:00:06 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 3BE39605F for ; Sun, 17 Jan 2016 21:00:06 +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 MUQkyIDxY5Pb for ; Sun, 17 Jan 2016 21:00:05 +0100 (CET) Original-Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) (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 8C841605A for ; Sun, 17 Jan 2016 20:59:55 +0100 (CET) Original-Received: by mail-wm0-f51.google.com with SMTP id 123so29145848wmz.0 for ; Sun, 17 Jan 2016 11:59:55 -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=soaemOZdPrnRgA80OzNJ/ACZXF8MpSoLaiKWaUSDi9c=; b=RxGMTufFdUz3J6NZFnv7BMie3LF3LrKMtJdpgwrlBRSpsZuQTWRu3APU98PZJwKA7E eNZAWK0lPX79b+OmIAlMQ4ry0wBsCAPEXPPbi0fMW8OOee7peDQHYA9/KFOH3X+Y0WMj jGQx0sOcvcO70MpY++j0DYaMx/FB39PaI+7fFtOVrb4RnQsUvZum/cN1fVytP0GZPsHK xr3Ge7u+uyXmiG/vPbUw2ou5JqtJ9WCnpP4gaZE7l3Op19/G1hufJAM0tvYTUZQJOPdC Q24J2ZhwsFhxhQqIn05POWEYIifVG/m9UZ3sERUvsrR7FguOCbEmefGSV1Y0lx8+YTXg 3C1g== 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=soaemOZdPrnRgA80OzNJ/ACZXF8MpSoLaiKWaUSDi9c=; b=ScfjZuN0mna8TnUNrhz44mxRfC2bGsv81PfQ3tNCU4EszsQGxEMUhCbrWwXp9XaTX7 AJ0RemrUbSg1+fFCk6NukYP6NdZYA9FyQklz1mIUkSgOMnH2A7xaQ67ZpvMKq2FnzFr6 /YTqK42rEQHvx5PwPQnqhIxQruE/2AYLradRPDuAwaFZ49cvo5jkCqFy5jbcq1dlldye 8r4pTdoSLSbDgQMw9CWaIy5C6fDIq9co5rKWc8BxgK2DMs8cgV+y6xZBYYHZh0LFL1ol oYP9MZdlUoFtpJVfzPjkU56H1vM5Ata5aNboUTCB7wVOokBfeOmJfYFTnZRv0+6+F+qI H9lA== X-Gm-Message-State: AG10YOQNY+uTGbOjk30+yNWcux350NFmEsqfxu+FYDjMV8WhFnqQm7bs3ZoLwDixXT1CkA== X-Received: by 10.28.187.198 with SMTP id l189mr9927969wmf.89.1453060795286; Sun, 17 Jan 2016 11:59:55 -0800 (PST) Original-Received: from keima.localdomain (x2f29812.dyn.telefonica.de. [2.242.152.18]) by smtp.gmail.com with ESMTPSA id y188sm12492399wmy.11.2016.01.17.11.59.54 for (version=TLSv1/SSLv3 cipher=OTHER); Sun, 17 Jan 2016 11:59:54 -0800 (PST) User-Agent: Postbox 4.0.8 (Macintosh/20151105) In-Reply-To: <730102E8-820B-4952-A87B-193ADBB7168A@uva.nl> 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:93359 Archived-At: This is a multi-part message in MIME format. --===============3182675980909898713== Content-Type: multipart/alternative; boundary="------------020703060103020308030606" This is a multi-part message in MIME format. --------------020703060103020308030606 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit > Meer, Hans van der > 17. Januar 2016 um 20:43 > Thanks Wolfgang. I am experimenting with your code and there has > arisen a problem. The book I am typesetting has some pages before the > text on page-1 starts (cover and so on). Therefore the code > > \def\mypageref[#1]{\setpagestate[hvdm][#1]\color[red]{page=\pagenumber\ and > pageref=\pagestaterealpage{hvdm}{#1}}} > produces "page=29 and pageref=31". Not as intended. Do I change the > macro \pagestaterealpage into what macro? I tried \pagestatepage, but > that wasn't the right idea. > > Now what further to change? You can use the dataset command which lets you store other information, e.g. the current value of the visible pagenumber. \definedataset[hans][delay=yes] \setupuserpagenumber[number=3] \starttext One\setdataset[hans][one][pagenumber=\userpagenumber] \page[+2] Two\setdataset[hans][two][pagenumber=\userpagenumber] Three\setdataset[hans][three][pagenumber=\userpagenumber] \blank \ifnum0\datasetvariable{hans}{two}{realpage}=0\datasetvariable{hans}{one}{realpage} The references are on the same page. \else The references are on different pages. \fi \blank \ifnum0\datasetvariable{hans}{two}{realpage}=0\datasetvariable{hans}{three}{realpage} The references are on the same page. \else The references are on different pages. \fi \page \starttabulate \NC One \NC \datasetvariable{hans}{one}{pagenumber} \NC\NR \NC Two \NC \datasetvariable{hans}{two}{pagenumber} \NC\NR \NC Three \NC \datasetvariable{hans}{three}{pagenumber} \NC\NR \stoptabulate \stoptext Wolfgang --------------020703060103020308030606 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
17= .=20 Januar 2016 um 20:43
Thanks Wolfgang. I am experimenting with your code and there has arisen a problem. The book I am typesetting has some pages before the text on=20 page-1 starts (cover and so on). Therefore the code
=C2=A0 =C2=A0=20 \def\mypageref[#1]{\setpagestate[hvdm][#1]\color[red]{page=3D\pagenumber\= =20 and pageref=3D\pagestaterealpage{hvdm}{#1}}}
produces "page=3D29 and pageref=3D31". Not as intended. D= o I=20 change the macro \pagestaterealpage into what macro? I tried=20 \pagestatepage, but that wasn't the right idea.

Now what further to change?
You can use the dataset command which lets you store other information,=20 e.g. the current value of the visible pagenumber.

\definedataset[hans][delay=3Dyes]

\setupuserpagenumber[number=3D3]

\starttext

One\setdataset[hans][one][pagenumber=3D\userpagenumber]

\page[+2]

Two\setdataset[hans][two][pagenumber=3D\userpagenumber]

Three\setdataset[hans][three][pagenumber=3D\userpagenumber]

\blank

\ifnum0\datasetvariable{hans}{two}{realpage}=3D0\datasetvariable{hans}{on= e}{realpage}
=C2=A0=C2=A0=C2=A0 The references are on the same page.
\else
=C2=A0=C2=A0=C2=A0 The references are on different pages.=C2=A0=C2=A0=C2=A0=
\fi

\blank

\ifnum0\datasetvariable{hans}{two}{realpage}=3D0\datasetvariable{hans}{th= ree}{realpage}
=C2=A0=C2=A0=C2=A0 The references are on the same page.
\else
=C2=A0=C2=A0=C2=A0 The references are on different pages.=C2=A0=C2=A0=C2=A0=
\fi

\page

\starttabulate
\NC One=C2=A0=C2=A0 \NC \datasetvariable{hans}{one}{pagenumber}=C2=A0=C2=A0= \NC\NR
\NC Two=C2=A0=C2=A0 \NC \datasetvariable{hans}{two}{pagenumber}=C2=A0=C2=A0= \NC\NR
\NC Three \NC \datasetvariable{hans}{three}{pagenumber} \NC\NR
\stoptabulate

\stoptext

Wolfgang
--------------020703060103020308030606-- --===============3182675980909898713== 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= --===============3182675980909898713==--