3

nicematrix seems not to display column matrices correctly. Is there a way to fix this, so that one doesn't have to change all files to use NiceArray? I also use [renew-dots,renew-matrix], so that matrices typeset using the amsmath matrix environments benefit from \NiceMatrixOptions{cell-space-limits = 1pt}. (I haven't used [renew-dots,renew-matrix] here to show the difference between nicematrix and amsmath.) As a result, unfortunately, I can't remove the [renew-dots,renew-matrix] option and just use pmatrix. (As you can see below, the rows in matrices using pmatrix are too close.)

I'm not sure if nicematrix always did this. I think I would have noticed, but maybe I didn't. Observe:

\documentclass[12pt]{amsart}

\usepackage{nicematrix}

\NiceMatrixOptions{cell-space-limits = 1pt}

\begin{document}

NiceMatrix

\begin{align} v_1 &= \begin{bNiceMatrix} 1\ 0 \3 \ 4\5 \end{bNiceMatrix} \ v_2 &= \begin{pNiceMatrix} 0\ 1 \end{pNiceMatrix} \end{align}

NiceArray

\begin{align} v_3 &= \left( \begin{NiceArray} {c} \frac{1}{2} \ \frac{1}{4} \end{NiceArray} \right) \ v_4 &= \left( \begin{NiceArray} {c} 1 \ 0 \end{NiceArray} \right) \end{align}

Without nicematrix

\begin{align} v_5 &= \begin{pmatrix} a\ b \c \ d \end{pmatrix} \ v_6 &= \begin{pmatrix} \frac{1}{2} \ \frac{1}{4} \end{pmatrix} \ v_7 &= \begin{pmatrix} \frac{1}{2} & 1\ \frac{1}{4} & 2 \end{pmatrix} \end{align}

\end{document}

This is the output:

various types of column matrices

EDIT: I'm using version 6.26a of nicematrix, dated 2023-12-04.

  • I actually get exactly the opposite: the NiceMatrix version looks good, the NiceArray version does not. I was able to fix the latter by putting "cc" in the argument rather than just "c"; I'm not sure what the cause of that problem is. – karlh Dec 13 '23 at 00:11
  • Hmm... Interesting. I wonder which version of nicematrix you are using. I'm using 6.26a, (which should be the latest one.) – Anthony Pulido Dec 13 '23 at 00:18
  • I am using 6.16 (comes with TeXLIVE 2023). I am unable to use 6.26a, as it relies on \int_if_zero:nT (which is evidently a new feature of the LaTeX3 kernel since February 2023). – karlh Dec 13 '23 at 00:43
  • Interesting... Thanks! What does \int_if_zero:nT do? Anyway, it suggests to me that this is new behavior. – Anthony Pulido Dec 13 '23 at 00:51
  • I also get correct spacing with pNiceMatrix and bNiceMatrix. Spacing on NiceArray is fixed by using pNiceArray instead of \left( and \right) – Sandy G Dec 13 '23 at 00:56
  • Thanks for mentioning pNiceArray! That will save me some typing if I have to convert. Like I asked karlh, which version of nicematrix are you using? – Anthony Pulido Dec 13 '23 at 01:02
  • 2
    This is bug in the latest version of nicematrix. I will post a new version on CTAN. – F. Pantigny Dec 13 '23 at 18:31
  • @F.Pantigny Thank you! – Anthony Pulido Dec 13 '23 at 19:37
  • @F.Pantigny By the way, I love nicematrix! – Anthony Pulido Dec 13 '23 at 19:40
  • @F.Pantigny I just received the updated version through TeXLive. It works! Thanks again! – Anthony Pulido Dec 15 '23 at 22:18

1 Answers1

4

The latest version of nicematrix (v. 6.26b 2023-12-13) solves that bug.

F. Pantigny
  • 40,250