ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* The correct way to add emphasis to text using italics
@ 2020-10-22  4:01 Andres Conrado Montoya
  2020-10-22  4:28 ` Aditya Mahajan
  0 siblings, 1 reply; 2+ messages in thread
From: Andres Conrado Montoya @ 2020-10-22  4:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2297 bytes --]

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.

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

Thank you for your time.

-- 
Andrés Conrado Montoya
Andi Kú
andresconrado@gmail.com
http://sesentaycuatro.com
http://messier87.com
http://chiquitico.org
----------------------------------------
Los fines no justifican los medios, porque la medida verdadera de nuestro
carácter está dada por los medios que estamos dispuestos a utilizar, no por
los fines que proclamamos.
----------------------------------------

“You develop an instant global consciousness, a people orientation, an
intense dissatisfaction with the state of the world, and a compulsion to do
something about it. From out there on the moon, international politics look
so petty. You want to grab a politician by the scruff of the neck and drag
him a quarter of a million miles out and say, ‘Look at that, you son of a
bitch.’” — Apollo 14 astronaut Edgar Mitchell

[-- Attachment #1.2: Type: text/html, Size: 3296 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

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

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

* Re: The correct way to add emphasis to text using italics
  2020-10-22  4:01 The correct way to add emphasis to text using italics Andres Conrado Montoya
@ 2020-10-22  4:28 ` Aditya Mahajan
  0 siblings, 0 replies; 2+ messages in thread
From: Aditya Mahajan @ 2020-10-22  4:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 2112 bytes --]

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

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

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

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

end of thread, other threads:[~2020-10-22  4:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-22  4:01 The correct way to add emphasis to text using italics Andres Conrado Montoya
2020-10-22  4:28 ` Aditya Mahajan

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