* Re: Automatic reference prefixing in heads with prefix=+ broken?
@ 2014-10-12 16:18 Christoph Reller
0 siblings, 0 replies; only message in thread
From: Christoph Reller @ 2014-10-12 16:18 UTC (permalink / raw)
To: ntg-context
[-- Attachment #1.1: Type: text/plain, Size: 3611 bytes --]
On Tue, Sep 30, 2014 at 8:08 AM, Christoph Reller <
christoph.reller@gmail.com> wrote:
> On Sat, Sep 27, 2014 at 12:00 PM, Christoph Reller <
> christoph.reller@gmail.com> wrote:
>
>> Hi,
>>
>> Various documents mention a namespace feature for references by setting
>> prefix=+. This is a really cool feature but I cannot get it to work. Why
>> does the following example not work:
>>
>> \setupinteraction[state=start]
>> \setuphead[chapter][prefix=+]
>>
>> \starttext
>>
>> \startchapter[reference=chap1,title={First Chapter}]
>> \startsection[reference=sec1,title={First Section in First Chapter}]
>> Reference \type{sec1} is \about[sec1].\par
>> Reference \type{chap2:sec1} is \about[chap2:sec1].\par
>> \stopsection
>> \stopchapter
>>
>> \startchapter[reference=chap2,title={Second Chapter}]
>> \startsection[reference=sec1,title={First Section in Second Chapter}]
>> Reference \type{sec1} is \about[sec1].\par
>> Reference \type{chap1:sec1} is \about[chap1:sec1].\par
>> \stopsection
>> \stopchapter
>>
>> \stoptext
>>
>> Any help is appreciated.
>>
>> Christoph Reller
>>
>
> Does anybody have a minimal working example on this topic? Because of the
> concise syntax "prefix=+" it is difficult to google for an example.
>
> This feature is mentioned in two places:
> 1. contextref.pdf in section "12.5 Cross references" explains the main
> mechanism but seems a little outdated.
> 2. Hans Hagen, "This Way - Cross document referencing", September 2011.
> This is more up to date, but mentions the feature only briefly. The
> mentioned key there is not "prefix" but "referenceprefix", which doesn't
> seem to work either.
>
> Regards,
> Christoph Reller
>
Hi everybody
Is automatic prefixing of references partially broken?
I have found the following example for mkiv in the unofficial test suite (
https://github.com/melmothx/context-unofficial-test-suite):
\setuphead[chapter][referenceprefix=+]
\starttext
\chapter[one]{Chapter One}
\section[bla]{Blablabla}
\chapter[two]{Chapter Two}
See \in{Section}[one:bla]
\stoptext
The test suite also contains the output pdf with the correct reference. So
there must have been a time when mkiv did resolve the reference in the
above example correctly. On my ConTeXt standalone dating 2014.08.19 11:57,
the above example does, however, not work.
The example does only a test of "non-local" references (from within the
namespace "two" to the different namespace "one"). Local references do,
however, work even with my version of ConTeXt. Here is an example:
\setuphead[chapter][referenceprefix=+]
\starttext
\startchapter[reference=chap1,title=First Chapter]
\startsection[reference=sec1,title=First Section in First Chapter]
Reference \type{sec1} is \about[sec1].
\stopsection
\stopchapter
\startchapter[reference=chap2,title=Second Chapter]
\startsection[reference=sec1,title=First Section in Second Chapter]
Reference \type{sec1} is \about[sec1].
\stopsection
\stopchapter
\stoptext
But how can I now reference chap1:sec1 from withing chap2? I tried
\about[chap1:sec1], but in vain.
Referencing the global namespace with "-:" does, surprisingly, work. Here
is an example:
\setuphead[chapter][referenceprefix=+]
\starttext
\startsection[reference=sec1,title=Freefloating Section]
\about[sec1]
\stopsection
\startchapter[reference=chap1,title=First Chapter]
\startsection[reference=sec1,title=First Section in First Chapter]
Reference \type{sec1} is \about[sec1].\par
Reference \type{-:sec1} is \about[-:sec1]
\stopsection
\stopchapter
\stoptext
Any help is appreciated.
Regards,
Christoph Reller
[-- Attachment #1.2: Type: text/html, Size: 5960 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-10-12 16:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-12 16:18 Automatic reference prefixing in heads with prefix=+ broken? Christoph Reller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).