ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* another issue with PDF bookmarks
@ 2014-04-08 14:20 Pablo Rodriguez
  2014-04-09 18:29 ` Andreas Schneider
  0 siblings, 1 reply; 7+ messages in thread
From: Pablo Rodriguez @ 2014-04-08 14:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear list,

I have a sample that shows an issue with PDF bookmarks:

    \setupinteraction[state=start]
    \placebookmarks[chapter]
    \setupheadertexts[chapter]
    \starttext
    \completecontent

    \chapter{Footnote\footnote{Only in bookmarks}}

    \stoptext

Sorry, but I don’t know why the footnote is removed in the table of
contents and in the header, but it isn‘t in the bookmark.

Am I missing something?

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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] 7+ messages in thread

* Re: another issue with PDF bookmarks
  2014-04-08 14:20 another issue with PDF bookmarks Pablo Rodriguez
@ 2014-04-09 18:29 ` Andreas Schneider
  2014-04-09 18:56   ` Pablo Rodriguez
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Schneider @ 2014-04-09 18:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

On 08.04.2014 16:20, Pablo Rodriguez wrote:
> Dear list,
>
> I have a sample that shows an issue with PDF bookmarks:
>
>     \setupinteraction[state=start]
>     \placebookmarks[chapter]
>     \setupheadertexts[chapter]
>     \starttext
>     \completecontent
>
>     \chapter{Footnote\footnote{Only in bookmarks}}
>
>     \stoptext
>
> Sorry, but I don’t know why the footnote is removed in the table of
> contents and in the header, but it isn‘t in the bookmark.
>
> Am I missing something?
>
> Many thanks for your help,
>
>
> Pablo
That probably has to do with expansion (a detailed explanation may be
given by a (Con)TeX(t) Guru :-)).

I think the best "fix" is to use the MkIV title mechanism (start... stop...)
http://wiki.contextgarden.net/Titles#New_MkIV_Sectioning

That way you can do:
\startchapter[title={Footnote\footnote{Only where appropriate}},
bookmark={No Footnote}]
...
\stopchapter

-- 
Best Regards,
Andreas


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 295 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] 7+ messages in thread

* Re: another issue with PDF bookmarks
  2014-04-09 18:29 ` Andreas Schneider
@ 2014-04-09 18:56   ` Pablo Rodriguez
  2014-04-09 19:17     ` Aditya Mahajan
  0 siblings, 1 reply; 7+ messages in thread
From: Pablo Rodriguez @ 2014-04-09 18:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 04/09/2014 08:29 PM, Andreas Schneider wrote:
> On 08.04.2014 16:20, Pablo Rodriguez wrote:
>> I have a sample that shows an issue with PDF bookmarks:
>> [...]
>> Sorry, but I don’t know why the footnote is removed in the table of
>> contents and in the header, but it isn‘t in the bookmark.
>
> That probably has to do with expansion (a detailed explanation may be
> given by a (Con)TeX(t) Guru :-)).
> 
> I think the best "fix" is to use the MkIV title mechanism (start... stop...)
> http://wiki.contextgarden.net/Titles#New_MkIV_Sectioning
> 
> That way you can do:
> \startchapter[title={Footnote\footnote{Only where appropriate}},
> bookmark={No Footnote}]
> ...
> \stopchapter

Many thanks for your reply, Andreas.

This is a way to avoid the problem.
F
rom the user’s perspective, I cannot see the reason why \footnote isn’t
removed from the PDF bookmark automatically. It makes the same sense as
in headers and ToC.

Sorry, but I’m trying to explain ConTeXt to others. And I have a hard
time when I cannot see the reason for what can be seen as glitches.

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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] 7+ messages in thread

* Re: another issue with PDF bookmarks
  2014-04-09 18:56   ` Pablo Rodriguez
@ 2014-04-09 19:17     ` Aditya Mahajan
  2014-04-09 19:33       ` Aditya Mahajan
  0 siblings, 1 reply; 7+ messages in thread
From: Aditya Mahajan @ 2014-04-09 19:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1226 bytes --]

On Wed, 9 Apr 2014, Pablo Rodriguez wrote:

> On 04/09/2014 08:29 PM, Andreas Schneider wrote:
>> On 08.04.2014 16:20, Pablo Rodriguez wrote:
>>> I have a sample that shows an issue with PDF bookmarks:
>>> [...]
>>> Sorry, but I don’t know why the footnote is removed in the table of
>>> contents and in the header, but it isn‘t in the bookmark.
>>
>> That probably has to do with expansion (a detailed explanation may be
>> given by a (Con)TeX(t) Guru :-)).
>>
>> I think the best "fix" is to use the MkIV title mechanism (start... stop...)
>> http://wiki.contextgarden.net/Titles#New_MkIV_Sectioning
>>
>> That way you can do:
>> \startchapter[title={Footnote\footnote{Only where appropriate}},
>> bookmark={No Footnote}]
>> ...
>> \stopchapter
>
> Many thanks for your reply, Andreas.
>
> This is a way to avoid the problem.
> F
> rom the user’s perspective, I cannot see the reason why \footnote isn’t
> removed from the PDF bookmark automatically. It makes the same sense as
> in headers and ToC.

One possibility is to add:

\appendtoks \let\footnote \gobbleoneargument \to \everysimplifycommands

to your style.

Perhaps this should be added to the definition of definenote.

Aditya

[-- 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] 7+ messages in thread

* Re: another issue with PDF bookmarks
  2014-04-09 19:17     ` Aditya Mahajan
@ 2014-04-09 19:33       ` Aditya Mahajan
  2014-04-10 14:44         ` Pablo Rodriguez
  2014-04-15  7:53         ` Hans Hagen
  0 siblings, 2 replies; 7+ messages in thread
From: Aditya Mahajan @ 2014-04-09 19:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, 9 Apr 2014, Aditya Mahajan wrote:

> One possibility is to add:
>
> \appendtoks \let\footnote \gobbleoneargument \to \everysimplifycommands
>
> to your style.
>
> Perhaps this should be added to the definition of definenote.

Hmm... simplifycommands needs an overhaul:

From typo-del.mkiv:

\appendtoks
     \def\quotation#1{"#1"}%
     \def\quote    #1{'#1'}%
\to \everysimplifycommands

and from buff-ver.mkiv:

\appendtoks
     \def\type#1{\letterbackslash\checkedstrippedcsname#1}% or maybe 
detokenize
     \def\tex #1{\letterbackslash#1}%
\to \everysimplifycommands


The simplification of \type assumes that a user will always use 
\type{\command} and gives the wrong result for \type{text} and fails for 
\type{text\undefined}.

The simplification of \quote and \quotation should not be hardcoded, but 
rather be a part of \definedelimitedtext.

Apart from notes and delimited text, are there other commands that need to 
be simplified for bookmarks, etc?

Aditya

___________________________________________________________________________________
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] 7+ messages in thread

* Re: another issue with PDF bookmarks
  2014-04-09 19:33       ` Aditya Mahajan
@ 2014-04-10 14:44         ` Pablo Rodriguez
  2014-04-15  7:53         ` Hans Hagen
  1 sibling, 0 replies; 7+ messages in thread
From: Pablo Rodriguez @ 2014-04-10 14:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 04/09/2014 09:33 PM, Aditya Mahajan wrote:
> On Wed, 9 Apr 2014, Aditya Mahajan wrote:
> 
>> One possibility is to add:
>>
>> \appendtoks \let\footnote \gobbleoneargument \to \everysimplifycommands
>>
>> to your style.
>>
>> Perhaps this should be added to the definition of definenote.
> 
> Hmm... simplifycommands needs an overhaul:
> 
>>From typo-del.mkiv:
> 
> \appendtoks
>      \def\quotation#1{"#1"}%
>      \def\quote    #1{'#1'}%
> \to \everysimplifycommands
> 
> and from buff-ver.mkiv:
> 
> \appendtoks
>      \def\type#1{\letterbackslash\checkedstrippedcsname#1}% or maybe 
> detokenize
>      \def\tex #1{\letterbackslash#1}%
> \to \everysimplifycommands
> 
> 
> The simplification of \type assumes that a user will always use 
> \type{\command} and gives the wrong result for \type{text} and fails for 
> \type{text\undefined}.
> 
> The simplification of \quote and \quotation should not be hardcoded, but 
> rather be a part of \definedelimitedtext.
> 
> Apart from notes and delimited text, are there other commands that need to 
> be simplified for bookmarks, etc?

Many thanks for your reply, Aditya.

If I don’t get it wrong, I guess all language and style commands should
be ignored. And all braces, when not explicitly invoked (such as in \{).

But this only would affect to PDF bookmarks.

Many thanks again,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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] 7+ messages in thread

* Re: another issue with PDF bookmarks
  2014-04-09 19:33       ` Aditya Mahajan
  2014-04-10 14:44         ` Pablo Rodriguez
@ 2014-04-15  7:53         ` Hans Hagen
  1 sibling, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2014-04-15  7:53 UTC (permalink / raw)
  To: ntg-context

On 4/9/2014 9:33 PM, Aditya Mahajan wrote:
> On Wed, 9 Apr 2014, Aditya Mahajan wrote:
>
>> One possibility is to add:
>>
>> \appendtoks \let\footnote \gobbleoneargument \to \everysimplifycommands
>>
>> to your style.
>>
>> Perhaps this should be added to the definition of definenote.
>
> Hmm... simplifycommands needs an overhaul:
>
>  From typo-del.mkiv:
>
> \appendtoks
>      \def\quotation#1{"#1"}%
>      \def\quote    #1{'#1'}%
> \to \everysimplifycommands
>
> and from buff-ver.mkiv:
>
> \appendtoks
>      \def\type#1{\letterbackslash\checkedstrippedcsname#1}% or maybe
> detokenize
>      \def\tex #1{\letterbackslash#1}%
> \to \everysimplifycommands
>
>
> The simplification of \type assumes that a user will always use
> \type{\command} and gives the wrong result for \type{text} and fails for
> \type{text\undefined}.
>
> The simplification of \quote and \quotation should not be hardcoded, but
> rather be a part of \definedelimitedtext.
>
> Apart from notes and delimited text, are there other commands that need
> to be simplified for bookmarks, etc?

this kind of things are always tricky ... simplify vs ignore and so

there is an experimental option:

\enabledirectives[references.bookmarks.preroll]

which also work to some extend with math:

$\sqrt{123}$

i've made that one also ignore notes (beta coming)

concerning the undefined commands (\command) ... ad \let\command\relax 
to the preamble then ... there is no way we can predict all that and 
we're in a different catcode regime at that point

Hans



-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2014-04-15  7:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-08 14:20 another issue with PDF bookmarks Pablo Rodriguez
2014-04-09 18:29 ` Andreas Schneider
2014-04-09 18:56   ` Pablo Rodriguez
2014-04-09 19:17     ` Aditya Mahajan
2014-04-09 19:33       ` Aditya Mahajan
2014-04-10 14:44         ` Pablo Rodriguez
2014-04-15  7:53         ` 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).