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:59g'' of the word
beginning.'' – Bryan M-H Jan 20 '18 at 20:38amsart
class allows for aframe
environment? – egreg Jan 20 '18 at 20:44\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