Summary of Error
I am trying to use nicematrix in a AASTeX v6.3.1 LaTeX document. However, I get several errors such as "Missing number, treated as zero."
Any suggestions on how I can use nicematrix with AAStex?
Tex file using AASTex
\documentclass[ApJL,twocolumn]{aastex631}
\usepackage{aas_macros}
% \documentclass{article}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{bm}
\usepackage{nicematrix}
\begin{document}
\begin{table}[]
\centering
\begin{NiceTabular}{cc}
\hline
Writer & \Block[l]{}{year\\ of birth} \\
\hline
Hugo & 1802 \\
Balzac & 1799 \\
\hline
\end{NiceTabular}
\end{table}
\end{document}
Error log summary
main.tex, 18
Package array Error: Illegal pream-token ([): `c' used.
main.tex, 23
Missing number, treated as zero.
main.tex, 23
Illegal unit of measure (pt inserted).
main.tex, 23
Missing number, treated as zero.
main.tex, 23
Illegal unit of measure (pt inserted).
Tex file without AASTex
% \documentclass[ApJL,twocolumn]{aastex631}
% \usepackage{aas_macros}
\documentclass{article}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{bm}
\usepackage{nicematrix}
\begin{document}
\begin{table}[]
\centering
\begin{NiceTabular}{cc}
\hline
Writer & \Block[l]{}{year\\ of birth} \\
\hline
Hugo & 1802 \\
Balzac & 1799 \\
\hline
\end{NiceTabular}
\end{table}
\end{document}
Best Answer
The latest version of
nicematrix
(v. 6.2 of 2021-09-09) is compatible with the classaastex631
.More precisely, that version is compatible with the class
revtex-4.1
which is used byaastex631
(even thoughrevtex-4.1
is obsolete and should be replaced byrevtex-4.2
). The classrevtex-4.1
redefines{array}
(of the eponymous package) andnicematrix
(in the latest version) adds code to come back to the standard definition ofarray
before using{array}
.However, there are, in fact, some lines of code to add in the preamble when using
nicematrix
withaastex631
:Here is an example.