3

What is the meaning of @{} in the following tabular declaration ?

\begin{tabular} { @{} l@{} } 

\end{tabular}

For instance, to have some lines of text, I use

\documentclass[a4paper,12pt]{article}

\ExplSyntaxOn

\NewDocumentEnvironment {ditura} { }

  {
    \begin {flushright}
      \begin{tabular} { @{} l@{} }
  }

  {
      \end{tabular}
    \end {flushright}}
  }

\ExplSyntaxOff

\begin {document}

\begin {ditura}
  Likku Cirillu \\
  Puppi Grillu
\end {ditura}

\end {document}
6
  • 1
    Note: The syntax is actualy @{...} where ... can be anything in horizontal mode, e.g. \hspace{1cm}, my text, etc. ... will be inserted in between the columns, replacing the default space of 2\tabcolsep (each adjacent column of a separation contributes one \tabcolsep.
    – Gargantuar
    Commented May 25 at 18:45
  • Off-topic: \ExplSyntaxOn \ExplSyntaxOff are not necessary in your case.
    – Gargantuar
    Commented May 25 at 18:46
  • Somewhat off-topic: why do you have a one column tabular?
    – Teepeemm
    Commented May 25 at 19:16
  • @Gargantuar well, without \ExplSyntaxOn \ExplSyntaxOff there would be several spaces hanging around...
    – Rmano
    Commented May 25 at 19:19
  • One column tabular to have a set of lines all aligned to the left and printed on the right side of a page. But perhaps there is a better implementation ?
    – Bulldrive
    Commented May 25 at 20:21

1 Answer 1

6

In a tabular, @{} suppresses column padding(1) (let's call it pad) and substitutes it with its argument. In a tabular, if you have n columns c₁ c₂ it will use "pad c₁ pad pad c₂ pad" when typesetting.

Try:

\documentclass{article}
\usepackage[T1]{fontenc}

\begin{document}
|\begin{tabular} { l }
    one \\ two \\
\end{tabular}|
|\begin{tabular} { l l }
    one & one\\ two & two\\
\end{tabular}|

|\begin{tabular} { @{} l@{} }
    one \\ two \\
\end{tabular}|
|\begin{tabular} { @{} l @{} l @{}}
    one & one\\ two & two\\
\end{tabular}|


|\begin{tabular} { @{A} l@{B} }
    one \\ two \\
\end{tabular}|
\end{document}

output generated by the code above

(1) Thanks to @Mico's comment

10
  • What is an intercolumn space? I want to have one column. Why does one need two @{} ?
    – Bulldrive
    Commented May 25 at 18:37
  • 2
    because there is space before and after a column. Commented May 25 at 18:39
  • Does this mean that there is one table with one column, with no spacing before and after the single column ? Why does one do l@{} on the second ?
    – Bulldrive
    Commented May 25 at 18:47
  • 4
    @Bulldrive yes this is very basic syntax it should be in any latex tutorial such as learnlatex.org/en/lesson-08 Commented May 25 at 21:06
  • 1
    @Bulldrive - The term "inter-column whitespace" may have thrown you off. If so, the term "whitespace padding" may be more helpful. By default, LaTeX inserts whitespace (in the amount given by the parameter \tabcolsep) on both sides of each and every column. As a result, by default, there's whitespace padding in the amount of \tabcolsep to the left of the first column and to the right of the final column, and 2\tabcolsep of whitespace between columns. Hence, {@{} cc @{}} means "no whitespace padding at the tabular's edges and normal whitespace padding between columns 1 and 2".
    – Mico
    Commented May 25 at 23:25

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