reference containing parentheses causes trouble
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
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 ___________________________________________________________________________________
On 2019-07-10 13:04, Peter Rolf
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
Am 10.07.2019 um 13:36 schrieb Sanjoy Mahajan:
On 2019-07-10 13:04, 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.
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
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 -----------------------------------------------------------------
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
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
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
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 ___________________________________________________________________________________
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
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
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 ___________________________________________________________________________________
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 -----------------------------------------------------------------
participants (6)
-
Alan Braslau
-
Hans Hagen
-
Otared Kavian
-
Peter Rolf
-
Sanjoy Mahajan
-
Wolfgang Schuster