注意:虽然我对排版欧拉常数的矩阵幂很感兴趣,但我更感兴趣的是了解为什么第二个版本会插入一个方点,以及为什么第三个版本无法编译。
首先,有效的方法:我调整了答案这里,(定义新命令)。其次,当我尝试结合更多建议时,我在单词“beginning”中的“g”下方看到了一个奇怪的方点。
第三,直接从使用 scalebox这个答案,我的代码根本无法编译。
我忽略了一些显而易见的东西,但希望得到解释。
[删除第一个\end{document}
命令会显示编译错误。它需要数学模式。]
代码:
\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}
答案1
我认为您不需要使用缩放(这会引入不一致的字体大小和间距)只需使用smallmatrix
脚本大小即可:
\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}
答案2
我建议使用以下变体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}
您的方法效果不太好;我去掉了所有不必要的括号。
\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}
关于 的问题frame
,解释起来很简单。LaTeX 内核定义了一个\frame
命令,它接受一个参数并将其装箱。在您的例子中,参数是\footnotesize
,因此 LaTeX 会将其装箱,导致没有内容,因此会得到一个非常小的框(您看到的方点)。
只是不要将其用作frame
环境:它不存在,也\begin{frame}
不会产生错误,因为\frame
确实存在,但正如您所见,它所做的事情与您预期的完全不同。除了小框之外,您得到的是将和的设置限制\arraycolsep
在由和\medmuskip
创建的组中。\begin
\end