[NTG-context] Styling References

Wolfgang Schuster schuster.wolfgang at gmail.com
Mon Jul 14 15:03:12 CEST 2014


Am 14.07.2014 um 13:58 schrieb Malte Stien <malte at stien.de>:

> Hi,
> 
> I need to style my references to SOME section/subsection/subsubsection differently. Here is an example:
> 
> \starttext
> There are lots of animals such as \about[ducks] and \about[bears].
> More about this can be found in Chapter~\about[introduction].
> 
> \chapter[introduction]{Introduction}
> \section[ducks]{Ducks}
> Some information about ducks...
> 
> \section[bears]{Bears}
> Some information about baers...
> 
> \stoptext
> 
> I am happy for the reference to the Introduction chapter to be in regular type with quotes, but I would like to render the references to Ducks and Baers in italics without the quotes. Note, that I do not require for ConTeXt to pick one or the other style automatically based on the section (that would be pretty complicated, I suppose). I am happy to ‘hint’ it when I make the reference. So, for example, I am happy to replace the first like with 
> 
> There are lots of animals such as \animalabout[ducks] and \animalabout[bears].
> 
> ...but so far I have been unsuccessful in creating such a \animalabout command. I looked at \definereferenceformat which gets rid of the quotes, but I can’t make it go italics. I also looked at \setupreferencing, but that seems to affect ALL \abouts.

\definereferenceformat[animalabout][style=italic,color=blue,type=title,left=«,right=»]

\starttext

There are lots of animals such as \about[ducks] and \about[bears].

There are lots of animals such as \animalabout[ducks] and \animalabout[bears].

\chapter[introduction]{Introduction}

\section[ducks]{Ducks}

Some information about ducks...

\section[bears]{Bears}

Some information about baers...

\stoptext

Wolfgang


More information about the ntg-context mailing list