From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/84669 Path: news.gmane.org!not-for-mail From: Marco Patzer Newsgroups: gmane.comp.tex.context Subject: Re: Conditional float references Date: Tue, 8 Oct 2013 23:23:30 +0200 Message-ID: <20131008212330.GR18324@homerow> References: <20130922210228.GJ17308@homerow> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1984764714==" X-Trace: ger.gmane.org 1381267417 1160 80.91.229.3 (8 Oct 2013 21:23:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Oct 2013 21:23:37 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Tue Oct 08 23:23:42 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 1VTekn-00056X-N1 for gctc-ntg-context-518@m.gmane.org; Tue, 08 Oct 2013 23:23:41 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 2D465101F5; Tue, 8 Oct 2013 23:21:10 +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 KCjnXSiImUS1; Tue, 8 Oct 2013 23:21:07 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 8F516101E6; Tue, 8 Oct 2013 23:21:07 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id BABFD101E6 for ; Tue, 8 Oct 2013 23:21:05 +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 2wcD8+YXT2g0 for ; Tue, 8 Oct 2013 23:21:04 +0200 (CEST) Original-Received: from filter1-utr.mf.surf.net (filter1-utr.mf.surf.net [195.169.124.152]) by balder.ntg.nl (Postfix) with ESMTP id DD1E610193 for ; Tue, 8 Oct 2013 23:21:03 +0200 (CEST) Original-Received: from forward5h.mail.yandex.net (forward5h.mail.yandex.net [IPv6:2a02:6b8:0:f05::5]) by filter1-utr.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r98LNXVn030620 for ; Tue, 8 Oct 2013 23:23:33 +0200 Original-Received: from smtp4h.mail.yandex.net (smtp4h.mail.yandex.net [84.201.186.21]) by forward5h.mail.yandex.net (Yandex) with ESMTP id DA85CD010DF for ; Wed, 9 Oct 2013 01:23:32 +0400 (MSK) Original-Received: from smtp4h.mail.yandex.net (localhost [127.0.0.1]) by smtp4h.mail.yandex.net (Yandex) with ESMTP id A96462C0D7F for ; Wed, 9 Oct 2013 01:23:32 +0400 (MSK) Original-Received: from unknown (unknown [83.68.239.193]) by smtp4h.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Ev4txamB9K-NVuSHnSZ; Wed, 9 Oct 2013 01:23:31 +0400 Mail-Followup-To: ntg-context@ntg.nl In-Reply-To: <20130922210228.GJ17308@homerow> X-PGP-Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xB8CFCB65D4F08C27 User-Agent: Mutt/1.5.21 (2010-09-15) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=2a02:6b8:0:f05::5; country=RU X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 07KyJnxqH - c83511e585ca - 20131008 (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:84669 Archived-At: --===============1984764714== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Bi+HF1AHjw0mn3zx" Content-Disposition: inline --Bi+HF1AHjw0mn3zx Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2013=E2=80=9309=E2=80=9322 Marco Patzer wrote: > a couple of times the question came up=C2=B9=C2=B2=C2=B3 how to create mo= re > intelligent referencing. There are already mechanisms in the core, > namely \somewhere and \atpage but they both have drawbacks. > \somewhere happily prints its text if the figure is placed on the > same double page. In fact, no text at all should be printed if the > figure is visible. Furthermore it's a little verbose to use unless > hidden in a custom macro. \atpage on the other hand doesn't hesitate > to print =E2=80=9Csee figure 1.2 at page 42=E2=80=9D while you're on page= 42. >=20 > I'm aware that automatic generation of reference text is problematic > since the text depends on the placement of floats which in turn > depends on the text which might result in oscillation. I'm not sure > how likely this is to occur in practice. >=20 > I don't know if there's interest in integrating such functionality > into the core. I attached some code, a new macro \smartref, which > takes the same arguments as \in. >=20 > \smartref{figure}[fig:somefigure] >=20 > - it prints the reference if it is on the same page > (e.g. Figure 1.2) >=20 > - it prints the reference and a customizable text if the reference > is on the next/previous page (e.g. Figure 1.2 on the previous page) >=20 > - it prints the reference and the page if the reference is further > away than one page (e.g. Figure 1.2 on page 42) >=20 > - it adapts to single-sided and double-sided layouts I now merged the functionality of \about. The \smartref command automatically refers to the section by number if it is available. If the user turns off numbering, the sections are referred to by title. I don't yet know if I do like it and how practical it is. It's an experiment. For those interested, the code is on Github=C2=B9. Marco =C2=B9 https://github.com/mpfusion/context-smartref --Bi+HF1AHjw0mn3zx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) iQEcBAEBAgAGBQJSVHfRAAoJEPGqVaNSn0iK5gYH/1ClajOnroXwaM6ZC1w7WaAK JVDewI1cOfIKWB9HolNvHxaL8TEc4RF1Op/hqVjNZz8/jMM52GZGnqo9LZFuyoeZ HPzYBwYq5u3IbY1oOv5PO2bphvLwXuNcpz13kQt0/KmyNP8P6Bgls8eujntkafHi U0daM0kJJTPnGKE38MyQzGuhheLMMKoEqFUr6Y3eIZdkAcVbXeSEvpb/V4q+glt9 ZWavC+lcnlrQ/7t8qhnKZaM85SHg0AALjxSJs/B+uGqXni4zYby7d8+KQeSvg9hJ caNTZVnmG1idTKG1bl2P4m8O+FZHKWnapgUbTKcWIqR2VhR2bYg8eGmY7ycEYs8= =egL3 -----END PGP SIGNATURE----- --Bi+HF1AHjw0mn3zx-- --===============1984764714== 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 ___________________________________________________________________________________ --===============1984764714==--