* Apostrophe entity using \xmltexentity is ignored
@ 2022-10-08 19:20 Thangalin via ntg-context
2022-10-08 21:49 ` Max Chernoff via ntg-context
0 siblings, 1 reply; 2+ messages in thread
From: Thangalin via ntg-context @ 2022-10-08 19:20 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Thangalin
Has the handling for the apostrophe character entity changed recently?
In the following example, the \xmltexentity for apostrophe is ignored,
resulting in a straight apostrophe instead of a curled one:
% SOT
\xmltexentity{apos}{’}
\xmltexentity{lsquo}{‘}
\xmltexentity{rsquo}{’}
\xmltexentity{laquo}{«}
\xmltexentity{raquo}{»}
\startbuffer[document]
<body>
‘Sylvia's spilled «wine».’
</body>
\stopbuffer
\startxmlsetups xml:xhtml
\xmlsetsetup{\xmldocument}{body}{xml:*}
\stopxmlsetups
\startxmlsetups xml:body
\xmlflush{#1}
\stopxmlsetups
\xmlregistersetup{xml:xhtml}
\starttext
\xmlprocessbuffer{xhtml}{document}{}
\stoptext
% EOT
Any ideas on how to fix it?
Thank you.
mtx-context | current version: 2022.09.11 20:44
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage : https://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Apostrophe entity using \xmltexentity is ignored
2022-10-08 19:20 Apostrophe entity using \xmltexentity is ignored Thangalin via ntg-context
@ 2022-10-08 21:49 ` Max Chernoff via ntg-context
0 siblings, 0 replies; 2+ messages in thread
From: Max Chernoff via ntg-context @ 2022-10-08 21:49 UTC (permalink / raw)
To: ntg-context; +Cc: Max Chernoff
Hi,
> Has the handling for the apostrophe character entity changed recently?
>
> In the following example, the \xmltexentity for apostrophe is ignored,
> resulting in a straight apostrophe instead of a curled one:
> Any ideas on how to fix it?
(see also https://tex.stackexchange.com/a/661002/270600)
There are two different problems here.
1. Typing "'" now gives a straight apostrophe instead of a curly one by
default.
The solution to this is to add
\definefontfeature[default][default][trep=yes]
somewhere near the start of your document. See this thread
https://mailman.ntg.nl/pipermail/ntg-context/2021/104286.html
from last year.
2. ConTeXt ignores the redefinition of predefined entities.
If you run this code:
\enabletrackers[xml.entities]
\xmltexentity{apos}{XXX}
\xmltexentity{lsquo}{YYY}
\xmltexentity{rsquo}{ZZZ}
\xmltexentity{laquo}{«}
\xmltexentity{raquo}{»}
then you get this output:
xml > tex > registering tex entity 'apos' as 'XXX'
xml > tex > registering tex entity 'lsquo' as 'YYY'
xml > tex > registering tex entity 'rsquo' as 'ZZZ'
xml > tex > registering tex entity 'laquo' as '«'
xml > tex > registering tex entity 'raquo' as '»'
xml > core > resolving entity ‘ to internal ''
xml > core > resolving entity ‘ to internal ''
xml > core > resolving entity ' to predefined '''
xml > core > resolving entity « to internal ''
xml > core > resolving entity « to internal ''
xml > core > resolving entity » to internal ''
xml > core > resolving entity » to internal ''
xml > core > resolving entity ’ to internal ''
xml > core > resolving entity ’ to internal ''
xml > tex > passing entity 'lsquo' as 'YYY' using 'ctxcatcodes'
xml > tex > passing entity 'U+27' as ''' using 'ctxcatcodes'
xml > tex > passing entity 'laquo' as '«' using 'ctxcatcodes'
xml > tex > passing entity 'raquo' as '»' using 'ctxcatcodes'
xml > tex > passing entity 'rsquo' as 'ZZZ' using 'ctxcatcodes'
I know of a bad way to fix this (see the linked SE question), but
hopefully someone here knows of a proper solution.
Thanks,
-- Max
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage : https://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-10-08 21:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-08 19:20 Apostrophe entity using \xmltexentity is ignored Thangalin via ntg-context
2022-10-08 21:49 ` Max Chernoff via ntg-context
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).