I have a document with an overset like this:

            \text{Text A}
            \text{Text B}

"Text A" appears printed smaller than "Text B". I'd like some other text to also appear with the same size as "Text A". How can I set other text to match this same size? I tried setting it to "small" and "tiny". Setting other text to "small" produced text that was several pixels taller than "Text A". Setting it to "tiny" did not result in any font size change.

  • Overset is meant for placing something on top of an operator. What exactly do you want to do. Do you simply need stacking of text (would simply placing two hboxes in a vbox work?) or do you need to use this in a math environment?
    – Aditya
    Feb 9, 2017 at 6:56

1 Answer 1


Let us dissect what is happening here. First of all we want to know more about \overset, which is defined in math-ali.mkiv


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


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



Jackpot! That is what we are looking for. The line of interest here is


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


The means we could query ourselves for the size of the script sized font and use it

Text A \switchtobodyfont[\scriptsize] Text B

or, if we don’t want to use the additional \scriptsize macro

Text A \switchtobodyfont[\thenormalizedbodyfontsize{\mathstyleface\scriptstyle}] Text B
  • I would have simply used oalign and ialign series of macros (from plain tex, also implemented in latex and context)
    – Aditya
    Feb 9, 2017 at 23:17
  • @Aditya Yes, of course I would not use \overset to stack text but rather a table (allows more tweaking than plain \oalign and \ialign). However, OP asked what is the fontsize in the upper part of \overset which I think I answered. Feb 10, 2017 at 8:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.