Let us dissect what is happening here. First of all we want to know more about \overset
, which is defined in math-ali.mkiv
\unexpanded\def\overset#1#2%
{\math_binrel_apply{#2}{\mathop{\kern\zeropoint#2}\limits\normalsuperscript{#1}}}
Aha! Apparently, the first argument is put inside \mathop
and the second argument inside a superscript. Super- and subscripts are always typeset in \scriptstyle
(unless \scriptstyle
was active before, then it becomes \scriptscriptstyle
). Therefore we conclude that we can typeset text in the same fontsize by using
\math{\scriptstyle\text{Foo}}
But we can go further. We could also find out what is the font size that is actually used inside the \text
command. Therefore we look up the definition of \text
and the associated macros in math-ini.mkiv
:
\appendtoks \let\text\mathtext \to \everymathematics
\unexpanded\def\mathtext{\mathortext{\math_text_choice_font\relax}\hbox}
\def\math_text_choice_font#1#2#%
{\normalizebodyfontsize\m_math_text_choice_face{\mathstyleface\normalmathstyle}%
\hbox#2\bgroup
\bgroup
\aftergroup\hss
\aftergroup\egroup
\hss
\font_basics_switchtobodyfont\m_math_text_choice_face
#1%
\let\next}
Jackpot! That is what we are looking for. The line of interest here is
\font_basics_switchtobodyfont\m_math_text_choice_face
As is evident from the macro name this command switches the font size to whatever is currently in \m_math_text_choice_face
. Some lines earlier this size is obtained using
\normalizebodyfontsize\m_math_text_choice_face{\mathstyleface\normalmathstyle}
The means we could query ourselves for the size of the script sized font and use it
\starttext
\normalizebodyfontsize\scriptsize{\mathstyleface\scriptstyle}
Text A \switchtobodyfont[\scriptsize] Text B
\stoptext
or, if we don’t want to use the additional \scriptsize
macro
\starttext
Text A \switchtobodyfont[\thenormalizedbodyfontsize{\mathstyleface\scriptstyle}] Text B
\stoptext