2

I'm using tabular to align numbers, answer choices basically. Each row is numbered (A), (B), etc. Is there any way to decrease the space between the row label and the first column?

\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}
4
  • 1
    change lrr to l@{\hspace{0cm}}rr Commented Apr 4, 2013 at 19:14
  • why has your table got 4 columns declared but you only use 2? Commented Apr 4, 2013 at 19:15
  • @GonzaloMedina thanks (I was in time to correct the comment:-) Commented Apr 4, 2013 at 19:18
  • Hm, I tried your suggestion and it gives me the erorr ! Use of \@@array doesn't match its definition. I'm using four columns because I'm using the same tabular environment multiple times (some of which need four columns).
    – ekrah
    Commented Apr 4, 2013 at 19:25

1 Answer 1

3

Please always post complete documents showing all packages used. Since you are using array I also inserted the $ in the preamble so the second column is math mode. @{} removes the default inter column space, and in this example I have replaced it with \hspace{1pt}

enter image description here

\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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .