[Tex/LaTex] Changing the size of things doesn’t work via \scriptsize, \normalsize, \large, etc. in math mode

fontsizemath-mode

You are supposed to be able to change the size of things via the commands

\large
\huge

etc. However, they don't seem to work in math mode. The following code

\documentclass{article}
\usepackage{amsmath}

\begin{document}
${\footnotesize Text\text{Text}}$\\
${\scriptsize Text\text{Text}}$\\
${\normalsize Text\text{Text}}$\\
${\large Text\text{Text}}$\\
${\Large Text\text{Text}}$\\
${\LARGE Text\text{Text}}$\\
${\huge Text\text{Text}}$\\
${\Huge Text\text{Text}}$\\
\end{document}

produces this:

changing font size doesn't work in math mode

While regular text is resized accordingly, things directly in math mode don't change.

Edit: I don't just want do change the size of a complete formula (which is solved by the answer from Rmano) but of singular symbols inside the formula (e.g. an integral sign inside an underset) which seems to only be possible with the \scriptscriptstyle, \scriptstyle, \displaystyle and \textstyle command. Since there are only these four, how can you change it to different sizes (especially larger ones)?

Best Answer

As stated in comments, the font-size command work only in text mode. On the other hand, math typeset in the scope of font changing command will (normally) follows suit.

Do not use \\ in normal text, and notice that \par should be in the scope of the font changing command to use the correct line skip.

\documentclass{article}
\usepackage{amsmath}

\begin{document}
{\footnotesize $a=b;\text{Text}$\par}
{\scriptsize $a=b;\text{Text}$\par}
{\normalsize $a=b;\text{Text}$\par}
{\large $a=b;\text{Text}$\par}
{\Large $a=b;\text{Text}$\par}
{\LARGE $a=b;\text{Text}$\par}
{\huge $a=b;\text{Text}$\par}
{\Huge $a=b;\text{Text}$\par}
\end{document}

output for the snippet above