From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/84415 Path: news.gmane.org!not-for-mail From: Otared Kavian Newsgroups: gmane.comp.tex.context Subject: Re: Conditional float references Date: Wed, 25 Sep 2013 16:40:25 +0200 Message-ID: <61307ACC-A811-42A4-B5E9-0754DB95AB6D@gmail.com> References: <20130922210228.GJ17308@homerow> <48A5B149-E292-4F8B-B6E3-5181045A3EDC@gmail.com> <20130925072906.GW17308@homerow> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1380120038 32033 80.91.229.3 (25 Sep 2013 14:40:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Sep 2013 14:40:38 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Sep 25 16:40:43 2013 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 1VOqGe-0008WP-AK for gctc-ntg-context-518@m.gmane.org; Wed, 25 Sep 2013 16:40:40 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 5CC81101F0; Wed, 25 Sep 2013 16:38:31 +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 9CPU-pkvYAXS; Wed, 25 Sep 2013 16:38:24 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 7A5E8101E5; Wed, 25 Sep 2013 16:38:24 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E7AB9101E5 for ; Wed, 25 Sep 2013 16:38:22 +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 jindXAWCgVMY for ; Wed, 25 Sep 2013 16:38:20 +0200 (CEST) Original-Received: from filter5-til.mf.surf.net (filter5-til.mf.surf.net [194.171.167.221]) by balder.ntg.nl (Postfix) with ESMTP id 83EAB101DE for ; Wed, 25 Sep 2013 16:38:20 +0200 (CEST) Original-Received: from mail-we0-x235.google.com (mail-we0-x235.google.com [IPv6:2a00:1450:400c:c03::235]) by filter5-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r8PEeQ2W030321 for ; Wed, 25 Sep 2013 16:40:27 +0200 Original-Received: by mail-we0-f181.google.com with SMTP id p61so5942715wes.26 for ; Wed, 25 Sep 2013 07:40:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=8htRJnWBUWIVOvbVrLJgs70bCgy9/4LNukfOO7NXggk=; b=wNnLrPvPhtQzoNf1nH3azEAEWIMwt9w8XYhLMY45tzyg69Iga1iBEER2tlbN/Np95R XChJK6VQJR14ItWpaDZe/H+Y723ocRQGxtPX/V35cwAV4kddDhN17Z/+H0pJBfS5X1vj A/WtwX28tTleTawshY4N135R0316Hm/8yTbC9fc1wu8++VHeqi8MteRtY25cJXXp+ImV AYqT4o48y1Awm1OI6Es8osgpUTAEnuapn0Vcc1iZzGXTKsYdc+WjMSc75z71drxqP3sc 9Vaa+8XD5BKAzBowgl59CYtG0Wd2CEBb+a32o4gRmlrqCYGbAAuIuWftumP68O+vIDXb p9hg== X-Received: by 10.194.158.67 with SMTP id ws3mr27512519wjb.5.1380120026551; Wed, 25 Sep 2013 07:40:26 -0700 (PDT) Original-Received: from [192.168.0.20] (seg75-6-82-236-32-4.fbx.proxad.net. [82.236.32.4]) by mx.google.com with ESMTPSA id mw9sm16382170wib.0.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 25 Sep 2013 07:40:25 -0700 (PDT) In-Reply-To: <20130925072906.GW17308@homerow> X-Mailer: Apple Mail (2.1510) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=2a00:1450:400c:c03::235; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0WKtqEqsM - 53895feeda78 - 20130925 (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:84415 Archived-At: Hi Marco, Thanks for your answer: indeed I was wrong about the issue I reported about= doublesided page numbering. The reason is that I use TeXShop (on a Mac) an= d the PDF produced is shown in a single page layout (it is however possible= to have doublesided layout as well: that's what I tested after your answer. Also after applying your patch everything works as expected. I tested your = file with some maths formulas and changed even the language to French with: \unprotect \setuplabeltext [\s!fr] [\v!atpage=3Dpage\nobreakspace, %% =93at page=94 sounds weird \v!previouspage=3D=E0 la page pr=E9c=E9dente, \v!nextpage=3D=E0 la page suivante] \protect \mainlanguage[fr] without any problem. So your macro is just wonderful! However maybe it would be better to have some setup options like: \setuplabeltext[smartref][atpage=3D{page}, previouspage=3D{=E0 la page pr=E9c=E9dente}, %or {page pr=E9c=E9dente} nextpage=3D{=E0 la page suivante}] %or {page suivante} In case Hans is willing to add such capabilities to the cross referencing, = it would be great if one could setup the cross references in the same way b= y saying for instance \setupreferencing[alternative=3Dsmartref] and then have \smartref be defined automatically. A final remark concerns the possibility to visualize the reference points w= hen one is in the process of proof reading: at least in maths, it is usual = to have dozens of reference points to formulas, lemmas, theorems, etc, and = it is quite useful to be able to visualize such things. For instance I use = a quick and dirty macro to print in the margin =AB eq:Fermat =BB to the rig= ht of the following formula \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 when I am preparing a paper. I do the same with references to lemmas and th= eorems, but I print them in the margin to the left of the reference point. = For now, mkiv does not support such things and it's a pity. Best regards: OK On 25 sept. 2013, at 09:29, Marco Patzer wrote: > On 2013=9609=9625 Otared Kavian wrote: > = >> I have not yet tried it with references to maths formulas, >> theorems, lemmas and such, > = > Me neither. > = > \ifsinglesided > \strc_references_do_relative_else\plusone > {\def\strc_references_smart_string{\labeltext\v!nextpage}} > {\strc_references_do_relative_else\minusone > = >> The issues I noticed are the following: >> 1. Typesetting the file gives an error message when there is no = >> \setuppagenumbering[alternative=3Ddoublesided] > = > A typo: > = > \ifsinglesided > \strc_references_do_relative_else\plusone > {\def\strc_references_smart_string{\labeltext\v!nextpage}} > - {\strc_references_do_relative\minusone > + {\strc_references_do_relative_else\minusone > = > = >> 2. In the above minimal example, when stating = >> \setuppagenumbering[alternative=3Ddoublesided] >> then Test 2 and Test 3 do not result in the smart references >> expected (they both result in =AB See figure 1 and figure 3. =BB while >> Test 2 should give =AB See figure 1 and figure 3 on next page. =BB, >> and Test 3 should result in =AB See figure 1 on previous page and >> figure 3. =BB). > = > That's on purpose. If the graphic appears on the same double page, > it is visible and no further reference is printed. In traditional > typesetting a single page is rather insignificant. The reader is > always faced with double pages, never single pages. > = >> Thanks again for sharing your module. > = > Well, it wasn't meant to be a module. I rather intended to start a > discussion and threw some code in to start with. If there's interest > I can make it a module. > = > Thanks for the feedback. > = > Marco > _________________________________________________________________________= __________ > 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-co= ntext > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > _________________________________________________________________________= __________ ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________