我在使用latex绘制表格时想通过直接添加[1.5pt]
来修改表格线宽:
\begin{table}[ht]
\centering
\begin{tabular}{lcc}
\toprule[1.5pt] % 调整顶部线的宽度
\textbf{Item} & \textbf{Quantity} & \textbf{Price} \\
\midrule[0.8pt] % 调整中部线的宽度
Apples & 10 & \$1.50 \\
Oranges & 5 & \$2.00 \\
Bananas & 7 & \$1.20 \\
\bottomrule[1.2pt] % 调整底部线的宽度
\end{tabular}
\caption{Sample Three-Line Table with Custom Line Widths}
\label{tab:sample}
\end{table}
在一个文档中没有问题,的确调整了线宽,如下图所示
但是在另一个文档中使用类似的代码,却出现只有底部的线宽被调整,顶部和中间的线宽没被调整,参数[1.5pt]
被当做表格内容了
造成这种情况出现可能的原因
在某些情况下,特定的 LaTeX 发行版或者特定的文档类可能会扩展 booktabs