ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Text style in bookmarks
@ 2006-05-20 17:49 nico
  2006-05-20 18:14 ` Willi Egger
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: nico @ 2006-05-20 17:49 UTC (permalink / raw)


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

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

* Re: Text style in bookmarks
  2006-05-20 17:49 Text style in bookmarks nico
@ 2006-05-20 18:14 ` Willi Egger
  2006-05-20 18:38   ` nico
  2006-05-21  6:38 ` Peter Münster
  2006-05-21 17:20 ` Hans Hagen
  2 siblings, 1 reply; 11+ messages in thread
From: Willi Egger @ 2006-05-20 18:14 UTC (permalink / raw)


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
>   

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

* Re: Text style in bookmarks
  2006-05-20 18:14 ` Willi Egger
@ 2006-05-20 18:38   ` nico
  2006-05-20 19:17     ` Johannes Graumann
  0 siblings, 1 reply; 11+ messages in thread
From: nico @ 2006-05-20 18:38 UTC (permalink / raw)


Hi Willi,

On Sat, 20 May 2006 20:14:30 +0200, Willi Egger <w.egger@boede.nl> 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

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

* Re: Text style in bookmarks
  2006-05-20 18:38   ` nico
@ 2006-05-20 19:17     ` Johannes Graumann
  2006-05-20 20:44       ` nico
  0 siblings, 1 reply; 11+ messages in thread
From: Johannes Graumann @ 2006-05-20 19:17 UTC (permalink / raw)


nico wrote:

> Hi Willi,
> 
> On Sat, 20 May 2006 20:14:30 +0200, Willi Egger <w.egger@boede.nl> 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
  {\@EA\@EAEAEA\csname                   % we use the fact that an
     \@EA\ifx\csname#1\endcsname\relax   % 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}}

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

* Re: Text style in bookmarks
  2006-05-20 19:17     ` Johannes Graumann
@ 2006-05-20 20:44       ` nico
  0 siblings, 0 replies; 11+ messages in thread
From: nico @ 2006-05-20 20:44 UTC (permalink / raw)


On Sat, 20 May 2006 12:17:06 -0700, Johannes Graumann  
<johannes_graumann@web.de> 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

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

* Re: Text style in bookmarks
  2006-05-20 17:49 Text style in bookmarks nico
  2006-05-20 18:14 ` Willi Egger
@ 2006-05-21  6:38 ` Peter Münster
  2006-05-21 16:42   ` Hans Hagen
  2006-05-21 17:20 ` Hans Hagen
  2 siblings, 1 reply; 11+ messages in thread
From: Peter Münster @ 2006-05-21  6:38 UTC (permalink / raw)


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/

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

* Re: Text style in bookmarks
  2006-05-21  6:38 ` Peter Münster
@ 2006-05-21 16:42   ` Hans Hagen
  0 siblings, 0 replies; 11+ messages in thread
From: Hans Hagen @ 2006-05-21 16:42 UTC (permalink / raw)


� 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

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

* Re: Text style in bookmarks
  2006-05-20 17:49 Text style in bookmarks nico
  2006-05-20 18:14 ` Willi Egger
  2006-05-21  6:38 ` Peter Münster
@ 2006-05-21 17:20 ` Hans Hagen
  2006-05-21 19:21   ` Aditya Mahajan
  2006-05-22  9:43   ` nico
  2 siblings, 2 replies; 11+ messages in thread
From: Hans Hagen @ 2006-05-21 17:20 UTC (permalink / raw)


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

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

* Re: Text style in bookmarks
  2006-05-21 17:20 ` Hans Hagen
@ 2006-05-21 19:21   ` Aditya Mahajan
  2006-05-21 21:18     ` Hans Hagen
  2006-05-22  9:43   ` nico
  1 sibling, 1 reply; 11+ messages in thread
From: Aditya Mahajan @ 2006-05-21 19:21 UTC (permalink / raw)


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

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

* Re: Text style in bookmarks
  2006-05-21 19:21   ` Aditya Mahajan
@ 2006-05-21 21:18     ` Hans Hagen
  0 siblings, 0 replies; 11+ messages in thread
From: Hans Hagen @ 2006-05-21 21:18 UTC (permalink / raw)


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

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

* Re: Text style in bookmarks
  2006-05-21 17:20 ` Hans Hagen
  2006-05-21 19:21   ` Aditya Mahajan
@ 2006-05-22  9:43   ` nico
  1 sibling, 0 replies; 11+ messages in thread
From: nico @ 2006-05-22  9:43 UTC (permalink / raw)


On Sun, 21 May 2006 19:20:38 +0200, Hans Hagen <pragma@wxs.nl> 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

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

end of thread, other threads:[~2006-05-22  9:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-20 17:49 Text style in bookmarks nico
2006-05-20 18:14 ` Willi Egger
2006-05-20 18:38   ` nico
2006-05-20 19:17     ` Johannes Graumann
2006-05-20 20:44       ` nico
2006-05-21  6:38 ` Peter Münster
2006-05-21 16:42   ` Hans Hagen
2006-05-21 17:20 ` Hans Hagen
2006-05-21 19:21   ` Aditya Mahajan
2006-05-21 21:18     ` Hans Hagen
2006-05-22  9:43   ` nico

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