我有一些代码(见下文)输出两个表格,如下所示。我怎样才能删除红色区域并使术语“nomenclature”像单词“contents”一样向左对齐?
\minitoc
\begin{table}[htbp]
\centering
%\begin{tabularx}{\textwidth}{| X | X | X |}
\begin{tabularx}{\textwidth}{sb}
%\hline
\large\textbf{Nomenclature} \normalsize & \\ \hline
0 & 2 \\
1 & 3 \\ \hline
\end{tabularx}
\end{table}
答案1
让我扩展我的评论来回答,其中包含两个如何编写表格的示例。示例采用 MWE(最小工作示例,一个完整的小文档)的形式,可以按原样编译:
\documentclass{article}
\usepackage{tabularray}
\usepackage{tabularx}
\begin{document}
with \verb+tabularx+:
\begin{table}[ht]
\setlength\extrarowheight{2pt}
\begin{tabularx}{\textwidth}{@{} X X @{}}
\hline
\large\textbf{Nomenclature} & \\
\hline
0 & 2 \\
1 & 3 \\
\hline
\end{tabularx}
\end{table}
with \verb+tabularray+:
\begin{table}[ht]
\begin{tblr}{hline{1,2,Z},
colspec = {@{} *{2}{X[l]} @{}},
row{1} = {font=\large\bfseries,abovesep+=2pt},
row{2-Z} = {rowsep=1pt}
}
Nomenclature & \\
0 & 2 \\
1 & 3 \\
\end{tblr}
\end{table}
\end{document}