2

I have two formulas in an align environment, and the second one starts with a bracket (this particular example is simplified):

\begin{align}
& x_\alpha(s) x_\alpha(t) \\
& \left[ x_\alpha(s),  x_\beta(t) \right]
\end{align}

The result is terrible, apparently because of the spacing before the bracket:

Standard

Since I can't put an alignment point between the brackets, I tried to put a phantom of a bracket in the beginning of the first line as follows:

\begin{align}
& \phantom{\left[{}\vphantom{x_\beta(t)}\right.}
  x_\alpha(s) x_\alpha(t) \\
& \left[ x_\alpha(s),  x_\beta(t)\right]
\end{align}

The result is better, but still not perfect (my trick did not work as I expected):

With a phantom

So how can I achieve the perfect alignment?

Update. By the "perfect alignment" I mean that the upper x stands straight above the lower one:

Perfect

Andrei Smolensky
  • 681
  • 4
  • 11
  • 1
    Consider totally dropping the left right constructions and use the manual scallers, then you can align inside. – daleif Aug 01 '15 at 10:41

3 Answers3

5

enter image description here

\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}

\begin{align}
& \left. x_\alpha(s) x_\alpha(t)\right . \\
& \left[ x_\alpha(s),  x_\beta(t)\right]
\end{align}

\end{document}

Just putting a virtual bracket (\left.) will do the trick, because \left. and \left[ should have the same spacing.

If you like the following alignment,

enter image description here

then, you can use the following (also pointed out by @daleif):

\begin{align}
& x_\alpha(s) x_\alpha(t) \\
& \bigl[ x_\alpha(s),x_\beta(t)\bigr]
\end{align}

Update

Aligning at the x's as per the OP's request:

\begin{align}
       & x_\alpha(s) x_\alpha(t) \\
\bigl[ & x_\alpha(s),x_\beta(t) \bigr]
\end{align}

enter image description here

Remark

Mathematicians often prefer the outer fences being just as tall as the tallest inner object excluding the exponents. As such, I personally prefer dropping all \lefts or \rights and just putting only the brackets [ (assuming no tall objects exist) like this:

\begin{align}
 & x_\alpha(s) x_\alpha(t) \\
[& x_\alpha(s),x_\beta(t)]
\end{align}

enter image description here

AboAmmar
  • 46,352
  • 4
  • 58
  • 127
1

One more solution:

\begin{align}
      x_\alpha(s)       & x_\alpha(t) \\
\left[x_\alpha(s)\right.&,\left.x_\beta(t) \right]
\end{align}

enter image description here

Zarko
  • 296,517
1

I have found a way to do this while not throwing away the \left[ command, thank to this answer. It goes like this (perhaps my code is too complicated and can be simplified):

\begin{align}
& \hphantom{ \left[ \vphantom{\dfrac{ABCD}{EFGH}} \right.\kern\nulldelimiterspace }
  x_\alpha(s) x_\alpha(t) \\
& \left[ x_\alpha(s), \dfrac{ABCD}{EFGH}\right]
\end{align}

Although looking promising, the mathopen and mathclose commands suggested by the other answers to the question in the link above do not solve the problem.

Andrei Smolensky
  • 681
  • 4
  • 11
  • If the other answers "do not solve the problem", then maybe the problem wasn't stated clearly enough? – Mico Aug 01 '15 at 12:21