2012-12-17 46 views
0

我最近开始学习LaTeX,虽然我通过在线查找(特别是在这里)找到了几乎所有问题的答案,但还是有一件事情我希望能够做到,但可以'吨我写的文章:指定块矩阵的大小

我想能够指定维度和矩阵下的“子维度”。为了更清楚,让我们看看下面的例子:

$ D = 
    \underbracket{\begin{pmatrix} 
    D_1 & 0  & 0 & &  & \\ 
    0 & \ddots &  & & {\textrm{\huge 0}} & \\ 
    0 & 0  & D_n & &  & \\ 
     &  &  & &  & \\ 
     & \textrm{\huge 0}  &  & & {\textrm{\huge 0}}  & \\ 
     &  &  & &  & \\ 
    \end{pmatrix}}_N $ 

这给了一个很好的矩阵蒙山指定为矩阵下方的支架尺寸N。这很好,但是我想添加第二个支架来指定矩阵下方的内部矩阵的较小尺寸n(可能在第一个主支架的上方),也就是说,我希望它从1n而不是矩阵下的所有方式。

我愿意接受任何解决方案,但越简单越好,我:)

+1

可能更适合于:http://tex.stackexchange.com/ – rofls

+0

谢谢rofls我会在那里发帖:) – Tibo

+1

@Tibo:不要在那里发帖。这已被标记为迁移到[TeX.SE](http://tex.stackexchange.com)。版主将移动帖子。 – Werner

回答

1

下面是不是真的养眼,但它可能是你以后:

enter image description here

\documentclass{article} 
\usepackage{mathtools}% http://ctan.org/pkg/mathtools 
\begin{document} 
\[ 
D = 
    \underbracket{\begin{pmatrix} 
    D_1 & 0  & 0 & &  & \\ 
    0 & \ddots &  & & {\textrm{\huge 0}} & \\ 
    0 & 0  & D_n & &  & \\ 
     &  &  & &  & \\ 
     & \textrm{\huge 0}  &  & & {\textrm{\huge 0}}  & \\ 
     &  &  & &  & \\ 
    \end{pmatrix}}_N 
\] 

\[ 
    D= \underbracket[.4pt]{\left(\begin{array}{@{}[email protected]{\quad}c} 
    \underbracket[.4pt]{\begin{array}{ccc} 
     D_1 & \vphantom{\ddots}0 & 0 \\ 
     0 & \ddots & 0 \\ 
     0 & \vphantom{\ddots}0 & D_n 
    \end{array}}_{n} & \text{\huge 0} \\ \\ 
    \text{\huge 0} & \text{\huge 0} 
    \end{array}\right)}_{N} 
\] 
\end{document} 

使用\vphantom可确保“内部矩阵”在所有行上的行高相似(实际上没有打印\ddots)。

我采用了更传统的方法(使用array),而不是pmatrix。好处是你可以控制对齐。