# How to avoid this undesired horizontal space?

In the following output, why do I get the undesired space before the (, and how to get rid of it globally?
Here is my code:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
&a=b\\
&\left(a\right)=b
\end{align*}
\end{document}


-
There's no need to use \left and \right there; it's a good example of why they should be used only when necessary. Can you give a more realistic example? –  egreg Jan 12 at 18:49
@egreg this is just an example to show the space. –  Vahid Damanafshan Jan 12 at 19:06

The align enviroment always starts the second column (and all even numbered ones) with an empty object, because usually one starts these columns with a relation symbol and the empty object guarantees correct spacing.

The math mode spacing rules, however, tell that between an ordinary symbol (the empty object, in this case) and an Inner atom (the subformula delimited by \left and \right) a thin space is inserted.

This is a good example showing why \left and \right should not be used in general, but only when they really serve a purpose.

There is a workaround, anyway:

\documentclass{article}
\usepackage{amsmath,mleftright}
\begin{document}
\begin{align*}
&a=b\\
&\mleft(a\mright)=b
\end{align*}
\end{document}


This is however not a good reason to use indiscriminately \mleft and \mright. For instance,

$\mleft(\sum_{i=1}^{n} a_i\mright)$


is significantly worse than

$\biggl(\sum_{i=1}^{n} a_i\biggr)$


-
@egreg thanks, but in your MWE, there is still a thin space before the (! One more thing: Why is \mleft worse than \biggl? –  Vahid Damanafshan Jan 12 at 19:14
@egreg. I'm curious, you say your example with \mleft is significantly worse than that with \biggl. That's the opposite conclusion I was expecting from you (though I do agree with about not indiscriminately using \mleft). Do you care to explain why you feel your \mleft example is worse in your eyes? –  A.Ellett Jan 12 at 19:19
@VahidDamanafshan and A.Ellet I don't know if this is what he means, but in my case is worse because it doesn't look good (it's too bigger, in that case, and the correct size, to my eyes, is the second one, which has to be written manually). –  Manuel Jan 12 at 19:20
@VahidDamanafshan The tiny space is due to the shape of the parenthesis; just try without \mleft and \mright and you'll have the very same result. You can say \mleftright in the preamble; then \left will mean \mleft and \right will be \mright. –  egreg Jan 12 at 20:10
@A.Ellett I think that just looking at the two typeset formulas shows that the \biggl-\biggr version is better than the \left-\right one, which has too tall delimiters. –  egreg Jan 12 at 20:15