On Wed, 21 Oct 2020, Andres Conrado Montoya wrote:

> I've seen in several articles on the Wiki, some differences about how this
> is done, and I'm confused about the differences:
> 
> *Font_Switching* says: "There is a font switch \em to emphasize text. This
> is somewhat special: it does automatic italic correction and changes the
> alternative depending on the current alternative. For example, if the
> current font alternative is normal (i.e. upright), \em switches to slanted;
> and if the current font alternative is slanted, \em switches to normal."
> And using \definebodyfontenvironment[default][em=italic] to use italic
> instead of slanted; for OpenType fonts, recommends using
> \definefontfeature[default][default][itlc=yes] to also activate the italic
> correction. However, this seems not to work in x(ht)ml export.

Did you also see **Before you start...** section on that page:
https://wiki.contextgarden.net/Font_Switching#Before_you_start_...

> If you go to *Export*, it says: "Also note that switches like \em don’t
> translate into output structure, you need to
> \definehighlight[emph][style={\em}] and use as \emph{emphasized}." This is
> what I'm currently using. Other parts of the Wiki show a similar solution,
> but using style=italic, or style={\it}; I've seen others, but now I can't
> find them.
> 
> Could you please guide me as to where is this documented in the manuals? Is
> there any particular reason to choose any of these approaches above the
> others? 

As far as PDF output is consider, both the font switch \em and the macro \emph 
defined using \definehighlight[emph][style=\em] are equivalent. You can test 
that:

    \definehighlight[emph][style=\em]

    \starttext
    Normal text. \emph{This is \emph{emphasized} test}

    Normal text. {\em This is {\em emphasized} test}
    \stoptext

> What is the recommended option if you want to have the \em
> properties for emphasized text, but works for BOTH pdf and x(h)tml export?

The raw font switch \em is not exported to HTML while \definehighlight[emph] 
is. 

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to