Firstly, sorry for my english level, I'm French.
Secondly, I've read eqnarray
environment becomes obsolete, and we have to replace this by align
. Ok, but it's not satisfying for me. I explain :
\documentclass[12pt]{article}
\usepackage{amsmath,amsfonts,amssymb} % Tableaux, maths
\usepackage[frenchb]{babel}
\usepackage[top=1.5cm,bottom=1.5cm,right=1.5cm,left=1.5cm]{geometry} % Marges
\begin{document}
\begin{eqnarray*}
Test~eqnarray* & = & \text{Good alignment} \\
& Because & \text{the text is aligned near to the equal sign}
\end{eqnarray*}
\end{document}
With the environment align
\documentclass[12pt]{article}
\usepackage{amsmath,amsfonts,amssymb} % Tableaux, maths
\usepackage[frenchb]{babel}
\usepackage[top=1.5cm,bottom=1.5cm,right=1.5cm,left=1.5cm]{geometry} % Marges
\begin{document}
\begin{align*}
Test~align* & = & \text{Bad alignment} \\
& Because & \text{the text is right-aligned, far to the equal sign}
\end{align*}
\end{document}
gives :
How can I obtain absolutly the same results as eqnarray
with align
?
Note : I don't care the spacing problem with eqnarray
\begin{align*} Test~align* & = \text{Bad alignment} \\ & = \text{Because the text is aligned near to the equal sign} \end{align*}
OK for you or do you want the excessive space around the equal sign?Because
with=
eqnarray*
example to show that as well. At first glance your question read as if you wanted to align two=
s.=
(centered) and the text after (left-aligned)\begin{align*} Test~align* & = \text{Bad alignment} \\ & = \text{Because the text is aligned near to the equal sign} \end{align*}
do more or less that if both lines contain a=
? If not, then the alignment would be different, of course.