2

I was trying to make the following matrix with the nicematrix package:

\begin{equation*}
    A_c+B_c K_c=\begin{bNiceMatrix}
        0               & 1                     & 0         & \Cdots    & 0     \\
        \Vdots          & \Ddots                & \Ddots    & \Ddots    & \Vdots\\
                        &                       & \Ddots    & \Ddots    & 0     \\
        0               & \Cdots                &           & 0         & 1     \\
        -\alpha_n+k_n   & -\alpha_{n-1}+k_{n-1} & \Cdots    &           & -\alpha_1+k_1
    \end{bNiceMatrix}
\end{equation*}

The problem is that the diagonal dots don't go where I would like them to go:

enter image description here

I found out that the nicematrix package draws all the diagonal dotted lines parallel to the first one. The nicematrix documentation says to set to false the option parallelize-diags (page 23), but the compiler gives this error:

Package keyvalue Error: Unknown option 'parallelize-diags' for package (keyvalue) nicematrix.

Is there a way to fix this problem?

Thanks in advance!

1 Answer 1

3

Previously, the key parallelize-diags was available only in \NiceMatrixOptions. In recent versions of nicematrix, it's also available for an individual environment.

Moreover, there is in your code two redundant commands \Ddots.

\documentclass{article}
\usepackage{nicematrix}

\begin{document}
\begin{equation*}
    A_c+B_c K_c=\begin{bNiceMatrix}[parallelize-diags=false]
        0               & 1                     & 0         & \Cdots    & 0     \\
        \Vdots          & \Ddots                & \Ddots    & \Ddots    & \Vdots\\
                        &                       &           &           & 0     \\
        0               & \Cdots                &           & 0         & 1     \\
        -\alpha_n+k_n   & -\alpha_{n-1}+k_{n-1} & \Cdots    &           & -\alpha_1+k_1
    \end{bNiceMatrix}
\end{equation*}
\end{document}

Result of the above code

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .