From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/88200 Path: news.gmane.org!not-for-mail From: Otared Kavian Newsgroups: gmane.comp.tex.context Subject: Re: Leave out reference to page if on the same page? Date: Thu, 24 Jul 2014 14:03:48 +0200 Message-ID: References: <9B2F0029-A808-473D-99C1-D3CC9AAE5A7C@rna.nl> <53D05484.3040803@panix.com> <7A5A73AF-CB29-45CC-A070-A83FA3DFE41D@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_C2881341-1BEF-4F3C-9E56-8ED33DB5BA5F" X-Trace: ger.gmane.org 1406203459 4876 80.91.229.3 (24 Jul 2014 12:04:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Jul 2014 12:04:19 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Jul 24 14:04:14 2014 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 1XAHkq-0006RO-Hn for gctc-ntg-context-518@m.gmane.org; Thu, 24 Jul 2014 14:04:12 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id EEB341022B for ; Thu, 24 Jul 2014 14:04:11 +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 ZQtL0b0B0dES for ; Thu, 24 Jul 2014 14:04:11 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 3284010230 for ; Thu, 24 Jul 2014 14:04:03 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 65105101EE for ; Thu, 24 Jul 2014 14:03:59 +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 yI3Tcdr2JUXj for ; Thu, 24 Jul 2014 14:03:54 +0200 (CEST) Original-Received: from filter3-ams.mf.surf.net (filter3-ams.mf.surf.net [192.87.102.71]) by balder.ntg.nl (Postfix) with ESMTP id 3579B101EC for ; Thu, 24 Jul 2014 14:03:53 +0200 (CEST) Original-Received: from mail-wg0-x22a.google.com (mail-wg0-x22a.google.com [IPv6:2a00:1450:400c:c00::22a]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s6OC3qN9030904 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Thu, 24 Jul 2014 14:03:53 +0200 Original-Received: by mail-wg0-f42.google.com with SMTP id l18so2605114wgh.25 for ; Thu, 24 Jul 2014 05:03:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:message-id:mime-version:subject:date:references :to:in-reply-to; bh=LoKQfJCCyL8o8WLaFufKIi8wZ+plleTpaB/vf8wrOB8=; b=o3SbQQrPBF4X9z5VsRPktvoFIapXe2bonjaFDqA+s/F+s9V5oJ1ioPasqS382FK//n RBa89UEzVZCjDEx0Jnz8NAfS9vb/373c0kR4RqhVuOwB4I/FNLr/1SHDGmsOeGRwQQ4T 0c3g7uubfWhFfvCVHjATRW8nDExC1MV4GiII9WrXrvS6YwjlsD5aVWrPVyarsGUJ1fq2 3Hykkw73i/ryqoEfHM/7Uxv+dE1Vy3EmNRoT+wtm4xYuvRmTs6vWadBmkfZOKGEh1q/d X1r4XY3PTaMSvf8gBilGqZSVy9R8p4a2jdVXV4zorOGuDnsujMhehFRDvLPluN+ZrCuk rPqA== X-Received: by 10.195.17.164 with SMTP id gf4mr11401767wjd.45.1406203432495; Thu, 24 Jul 2014 05:03:52 -0700 (PDT) Original-Received: from [192.168.0.101] (lns-bzn-25-82-254-145-65.adsl.proxad.net. [82.254.145.65]) by mx.google.com with ESMTPSA id v14sm15326947wjw.38.2014.07.24.05.03.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Jul 2014 05:03:51 -0700 (PDT) In-Reply-To: <7A5A73AF-CB29-45CC-A070-A83FA3DFE41D@gmail.com> X-Mailer: Apple Mail (2.1878.6) X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2a00:1450:400c:c00::22a; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 03Muc3QDj - 0446ff9ecc43 - 20140724 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 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-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:88200 Archived-At: --Apple-Mail=_C2881341-1BEF-4F3C-9E56-8ED33DB5BA5F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Hi, Thanks for your attention, Wolfgang: indeed removing=20 \analyzecurrentreference from your example allows mkiv to typeset correctly and obtain the = expected result. Regarding Marco Patzer=92s smartref command, I can typest the following = example if I \input directly=20 \input conditionalfloatreferences.mkvi but invoking \usemodule[conditionalfloatreferences] does not work. (By the way I didn=92t check whether the module is = included in the minimals: so I am sending the file with this mail). Best regards: OK %%% begin test-smartref.tex %\usemodule[conditionalfloatreferences] \input conditionalfloatreferences.mkvi \useMPlibrary[dum] \starttext {\bf Test 1:} See \smartref{figure}[fig:alpha] and \smartref{figure}[fig:gamma]. See \smartref{equation}[eq:Fermat]. \page=20 {\bf Test 2:} See \smartref{figure}[fig:alpha] and \smartref{figure}[fig:gamma]. See \smartref{equation}[eq:Fermat]. \startplacefigure [reference=3Dfig:alpha] \externalfigure = \stopplacefigure \startplacefigure [reference=3Dfig:beta] \externalfigure = \stopplacefigure \input knuth.tex \placeformula[eq:Fermat] \startformula a,b,c \in {\Bbb N}^*, \quad n \geq 3, \quad a^n + b^n =3D c^n \imply abc = =3D 0. \stopformula \page=20 {\bf Test 3:} See \smartref{figure}[fig:alpha] and \smartref{figure}[fig:gamma]. See \smartref{equation}[eq:Fermat]. \startplacefigure [reference=3Dfig:gamma] \externalfigure = \stopplacefigure \startplacefigure [reference=3Dfig:delta] \externalfigure = \stopplacefigure \page=20 {\bf Test 4:} See \smartref{figure}[fig:alpha] and \smartref{figure}[fig:gamma]. See \smartref{equation}[eq:Fermat]. \page=20 {\bf Test 5:} See \smartref{figure}[fig:alpha] and \smartref{figure}[fig:gamma]. See \smartref{equation}[eq:Fermat]. \stoptext %%% end test-smartref.tex --Apple-Mail=_C2881341-1BEF-4F3C-9E56-8ED33DB5BA5F Content-Disposition: attachment; filename=conditionalfloatreferences.mkvi Content-Type: application/octet-stream; name="conditionalfloatreferences.mkvi" Content-Transfer-Encoding: quoted-printable \unprotect=0A=0A\unexpanded\def\strc_references_smart=0A=20=20= {\strc_references_start_goto=0A=20=20=20= \let\currentreferencecontent\currentreferencedefault=0A=20=20=20= \strc_references_pickup_smart_goto}=0A=0A= \def\strc_references_pickup_smart_goto=0A=20=20= {\dodoublegroupempty\strc_references_pickup_goto_smart_indeed}=0A=0A= \starttexdefinition=20strc_references_pickup_goto_smart_indeed=20= #left#right#dummy[#label]=0A=20=20\leftreferencetoks=0A=20=20= \iffirstargument=0A=20=20=20=20{#left}=0A=20=20\else=0A=20=20=20=20= \defaultleftreferencetoks=0A=20=20=20=20= \let\leftofreferencecontent\empty=0A=20=20\fi=0A=20=20= \rightreferencetoks=0A=20=20\ifsecondargument=0A=20=20=20=20{#right}=0A=20= =20\else=0A=20=20=20=20\defaultrightreferencetoks=0A=20=20=20=20= \let\rightofreferencecontent\empty=0A=20=20\fi=0A=20=20= \doifreferencefoundelse{#label}=0A=20=20=20=20= {\goto{\referencesequence}[#label]=0A=20=20=20=20=20= \strc_references_check_visibility=0A=20=20=20=20=20= \ifreferenceisvisible\else=0A=20=20=20=20=20=20=20= \space\strc_references_smart_string=0A=20=20=20=20=20\fi}=0A=20=20=20=20=20= {\let\currentreferencecontent\dummyreference=0A=20=20=20=20=20=20= \goto{\referencesequence}[#label]}=0A=20=20\strc_references_stop_goto=0A= \stoptexdefinition=0A=0A\newif\ifreferenceisvisible=20= \referenceisvisiblefalse=0A=0A\starttexdefinition=20= strc_references_check_visibility=0A=20=20= \def\strc_references_smart_string{\labeltext\v!atpage\currentreferencepage= }=0A=20=20\referenceisvisiblefalse=0A=0A=20=20= \ifnum\referencepagestate=3D\plusone=20%%=201=20=3D=20reference=20on=20= current=20page=0A=20=20=20=20\referenceisvisibletrue=0A=20=20\else=0A=20=20= =20=20\ifsinglesided=0A=20=20=20=20=20=20= \strc_references_do_relative_else\plusone=0A=20=20=20=20=20=20=20=20= {\def\strc_references_smart_string{\labeltext\v!nextpage}}=0A=20=20=20=20= =20=20=20=20{\strc_references_do_relative_else\minusone=0A=20=20=20=20=20= =20=20=20=20= {\def\strc_references_smart_string{\labeltext\v!previouspage}}{}}=0A=20=20= =20=20\else=0A=20=20=20=20=20=20\ifodd\realpageno=0A=20=20=20=20=20=20=20= =20\strc_references_do_relative_else\minusone=0A=20=20=20=20=20=20=20=20=20= =20{\def\strc_references_smart_string{\labeltext\v!previouspage}=0A=20=20= =20=20=20=20=20=20=20=20=20\referenceisvisibletrue}=0A=20=20=20=20=20=20=20= =20=20=20{\strc_references_do_relative_else\plusone=0A=20=20=20=20=20=20=20= =20=20=20=20= {\def\strc_references_smart_string{\labeltext\v!nextpage}}{}}=0A=20=20=20= =20=20=20\else=0A=20=20=20=20=20=20=20=20= \strc_references_do_relative_else\minusone=0A=20=20=20=20=20=20=20=20=20=20= {\def\strc_references_smart_string{\labeltext\v!previouspage}}=0A=20=20=20= =20=20=20=20=20=20=20{\strc_references_do_relative_else\plusone=0A=20=20=20= =20=20=20=20=20=20=20=20\referenceisvisibletrue{}}=0A=20=20=20=20=20=20= \fi=0A=20=20=20=20\fi=0A=20=20\fi=0A\stoptexdefinition=0A=0A= \starttexdefinition=20strc_references_do_relative_else=20= #relativepagenumber=0A=20=20= \ifnum\currentreferencerealpage=3D\numexpr\realpageno+#relativepagenumber\= relax=0A=20=20=20=20\expandafter\firstoftwoarguments=0A=20=20\else=0A=20=20= =20=20\expandafter\secondoftwoarguments=0A=20=20\fi=0A\stoptexdefinition=0A= =0A\let\smartref\strc_references_smart=0A=0A\startinterface=20all=0A=20=20= \setinterfacevariable=20{previouspage}=20{previouspage}=0A=20=20= \setinterfacevariable=20{nextpage}=20=20=20=20=20{nextpage}=0A= \stopinterface=0A=0A\setuplabeltext=0A=20=20[\s!en]=0A=20=20= [\v!atpage=3Don=20page\nobreakspace,=20%%=20=E2=80=9Cat=20page=E2=80=9D=20= sounds=20weird=0A=20=20=20\v!previouspage=3Don=20the=20previous=20page,=0A= =20=20=20\v!nextpage=3Don=20the=20next=20page]=0A=0A\protect=20\endinput=0A= =0A\useMPlibrary=20[dum]=0A\setuppagenumbering=20= [alternative=3Ddoublesided]=0A=0A\starttext=0A=0A=20=20=20=20=20=20See=20= \smartref{figure}[fig:alpha]=20and=20\smartref{figure}[fig:gamma].=0A= \page=20See=20\smartref{figure}[fig:alpha]=20and=20= \smartref{figure}[fig:gamma].=0A=0A\startplacefigure=20= [reference=3Dfig:alpha]=20\externalfigure=20\stopplacefigure=0A= \startplacefigure=20[reference=3Dfig:beta]=20=20\externalfigure=20= \stopplacefigure=0A=0A\page=20See=20\smartref{figure}[fig:alpha]=20and=20= \smartref{figure}[fig:gamma].=0A=0A\startplacefigure=20= [reference=3Dfig:gamma]=20\externalfigure=20\stopplacefigure=0A= \startplacefigure=20[reference=3Dfig:delta]=20\externalfigure=20= \stopplacefigure=0A=0A\page=20See=20\smartref{figure}[fig:alpha]=20and=20= \smartref{figure}[fig:gamma].=0A\page=20See=20= \smartref{figure}[fig:alpha]=20and=20\smartref{figure}[fig:gamma].=0A=0A= \stoptext=0A= --Apple-Mail=_C2881341-1BEF-4F3C-9E56-8ED33DB5BA5F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On 24 Jul 2014, at 13:34, Wolfgang Schuster = wrote: >=20 > Am 24.07.2014 um 13:20 schrieb Otared Kavian : >=20 >> Hi Rik, >>=20 >> As a matter of fact the example given by Wolfgang works despite mkiv = complaining about >> \analyzecurrentreference >> being unknown=85 Whent the typesetting stops because of this command, = saying =AB run =BB or rather =AB r =BB continues the typesetting. >=20 > Better remove the \analyzecurrentreference command. >=20 >> I didn=92t send the example module of Marco Patzer since it doesn=92t = seem to work anymore with recent versions of mkiv. >=20 > Do you have a example because I run the example at the end of the = module and had no problems. >=20 > What could be improved in the module is the check for left/right pages = because the current check > can fail when the reference appears at the begin of a page. >=20 > Wolfgang >=20 > = __________________________________________________________________________= _________ > If your question is of interest to others as well, please add an entry = to the Wiki! >=20 > 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 > = __________________________________________________________________________= _________ --Apple-Mail=_C2881341-1BEF-4F3C-9E56-8ED33DB5BA5F Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --Apple-Mail=_C2881341-1BEF-4F3C-9E56-8ED33DB5BA5F--