Re: [NTG-context] Text style in bookmarks

2006-05-22 Thread nico
On Sun, 21 May 2006 19:20:38 +0200, Hans Hagen <[EMAIL PROTECTED]> wrote:

> nico wrote:
>> Hello,
>>
>> Is there a trick so that I can put styles like {\bf ...} or {\tt ...} in
>> the headings without having any weird text in the bookmarks?
>>
> \setupinteraction[state=start]
>
> \appendtoks
>   \let\groupedcommand\thirdofthreearguments
> \to \simplifiedcommands
>
> % no command for monospaced yet
>
> \unprotected \definealternativestyle [\v!mono] [\tt]  []
>
> \placebookmarks
> \starttext
> \chapter{test \mono{test} \bold{test}}
> \stoptext
>
> (i will add the extra definitions to the core)

Thanks!

Regards,
BG
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Text style in bookmarks

2006-05-21 Thread Hans Hagen
Aditya Mahajan wrote:
> On Sun, 21 May 2006, Hans Hagen wrote:
>
>   
>> nico wrote:
>> 
>>> Hello,
>>>
>>> Is there a trick so that I can put styles like {\bf ...} or {\tt ...} in
>>> the headings without having any weird text in the bookmarks?
>>>
>>> Adding \bf or \tt as empty macros to the simplifiedcommands doesn't avoid
>>> the curly braces to appear (which is normal). Do I need to use something
>>> like \def\textbf#1{\def\textbf#1{\bgroup\bf #1\egroup} to have this
>>> working?
>>>
>>>   
>> \setupinteraction[state=start]
>>
>> \appendtoks
>>  \let\groupedcommand\thirdofthreearguments
>> \to \simplifiedcommands
>>
>> % no command for monospaced yet
>>
>> \unprotected \definealternativestyle [\v!mono] [\tt]  []
>> 
>
> Isn't this same as type? In font-ini.tex you have
>
> \definealternativestyle [\v!type]  [\tt]  []
>
>   
thit will not turn into a command since \type is already a defined 
command, but type is recognizes as keyword in 
style=whateverisdefinedasalternativestyle

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
-

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


Re: [NTG-context] Text style in bookmarks

2006-05-21 Thread Aditya Mahajan
On Sun, 21 May 2006, Hans Hagen wrote:

> nico wrote:
>> Hello,
>>
>> Is there a trick so that I can put styles like {\bf ...} or {\tt ...} in
>> the headings without having any weird text in the bookmarks?
>>
>> Adding \bf or \tt as empty macros to the simplifiedcommands doesn't avoid
>> the curly braces to appear (which is normal). Do I need to use something
>> like \def\textbf#1{\def\textbf#1{\bgroup\bf #1\egroup} to have this
>> working?
>>
> \setupinteraction[state=start]
>
> \appendtoks
>  \let\groupedcommand\thirdofthreearguments
> \to \simplifiedcommands
>
> % no command for monospaced yet
>
> \unprotected \definealternativestyle [\v!mono] [\tt]  []

Isn't this same as type? In font-ini.tex you have

\definealternativestyle [\v!type]  [\tt]  []

> (i will add the extra definitions to the core)

Can you also add something for \em.


Aditya

-- 
Aditya Mahajan, EECS Systems, University of Michigan
http://www.eecs.umich.edu/~adityam || Ph: 7342624008
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Text style in bookmarks

2006-05-21 Thread Hans Hagen
nico wrote:
> Hello,
>
> Is there a trick so that I can put styles like {\bf ...} or {\tt ...} in  
> the headings without having any weird text in the bookmarks?
>
> Adding \bf or \tt as empty macros to the simplifiedcommands doesn't avoid  
> the curly braces to appear (which is normal). Do I need to use something  
> like \def\textbf#1{\def\textbf#1{\bgroup\bf #1\egroup} to have this  
> working?
>   
\setupinteraction[state=start]

\appendtoks
  \let\groupedcommand\thirdofthreearguments
\to \simplifiedcommands

% no command for monospaced yet

\unprotected \definealternativestyle [\v!mono] [\tt]  []

\placebookmarks

\starttext

\chapter{test \mono{test} \bold{test}}

\stoptext

(i will add the extra definitions to the core) 


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

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


Re: [NTG-context] Text style in bookmarks

2006-05-21 Thread Hans Hagen
� wrote:
> On Sat, 20 May 2006, nico wrote:
>
>   
>> Is there a trick so that I can put styles like {\bf ...} or {\tt ...} in  
>> the headings without having any weird text in the bookmarks?
>> 
>
> This works well with LaTeX and hyperref. Perhaps the same mechanism could
> be adopted to ConTeXt?
>   
a small test file showing the problem is needed

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


Re: [NTG-context] Text style in bookmarks

2006-05-20 Thread Peter Münster
On Sat, 20 May 2006, nico wrote:

> Is there a trick so that I can put styles like {\bf ...} or {\tt ...} in  
> the headings without having any weird text in the bookmarks?

This works well with LaTeX and hyperref. Perhaps the same mechanism could
be adopted to ConTeXt?
Cheers, Peter

-- 
http://pmrb.free.fr/contact/
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Text style in bookmarks

2006-05-20 Thread nico
On Sat, 20 May 2006 12:17:06 -0700, Johannes Graumann  
<[EMAIL PROTECTED]> wrote:

> nico wrote:
>>
>> Thanks, but it is not a global heading style I look for, but the ability
>> to do things like this:
>>
>> \section{This {\tt file} {\em is} {\bf quite important}}
>>
>> So that it appears "This file is quite important" in the bookmark,  
>> instead
>> of "This {file} {is} {quite important}".
>
> Hehe - may be first time I can help ;0)
>
> Recently I asked for something similar: how to get a short version of a
> figure caption into the List of Figures while maintaining the long  
> version
> in the actual caption. As a solution Hans came up with the 'selector'
> feature below (not sure wheather the last release has it yet). Look in  
> the
> archive ...
>
> If I understand you correctly this may be applicable to your problem.

Well, yes, the selector is something I should try (it's in the  
distribution now). I just wanted to avoid writing two titles, since they  
are generated from a single source. BTW, using \bookmark as alternative  
title in bookmark would also work.

Regards,
BG
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Text style in bookmarks

2006-05-20 Thread Johannes Graumann
nico wrote:

> Hi Willi,
> 
> On Sat, 20 May 2006 20:14:30 +0200, Willi Egger <[EMAIL PROTECTED]> wrote:
> 
>> Provided I understnad you correctly, then you could play with code as:
>>
>> \setuphead
> 
> Thanks, but it is not a global heading style I look for, but the ability
> to do things like this:
> 
> \section{This {\tt file} {\em is} {\bf quite important}}
> 
> So that it appears "This file is quite important" in the bookmark, instead
> of "This {file} {is} {quite important}".

Hehe - may be first time I can help ;0)

Recently I asked for something similar: how to get a short version of a
figure caption into the List of Figures while maintaining the long version
in the actual caption. As a solution Hans came up with the 'selector'
feature below (not sure wheather the last release has it yet). Look in the
archive ...

If I understand you correctly this may be applicable to your problem.

Joh

%
% Float definitions %
%

% Define selectors for short caption versions (Hans Hagen)
%%

\unprotect

% let's reuse this one in selectors (from syst-ext) 

\def\dofilterfromstr#1#2% max n
  {\ifcase#1\or
 \ifcase#2\or
   \strippedcsname\firstofoneargument
 \else
   \strippedcsname\gobbleoneargument
 \fi
   \or
 \ifcase#2\or
   \strippedcsname\firstoftwoarguments
 \or
   \strippedcsname\secondoftwoarguments
 \else
   \strippedcsname\gobbletwoarguments
 \fi
   \or
 \ifcase#2\or
   \strippedcsname\firstofthreearguments
 \or
   \strippedcsname\secondofthreearguments
 \or
   \strippedcsname\thirdofthreearguments
 \else
   \strippedcsname\gobblethreearguments
 \fi
   \or
 \ifcase#2\or
   \strippedcsname\firstoffourarguments
 \or
   \strippedcsname\secondoffourarguments
 \or
   \strippedcsname\thirdoffourarguments
 \or
   \strippedcsname\fourthoffourarguments
 \else
   \strippedcsname\gobblefourarguments
 \fi
   \or
 \ifcase#2\or
   \strippedcsname\firstoffivearguments
 \or
   \strippedcsname\secondoffivearguments
 \or
   \strippedcsname\thirdoffivearguments
 \or
   \strippedcsname\fourthoffivearguments
 \or
   \strippedcsname\fifthoffivearguments
 \else
   \strippedcsname\gobblefivearguments
 \fi
   \fi}

\def\filterfromvalue#1#2#3% value max n
  [EMAIL PROTECTED]@EAEAEA\csname   % we use the fact that an
 [EMAIL PROTECTED]   % undefined cs has become \relax
   \strippedcsname\gobbleoneargument % which we then gobble here
 \else
   \dofilterfromstr{#2}{#3}%
 \fi
 \endcsname\csname#1\endcsname}

\def\filterfromnext#1#2% max n {..}{..}{..}{..}
  {\csname\dofilterfromstr{#1}{#2}\endcsname}

% new, selectors

\definesystemvariable{sx}

\def\defineselector{\dodoubleargument\dodefineselector}
\def\setupselector {\dodoubleargument\dosetupselector}

\def\dodefineselector[#1][#2]{\getparameters[\??sx#1][\c!max=2,\c!n=1,#2]}
\def\dosetupselector [#1][#2]{\getparameters[\??sx#1][#2]}

\unexpanded\def\select#1%
  {\filterfromnext
 {\executeifdefined{\??sx#1\c!max}1}
 {\executeifdefined{\??sx#1\c!n  }1}}

\protect

% Define the caption selector
\defineselector[caption][max=2,n=2]

% Format captions
%

\setupcaptions[style={\switchtobodyfont[small]\setupinterlinespace[line=2.8ex]},width=\textwidth]
\setupcaption[table][location=top]

% Setup List Of Figures
%%%
\defineXMLargument
  [listoffigures]
  {
\start
  \setupselector[caption][n=1]
  \completelistoffigures[criterium=text]
  %\writetolist[chapter]{Figures}{}
\stop
  }

% in the text:
\placefigure
  {\select{caption}{shortcaption}{Longcaption}}


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


Re: [NTG-context] Text style in bookmarks

2006-05-20 Thread nico
Hi Willi,

On Sat, 20 May 2006 20:14:30 +0200, Willi Egger <[EMAIL PROTECTED]> wrote:

> Provided I understnad you correctly, then you could play with code as:
>
> \setuphead

Thanks, but it is not a global heading style I look for, but the ability  
to do things like this:

\section{This {\tt file} {\em is} {\bf quite important}}

So that it appears "This file is quite important" in the bookmark, instead  
of "This {file} {is} {quite important}".

Regards,
BG
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Text style in bookmarks

2006-05-20 Thread Willi Egger
Hi Nico,

Provided I understnad you correctly, then you could play with code as:

\setuphead
[chapter]
[style=\sca,
after={\blank[3*big]},
number=no,
alternative=middle,
textstyle=\sca]

\setuplist
[contents]
[sectionnumber=no,
style=normal,
textstyle=normal,
pagestyle=normal,
numberstyle=bold]


kind regards

Willi

nico wrote:
> Hello,
>
> Is there a trick so that I can put styles like {\bf ...} or {\tt ...} in  
> the headings without having any weird text in the bookmarks?
>
> Adding \bf or \tt as empty macros to the simplifiedcommands doesn't avoid  
> the curly braces to appear (which is normal). Do I need to use something  
> like \def\textbf#1{\def\textbf#1{\bgroup\bf #1\egroup} to have this  
> working?
>
> Thanks for any hint.
>
> Regards,
> BG
> ___
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>   
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Text style in bookmarks

2006-05-20 Thread nico
Hello,

Is there a trick so that I can put styles like {\bf ...} or {\tt ...} in  
the headings without having any weird text in the bookmarks?

Adding \bf or \tt as empty macros to the simplifiedcommands doesn't avoid  
the curly braces to appear (which is normal). Do I need to use something  
like \def\textbf#1{\def\textbf#1{\bgroup\bf #1\egroup} to have this  
working?

Thanks for any hint.

Regards,
BG
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context