Why does LaTeX issue \scriptsize warnings in math mode?

David Carlisle d.p.carlisle at gmail.com
Thu May 7 12:21:12 CEST 2020


No latex font size command is valid in math mode. The fonts need to be set
up before math is entered. It really should be an error but it's a warning
for historical reasons.

If you try it anyway then sometime it apparently has an effect and
sometimes that effect does change the size of some of the letters, but the
details are unpredictable
and affected by what math expressions have already been used in the
document and how many fonts are already "known", and whether (like arrays)
the math does
in fact  switch to a new math list for each cell, so typically you see that
math in alignments is affected by the font size, but math outside is not.

Possibly you are looking for \scriptstyle but \scriptsyle is the default
style in sub and superscripts so would do nothing at the place you show.

David


On Thu, 7 May 2020 at 09:40, Doug McKenna <doug at mathemaesthetics.com> wrote:

> I've been trying to put a LaTeX verbatim quote in a superscript or
> subscript.  Here's a simple MWE:
>
>
> % !TEX TS-program = pdflatex
>
> \documentclass{letter}
> \begin{document}
>
> \verb|normal|, $10^{\scriptsize \verb|foo|}$, $A_{\scriptsize
> \verb|bar|}$, or $2^{2^{-{\tiny \verb|foobar|}}}$
>
> \end{document}
>
>
> It seems to work quite well or at least as expected, except that LaTeX
> issues the following warning messages which, given that it seems to work,
> don't make much sense:
>
>
> LaTeX Font Warning: Command \scriptsize invalid in math mode on input line
> 6.
>
> LaTeX Font Warning: Command \scriptsize invalid in math mode on input line
> 6.
>
> LaTeX Font Warning: Command \tiny invalid in math mode on input line 6.
>
>
> What is it that one needs to do better or correctly to keep such warnings
> at bay?
>
>
> Doug McKenna
> Mathemaesthetics, Inc.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/texhax/attachments/20200507/6b1b4420/attachment.html>


More information about the texhax mailing list.