我可能错了,但 nicematrix 包似乎不再像以前那样工作了。以下代码的输出没有任何彩色行,并给出了几条错误消息。
\documentclass[xcolor=table]{beamer}
\usepackage{amsmath,nicematrix}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{frame}{Test 1}
\begin{NiceTabular}{clr}[hvlines]
\CodeBefore
\rowcolors[gray]{2}{0.8}{}[cols=2-3,restart]
\Body
\Block{1-*}{Results} \\
John & 12 \\
Stephen & 8 \\
Sarah & 18 \\
Ashley & 20 \\
Henry & 14 \\
Madison & 15
\end{NiceTabular}
\end{frame}
\begin{frame}{Test 2}
$\begin{pNiceMatrix}[columns-width = 20pt,margin=5pt,cell-space-limits = 10pt]
\phantom{} & I & II & III & IV \\
A & 15 & 3 & 30 & 20 \\
B & 20 & 2 & 20 & 30\\
C & 40 & 20 & 10 & 40 \\
D & 5 & 30 & 40 & 40
\CodeAfter\SubMatrix({2-2}{5-5})
\end{pNiceMatrix}$
\end{frame}
\end{document}