[Tex/LaTex] When should we use \DeclareMathSizes, \xxxstyle and font size changing macros (\tiny, \small, etc)

best practicesfontsizemath-mode

Could you give me a complete overview when we should use \DeclareMathSizes, \xxxstyle (such as \scriptstyle, etc), and font size changing macros (\tiny, \small, etc)?

I want this answer to be CW so all of you can collaborate the answer as complete as possible.
You can elaborate any relevant aspects that you think they are important for most users.

Best Answer

I'm not sure the question is really answerable. It mentions several essentially unrelated commands and asks when they should be used, but I'll have a go.

\DeclareMathSizes should be used almost never. It defines for a given text font size, what size font to use for math node at text and script sizes. The values predeclared in the LaTeX format will cover the vast majority of cases. You would only using this if writing a class that had a very different set of supported font sizes to the standard classes or were writing a package loading a math font suite that is very different to computer modern (for example some fonts may require script and scriptscript text to be set slightly larger to be readable, computer modern fonts are designed at small point sizes to be legible but if you are using a scalable font with just a single design mechanically scaled you may want to prevent sub-subscripts being too small.

\textstyle \scriptstyle are user level commands in math that force the font style that TeX would normally use automatically in certain constructs so $\scriptstyle b$ and $a^{b}$ the b uses the same font in both cases. It's not possible to give general rules why you should want to do this, it is just an available control. One common reason is to force entries in arrays (which would by default be set as \textstyle to display style by issuing \displaystyle. (AMS and similar alignment environments do this as part of their definition.)

\tiny \small may not be used in math mode they set the font for text mode use (math fonts are normally sized to match though, according to the sizes specified by \DeclareMathSizes). Normally in a document one should avoid explicit size (or font) changes and use logical markup such as \section or \footnote, but they can be useful sometimes, eg to reduce the font to squeeze in a large table.