如何更改表格環境中行號的縮排?

如何更改表格環境中行號的縮排?

我使用表格來對齊數字,基本上回答選擇。每行都編號為(A)、(B)等。

\newcounter{ans}
\renewcommand\theans{\Alph{ans}}
\newcommand\anslabel{(\theans)}

\setcounter{ans}{0}
\begin{tabular}{@{}>{\stepcounter{ans}(\theans)}lrr@{.}l}
&$-2$ \\
&$-1$ \\
&$0.8$ \\
&$1$ \\
&$2.3$ \\
\end{tabular}

答案1

請經常發帖完全的顯示所有使用的包的文檔。由於您正在使用,我還在序言中array插入了,因此第二列是數學模式。刪除預設的列間空間,在本例中我將其替換為$@{}\hspace{1pt}

在此輸入影像描述

\documentclass{article}

\usepackage{array}
\newcounter{ans}
\renewcommand\theans{\Alph{ans}}
\newcommand\anslabel{(\theans)}

\begin{document}

\setcounter{ans}{0}
\begin{tabular}{
@{}>{\stepcounter{ans}(\theans)}l
@{\hspace{1pt}}>{$}r<{$}
r@{.}l
}
&-2 \\
&-1 \\
&0.8 \\
&1 \\
&2.3
\end{tabular}

\end{document}

相關內容