Re: [NTG-context] another issue with PDF bookmarks

2014-04-15 Thread Hans Hagen

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
___


Re: [NTG-context] another issue with PDF bookmarks

2014-04-10 Thread Pablo Rodriguez
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
___


Re: [NTG-context] another issue with PDF bookmarks

2014-04-09 Thread Andreas Schneider
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



signature.asc
Description: OpenPGP digital signature
___
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
___

Re: [NTG-context] another issue with PDF bookmarks

2014-04-09 Thread Pablo Rodriguez
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
___


Re: [NTG-context] another issue with PDF bookmarks

2014-04-09 Thread Aditya Mahajan

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___
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
___

Re: [NTG-context] another issue with PDF bookmarks

2014-04-09 Thread Aditya Mahajan

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
___


[NTG-context] another issue with PDF bookmarks

2014-04-08 Thread Pablo Rodriguez
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
___