4

The sample codes:

\documentclass{article}
\usepackage{nicematrix}
\begin{document}
\noindent
\begin{NiceTabular*}{\textwidth}{XX}[hvlines]
    X & X \\
\end{NiceTabular*}
\end{document}

The output: enter image description here

I replace {XX} by {CC}, and the output:

enter image description here

5
  • When I compile your MWE, I get this error message: ./nm.tex:6: Fatal Package nicematrix Error: The column type 'X' in your environ ment (nicematrix) {NiceTabular*} is unknown. (nicematrix) This error is fatal. So the error is not the definition of the width of the table, but the wrong indication of the position of the content.
    – C. Peters
    Commented Jul 29, 2021 at 8:05
  • I tested again. I didn't get the column type 'X' error message, but some overfull \hbox messages. The nicematrix version is 5.19. Commented Jul 29, 2021 at 8:20
  • And what does happen if you replace {XX} for example by {cc}?
    – C. Peters
    Commented Jul 29, 2021 at 8:23
  • I added the output with replace {XX} by {CC} in the question. Commented Jul 29, 2021 at 8:31
  • The TS-program I used is XeLaTeX. Commented Jul 29, 2021 at 8:34

2 Answers 2

6

The latest version of nicematrix (6.0 of 2021-08-10) provides an environment {NiceTabularX} similar to the classical environment {tabularx} of the package tabularx.

\documentclass{article}
\usepackage{nicematrix}
\begin{document}
\noindent
\begin{NiceTabularX}{\textwidth}{XX}[hvlines]
    X & X \\
\end{NiceTabularX}
\end{document}

Output of the above code

7

{NiceTabular*} is not equivalent to {tabularx} (of the eponymous package) but to the standard {tabular*} (certainly less efficient). So, there is no X column in {NiceTabular*}.

\documentclass{article}
\setlength{\parindent}{0pt}
\usepackage{nicematrix}
\usepackage{lipsum}

\begin{document}

\lipsum[1]

\begin{NiceTabular*}{\linewidth}{@{\extracolsep{\fill}}ccccc}
one & two & three & four & five \\
six & seven & eight & nine & ten \\
eleven & twelve & thirteen & fourteen & fifteen
\end{NiceTabular*}

\end{document}

Output of the above code

1
  • I got it. Thank you very much! Commented Jul 31, 2021 at 13:20

You must log in to answer this question.

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