ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* literal escape strings in bookmarks
@ 2005-07-06 23:05 Stuart Jansen
  2005-07-07  7:17 ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Stuart Jansen @ 2005-07-06 23:05 UTC (permalink / raw)



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

Below is a simple example of chapter/section titles containing
characters that need to be escaped. Although the page content turns out
correctly, the PDF bookmarks contain the literal escape string instead
or the desired character. Any ideas how avoid this? I guess this is a
bug report.

======

\setupinteraction[state=start]
\placebookmarks[chapter,section]
\starttext
\chapter{test{\char`_}chapter}
The underscore character needs to be escaped in certain situations.
\chapter{start{\char124}stop}
So does the pipe symbol.
\chapter{foo}
\section{bar}
How can I avoid literals escape strings in bookmarks?
\stoptext

======

-- 
Stuart Jansen <sjansen@gurulabs.com>
Guru Labs, L.C.

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: literal escape strings in bookmarks
  2005-07-06 23:05 literal escape strings in bookmarks Stuart Jansen
@ 2005-07-07  7:17 ` Hans Hagen
  2005-07-07 16:29   ` Stuart Jansen
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2005-07-07  7:17 UTC (permalink / raw)


Stuart Jansen wrote:
> Below is a simple example of chapter/section titles containing
> characters that need to be escaped. Although the page content turns out
> correctly, the PDF bookmarks contain the literal escape string instead
> or the desired character. Any ideas how avoid this? I guess this is a
> bug report.
> 
> ======
> 
> \setupinteraction[state=start]
> \placebookmarks[chapter,section]
> \starttext
> \chapter{test{\char`_}chapter}
> The underscore character needs to be escaped in certain situations.
> \chapter{start{\char124}stop}
> So does the pipe symbol.
> \chapter{foo}
> \section{bar}
> How can I avoid literals escape strings in bookmarks?
> \stoptext

there some sanitizing mechanism, but i'm not sure if you wan that here; Why do 
you use the hard coded \char's? If you use the named access mechanisms they are 
normally handled ok in bookmarks

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------

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

* Re: literal escape strings in bookmarks
  2005-07-07  7:17 ` Hans Hagen
@ 2005-07-07 16:29   ` Stuart Jansen
  2005-07-07 21:00     ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Stuart Jansen @ 2005-07-07 16:29 UTC (permalink / raw)



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

On Thu, 2005-07-07 at 09:17 +0200, Hans Hagen wrote:
> there some sanitizing mechanism, but i'm not sure if you wan that here; Why do 
> you use the hard coded \char's? If you use the named access mechanisms they are 
> normally handled ok in bookmarks

Mostly because I wasn't aware they existed. Your suggestion mostly
works. Unfortunately, I still have a problem with the braces. I'm doing
automated document generation, and I've had problems with stray spaces
finding their way into the document, so I've taken to always using
{\letterbar} or \letterunderscore{}. I suppose I might be able to solve
the problem instead with some creative post-processing, but it'd be
kinda tricky. Any simple solutions?

=====
\setupinteraction[state=start]
\starttext
\placebookmarks[chapter,section]
\chapter{test{\letterunderscore}chapter}
The underscore character needs to be escaped in certain situations.
\chapter{start\letterbar{}stop}
So does the pipe symbol.
\chapter{foo}
\section{bar}
How can I avoid literals escape strings in bookmarks?
\stoptext
=====


-- 
Stuart Jansen <sjansen@gurulabs.com>
Guru Labs, L.C.

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: literal escape strings in bookmarks
  2005-07-07 16:29   ` Stuart Jansen
@ 2005-07-07 21:00     ` Hans Hagen
  2005-07-07 22:07       ` Stuart Jansen
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2005-07-07 21:00 UTC (permalink / raw)


Stuart Jansen wrote:
> On Thu, 2005-07-07 at 09:17 +0200, Hans Hagen wrote:
> 
>>there some sanitizing mechanism, but i'm not sure if you wan that here; Why do 
>>you use the hard coded \char's? If you use the named access mechanisms they are 
>>normally handled ok in bookmarks
> 
> 
> Mostly because I wasn't aware they existed. Your suggestion mostly
> works. Unfortunately, I still have a problem with the braces. I'm doing
> automated document generation, and I've had problems with stray spaces
> finding their way into the document, so I've taken to always using
> {\letterbar} or \letterunderscore{}. I suppose I might be able to solve
> the problem instead with some creative post-processing, but it'd be
> kinda tricky. Any simple solutions?
> 
> =====
> \setupinteraction[state=start]
> \starttext
> \placebookmarks[chapter,section]
> \chapter{test{\letterunderscore}chapter}
> The underscore character needs to be escaped in certain situations.
> \chapter{start\letterbar{}stop}
> So does the pipe symbol.
> \chapter{foo}
> \section{bar}
> How can I avoid literals escape strings in bookmarks?
> \stoptext
> =====


\setupinteraction[state=start]

\placebookmarks[chapter,section]

\starttext

\chapter{test\getvalue{letterunderscore}chapter}

The underscore character needs to be escaped in certain situations.

\chapter{start\getvalue{letterbar}stop}

So does the pipe symbol.

\chapter{foo}
\section{bar}

\stoptext


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------

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

* Re: literal escape strings in bookmarks
  2005-07-07 21:00     ` Hans Hagen
@ 2005-07-07 22:07       ` Stuart Jansen
  0 siblings, 0 replies; 5+ messages in thread
From: Stuart Jansen @ 2005-07-07 22:07 UTC (permalink / raw)



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

On Thu, 2005-07-07 at 23:00 +0200, Hans Hagen wrote:
> \getvalue{letterunderscore}

Very nice. Thank you.

-- 
Stuart Jansen <sjansen@gurulabs.com>
Guru Labs, L.C.

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

end of thread, other threads:[~2005-07-07 22:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-06 23:05 literal escape strings in bookmarks Stuart Jansen
2005-07-07  7:17 ` Hans Hagen
2005-07-07 16:29   ` Stuart Jansen
2005-07-07 21:00     ` Hans Hagen
2005-07-07 22:07       ` Stuart Jansen

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