context sensitive highlight styles
![](https://secure.gravatar.com/avatar/e5aa6984b53b8925e405ebbdbc051ad9.jpg?s=120&d=mm&r=g)
In my current project, section titles are typeset in SansBold while the body text (and that of the ToC) is roman. How can I define \definehighlight[emph], so that I get SansBoldItalic in titles and SerifItalic in body text and ToC? (Body text is not a problem.) MNWE: \setuphead[chapter][page=yes,style={\ss\bfc}] \setuphead[section][page=no,style={\ss\bfa}] \definehighlight[emph][style=\it] \starttext \completecontent \startchapter[title={My book \emph{\ConTeXt\ for Runaways}}] \startsection[title={Knuth, \emph{the professor}}] \input knuth \stopsection \stopchapter \stoptext Greetlings, Hraban --- http://www.fiee.net http://wiki.contextgarden.net GPG Key ID 1C9B22FD
![](https://secure.gravatar.com/avatar/5955e8e90611e77ccbfc7721b6112027.jpg?s=120&d=mm&r=g)
On 08/16/2017 05:47 PM, Henning Hraban Ramm wrote:
In my current project, section titles are typeset in SansBold while the body text (and that of the ToC) is roman.
How can I define \definehighlight[emph], so that I get SansBoldItalic in titles and SerifItalic in body text and ToC? (Body text is not a problem.)
Hi Hraban, if I get your question, the reply would be: \definehighlight[emph][style=\em] \setupbodyfontenvironment[default][em=italic] Was this what you needed? Pablo -- http://www.ousia.tk
![](https://secure.gravatar.com/avatar/e5aa6984b53b8925e405ebbdbc051ad9.jpg?s=120&d=mm&r=g)
Am 2017-08-16 um 18:09 schrieb Pablo Rodriguez
On 08/16/2017 05:47 PM, Henning Hraban Ramm wrote:
In my current project, section titles are typeset in SansBold while the body text (and that of the ToC) is roman.
How can I define \definehighlight[emph], so that I get SansBoldItalic in titles and SerifItalic in body text and ToC? (Body text is not a problem.)
Hi Hraban,
if I get your question, the reply would be:
\definehighlight[emph][style=\em] \setupbodyfontenvironment[default][em=italic]
Was this what you needed?
Great, thank you! I should have tried \em myself... I don’t even need \setupbodyfontenvironment, because I defined slanted as italics in my typescript. Greetlings, Hraban --- http://www.fiee.net http://wiki.contextgarden.net GPG Key ID 1C9B22FD
![](https://secure.gravatar.com/avatar/b79687264c3e06cba13b54d05b12a9f5.jpg?s=120&d=mm&r=g)
Henning Hraban Ramm mailto:texml@fiee.net 16. August 2017 um 17:47 In my current project, section titles are typeset in SansBold while the body text (and that of the ToC) is roman.
How can I define \definehighlight[emph], so that I get SansBoldItalic in titles and SerifItalic in body text and ToC? (Body text is not a problem.)
MNWE:
\setuphead[chapter][page=yes,style={\ss\bfc}] \setuphead[section][page=no,style={\ss\bfa}] \definehighlight[emph][style=\it] \definestyle[emph][style=\italicface]
Wolfgang
participants (3)
-
Henning Hraban Ramm
-
Pablo Rodriguez
-
Wolfgang Schuster