![下三角に大きなゼロがある上三角行列ですか?](https://rvso.com/image/254726/%E4%B8%8B%E4%B8%89%E8%A7%92%E3%81%AB%E5%A4%A7%E3%81%8D%E3%81%AA%E3%82%BC%E3%83%AD%E3%81%8C%E3%81%82%E3%82%8B%E4%B8%8A%E4%B8%89%E8%A7%92%E8%A1%8C%E5%88%97%E3%81%A7%E3%81%99%E3%81%8B%3F.png)
上台形行列は、次のように表すことができます。これらのゼロをすべて、下三角形の行と列にまたがる 1 つの大きなゼロに置き換え、上対角行列であることを明確に示す区切り文字を対角線に沿って追加したいと思います。どうすればよいでしょうか。
\newcommand\x{\XSolid}
%\newcommand\x{\ding{53}}
\begin{equation}
\left(
\begin{array}{*5{c}}
\x & \x & \x & \x & \x \\
0 & \x & \x & \x & \x \\
0 & 0 & \x & \x & \x \\
0 & 0 & 0 & \x & \x \\
0 & 0 & 0 & 0 & \x \\
\end{array}\right)
\end{equation}
別の質問ですが、私が定義したコマンドはなぜ意図\x
し#
た十字のシンボルではなく出力されるの#
でしょうか?\XSolid
\ding{53}
更新: 回答を入力として、私は次のようにしました:
\newcommand\x{\times}
\newcommand\bigzero{\makebox(0,0){\text{\huge0}}}
\newcommand*{\bord}{\multicolumn{1}{c|}{}}
\begin{equation}
\left(
\begin{array}{ccccc}
\x & \x & \x & \x & \x \\ \cline{1-1}
\bord & \x & \x & \x & \x \\ \cline{2-2}
& \bord & \x & \x & \x \\ \cline{3-3}
& \bigzero & \bord & \x & \x \\ \cline{4-4}
& & & \bord & \x \\ \cline{5-5}
\end{array}\right)
\end{equation}
これは次のようになります:
答え1
\documentclass[]{article}
\usepackage{mathtools}
\begin{document}
\[
\left(
\begin{array}{ccccc}
1 \\
& 1 & & \text{\huge0}\\
& & 1 \\
& \text{\huge0} & & 1 \\
& & & & 1
\end{array}
\right)
\]
\end{document}
または、\makebox(0,0){\text{\huge0}}
同じ行間隔にしたい場合。
答え2
念のため、対角線上にドットを繰り返し配置する必要があるかもしれません。ここでは、そのための醜い方法を紹介します。
\newcount\dotcnt\newdimen\deltay
\def\Ddot#1#2(#3,#4,#5,#6){\deltay=#6\setbox1=\hbox to0pt{\smash{\dotcnt=1
\kern#3\loop\raise\dotcnt\deltay\hbox to0pt{\hss#2}\kern#5\ifnum\dotcnt<#1
\advance\dotcnt 1\repeat}\hss}\setbox2=\vtop{\box1}\ht2=#4\box2}
そして、例(もちろん、amsmath を使用):
\[\begin{pmatrix}
1\Ddot{12}.(6pt,-2pt,6pt,-5pt)&1\Ddot8.(9pt,2pt,6pt,0pt)&\quad&\quad&1\\
&&&&\\
&&&&\\
&&&&\\
&\mbox{\Huge 0}&&&\\
&&&&1\\
\end{pmatrix}\]
答え3
のと。{pNiceMatrix}
nicematrix
\documentclass{article}
\usepackage{nicematrix,tikz}
\begin{document}
$\begin{pNiceMatrix}[left-margin]
\times & \times & \times & \times & \times \\
& \times & \times & \times & \times \\
& & \times & \times & \times \\
\Block{2-2}<\Huge>{0}
& & & \times & \times \\
& & & & \times \\
\CodeAfter
\tikz \draw (2-|1) -| (3-|2) -| (4-|3) -| (5-|4) -| (6-|5) ;
\end{pNiceMatrix}$
\end{document}