下三角に大きなゼロがある上三角行列ですか?

下三角に大きなゼロがある上三角行列ですか?

上台形行列は、次のように表すことができます。これらのゼロをすべて、下三角形の行と列にまたがる 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}\]

\Ddot の動作

答え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}

上記コードの出力

関連情報