您好,我正在做一项作业,我在一个名为 table.tex 的文件中创建了一张表,如下所示:
\documentclass{article}
\usepackage{nicematrix}
\begin{document}
\begin{table}[htbp]
\centering
\begin{NiceTabular}{|X|X|X[2]|}[hlines]
\textbf{Attribute} & \textbf{Possible Values} & \textbf{Description} \\
Class & DIE,ALIVE & Whether patient survived disease or not \\
AGE & 10, 20, 30, 40, 50, 60, 70, 80 & Age of patient \\
SEX & male, female & Binary gender of patient \\
ANTIVIRALS & no, yes & Whether patient was given steroids \\
FATIGUE & no, yes & Whether patient presented fatigue as a symptom \\
MALAISE & no, yes & Whether a patient presented malaise as a symptom \\
ANOREXIA & no, yes & Whether patient suffered from anorexia when they got hepatitis \\
LIVER BIG & no, yes & Whether the size of the liver of the patient is big \\
\end{NiceTabular}
\end{table}
\end{document}
因此,此代码在单独的 .tex 文件中运行,但是当我尝试将其复制并粘贴到我的 main.tex 中时,出现以下错误: 致命的软件包 nicematrix 错误:您的环境中的列类型为“2” 我真的不明白为什么会出现这种情况,因为代码是在单独的文件上运行的。有人能帮帮我吗?
我也考虑过将其打印到单独的文件中,然后从那里将其添加到主文件中,但我不确定我这样做是否正确。提前致谢!