1

I have searched and found a solution to a problem I had here: Horizontal alignment, but now I have a follow-up question (and can't comment there because I have little reputation):

The code in the answer is

\usepackage{amsmath}
BEFORE
\begin{equation*}
\renewcommand\arraystretch{1.5} % mimic wider spacing of align environment
\begin{array}{@{} r@{}c@{}l @{}}
   V & \overset{\textnormal{def}}{=}     & R(\delta) \\
     & \overset{ \{ 1.2.3 \} }{=} & \delta(a) R(a)
\end{array}
\end{equation*}

and this looks nice. However, when I remove all the @{} things, it looks different:

AFTER
\begin{equation*}
\renewcommand\arraystretch{1.5}
\begin{array}{rcl}
   V & \overset{\textnormal{def}}{=}     & R(\delta) \\
     & \overset{ \{ 1.2.3 \} }{=} & \delta(a) R(a)
\end{array}
\end{equation*}

What do the @{} mean? Can you explain to me where the difference lies? I thought, only \begin{array}{rcl} would suffice to get the exact same output.

Picture:

Picture_of_Code

  • Between two columns there is always some space; with @{...} you tell LaTeX to place ... between the two columns, instead of the usual space. So @{} means: put nothing (not even the space). – egreg Jan 14 '16 at 14:17
3

It would be better to use an environment designed for aligning displayed equations such as align from amsmath (which would set the display in display math mode and put the right space around the =.

array is designed for matrices and sets its content in inline math mode and is not optimised for aligning a single equation.

\begin{array}{rcl}

means a three column table but each column has \tabcolsep space (padding) either side so there is 2\tabcolsep between each column. @{hello} replaces the tabcolsep by the supplied text so this would write hello in each row. so @{} has the effect of removing the 2\tabcolsep space.

So r@{}c@{}l gives tighter spacing but neither gives the same space as an = normally gets in infix position compare with

\begin{align*}
   V & \overset{\mathrm{def}}{=}      R(\delta) \\
     & \overset{ \{ 1.2.3 \} }{=}  \delta(a) R(a)
\end{align*}
| improve this answer | |
  • Wonderful. I did not use align because even though it's what I originally wanted to use, I wanted both the equal signs to be aligned vertically while not leaving too much space to their left and right. Searching for similar questions here led me to the answer which I followed up with my question. – Manuel Jan 14 '16 at 14:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.