矩阵太大,不适合页面宽度

矩阵太大,不适合页面宽度

当我在课堂上输入矩阵时beamer,它们通常太大而无法容纳页面的宽度。有什么方法可以使矩阵变小?我还想使这些矩阵条目的字体变小。我用

\[ \scriptscriptstyle
M_{1,k}  = \frac{1}{15} \left(
        \begin{array}{cccccccc}
         0 & 0 & 0 & 0 & 0 & 0  \\
         0 & 12k b_0 & (12k+15) b_1 & (12k+30) b_2 & (12k+45)  b_3 & (12k+60) b_4  \\
         0 & 0 & 0 & 0 & 0 & 0   \\
         0 & 2k  a_0 & (2k+5)  a_1 & (2k+10)  a_2 & 0 & 0   \\
        \end{array}
      \right)
\]

但它只会使缩放器缩小 1/15,而不会使这个矩阵的条目变小。有没有办法让条目变小,而不用\scriptstyle为每个条目输入内容?也许我们可以将整个大小改变 75%,50% 的内容\begin{equation}...\end{equation}

答案1

一个快速(但不太漂亮)的解决方案是使用包\scalebox中的功能graphicx,例如

\newcommand\scalemath[2]{\scalebox{#1}{\mbox{\ensuremath{\displaystyle #2}}}}

\[
M_{1,k}  = \frac{1}{15} \left(
    \scalemath{0.3}{
    \begin{array}{cccccccc}
     0 & 0 & 0 & 0 & 0 & 0  \\
     0 & 12k b_0 & (12k+15) b_1 & (12k+30) b_2 & (12k+45)  b_3 & (12k+60) b_4  \\
     0 & 0 & 0 & 0 & 0 & 0   \\
     0 & 2k  a_0 & (2k+5)  a_1 & (2k+10)  a_2 & 0 & 0   \\
    \end{array}
    }
  \right)
\]

答案2

\begin{frame}我建议您在语句之后但在等式开始之前插入以下说明。

\footnotesize
\setlength{\arraycolsep}{2.5pt}
\medmuskip = 1mu % default: 4mu plus 2mu minus 4mu

该命令\footnotesize将使字体大小减少约 20%;\arraycolsep=3pt减少插入列之间的空白约 40%(这很有用,因为您有 7 个这样的空白),并\medmuskip=1mu大大减少 TeX 在每个“+”符号(以及所有其他“mathbin”类的符号)之前和之后插入的空白量。

以下是完整的 MWE 及其输出:

\documentclass{beamer}
\begin{document}
\begin{frame}
\footnotesize
\setlength{\arraycolsep}{2.5pt} % default: 5pt
\medmuskip = 1mu % default: 4mu plus 2mu minus 4mu
\[ 
M_{1,k}  = \frac{1}{15} 
\left( \begin{array}{rrrrrr} 
0 & 0 & 0 & 0 & 0 & 0  \\
0 & 12k b_0 & (12k+15) b_1 & (12k+30) b_2 & (12k+45) b_3 & (12k+60) b_4 \\
0 & 0 & 0 & 0 & 0 & 0   \\
0 & 2k  a_0 & (2k+5)  a_1 & (2k+10)  a_2 & 0 & 0   \\
\end{array} \right)
\]
\end{frame}
\end{document}

在此处输入图片描述

附录:如果您需要进一步节省空格,您可以(i)通过发出命令减少等号周围的空格,以及(ii)用\thickmuskip = 2mu替换数组前导行;后一种措施将消除左括号和右括号以及第一列/最后一列数字之间的空格。\begin{array}{rrrrrr}\begin{array}{@{}rrrrrr@{}}

答案3

调整宽度为\linewidth

\documentclass{beamer}
\begin{document}
\begin{frame}

\resizebox{\linewidth}{!}{%
$\displaystyle
M_{1,k}  = \frac{1}{15} 
\left( \begin{array}{rrrrrrrr} 
0 & 0 & 0 & 0 & 0 & 0  \\
0 & 12k b_0 & (12k+15) b_1 & (12k+30) b_2 & (12k+45)  b_3 & (12k+60) b_4  \\
0 & 0 & 0 & 0 & 0 & 0   \\
0 & 2k  a_0 & (2k+5)  a_1 & (2k+10)  a_2 & 0 & 0   \\
\end{array} \right)
$}
\end{frame}

\end{document}

相关内容