I am trying to write a nicematrix version of this tridiagonal (infinite size) matrix, as the pmatrix environment renders a very ugly version
\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}
So I naively wrote
\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}
But the result does not work at all
I am guessing the problem comes from a lack of indication for an end to my \Ddots. But then how am I supposed to manage infinite size matrices ?
Edit
I am providing a complete minimal example, with the document class I am working in.
\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}
The results of compilation look a little bit different to the pictures I provided because I had a font package. But the problem is still there.




\Ddotsare intended to be drawn between two not empty matrix nodes. So you should stich with first code fragment which gives to my opinion nice looking result. What you after seems to be features request. Hopefully author of package will see your question and provide some fix to your problem – Zarko Dec 15 '23 at 23:22