2

I don't know whether it is a bug. The \Block command works well with first-row option, but with last-row, I got an error: You try to draw a block in the cell 3-1 of your matrix but the matrix is too small for that block. If you go on, this command will be ignored.

Here is the code.

\documentclass{article}
\usepackage{nicematrix}

\begin{document}
\[
\begin{bNiceMatrix}[first-row, last-row]
  \Block{1-2}{\text{test}}\\
  a & b\\
  c & d\\
  \Block{1-2}{\text{test}}\\
\end{bNiceMatrix}
\]
\end{document}
1
  • From the documentation of nicematrix, sec. 4, "The command \Block must be used in the upper leftmost cell of the array with two arguments." When option last-row is used, the last row is considered out of the array. Hence I suppose this is not.a bug. Though your question can still exist as a feature request. Jun 11 '20 at 15:27
3

Update

The desired usage is supported in nicematrix, v4.3 of 2020/06/12. See the answer by package author F. Pantigny.

Old

(Continued from my comment under question.)

If strictly follow the package documentation, \Block should not be supported in either first row nor last row. But it seems nicematrix supports \Block used in first row, but not last row. Maybe you can contact the package author.

As a workaround, you can use \multicolumn in last row.

\documentclass{article}
\usepackage{nicematrix}

\begin{document}
\[
\begin{bNiceMatrix}[first-row, last-row]
  \Block{1-2}{\text{test}}\\
  a & b\\
  c & d\\
  \multicolumn{2}{C}{\text{test}}
\end{bNiceMatrix}
\]
\end{document}
2
  • I have contacted the author. This feature will come soon in the next version.
    – ZhiyuanLck
    Jun 11 '20 at 16:17
  • @ZhiyuanLck I've also appended a possible improvement code. Jun 11 '20 at 16:39
2

The latest version of nicematrix (v 4.3 of 2020/06/12) solves that problem. It's now possible to use \Block in the last row. Moreover, the key code-for-first-row also applies in a \Block entirely in the first row and code-for-last-row applies in a \Block entirely in the last row.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.