4

There seems to be a small left indent to a tabular enviroment, which offsets the left margin of the tabular (first column) from the left margin of the enclosing paragraph.

I would like to know how to supress this indent.

Here is a minimal example:

\documentclass{article}

\begin{document}

\section*{Test}
\noindent
Some text

\noindent
\begin{tabular}{ll}
        abc \\
        cbd
\end{tabular}
\end{document} 

This produces

enter image description here

I did see this earlier question: Aligned column text with the title of the section, which works (replace \begin{tabular}{ll} with \hspace{-6pt}\begin{tabular}{ll} in my example) but I need to iteratively tailor the negative hspace value (e.g., I seem to need -6pt, whereas the answer states -9pt).

Is there a more general adjustment I can make?

1 Answer 1

8

The tabular environment enforces some default separation spacing between columns. You can suppress the separator between two columns (or before the first column and after the last) by suitably adding an @{} in the column specification argument. More generally, whatever (even nonempty) argument you provide to @ will be used as column separator. Note that the same syntax works for math array as well.

\documentclass{article}

\begin{document}

\section*{Test}
\noindent
Some text

\noindent
\begin{tabular}{@{}ll} % <--- added @{} before the first column
        abc \\
        cbd
\end{tabular}

\noindent
You can also put a nonempty argument:

\noindent
\begin{tabular}[b]{@{}r@{: }l}
    Apple & fruit \\
    Cabbage & vegetable
\end{tabular}
\end{document}

Output of MWE

1
  • 1
    Fantastic, thank you that does the trick :-)
    – Blair
    Oct 31, 2023 at 20:15

You must log in to answer this question.

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