Henning Hraban Ramm
8. November 2017 um 10:57
Ahoi,
I’m working on ePubs again and need a bit more information in the exported xml.

E.g. I defined my own small caps macro:
\def\SC#1{{\sc\lowercase{#1}}}
to be able to say \SC{ISO} instead of changing everything into lowercase like {\sc iso}.
(I also tried OpenType features, but those were too unreliable with my fonts. That’s not the problem here.)

But my small caps end as unmarked lowercase in the exported xml.
I didn’t manage to combine my above approach with \definehighlight, but after poking around in the source (core-sys.mkiv, strc-tag.mkiv)
I found this solution:

\def\SC#1{\dostarttagged{highlight}{scaps}{\sc\lowercase{#1}}\dostoptagged}

so that \SC{ISO} becomes
<highlight detail="scaps">iso</highlight>

Works for me. Better suggestions?

\definehighlight[SC][style=capital]

\starttext
so that \SC{ISO} becomes
\stoptext


or


\setupsynonyms[abbreviation][synonymstyle=capital]

\abbreviation{ISO}{International Organization for Standardization}

\starttext
so that \ISO\ becomes
\stoptext


Wolfgang