有什么办法可以让它看起来更优雅吗?
\documentclass{book}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\begin{pmatrix}
\sum_{j=1}^{q_{k}} \frac{\vec{e}_{k,j}}{b_{k,j} - \vec{m}_{k,j}^T \vec{x}_{k} - \vec{e}_{k,j}^T \vec{u}_{k}} \\
\sum_{j=1}^{q_{k+1}} \frac{\begin{pmatrix} \vec{e}_{k+1,j} & \vec{m}_{k+1,j} \end{pmatrix}^T}{b_{k+1,j} - \vec{e}_{k+1,j}^T \vec{u}_{k+1} - \vec{m}_{k+1,j}^T \vec{x}_{k+1}} \\
\vdots \\
\sum_{j=1}^{q_{k+N-1}} \frac{\begin{pmatrix} \vec{e}_{k+N-1,j} & \vec{m}_{k+N-1,j} \end{pmatrix}^T}{b_{k+N-1,j} - \vec{e}_{k+N-1,j}^T \vec{u}_{k+N-1} - \vec{m}_{k+N-1,j}^T \vec{x}_{k+N-1}} \\
\sum_{j=1}^{q_{k+N}} \frac{\vec{m}_{k+N,j}}{b_{k+N,j} - \vec{m}_{k+N,j}^T \vec{x}_{k+N}}
\end{pmatrix}
\end{equation}
\end{document}
编译后为
正如您所看到的,分子的字体大小不同, 还向量内的对齐可能会有帮助,以及修改条目之间的分隔空间。也许这些都无济于事,我不得不忍受一些不太漂亮的矢量。有什么建议吗?谢谢!
注意:在实际文档中,我没有使用\vec{}
,而是\boldsymbol{}
用来区分向量和标量,这对这个问题没有影响。
答案1
我建议使用另一种布局,其中采用中等大小的分数nccmath
以及总和符号的对齐,这要归功于pmatrix*
环境 frommathtools
和包eqparbox
:
\documentclass{book}
\usepackage{mathtools, nccmath}
\usepackage{bm}
\usepackage{eqparbox, booktabs}
\newcommand{\eqmathbox}[2][M]{\eqmakebox[#1]{$\scriptstyle#2$}}
\newcommand{\msum}{\medop\sum\limits}
%
\begin{document}
\begin{equation}
\begin{pmatrix*}[l]
\msum_{j=1}^{\eqmathbox{q_{k}}} \mkern-12mu \frac{\bm{e}_{k,j}}{b_{k,j} - \bm{m}_{k,j}^T \bm{x}_{k} - \bm{e}_{k,j}^T \bm{u}_{k}} \\ \addlinespace
\msum_{j=1}^{\eqmathbox{q_{k+1}}} \mkern-12mu \frac{\bigl(\bm{e}_{k+1,j} \enspace \bm{m}_{k+1,j}\bigr)^T}{b_{k+1,j} - \bm{e}_{k+1,j}^T \bm{u}_{k+1} - \bm{m}_{k+1,j}^T \bm{x}_{k+1}} \\
\eqmathbox{ ⋮ } \\[0.5ex]
\msum_{j=1}^{\eqmathbox{q_{k+N-1}}}\mkern-12mu \mfrac{\bigr( \bm{e}_{k+N-1,j} \quad \bm{m}_{k+N-1,j} \bigr)^T}{b_{k+N-1,j} - \bm{e}_{k+N-1,j}^T
\bm{u}_{k+N-1} - \bm{m}_{k+N-1,j}^T \bm{x}_{k+N-1}} \\ \addlinespace
\msum_{j=1}^{\eqmathbox{q_{k+N}}}\mkern-12mu \frac{\bm{m}_{k+N,j}}{b_{k+N,j} - \bm{m}_{k+N,j}^T \bm{x}_{k+N}}
\end{pmatrix*}
\end{equation}
\end{document}
答案2
始终使用\dfrac
并且\limits
:
\documentclass{book}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\begin{pmatrix}
\sum\limits_{j=1}^{q_{k}} \dfrac{\vec{e}_{k,j}}{b_{k,j} - \vec{m}_{k,j}^T \vec{x}_{k} -
\vec{e}_{k,j}^T
\vec{u}_{k}} \\
\sum\limits_{j=1}^{q_{k+1}} \dfrac{\begin{pmatrix} \vec{e}_{k+1,j} & \vec{m}_{k+1,j}
\end{pmatrix}^T}{b_{k+1,j} - \vec{e}_{k+1,j}^T \vec{u}_{k+1} - \vec{m}_{k+1,j}^T \vec{x}_{k+1}} \\
\vdots \\
\sum\limits_{j=1}^{q_{k+N-1}} \dfrac{\begin{pmatrix} \vec{e}_{k+N-1,j} & \vec{m}_{k+N-1,j}
\end{pmatrix}^T}{b_{k+N-1,j} - \vec{e}_{k+N-1,j}^T \vec{u}_{k+N-1} - \vec{m}_{k+N-1,j}^T
\vec{x}_{k+N-1}} \\
\sum\limits_{j=1}^{q_{k+N}} \dfrac{\vec{m}_{k+N,j}}{b_{k+N,j} - \vec{m}_{k+N,j}^T \vec{x}_{k+N}}
\end{pmatrix}
\end{equation}
\end{document}
答案3
我发现主要问题是你pmatrix
在另一个pmatrix
环境中使用环境。这导致分子和分母之间的大小差异。
如果您不完全理解 的代码pmatrix
,一种解决方案是使用纯数组。您可以创建一个一列的数组,该数组中的每个条目都是一个总和。如果您需要更多空间,请添加一个空白行或创建一个新行。这是代码:
\documentclass{book}
\usepackage{amsmath}
\begin{document}
\[ % begin math environment
\left( % left parenthesis
\begin{array}{c} % begins an array of one column
\sum_{j=1}^{q_{k}} \frac{\vec{e}_{k,j}}{b_{k,j}-\vec{m}_{k,j}^\vec{x}_{k}-\vec{e}_{k,j}^T \vec{u}_{k}} \\ % some space
\\ % more space
\sum_{j=1}^{q_{k+1}} \frac{\left(\vec{e}_{k+1,j}~\vec{m}_{k+1,j}\right)^T}{b_{k+1,j}-\vec{e}_{k+1,j}^T \vec{u}_{k+1}-\vec{m}_{k+1,j}^T\vec{x}_{k+1}} \\ % some space
\\ % more space
\vdots \\ % some space
\\ % more space
\sum_{j=1}^{q_{k+N-1}}\frac{\left(\vec{e}_{k+N-1,j}~\vec{m}_{k+N-1,j}\right)^T}{b_{k+N-1,j}-\vec{e}_{k+N-1,j}^T\vec{u}_{k+N-1}-\vec{m}_{k+N-1,j}^T \vec{x}_{k+N-1}} \\ % some space
\\ % more space
\sum_{j=1}^{q_{k+N}}\frac{\vec{m}_{k+N,j}}{b_{k+N,j}-\vec{m}_{k+N,j}^T\vec{x}_{k+N}}
\end{array} % ends array
\right) % right hand side parenthesis
\] % ends math environment
\end{document}
另一个解决方案是pmatrix
在求和时不使用环境。只需\left( \right)
使用大的括号,如下所示:
\documentclass{book}
\usepackage{amsmath}
\begin{document}
\[ % begin math environment
\begin{pmatrix}
\sum_{j=1}^{q_{k}} \frac{\vec{e}_{k,j}}{b_{k,j}-\vec{m}_{k,j}^\vec{x}_{k}-\vec{e}_{k,j}^T \vec{u}_{k}} \\ % some space
\\ % more space
\sum_{j=1}^{q_{k+1}} \frac{\left(\vec{e}_{k+1,j}~\vec{m}_{k+1,j}\right)^T}{b_{k+1,j}-\vec{e}_{k+1,j}^T \vec{u}_{k+1}-\vec{m}_{k+1,j}^T\vec{x}_{k+1}} \\ % some space
\\ % more space
\vdots \\ % some space
\\ % more space
\sum_{j=1}^{q_{k+N-1}}\frac{\left(\vec{e}_{k+N-1,j}~\vec{m}_{k+N-1,j}\right)^T}{b_{k+N-1,j}-\vec{e}_{k+N-1,j}^T\vec{u}_{k+N-1}-\vec{m}_{k+N-1,j}^T~\vec{x}_{k+N-1}} \\ % some space
\\ % more space
\sum_{j=1}^{q_{k+N}}\frac{\vec{m}_{k+N,j}}{b_{k+N,j}-\vec{m}_{k+N,j}^T\vec{x}_{k+N}}
\end{pmatrix}
\] % ends math environment
\end{document}