如何显示真正的对角矩阵?我想要一个对角块矩阵。下面的解决方案有几个问题:前半部分的对角线项没有真正对齐,后半部分的对角点\ddots
在零点之间不够陡峭。
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\mathrm{Mat}(u;\mathcal{B})=
\begin{pmatrix}
I_{n_+}\\&-I_{n_-}\\
&&R_{\theta_1}\\
&&&R_{\theta_2}\\
&&&&\ddots\\
&&&&&R_{\theta_r}\\
&&&&&&0\\
&&&&&&&0\\
&&&&&&&&\ddots\\
&&&&&&&&&0\\
\end{pmatrix}
\]
\end{document}
答案1
也许是这个?
\documentclass{article}
\usepackage{amsmath,mathtools}
\DeclareMathOperator{\Mat}{Mat}
\newcommand{\diagentry}[1]{\mathmakebox[1.8em]{#1}}
\newcommand{\xddots}{%
\raise 4pt \hbox {.}
\mkern 6mu
\raise 1pt \hbox {.}
\mkern 6mu
\raise -2pt \hbox {.}
}
\begin{document}
\[
\Mat(u;\mathcal{B})=
\begin{pmatrix}
\diagentry{I_{n_+}}\\
&\diagentry{-I_{n_-}}\\
&&\diagentry{R_{\theta_1}}\\
&&&\diagentry{R_{\theta_2}}\\
&&&&\diagentry{\xddots}\\
&&&&&\diagentry{R_{\theta_r}}\\
&&&&&&\diagentry{0}\\
&&&&&&&\diagentry{0}\\
&&&&&&&&\diagentry{\xddots}\\
&&&&&&&&&\diagentry{0}\\
\end{pmatrix}
\]
\end{document}
答案2
在我看来,这是另一种给读者增加负担但却保护读者眼睛的方法
\documentclass{article}
\usepackage{mathtools}
\DeclareMathOperator{\Mat}{Mat}
\DeclarePairedDelimiter{\diagfences}{(}{)}
\newcommand{\diag}{\operatorname{diag}\diagfences}
\begin{document}\noindent
I would instead do either
\[
\Mat(u;\mathcal{B})=
\begin{pmatrix}
I_{n_+}\\
&\!\!-I_{n_-}\\
&&R_{\theta}\\
&&&0_m
\end{pmatrix},\;R_{\theta}=\diag{R_{\theta_1}, \cdots,R_{\theta_r}}
\]
or even
\[
\Mat(u;\mathcal{B})= \diag{I_{n_+},-I_{n_-},R_{\theta},0_m},\; R_{\theta}=\diag{R_{\theta_1}\, ,\, \cdots,R_{\theta_r}}
\]
\end{document}
答案3
一种可能性是通过调整坐标来控制并将物品精确地放置在 45 度斜坡上(或您想要的任何斜坡):
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\mathrm{Mat}(u;\mathcal{B})=
\begin{pmatrix}
I_{n_+}\\&-I_{n_-}\\
&&R_{\theta_1}\\
&&&R_{\theta_2}\\
&&&&\ddots\\
&&&&&R_{\theta_r}\\
&&&&&&0\\
&&&&&&&0\\
&&&&&&&&\ddots\\
&&&&&&&&&0\\
\end{pmatrix}
\]
\[\setlength\unitlength{13pt}
\mathrm{Mat}(u;\mathcal{B})=
\left(\begin{picture}(11,6)(0,-5.5)
\put(1,-1){\makebox(0,0){$I_{n_+}$}}
\put(2,-2){\makebox(0,0){$-I_{n_-}$}}
\put(3,-3){\makebox(0,0){$R_{\theta_1}$}}
\put(4,-4){\makebox(0,0){$R_{\theta_2}$}}
%\put(5,-5){\makebox(0,0){$\ddots$}}
\put(4.8,-4.8){\makebox(0,0){$\cdot$}}
\put(5.1,-5.1){\makebox(0,0){$\cdot$}}
\put(5.4,-5.4){\makebox(0,0){$\cdot$}}
\put(6,-6){\makebox(0,0){$R_{\theta_r}$}}
\put(7,-7){\makebox(0,0){$0$}}
\put(8,-8){\makebox(0,0){$0$}}
%\put(9,-9){\makebox(0,0){$\ddots$}}
\put(8.8,-8.8){\makebox(0,0){$\cdot$}}
\put(9.1,-9.1){\makebox(0,0){$\cdot$}}
\put(9.4,-9.4){\makebox(0,0){$\cdot$}}
\put(10,-10){\makebox(0,0){$0$}}
\end{picture}
\right)
\]
\end{document}