# font size in math mode (for an exponentiated matrix)

Note: While I am interested in typesetting the Euler constant raised to the power of a matrix, I am more interested in understanding why the second version inserts a square dot, and why the third doesn't compile.

First, what works: I have adapted the answer here, (defining a new command). Second, when I try incorporating more of the suggestions, I get an odd square dot below the “g” in word “beginning.”

Third, using scalebox directly from this answer, my code fails to compile at all.

I am missing something obvious, but would appreciate an explanation.

[Removing the first \end{document} command reveals the compilation error. It wants mathmode.]

Code:

\documentclass[11pt]{amsart}
\usepackage{amsmath,amssymb}
\usepackage{graphicx}
\newcommand\scalemath[2]{\scalebox{#1}{\mbox{\ensuremath{\displaystyle #2}}}}
% The Euler number, e'.
\newcommand{\eu}{\ensuremath{\mathrm{e}}}
\newcommand{\du}{\ensuremath{\mathop{}\!\textnormal{\slshape d}}} % the command \du gives a slant roman differential operator, distinguished from either an italic math variable d or a math operator with d.

\begin{document}

\noindent Here is what I get without messing with things:$\eu^{\left[\begin{array}{cc} 1&2 \\ 3&4 \end{array}\right]}$. Obviously, not good.

The following two versions compile, and the matrix has dimensions similar to those of the $\frac{\du}{\du x}$ operator from the previous term. Optically, however, each looks horrible. \\

$\eu^{\pi}, \eu^{\sqrt[3]{2}}, \eu^i, e^{3-4i}, \eu^{\frac{\du}{\du x}}, { \eu^{\scalemath{0.4}{% {\left[ \begin{array}{cc} a&b \\ c&d \end{array} \right]} }}};$

[Inserting frames and making more adjustment looks like this, which I \emph{think} improves the look of the matrix, but introduces a square dot at the beginning of the line. I can't figure out how to get rid of it.]

\begin{frame} % inserts square dot that I don't understand
\footnotesize
\setlength{\arraycolsep}{2.5pt} % default: 5pt
\medmuskip = 1mu % default: 4mu plus 2mu minus 4mu
$\eu^{\pi}, \eu^{\sqrt[3]{2}}, \eu^i, e^{3-4i}, \eu^{\frac{\du}{\du x}}, { \eu^{\scalemath{0.4}{% {\left[ \begin{array}{cc} a&b \\ c&d \end{array} \right]} }}};$
\end{frame}

\end{document} % on removing this line, the last example fails to compile

Why does scalemath seem to work, but scalebox not?

$\eu^ {\scalebox{0.4}{% \left[ \begin{array}{cc} a&b \\ c&d \end{array} \right]} }$

\end{document}

• \scalebox is like \mbox and the content is always text mode, so you would need $....$ inside the box to get back to math (but I would never use scaling here) also never use \\  at the end of a paragraph, tex warns: Underfull \hbox (badness 10000) in paragraph at lines 14--15 (note 10000 is as bad as it gets, that is the maximum value of badness) – David Carlisle Jan 20 '18 at 17:59
• i'm certain i'm missing something, but i don't see the "odd square dot" you're referring to. (i know the origin of one such dot, but don't want to try to explain it unless i know it's the same as what you're referring to,.) – barbara beeton Jan 20 '18 at 19:30
• I am adding (to the original question) a picture with the square dot. It appears below the g'' of the word beginning.'' – Bryan M-H Jan 20 '18 at 20:38
• What makes you think that the amsart class allows for a frame environment? – egreg Jan 20 '18 at 20:44
• @David, the clarification on \scalebox working like \mbox was part of what I had been missing. Badness 10000 is pretty bad <grin>. – Bryan M-H Jan 20 '18 at 20:54

I don't think you need to use scaling (which introduces inconsistent font sizes and spacing) Just use a smallmatrix at scriptsize:

\documentclass[11pt]{amsart}
\usepackage{amsmath,amssymb}
\newcommand{\eu}{\mathrm{e}}
\newcommand{\du}{\mathop{}\!\textnormal{\slshape d}} % the command \du gives a slant roman differential operator, distinguished from either an italic math variable d or a math operator with d.

\begin{document}

\noindent Here is what I get without messing with things:$\eu^{\left[\begin{array}{cc} 1&2 \\ 3&4 \end{array}\right]}$. Obviously, not good.

The following two versions compile, and the matrix has dimensions similar to those of the $\frac{\du}{\du x}$ operator from the previous term. Optically, however, each looks horrible.
$\eu^{\pi}, \eu^{\sqrt[3]{2}}, \eu^i, e^{3-4i}, \eu^{\frac{\du}{\du x}}, \eu^{\text{\left[\begin{smallmatrix} a&b \\ c&d \end{smallmatrix}\right]}};$

\end{document}

• I have gone with the smallmatrix (for now) in my document. I had forgotten about this option. – Bryan M-H Jan 20 '18 at 20:55

I'd suggest a variant of smallmatrix:

\documentclass[11pt]{amsart}
\usepackage{amsmath,amssymb}

% The Euler number, e'.
\newcommand{\eu}{\mathrm{e}}
\newcommand{\du}{\mathop{}\!\textnormal{\slshape d}}

\makeatletter
\newenvironment{smallermatrix}{\null\,\vcenter\bgroup
\Let@\restore@math@cr\default@tag
\baselineskip4\ex@ \lineskip1.2\ex@ \lineskiplimit\lineskip
\ialign\bgroup\hfil$\m@th\scriptscriptstyle##$\hfil&&\thickspace\hfil
$\m@th\scriptscriptstyle##$\hfil\crcr
}{%
\crcr\egroup\egroup\,%
}
\newenvironment{bsmallermatrix}
{\left[\smallermatrix}
{\endsmallermatrix\right]}
\newenvironment{bsmallmatrix}
{\left[\smallmatrix}
{\endsmallmatrix\right]}
\makeatother

\begin{document}
$\eu^{\begin{bsmallermatrix} 1 & 2 \\ 3 & 4 \end{bsmallermatrix}} = \exp(\begin{bsmallmatrix} 1 & 2 \\ 3 & 4 \end{bsmallmatrix})$

\end{document}


Your method gives not so nice results; I removed all unnecessary braces.

\documentclass[11pt]{amsart}
\usepackage{amsmath,amssymb}
\usepackage{graphicx}

\newcommand\scalemath[2]{\scalebox{#1}{$\displaystyle #2$}}
% The Euler number, e'.
\newcommand{\eu}{\ensuremath{\mathrm{e}}}
\newcommand{\du}{\ensuremath{\mathop{}\!\textnormal{\slshape d}}}

\begin{document}

$\eu^{\pi}, \eu^{\sqrt[3]{2}}, \eu^i, e^{3-4i}, \eu^{\frac{\du}{\du x}}, \eu^{\scalemath{0.4}{% \begin{bmatrix} a&b \\ c&d \end{bmatrix} }};$

\footnotesize
\setlength{\arraycolsep}{2.5pt} % default: 5pt
\medmuskip = 1mu % default: 4mu plus 2mu minus 4mu
$\eu^{\pi}, \eu^{\sqrt[3]{2}}, \eu^i, e^{3-4i}, \eu^{\frac{\du}{\du x}}, \eu^{\scalemath{0.4}{% \begin{bmatrix} a&b \\ c&d \end{bmatrix} }};$

\end{document}


About your problem with frame, the explanation is very easy. The LaTeX kernel defines a \frame command that takes an argument and boxes it. In your case the argument is \footnotesize, so LaTeX will box it, resulting in no contents and therefore a very tiny box (the square dot you see).

Just don't use frame as an environment: it doesn't exist and \begin{frame} does not produce an error because \frame does exist, but, as you see, does a rather different thing than what you may be expecting. What you get, apart from the small box, is confining the setting of \arraycolsep and \medmuskip in the group created by \begin and \end.

• since amsart automatically loads amsmath, it's not necessary to load it. (i know. the original question didn't specify document class, and if it's not one from ams, amsmath` does have to be loaded explicitly.) – barbara beeton Jan 20 '18 at 19:22
• @egreg that explains my little square dot! – Bryan M-H Jan 20 '18 at 20:56
• I've gone with the smallmatrix, simply because I am not sure that I could troubleshoot the smallermatrix if I were to come back to it in several years and want to make an adjustment. – Bryan M-H Jan 20 '18 at 20:58