Substitute for eqnarray?











up vote
6
down vote

favorite












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}


gives this :



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 :



enter image description here



How can I obtain absolutly the same results as eqnarray with align ?



Note : I don't care the spacing problem with eqnarray










share|improve this question
























  • Is 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?
    – moewe
    17 hours ago










  • No the spacing is ok here, but as said below, I want to aligne Because with =
    – Alex
    16 hours ago










  • In that case it might make sense to change the eqnarray* example to show that as well. At first glance your question read as if you wanted to align two =s.
    – moewe
    16 hours ago










  • I want to align both = (centered) and the text after (left-aligned)
    – Alex
    16 hours ago










  • But doesn't 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.
    – moewe
    16 hours ago















up vote
6
down vote

favorite












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}


gives this :



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 :



enter image description here



How can I obtain absolutly the same results as eqnarray with align ?



Note : I don't care the spacing problem with eqnarray










share|improve this question
























  • Is 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?
    – moewe
    17 hours ago










  • No the spacing is ok here, but as said below, I want to aligne Because with =
    – Alex
    16 hours ago










  • In that case it might make sense to change the eqnarray* example to show that as well. At first glance your question read as if you wanted to align two =s.
    – moewe
    16 hours ago










  • I want to align both = (centered) and the text after (left-aligned)
    – Alex
    16 hours ago










  • But doesn't 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.
    – moewe
    16 hours ago













up vote
6
down vote

favorite









up vote
6
down vote

favorite











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}


gives this :



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 :



enter image description here



How can I obtain absolutly the same results as eqnarray with align ?



Note : I don't care the spacing problem with eqnarray










share|improve this question















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}


gives this :



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 :



enter image description here



How can I obtain absolutly the same results as eqnarray with align ?



Note : I don't care the spacing problem with eqnarray







align eqnarray






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 16 hours ago

























asked 17 hours ago









Alex

677




677












  • Is 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?
    – moewe
    17 hours ago










  • No the spacing is ok here, but as said below, I want to aligne Because with =
    – Alex
    16 hours ago










  • In that case it might make sense to change the eqnarray* example to show that as well. At first glance your question read as if you wanted to align two =s.
    – moewe
    16 hours ago










  • I want to align both = (centered) and the text after (left-aligned)
    – Alex
    16 hours ago










  • But doesn't 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.
    – moewe
    16 hours ago


















  • Is 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?
    – moewe
    17 hours ago










  • No the spacing is ok here, but as said below, I want to aligne Because with =
    – Alex
    16 hours ago










  • In that case it might make sense to change the eqnarray* example to show that as well. At first glance your question read as if you wanted to align two =s.
    – moewe
    16 hours ago










  • I want to align both = (centered) and the text after (left-aligned)
    – Alex
    16 hours ago










  • But doesn't 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.
    – moewe
    16 hours ago
















Is 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?
– moewe
17 hours ago




Is 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?
– moewe
17 hours ago












No the spacing is ok here, but as said below, I want to aligne Because with =
– Alex
16 hours ago




No the spacing is ok here, but as said below, I want to aligne Because with =
– Alex
16 hours ago












In that case it might make sense to change the eqnarray* example to show that as well. At first glance your question read as if you wanted to align two =s.
– moewe
16 hours ago




In that case it might make sense to change the eqnarray* example to show that as well. At first glance your question read as if you wanted to align two =s.
– moewe
16 hours ago












I want to align both = (centered) and the text after (left-aligned)
– Alex
16 hours ago




I want to align both = (centered) and the text after (left-aligned)
– Alex
16 hours ago












But doesn't 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.
– moewe
16 hours ago




But doesn't 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.
– moewe
16 hours ago










2 Answers
2






active

oldest

votes

















up vote
7
down vote



accepted










You have to understand that in align and similar amsmath environments, if you want n alignment groups, each group except the first requires 2 ampersands: the first & introduces a new alignment group, and the second & specifies the alignment point inside this group. The first group doesn't require the first ampersand, of course, so n alignment groups in all require 2 n – 1 &s.



You have used the eqnarray syntax, with two &, so amsmath understands there are two groups. As there's no & for the alignment point in the second group, it is aligned on the last characters of each line.



Added:



An easy solution to your problem is obtained with the eqparbox package. Incidentally, I simplified your code for geometry (since all your margins are equal you can simply set margin =). Also, the frenchb option is ibsolete, and should be replaced with french, preferable loaded with the documentclass, so that all language-dependent packages be informed. Lastn needless to load amsfonts, since amssymb does it for you.



documentclass[12pt, french]{article}
usepackage{amsmath,amssymb} % Tableaux, maths
usepackage{babel}
usepackage[margin=1.5cm]{geometry} % Marges
usepackage{eqparbox}
newcommand{eqrel}[2][B]{mathrel{eqmakebox[#1]{#2}}} %% eqparbox uses a system of tags, which is the optional argument here – defaults to B.

begin{document}

begin{align*}
emph{Test~align*} &eqrel{$=$} text{Bad alignment} \
&eqrel{em Because} text{the text is left-aligned, near the equal sign}
end{align*}

end{document}


enter image description here






share|improve this answer























  • Ok thank you it's interesting, even if I don't success to have that I want for now
    – Alex
    16 hours ago










  • You want because to be aligned with the = sign?
    – Bernard
    16 hours ago










  • Yes, and the text in the first line left-aligned with the text in the second line (see my changed MWE)
    – Alex
    16 hours ago










  • It is a solution yes, not very practical but I can enumerate my equations. Thank you for your help
    – Alex
    15 hours ago










  • I've defined an, eqrel command to simplify typing.
    – Bernard
    15 hours ago


















up vote
6
down vote













in align you have one ampersand to much:



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*}
or
begin{align*}
Test~align* & = text{Bad alignment} \
& text{Because the text is right-aligned, far to the equal sign}
end{align*}
or
begin{align*}
Test~align* & = parbox[t]{0.4linewidth}{
Bad alignment \
Because the text is right-aligned, far to the equal sign}
end{align*}
end{document}


enter image description here



adedndum:
apparently you looking for the following:



enter image description here



documentclass[12pt]{article}
usepackage{amsmath}

begin{document}
[setlengtharraycolsep{2pt}
begin{array}{rcl}
Test~array & = & text{Fine alignment}\
& Because & text{the text is left-aligned dots}
end{array}
]
end{document}


addendum (2):
with help of very old (and almost forgotten) package mathenv from mfwtools:



documentclass[12pt]{article}
usepackage{amsmath}
usepackage{mathenv}
usepackage[frenchb]{babel}
usepackage[top=1.5cm,bottom=1.5cm,right=1.5cm,left=1.5cm]{geometry} % Marges

begin{document}
begin{eqnarray}[rc@{;}l]
Test~eqnarray & = & text{Good alignment} \
& Because & text{the text is aligned near to the equal sign}
end{eqnarray}
end{document}


enter image description here






share|improve this answer























  • Thank you, but I want Because to be aligned with =. Is this possible ?
    – Alex
    16 hours ago










  • @Alex, of course. you just need to place ampersand before Because if you like to have it below right text
    – Zarko
    16 hours ago












  • Sorry, I've changed my MWE to reveal better that I want
    – Alex
    16 hours ago










  • @Alex, this is not possible to achieve with align, but with array is simple. see addendum to answer.
    – Zarko
    16 hours ago










  • Yes it's perfect. But I can't enumerate my equations if necessary... Can I ?
    – Alex
    16 hours ago











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f463817%2fsubstitute-for-eqnarray%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
7
down vote



accepted










You have to understand that in align and similar amsmath environments, if you want n alignment groups, each group except the first requires 2 ampersands: the first & introduces a new alignment group, and the second & specifies the alignment point inside this group. The first group doesn't require the first ampersand, of course, so n alignment groups in all require 2 n – 1 &s.



You have used the eqnarray syntax, with two &, so amsmath understands there are two groups. As there's no & for the alignment point in the second group, it is aligned on the last characters of each line.



Added:



An easy solution to your problem is obtained with the eqparbox package. Incidentally, I simplified your code for geometry (since all your margins are equal you can simply set margin =). Also, the frenchb option is ibsolete, and should be replaced with french, preferable loaded with the documentclass, so that all language-dependent packages be informed. Lastn needless to load amsfonts, since amssymb does it for you.



documentclass[12pt, french]{article}
usepackage{amsmath,amssymb} % Tableaux, maths
usepackage{babel}
usepackage[margin=1.5cm]{geometry} % Marges
usepackage{eqparbox}
newcommand{eqrel}[2][B]{mathrel{eqmakebox[#1]{#2}}} %% eqparbox uses a system of tags, which is the optional argument here – defaults to B.

begin{document}

begin{align*}
emph{Test~align*} &eqrel{$=$} text{Bad alignment} \
&eqrel{em Because} text{the text is left-aligned, near the equal sign}
end{align*}

end{document}


enter image description here






share|improve this answer























  • Ok thank you it's interesting, even if I don't success to have that I want for now
    – Alex
    16 hours ago










  • You want because to be aligned with the = sign?
    – Bernard
    16 hours ago










  • Yes, and the text in the first line left-aligned with the text in the second line (see my changed MWE)
    – Alex
    16 hours ago










  • It is a solution yes, not very practical but I can enumerate my equations. Thank you for your help
    – Alex
    15 hours ago










  • I've defined an, eqrel command to simplify typing.
    – Bernard
    15 hours ago















up vote
7
down vote



accepted










You have to understand that in align and similar amsmath environments, if you want n alignment groups, each group except the first requires 2 ampersands: the first & introduces a new alignment group, and the second & specifies the alignment point inside this group. The first group doesn't require the first ampersand, of course, so n alignment groups in all require 2 n – 1 &s.



You have used the eqnarray syntax, with two &, so amsmath understands there are two groups. As there's no & for the alignment point in the second group, it is aligned on the last characters of each line.



Added:



An easy solution to your problem is obtained with the eqparbox package. Incidentally, I simplified your code for geometry (since all your margins are equal you can simply set margin =). Also, the frenchb option is ibsolete, and should be replaced with french, preferable loaded with the documentclass, so that all language-dependent packages be informed. Lastn needless to load amsfonts, since amssymb does it for you.



documentclass[12pt, french]{article}
usepackage{amsmath,amssymb} % Tableaux, maths
usepackage{babel}
usepackage[margin=1.5cm]{geometry} % Marges
usepackage{eqparbox}
newcommand{eqrel}[2][B]{mathrel{eqmakebox[#1]{#2}}} %% eqparbox uses a system of tags, which is the optional argument here – defaults to B.

begin{document}

begin{align*}
emph{Test~align*} &eqrel{$=$} text{Bad alignment} \
&eqrel{em Because} text{the text is left-aligned, near the equal sign}
end{align*}

end{document}


enter image description here






share|improve this answer























  • Ok thank you it's interesting, even if I don't success to have that I want for now
    – Alex
    16 hours ago










  • You want because to be aligned with the = sign?
    – Bernard
    16 hours ago










  • Yes, and the text in the first line left-aligned with the text in the second line (see my changed MWE)
    – Alex
    16 hours ago










  • It is a solution yes, not very practical but I can enumerate my equations. Thank you for your help
    – Alex
    15 hours ago










  • I've defined an, eqrel command to simplify typing.
    – Bernard
    15 hours ago













up vote
7
down vote



accepted







up vote
7
down vote



accepted






You have to understand that in align and similar amsmath environments, if you want n alignment groups, each group except the first requires 2 ampersands: the first & introduces a new alignment group, and the second & specifies the alignment point inside this group. The first group doesn't require the first ampersand, of course, so n alignment groups in all require 2 n – 1 &s.



You have used the eqnarray syntax, with two &, so amsmath understands there are two groups. As there's no & for the alignment point in the second group, it is aligned on the last characters of each line.



Added:



An easy solution to your problem is obtained with the eqparbox package. Incidentally, I simplified your code for geometry (since all your margins are equal you can simply set margin =). Also, the frenchb option is ibsolete, and should be replaced with french, preferable loaded with the documentclass, so that all language-dependent packages be informed. Lastn needless to load amsfonts, since amssymb does it for you.



documentclass[12pt, french]{article}
usepackage{amsmath,amssymb} % Tableaux, maths
usepackage{babel}
usepackage[margin=1.5cm]{geometry} % Marges
usepackage{eqparbox}
newcommand{eqrel}[2][B]{mathrel{eqmakebox[#1]{#2}}} %% eqparbox uses a system of tags, which is the optional argument here – defaults to B.

begin{document}

begin{align*}
emph{Test~align*} &eqrel{$=$} text{Bad alignment} \
&eqrel{em Because} text{the text is left-aligned, near the equal sign}
end{align*}

end{document}


enter image description here






share|improve this answer














You have to understand that in align and similar amsmath environments, if you want n alignment groups, each group except the first requires 2 ampersands: the first & introduces a new alignment group, and the second & specifies the alignment point inside this group. The first group doesn't require the first ampersand, of course, so n alignment groups in all require 2 n – 1 &s.



You have used the eqnarray syntax, with two &, so amsmath understands there are two groups. As there's no & for the alignment point in the second group, it is aligned on the last characters of each line.



Added:



An easy solution to your problem is obtained with the eqparbox package. Incidentally, I simplified your code for geometry (since all your margins are equal you can simply set margin =). Also, the frenchb option is ibsolete, and should be replaced with french, preferable loaded with the documentclass, so that all language-dependent packages be informed. Lastn needless to load amsfonts, since amssymb does it for you.



documentclass[12pt, french]{article}
usepackage{amsmath,amssymb} % Tableaux, maths
usepackage{babel}
usepackage[margin=1.5cm]{geometry} % Marges
usepackage{eqparbox}
newcommand{eqrel}[2][B]{mathrel{eqmakebox[#1]{#2}}} %% eqparbox uses a system of tags, which is the optional argument here – defaults to B.

begin{document}

begin{align*}
emph{Test~align*} &eqrel{$=$} text{Bad alignment} \
&eqrel{em Because} text{the text is left-aligned, near the equal sign}
end{align*}

end{document}


enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited 14 hours ago

























answered 16 hours ago









Bernard

163k769192




163k769192












  • Ok thank you it's interesting, even if I don't success to have that I want for now
    – Alex
    16 hours ago










  • You want because to be aligned with the = sign?
    – Bernard
    16 hours ago










  • Yes, and the text in the first line left-aligned with the text in the second line (see my changed MWE)
    – Alex
    16 hours ago










  • It is a solution yes, not very practical but I can enumerate my equations. Thank you for your help
    – Alex
    15 hours ago










  • I've defined an, eqrel command to simplify typing.
    – Bernard
    15 hours ago


















  • Ok thank you it's interesting, even if I don't success to have that I want for now
    – Alex
    16 hours ago










  • You want because to be aligned with the = sign?
    – Bernard
    16 hours ago










  • Yes, and the text in the first line left-aligned with the text in the second line (see my changed MWE)
    – Alex
    16 hours ago










  • It is a solution yes, not very practical but I can enumerate my equations. Thank you for your help
    – Alex
    15 hours ago










  • I've defined an, eqrel command to simplify typing.
    – Bernard
    15 hours ago
















Ok thank you it's interesting, even if I don't success to have that I want for now
– Alex
16 hours ago




Ok thank you it's interesting, even if I don't success to have that I want for now
– Alex
16 hours ago












You want because to be aligned with the = sign?
– Bernard
16 hours ago




You want because to be aligned with the = sign?
– Bernard
16 hours ago












Yes, and the text in the first line left-aligned with the text in the second line (see my changed MWE)
– Alex
16 hours ago




Yes, and the text in the first line left-aligned with the text in the second line (see my changed MWE)
– Alex
16 hours ago












It is a solution yes, not very practical but I can enumerate my equations. Thank you for your help
– Alex
15 hours ago




It is a solution yes, not very practical but I can enumerate my equations. Thank you for your help
– Alex
15 hours ago












I've defined an, eqrel command to simplify typing.
– Bernard
15 hours ago




I've defined an, eqrel command to simplify typing.
– Bernard
15 hours ago










up vote
6
down vote













in align you have one ampersand to much:



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*}
or
begin{align*}
Test~align* & = text{Bad alignment} \
& text{Because the text is right-aligned, far to the equal sign}
end{align*}
or
begin{align*}
Test~align* & = parbox[t]{0.4linewidth}{
Bad alignment \
Because the text is right-aligned, far to the equal sign}
end{align*}
end{document}


enter image description here



adedndum:
apparently you looking for the following:



enter image description here



documentclass[12pt]{article}
usepackage{amsmath}

begin{document}
[setlengtharraycolsep{2pt}
begin{array}{rcl}
Test~array & = & text{Fine alignment}\
& Because & text{the text is left-aligned dots}
end{array}
]
end{document}


addendum (2):
with help of very old (and almost forgotten) package mathenv from mfwtools:



documentclass[12pt]{article}
usepackage{amsmath}
usepackage{mathenv}
usepackage[frenchb]{babel}
usepackage[top=1.5cm,bottom=1.5cm,right=1.5cm,left=1.5cm]{geometry} % Marges

begin{document}
begin{eqnarray}[rc@{;}l]
Test~eqnarray & = & text{Good alignment} \
& Because & text{the text is aligned near to the equal sign}
end{eqnarray}
end{document}


enter image description here






share|improve this answer























  • Thank you, but I want Because to be aligned with =. Is this possible ?
    – Alex
    16 hours ago










  • @Alex, of course. you just need to place ampersand before Because if you like to have it below right text
    – Zarko
    16 hours ago












  • Sorry, I've changed my MWE to reveal better that I want
    – Alex
    16 hours ago










  • @Alex, this is not possible to achieve with align, but with array is simple. see addendum to answer.
    – Zarko
    16 hours ago










  • Yes it's perfect. But I can't enumerate my equations if necessary... Can I ?
    – Alex
    16 hours ago















up vote
6
down vote













in align you have one ampersand to much:



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*}
or
begin{align*}
Test~align* & = text{Bad alignment} \
& text{Because the text is right-aligned, far to the equal sign}
end{align*}
or
begin{align*}
Test~align* & = parbox[t]{0.4linewidth}{
Bad alignment \
Because the text is right-aligned, far to the equal sign}
end{align*}
end{document}


enter image description here



adedndum:
apparently you looking for the following:



enter image description here



documentclass[12pt]{article}
usepackage{amsmath}

begin{document}
[setlengtharraycolsep{2pt}
begin{array}{rcl}
Test~array & = & text{Fine alignment}\
& Because & text{the text is left-aligned dots}
end{array}
]
end{document}


addendum (2):
with help of very old (and almost forgotten) package mathenv from mfwtools:



documentclass[12pt]{article}
usepackage{amsmath}
usepackage{mathenv}
usepackage[frenchb]{babel}
usepackage[top=1.5cm,bottom=1.5cm,right=1.5cm,left=1.5cm]{geometry} % Marges

begin{document}
begin{eqnarray}[rc@{;}l]
Test~eqnarray & = & text{Good alignment} \
& Because & text{the text is aligned near to the equal sign}
end{eqnarray}
end{document}


enter image description here






share|improve this answer























  • Thank you, but I want Because to be aligned with =. Is this possible ?
    – Alex
    16 hours ago










  • @Alex, of course. you just need to place ampersand before Because if you like to have it below right text
    – Zarko
    16 hours ago












  • Sorry, I've changed my MWE to reveal better that I want
    – Alex
    16 hours ago










  • @Alex, this is not possible to achieve with align, but with array is simple. see addendum to answer.
    – Zarko
    16 hours ago










  • Yes it's perfect. But I can't enumerate my equations if necessary... Can I ?
    – Alex
    16 hours ago













up vote
6
down vote










up vote
6
down vote









in align you have one ampersand to much:



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*}
or
begin{align*}
Test~align* & = text{Bad alignment} \
& text{Because the text is right-aligned, far to the equal sign}
end{align*}
or
begin{align*}
Test~align* & = parbox[t]{0.4linewidth}{
Bad alignment \
Because the text is right-aligned, far to the equal sign}
end{align*}
end{document}


enter image description here



adedndum:
apparently you looking for the following:



enter image description here



documentclass[12pt]{article}
usepackage{amsmath}

begin{document}
[setlengtharraycolsep{2pt}
begin{array}{rcl}
Test~array & = & text{Fine alignment}\
& Because & text{the text is left-aligned dots}
end{array}
]
end{document}


addendum (2):
with help of very old (and almost forgotten) package mathenv from mfwtools:



documentclass[12pt]{article}
usepackage{amsmath}
usepackage{mathenv}
usepackage[frenchb]{babel}
usepackage[top=1.5cm,bottom=1.5cm,right=1.5cm,left=1.5cm]{geometry} % Marges

begin{document}
begin{eqnarray}[rc@{;}l]
Test~eqnarray & = & text{Good alignment} \
& Because & text{the text is aligned near to the equal sign}
end{eqnarray}
end{document}


enter image description here






share|improve this answer














in align you have one ampersand to much:



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*}
or
begin{align*}
Test~align* & = text{Bad alignment} \
& text{Because the text is right-aligned, far to the equal sign}
end{align*}
or
begin{align*}
Test~align* & = parbox[t]{0.4linewidth}{
Bad alignment \
Because the text is right-aligned, far to the equal sign}
end{align*}
end{document}


enter image description here



adedndum:
apparently you looking for the following:



enter image description here



documentclass[12pt]{article}
usepackage{amsmath}

begin{document}
[setlengtharraycolsep{2pt}
begin{array}{rcl}
Test~array & = & text{Fine alignment}\
& Because & text{the text is left-aligned dots}
end{array}
]
end{document}


addendum (2):
with help of very old (and almost forgotten) package mathenv from mfwtools:



documentclass[12pt]{article}
usepackage{amsmath}
usepackage{mathenv}
usepackage[frenchb]{babel}
usepackage[top=1.5cm,bottom=1.5cm,right=1.5cm,left=1.5cm]{geometry} % Marges

begin{document}
begin{eqnarray}[rc@{;}l]
Test~eqnarray & = & text{Good alignment} \
& Because & text{the text is aligned near to the equal sign}
end{eqnarray}
end{document}


enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited 15 hours ago

























answered 17 hours ago









Zarko

118k865155




118k865155












  • Thank you, but I want Because to be aligned with =. Is this possible ?
    – Alex
    16 hours ago










  • @Alex, of course. you just need to place ampersand before Because if you like to have it below right text
    – Zarko
    16 hours ago












  • Sorry, I've changed my MWE to reveal better that I want
    – Alex
    16 hours ago










  • @Alex, this is not possible to achieve with align, but with array is simple. see addendum to answer.
    – Zarko
    16 hours ago










  • Yes it's perfect. But I can't enumerate my equations if necessary... Can I ?
    – Alex
    16 hours ago


















  • Thank you, but I want Because to be aligned with =. Is this possible ?
    – Alex
    16 hours ago










  • @Alex, of course. you just need to place ampersand before Because if you like to have it below right text
    – Zarko
    16 hours ago












  • Sorry, I've changed my MWE to reveal better that I want
    – Alex
    16 hours ago










  • @Alex, this is not possible to achieve with align, but with array is simple. see addendum to answer.
    – Zarko
    16 hours ago










  • Yes it's perfect. But I can't enumerate my equations if necessary... Can I ?
    – Alex
    16 hours ago
















Thank you, but I want Because to be aligned with =. Is this possible ?
– Alex
16 hours ago




Thank you, but I want Because to be aligned with =. Is this possible ?
– Alex
16 hours ago












@Alex, of course. you just need to place ampersand before Because if you like to have it below right text
– Zarko
16 hours ago






@Alex, of course. you just need to place ampersand before Because if you like to have it below right text
– Zarko
16 hours ago














Sorry, I've changed my MWE to reveal better that I want
– Alex
16 hours ago




Sorry, I've changed my MWE to reveal better that I want
– Alex
16 hours ago












@Alex, this is not possible to achieve with align, but with array is simple. see addendum to answer.
– Zarko
16 hours ago




@Alex, this is not possible to achieve with align, but with array is simple. see addendum to answer.
– Zarko
16 hours ago












Yes it's perfect. But I can't enumerate my equations if necessary... Can I ?
– Alex
16 hours ago




Yes it's perfect. But I can't enumerate my equations if necessary... Can I ?
– Alex
16 hours ago


















draft saved

draft discarded




















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f463817%2fsubstitute-for-eqnarray%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Morgemoulin

Scott Moir

Souastre