無限サイズの nicematrix

無限サイズの nicematrix

私は、この三角行列(無限サイズ)のnicematrixバージョンを書こうとしています。pmatrix環境では非常に醜いバージョンがレンダリングされるからです。

\begin{equation}
\begin{pmatrix}
    -\lambda & \lambda             & 0                    & 0       & \dots  \\
    \mu      & -(\lambda+\mu)      & \lambda              & 0       &        \\
    0        & 2\mu                & -(\lambda+2\mu)      & \lambda &        \\
    \vdots   &                     & \ddots               & \ddots  & \ddots
\end{pmatrix}
\end{equation}

だから私は素朴に書いた

\begin{equation}
\begin{pNiceMatrix}
    -\lambda & \lambda             & 0                    & 0       & \Cdots  \\
    \mu      & -(\lambda+\mu)      & \lambda              & 0       &        \\
    0        & 2\mu                & -(\lambda+2\mu)      & \lambda &        \\
    \Vdots   &                     & \Ddots               & \Ddots  & \Ddots
\end{pNiceMatrix}
\end{equation}

しかし、結果は全く機能しない

この問題は、\Ddots の終了を示す表示がないことから生じているのではないかと思います。しかし、それでは無限サイズの行列をどうやって管理すればよいのでしょうか?

編集

私が作業しているドキュメント クラスを使用して、完全かつ最小限の例を提供します。

\documentclass{article}

\usepackage{nicematrix}

\begin{document}
\begin{equation}
\begin{pNiceMatrix}
    -\lambda & \lambda             & 0                    & 0       & \Cdots  \\
    \mu      & -(\lambda+\mu)      & \lambda              & 0       &        \\
    0        & 2\mu                & -(\lambda+2\mu)      & \lambda &        \\
    \Vdots   &                     & \Ddots               & \Ddots  & \Ddots
\end{pNiceMatrix}
\end{equation}
\end{document}

フォント パッケージを使用していたため、コンパイルの結果は私が提供した画像とは少し異なります。しかし、問題は依然として残っています。

答え1

コマンド\Ldots\Cdots\Vdots\Ddotsは、\Iddots空でないセル間で使用することを目的としています。したがって、セル を作成できます\NotEmpty

ここに画像の説明を入力してください

\documentclass{article}

\usepackage{nicematrix}

\begin{document}

\[
\begin{pNiceMatrix}
    -\lambda  & \lambda        & 0               & 0         & \Cdots  \\
    \mu       & -(\lambda+\mu) & \lambda         & 0         &         \\
    0         & 2\mu           & -(\lambda+2\mu) & \lambda   &         \\
    \Vdots    &                & \Ddots          & \Ddots    & \Ddots  \\
    \NotEmpty &                &                 & \NotEmpty & \NotEmpty
\end{pNiceMatrix}
\]

\end{document}

答え2

おそらくそれ\phantomで十分でしょうか?

\documentclass[border=5mm]{standalone}
\usepackage{nicematrix}
\begin{document}
$\begin{pNiceMatrix}
    -\lambda & \lambda             & 0                    & 0       & \Cdots  \\
    \mu      & -(\lambda+\mu)      & \lambda              & 0       &        \\
    0        & 2\mu                & -(\lambda+2\mu)      & \lambda &        \\
    \Vdots   &                     & \Ddots               & \Ddots  & \Ddots\\
\phantom{}&\phantom{}&\phantom{}&\phantom{.}&\phantom{.}
\end{pNiceMatrix}$
\end{document}

ここに画像の説明を入力してください

関連情報