ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* reference containing parentheses causes trouble
@ 2019-07-10  2:15 Sanjoy Mahajan
  2019-07-10 11:04 ` Peter Rolf
  2019-07-10 19:29 ` Wolfgang Schuster
  0 siblings, 2 replies; 10+ messages in thread
From: Sanjoy Mahajan @ 2019-07-10  2:15 UTC (permalink / raw)
  To: ntg-context

Dear List,

Warning: The following may be a bug or feature or just my
misunderstanding!  It seems that parentheses cause trouble in
references. MNWE:

  \starttext
  \section[sec:one(two)]{One}

  As you see in sec.~\in[sec:one(two)],

  \stoptext

The "in sec.~\in[sec:one(two)]" typesets as "in sec. ??" and the log
shows:

  references      > start missing references

  references      >    1  [][sec:one(two)]

  references      > stop missing references

(It all works fine upon deleting "(two)" throughout.)

Is this behavior known and expected?  If it is, I'll add a note to the
"References" page on the wiki.

-Sanjoy
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: reference containing parentheses causes trouble
  2019-07-10  2:15 reference containing parentheses causes trouble Sanjoy Mahajan
@ 2019-07-10 11:04 ` Peter Rolf
  2019-07-10 11:36   ` [DKIM Failure] " Sanjoy Mahajan
  2019-07-10 11:39   ` Hans Hagen
  2019-07-10 19:29 ` Wolfgang Schuster
  1 sibling, 2 replies; 10+ messages in thread
From: Peter Rolf @ 2019-07-10 11:04 UTC (permalink / raw)
  To: ntg-context

Hi Sanjoy,

I think it's just the 'normal' limitations you have when setting a
variable/id name. Special characters, like parenthesis, are not allowed
here.

Even whitespace can be problematic. Yesterday I had a problem with a
reference (data driven) that has a trailing space (obviously a typo).
This space was 'eaten' by TeX, resulting in a broken link. Embracing the
argument helped here, but I haven't tested what happens, if you use
multiple spaces in a row...


Greetings,  Peter


Am 10.07.2019 um 04:15 schrieb Sanjoy Mahajan:
> Dear List,
>
> Warning: The following may be a bug or feature or just my
> misunderstanding!  It seems that parentheses cause trouble in
> references. MNWE:
>
>   \starttext
>   \section[sec:one(two)]{One}
>
>   As you see in sec.~\in[sec:one(two)],
>
>   \stoptext
>
> The "in sec.~\in[sec:one(two)]" typesets as "in sec. ??" and the log
> shows:
>
>   references      > start missing references
>
>   references      >    1  [][sec:one(two)]
>
>   references      > stop missing references
>
> (It all works fine upon deleting "(two)" throughout.)
>
> Is this behavior known and expected?  If it is, I'll add a note to the
> "References" page on the wiki.
>
> -Sanjoy
> ___________________________________________________________________________________
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
>

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [DKIM Failure] Re: reference containing parentheses causes trouble
  2019-07-10 11:04 ` Peter Rolf
@ 2019-07-10 11:36   ` Sanjoy Mahajan
  2019-07-10 12:28     ` Peter Rolf
  2019-07-10 11:39   ` Hans Hagen
  1 sibling, 1 reply; 10+ messages in thread
From: Sanjoy Mahajan @ 2019-07-10 11:36 UTC (permalink / raw)
  To: Peter Rolf, ntg-context

On 2019-07-10 13:04, Peter Rolf <indiego@gmx.net> wrote:

> Hi Sanjoy,
>
> I think it's just the 'normal' limitations you have when setting a
> variable/id name. Special characters, like parenthesis, are not allowed
> here.

Peter,

I think that's right, but there are small differences.  For example,
variables in most languages don't allow hyphens, because they are
interpreted as minus signs.  But ConTeXt references do allow them (and I
use them all the time).  That may be why I expected free reign to use
any characters in the reference (except, as you say, for whitespace!)
and wrote my script accordingly to turn problem titles into references
(by replacing whitespace with a hyphen).

-Sanjoy
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: reference containing parentheses causes trouble
  2019-07-10 11:04 ` Peter Rolf
  2019-07-10 11:36   ` [DKIM Failure] " Sanjoy Mahajan
@ 2019-07-10 11:39   ` Hans Hagen
  1 sibling, 0 replies; 10+ messages in thread
From: Hans Hagen @ 2019-07-10 11:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 7/10/2019 1:04 PM, Peter Rolf wrote:
> Hi Sanjoy,
> 
> I think it's just the 'normal' limitations you have when setting a
> variable/id name. Special characters, like parenthesis, are not allowed
> here.
> 
> Even whitespace can be problematic. Yesterday I had a problem with a
> reference (data driven) that has a trailing space (obviously a typo).
> This space was 'eaten' by TeX, resulting in a broken link. Embracing the
> argument helped here, but I haven't tested what happens, if you use
> multiple spaces in a row...
indeed, references are actually a little language in their own (always 
have been)

\enabletrackers[structures.referencing.analyzing]

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [DKIM Failure] Re: reference containing parentheses causes trouble
  2019-07-10 11:36   ` [DKIM Failure] " Sanjoy Mahajan
@ 2019-07-10 12:28     ` Peter Rolf
  0 siblings, 0 replies; 10+ messages in thread
From: Peter Rolf @ 2019-07-10 12:28 UTC (permalink / raw)
  To: Sanjoy Mahajan, ntg-context

Am 10.07.2019 um 13:36 schrieb Sanjoy Mahajan:
> On 2019-07-10 13:04, Peter Rolf <indiego@gmx.net> wrote:
>
>> Hi Sanjoy,
>>
>> I think it's just the 'normal' limitations you have when setting a
>> variable/id name. Special characters, like parenthesis, are not allowed
>> here.
>
> Peter,
>
> I think that's right, but there are small differences.  For example,
> variables in most languages don't allow hyphens, because they are
> interpreted as minus signs.  But ConTeXt references do allow them (and I
> use them all the time).  That may be why I expected free reign to use
> any characters in the reference (except, as you say, for whitespace!)
> and wrote my script accordingly to turn problem titles into references
> (by replacing whitespace with a hyphen).
>

I agree (I always use the underscore instead of space). In general it's
best to avoid problems if you can.
If you use messy third party data as reference things are totally
different. In my current project I have one dead link out of 1275 (also
caused by parenthesis). Not enough to make me write some extra code to
deal with it.

Peter
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: reference containing parentheses causes trouble
  2019-07-10  2:15 reference containing parentheses causes trouble Sanjoy Mahajan
  2019-07-10 11:04 ` Peter Rolf
@ 2019-07-10 19:29 ` Wolfgang Schuster
  2019-07-11  9:03   ` Peter Rolf
  1 sibling, 1 reply; 10+ messages in thread
From: Wolfgang Schuster @ 2019-07-10 19:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Sanjoy Mahajan

Sanjoy Mahajan schrieb am 10.07.2019 um 04:15:
> Dear List,
>
> Warning: The following may be a bug or feature or just my
> misunderstanding!  It seems that parentheses cause trouble in
> references.
Braces are used for the argument of reference actions.

\setupinteraction[state=start]

\starttext

\goto{Second page}[page(2)]

\page

\goto{ConTeXt garden}[url(http://wiki.contextgarden.net)]

\stoptext

Wolfgang

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: reference containing parentheses causes trouble
  2019-07-10 19:29 ` Wolfgang Schuster
@ 2019-07-11  9:03   ` Peter Rolf
  2019-07-11 12:56     ` Otared Kavian
  0 siblings, 1 reply; 10+ messages in thread
From: Peter Rolf @ 2019-07-11  9:03 UTC (permalink / raw)
  To: ntg-context

Am 10.07.2019 um 21:29 schrieb Wolfgang Schuster:
> Sanjoy Mahajan schrieb am 10.07.2019 um 04:15:
>> Dear List,
>>
>> Warning: The following may be a bug or feature or just my
>> misunderstanding!  It seems that parentheses cause trouble in
>> references.
> Braces are used for the argument of reference actions.
>
> \setupinteraction[state=start]
>
> \starttext
>
> \goto{Second page}[page(2)]
>
> \page
>
> \goto{ConTeXt garden}[url(http://wiki.contextgarden.net)]
>
> \stoptext
>
> Wolfgang
>

I see. Thanks for clearifying.


Peter
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: reference containing parentheses causes trouble
  2019-07-11  9:03   ` Peter Rolf
@ 2019-07-11 12:56     ` Otared Kavian
  2019-07-11 15:27       ` Alan Braslau
  0 siblings, 1 reply; 10+ messages in thread
From: Otared Kavian @ 2019-07-11 12:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1616 bytes --]

Actually in the context of references, not only parentheses as Wolfgang pointed out, but also some words are reserved, such as nextpage and previous page:

\setupinteraction[state=start]

\starttext

\goto{Second page}[page(2)]

\goto{Go to next page}[nextpage]

\page

\goto{ConTeXt garden}[url(http://wiki.contextgarden.net)]

\goto{Go to previous page}[previouspage]

\stoptext

Best regards: OK

> On 11 Jul 2019, at 11:03, Peter Rolf <indiego@gmx.net> wrote:
> 
> Am 10.07.2019 um 21:29 schrieb Wolfgang Schuster:
>> Sanjoy Mahajan schrieb am 10.07.2019 um 04:15:
>>> Dear List,
>>> 
>>> Warning: The following may be a bug or feature or just my
>>> misunderstanding!  It seems that parentheses cause trouble in
>>> references.
>> Braces are used for the argument of reference actions.
>> 
>> \setupinteraction[state=start]
>> 
>> \starttext
>> 
>> \goto{Second page}[page(2)]
>> 
>> \page
>> 
>> \goto{ConTeXt garden}[url(http://wiki.contextgarden.net)]
>> 
>> \stoptext
>> 
>> Wolfgang
>> 
> 
> I see. Thanks for clearifying.
> 
> 
> Peter
> ___________________________________________________________________________________
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________


[-- Attachment #1.2: Type: text/html, Size: 5040 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: reference containing parentheses causes trouble
  2019-07-11 12:56     ` Otared Kavian
@ 2019-07-11 15:27       ` Alan Braslau
  2019-07-12 11:31         ` Hans Hagen
  0 siblings, 1 reply; 10+ messages in thread
From: Alan Braslau @ 2019-07-11 15:27 UTC (permalink / raw)
  To: Otared Kavian; +Cc: mailing list for ConTeXt users

This is why it is always a good idea to preface references with a
(personal) identifier. However, perhaps Hans, Wolfgang, or someone else
can explain the use of colons (:) and double colons (::) in references
and in other tags in general (they have to do with namespaces,
instances, etc.).

Alan


On Thu, 11 Jul 2019 14:56:02 +0200
Otared Kavian <otared@gmail.com> wrote:

> Actually in the context of references, not only parentheses as
> Wolfgang pointed out, but also some words are reserved, such as
> nextpage and previous page:
> 
> \setupinteraction[state=start]
> 
> \starttext
> 
> \goto{Second page}[page(2)]
> 
> \goto{Go to next page}[nextpage]
> 
> \page
> 
> \goto{ConTeXt garden}[url(http://wiki.contextgarden.net)]
> 
> \goto{Go to previous page}[previouspage]
> 
> \stoptext
> 
> Best regards: OK
> 
> > On 11 Jul 2019, at 11:03, Peter Rolf <indiego@gmx.net> wrote:
> > 
> > Am 10.07.2019 um 21:29 schrieb Wolfgang Schuster:  
> >> Sanjoy Mahajan schrieb am 10.07.2019 um 04:15:  
> >>> Dear List,
> >>> 
> >>> Warning: The following may be a bug or feature or just my
> >>> misunderstanding!  It seems that parentheses cause trouble in
> >>> references.  
> >> Braces are used for the argument of reference actions.
> >> 
> >> \setupinteraction[state=start]
> >> 
> >> \starttext
> >> 
> >> \goto{Second page}[page(2)]
> >> 
> >> \page
> >> 
> >> \goto{ConTeXt garden}[url(http://wiki.contextgarden.net)]
> >> 
> >> \stoptext
> >> 
> >> Wolfgang
> >>   
> > 
> > I see. Thanks for clearifying.
> > 
> > 
> > Peter
> > ___________________________________________________________________________________
> > 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://context.aanhet.net archive  :
> > https://bitbucket.org/phg/context-mirror/commits/ wiki     :
> > http://contextgarden.net
> > ___________________________________________________________________________________  
> 

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: reference containing parentheses causes trouble
  2019-07-11 15:27       ` Alan Braslau
@ 2019-07-12 11:31         ` Hans Hagen
  0 siblings, 0 replies; 10+ messages in thread
From: Hans Hagen @ 2019-07-12 11:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Alan Braslau, Otared Kavian

On 7/11/2019 5:27 PM, Alan Braslau wrote:
> This is why it is always a good idea to preface references with a
> (personal) identifier. However, perhaps Hans, Wolfgang, or someone else
> can explain the use of colons (:) and double colons (::) in references
> and in other tags in general (they have to do with namespaces,
> instances, etc.).
grep for :::

mag-1103-mkiv.tex


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-07-12 11:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-10  2:15 reference containing parentheses causes trouble Sanjoy Mahajan
2019-07-10 11:04 ` Peter Rolf
2019-07-10 11:36   ` [DKIM Failure] " Sanjoy Mahajan
2019-07-10 12:28     ` Peter Rolf
2019-07-10 11:39   ` Hans Hagen
2019-07-10 19:29 ` Wolfgang Schuster
2019-07-11  9:03   ` Peter Rolf
2019-07-11 12:56     ` Otared Kavian
2019-07-11 15:27       ` Alan Braslau
2019-07-12 11:31         ` Hans Hagen

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).