From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/92453 Path: news.gmane.org!not-for-mail From: Norbert Melzer Newsgroups: gmane.comp.tex.context Subject: Re: The `\somewhere`-macro Date: Thu, 27 Aug 2015 22:14:17 +0000 Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0089880804==" X-Trace: ger.gmane.org 1440713829 21878 80.91.229.3 (27 Aug 2015 22:17:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 27 Aug 2015 22:17:09 +0000 (UTC) To: "ntg-context@ntg.nl" Original-X-From: ntg-context-bounces@ntg.nl Fri Aug 28 00:16:53 2015 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 1ZV5TW-0006e6-W3 for gctc-ntg-context-518@m.gmane.org; Fri, 28 Aug 2015 00:16:51 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 410B310242 for ; Fri, 28 Aug 2015 00:16:50 +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 0YND2_Q5Wk46 for ; Fri, 28 Aug 2015 00:16:49 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 5CD8310247 for ; Fri, 28 Aug 2015 00:16:16 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E245910211 for ; Fri, 28 Aug 2015 00:16: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 R4SMUJHHmGyv for ; Fri, 28 Aug 2015 00:16:10 +0200 (CEST) Original-Received: from filter4-ams.mf.surf.net (filter4-ams.mf.surf.net [192.87.102.72]) by balder.ntg.nl (Postfix) with ESMTP id 8CB911020A for ; Fri, 28 Aug 2015 00:14:29 +0200 (CEST) Original-Received: from mail-lb0-x230.google.com (mail-lb0-x230.google.com [IPv6:2a00:1450:4010:c04::230]) by filter4-ams.mf.surf.net (8.14.4/8.14.4/Debian-4) with ESMTP id t7RMESjd032018 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 28 Aug 2015 00:14:28 +0200 Original-Received: by lbcbn3 with SMTP id bn3so19958343lbc.2 for ; Thu, 27 Aug 2015 15:14:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-type; bh=+Fqfnbkad/yaFzIL+tf0QSIfrObyxH6vvb3pBh9/wAI=; b=0ALgmmqjvsEFfjQcbSCPrMj1dgBj222lhuoQmhUKUE5GNr6jmzpZG29mvPbIU/JTHF 3EkRMPl1QZnYLztc0aUkkYSjowZf5EkywFrjVNDB7UY7A6qPhliwTYIYEg7x200Mb9sS IAHub8RPdIBTEpA+4xBMKMkZLJHM/MUEm6ryTgHB9ggaAn0WKcgTY9ui5dcXBZLIulGM HUMjqkj0Tc8LOpzCIwKQXQjACF4V8eeEUm8g6afas5fJ5V4eOZb/ap1Omp7Tw5EcY30v PUr7hN52dhTAAqUPi8N8n+jqW8MS22QfzlVQUxcId5b/hVgPnDRg30EP27N0UvFr3bVS /y+w== X-Received: by 10.152.20.196 with SMTP id p4mr3235297lae.121.1440713667807; Thu, 27 Aug 2015 15:14:27 -0700 (PDT) In-Reply-To: X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2a00:1450:4010:c04::230; country=FI; region=South Karelia; city=Lappeenranta; latitude=61.0667; longitude=28.1833; http://maps.google.com/maps?q=61.0667,28.1833&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 01P9WesMQ - d63d633339c6 - 20150828 (trained as not-spam) Received-SPF: pass (filter4-ams.mf.surf.net: domain of timmelzer@gmail.com designates 2a00:1450:4010:c04::230 as permitted sender) receiver=filter4-ams.mf.surf.net; client-ip=2a00:1450:4010:c04::230; envelope-from=; helo=mail-lb0-x230.google.com; identity=mailfrom X-Scanned-By: CanIt (www . roaringpenguin . com) 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:92453 Archived-At: --===============0089880804== Content-Type: multipart/alternative; boundary=089e013d203c648faa051e524ae7 --089e013d203c648faa051e524ae7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Repost... Norbert Melzer schrieb am Sa., 08.08.2015, 18:06: > The wiki states on page > http://wiki.contextgarden.net/Latex_Packages#varioref that the macro > `\somewhere` can be used to get same behaviour as varioref gives in LaTeX= : > > > varioref > > Context provides similar functionality using \somewhere > > Some more searching around made me find > http://wiki.contextgarden.net/Command/somewhere > > There I can see, that I have to provide 2 text-arguments in curly braces > and the references name in squarebrackets. > > So I did exactly that in an experiment. > > \somewhere{Foo}{Bar}[foo:bar] > > This does create a clickable =E2=80=9CFoo=E2=80=9D when the reference exi= sts somewhere in > the document, independent off the fact that this reference is on the same > page or anywhere else. > > When the reference does not exists, =E2=80=9Cfoo:bar=E2=80=9D is typeset. > > I am using: > > ```plain > $ context --version > > mtx-context | ConTeXt Process Management 0.61 > mtx-context | > mtx-context | main context file: > /usr/local/texlive/2015/texmf-dist/tex/context/base/context.mkiv > mtx-context | current version: 2015.05.18 12:26 > ``` > > Example: > > ```tex > \setupinteraction[state=3Dstart] > > \starttext > \startsection[title=3D{Foo-Bar},reference=3D{foo:bar}] > Blubberblubb, \somewhere{Foo}{Bar}[foo:bar]. > > \input knuth > > \input knuth > > \input knuth > > \input knuth > > \input knuth > > \input knuth > > \input knuth > > \input knuth > > \input knuth > > \input knuth > > \input knuth > > \somewhere{Foo}{Bar}[foo:bar]. > \stopsection > > \startsection[title=3D{Bar},reference=3D{bar:foo}] > \somewhere{Foo}{Bar}[foo:bar]. > \stopsection > \stoptext > ``` > > --089e013d203c648faa051e524ae7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Repost...


Norbert Melzer <timmelzer@gmail.com> schrieb am Sa.,= 08.08.2015, 18:06:
The wiki states on page http://wiki.contextgarden.net/Latex_Pack= ages#varioref that the macro `\somewhere` can be used to get same behav= iour as varioref gives in LaTeX:

> varioref
> Context provi= des similar functionality using \somewhere

Some more searching aroun= d made me find=C2=A0http://wiki.contextgarden.net/Command/somewhere<= div>
There I can see, that I have to provide 2 text-arguments= in curly braces and the references name in squarebrackets.

<= /div>
So I did exactly that in an experiment.

= \somewhere{Foo}{Bar}[foo:bar]

This does create a c= lickable =E2=80=9CFoo=E2=80=9D when the reference exists somewhere in the d= ocument, independent off the fact that this reference is on the same page o= r anywhere else.

When the reference does not exist= s, =E2=80=9Cfoo:bar=E2=80=9D is typeset.

I am usin= g:

```plain
$ context --version

mtx-context =C2=A0 =C2=A0 | ConTeXt Process Managemen= t 0.61
mtx-context =C2=A0 =C2=A0 |
mtx-context =C2=A0 = =C2=A0 | main context file: /usr/local/texlive/2015/texmf-dist/tex/context/= base/context.mkiv
mtx-context =C2=A0 =C2=A0 | current version: 20= 15.05.18 12:26
```

Example:
```tex
\setupinteraction[state=3Dstart]

\starttext
\startsection[title=3D{Foo-Bar},refe= rence=3D{foo:bar}]
=C2=A0 Blubberblubb, \somewhere{Foo}{Bar}[foo:= bar].

=C2=A0 \input knuth

=C2=A0 \input knuth

=C2=A0 \input knuth

=C2=A0 \input knuth

=C2=A0 \input = knuth

=C2=A0 \input knuth

=C2=A0 \input knuth

=C2=A0 \input knuth

=C2=A0 \input knuth

=C2=A0 \input = knuth

=C2=A0 \input knuth

=C2=A0 \somewhere{Foo}{Bar}[foo:bar].
\stopsection
\startsection[title=3D{Bar},reference=3D{bar:foo}]
= =C2=A0 \somewhere{Foo}{Bar}[foo:bar].
\stopsection
\sto= ptext
```

--089e013d203c648faa051e524ae7-- --===============0089880804== 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= --===============0089880804==--