I saw people use @{} in the array's environment at Align a linear program. I can understand that l means flush the array cell to left, but cannot understand what the purpose of @{} or find it in google. :-(

Could anyone help provide a link or some advice of where I can find the meaning of @{}?

Below is the array where they use the @{}.

\usepackage[paper size={10cm,5cm}]{geometry}
\text{minimize}  & \displaystyle\sum\limits_{j=1}^{m} w_{j}&x_{j} &\\
\text{subject to}& \displaystyle\sum\limits_{j:e_{i} \in S_{j}}   &x_{j} \geq 1,  &i=1 ,..., n\\
                 &                                                &x_{j} \in \{0,1\}, &j=1 ,..., m
  • 5
    It removes the default space between the two columns.
    – egreg
    Oct 16, 2014 at 14:43
  • 2
    Or in other words, replaces the space with nothing. You could use @{hello} as well.
    – Johannes_B
    Oct 16, 2014 at 14:45
  • 2
    For a example see tex.stackexchange.com/questions/195899/… (Admitted, it's an answer by me ;-))
    – user31729
    Oct 16, 2014 at 14:47
  • 1
    It's easier to see what it does if you use @{hello} Oct 16, 2014 at 15:00

3 Answers 3

  • @{command} defines the space before and after one column
  • !{command} defines what should be printed as vertical line

enter image description here

\begin{tabular}{@{dimen} c !{rule} c !{\vrule width 5pt}}\hline
foo & bar \\\hline

Instead of a space command in writes dimen directly before the entry foo. Instead of a vertical line it writes rule with space before and after. The right vertical line is set with a width of 5pt. However, something like @{} for no space before/after a column or @{\kern2em} for a space of 2em makes more sense :-)


@egreg has already addressed your main question in a comment: @{} suppresses the intercolumn whitespace anywhere it gets inserted, not only to the left of the first column and to the right of the final column.

I find that writing this particular group of equations using an array environment inside an equation* environment to be quite cumbersome. A more natural way, I believe, would be to use a gather* or an align* environment. In the code below, I suggest using an aligned environment, for the second and third line, nested inside a gather* environment; I don't think it serves much of a purpose to align all three rows.

Some fine points of mathematical typesetting:

  • Don't type ...; type \dots instead.
  • Don't type : inside a math expression; use \colon.
  • To avoid getting a lot of whitespace to the left and right of the second summation symbol, encase its subscript term in a \mathclap macro.

enter image description here

\text{minimize }\sum_{j=1}^{m} w_{j}x_{j}\\
\text{subject to }
\sum_{\mathclap{j\colon e_{i} \in S_{j}}}x_{j} \ge 1, &\quad i=1,\dots,n\\
x_j \in \{0{,}1\}, & \quad j=1,\dots,m

It is called @-expression, at least in this source, and is part of the standard table column specifier. It replaces the column separator with the content between { and }, in this case with nothing, which is useful to make very condensed tables, arrays, etc.

In your example it is used to reduce the distance between the summation sign and its operands.

You must log in to answer this question.

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