# How to get ex or em equivalent in math display mode

Based on the following output, it appears to me that changing to \displaystyle or \scriptstyle does not actually change the font size as represented by \f@size. It also does not appear to change the ex or em values.

\documentclass{article}
\begin{document}

\makeatletter
Display style $\displaystyle \f@size pt$.

text style $\textstyle \f@size pt$.

script style $\scriptstyle \f@size pt$.

scriptscript style $\scriptscriptstyle \f@size pt$.

small $\small\f@size pt$.

tiny $\tiny\f@size pt$.

large $\large\f@size pt$.
\makeatother

\end{document}


I would like to define a macro using \mathchoice that displays a tikz picture that is appropriately scaled, and I need access to something like ex or em for the font size that is actually being used, depending on the math display style.

Question. How do I get access to the current font size being used for the current math display style?

• simplest is to use \text{\begin{tizpicture....} and then the ams \text macro takes care of this and gives you a matching text font setup. – David Carlisle Nov 26 '17 at 15:41
• That totally works! Please post your comment as an answer, and I will accept. I was able to avoid \mathchoice this way, simply by using ex unit. – JDH Nov 26 '17 at 15:46

It would be simpler to use \text{\begin{tizpicture....} and then the AMS \text macro takes care of this and gives you a matching text font setup