如何在一个地方删除所有表格第一列的 tabcolsep?

如何在一个地方删除所有表格第一列的 tabcolsep?

我想垂直对齐所有表格的第一列文本。我可以使用 \tabcolsep 进行更改,@{}但我如何在一个地方将其声明为默认值?

编辑:我在下面添加了一个 MWE。

第二次编辑:我根据您的评论修改了问题。感谢您澄清这确实不是缩进而是 tabcolsep。

\documentclass{article}
\begin{document}
This is some normal text. This is some normal text. This is some normal text. This is some normal text.\\
\begin{tabular}{@{}ll@{}}
    This is aligned with the text &abc\\
\end{tabular}
\newline
\begin{tabular}{ll}
    This is not aligned with the text   &abc\\
\end{tabular}
\end{document}

答案1

tblr使用我的新 LaTeX3 软件包环境,一切都变得非常简单tabularray,因为您可以使用命令来设置环境\SetTblrInner的默认样式。tblr

\documentclass{article}

\usepackage{tabularray}

\SetTblrInner{
  column{1} = {leftsep=0pt}
}

\begin{document}

This is some normal text. This is some normal text.
This is some normal text. This is some normal text.

\bigskip

\begin{tblr}{colspec={ll},hlines}
  This is aligned with the text & abc\\
\end{tblr}

\bigskip

\begin{tblr}{colspec={ll},hlines}
  This is also aligned with the text & abc\\
\end{tblr}

\end{document}

在此处输入图片描述

相关内容