Substitute for eqnarray?












6














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
    Dec 8 at 14:11










  • No the spacing is ok here, but as said below, I want to aligne Because with =
    – Alex
    Dec 8 at 14:29










  • 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
    Dec 8 at 14:31










  • I want to align both = (centered) and the text after (left-aligned)
    – Alex
    Dec 8 at 14:33










  • 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
    Dec 8 at 14:35
















6














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
    Dec 8 at 14:11










  • No the spacing is ok here, but as said below, I want to aligne Because with =
    – Alex
    Dec 8 at 14:29










  • 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
    Dec 8 at 14:31










  • I want to align both = (centered) and the text after (left-aligned)
    – Alex
    Dec 8 at 14:33










  • 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
    Dec 8 at 14:35














6












6








6







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 Dec 8 at 14:38

























asked Dec 8 at 14:07









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
    Dec 8 at 14:11










  • No the spacing is ok here, but as said below, I want to aligne Because with =
    – Alex
    Dec 8 at 14:29










  • 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
    Dec 8 at 14:31










  • I want to align both = (centered) and the text after (left-aligned)
    – Alex
    Dec 8 at 14:33










  • 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
    Dec 8 at 14:35


















  • 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
    Dec 8 at 14:11










  • No the spacing is ok here, but as said below, I want to aligne Because with =
    – Alex
    Dec 8 at 14:29










  • 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
    Dec 8 at 14:31










  • I want to align both = (centered) and the text after (left-aligned)
    – Alex
    Dec 8 at 14:33










  • 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
    Dec 8 at 14:35
















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
Dec 8 at 14:11




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
Dec 8 at 14:11












No the spacing is ok here, but as said below, I want to aligne Because with =
– Alex
Dec 8 at 14:29




No the spacing is ok here, but as said below, I want to aligne Because with =
– Alex
Dec 8 at 14:29












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
Dec 8 at 14:31




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
Dec 8 at 14:31












I want to align both = (centered) and the text after (left-aligned)
– Alex
Dec 8 at 14:33




I want to align both = (centered) and the text after (left-aligned)
– Alex
Dec 8 at 14:33












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
Dec 8 at 14:35




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
Dec 8 at 14:35










2 Answers
2






active

oldest

votes


















7














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
    Dec 8 at 14:40










  • You want because to be aligned with the = sign?
    – Bernard
    Dec 8 at 14:43










  • Yes, and the text in the first line left-aligned with the text in the second line (see my changed MWE)
    – Alex
    Dec 8 at 14:45










  • It is a solution yes, not very practical but I can enumerate my equations. Thank you for your help
    – Alex
    Dec 8 at 15:16










  • I've defined an, eqrel command to simplify typing.
    – Bernard
    Dec 8 at 15:36



















6














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
    Dec 8 at 14:20










  • @Alex, of course. you just need to place ampersand before Because if you like to have it below right text
    – Zarko
    Dec 8 at 14:23












  • Sorry, I've changed my MWE to reveal better that I want
    – Alex
    Dec 8 at 14:40










  • @Alex, this is not possible to achieve with align, but with array is simple. see addendum to answer.
    – Zarko
    Dec 8 at 14:57










  • Yes it's perfect. But I can't enumerate my equations if necessary... Can I ?
    – Alex
    Dec 8 at 15:00











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',
autoActivateHeartbeat: false,
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









7














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
    Dec 8 at 14:40










  • You want because to be aligned with the = sign?
    – Bernard
    Dec 8 at 14:43










  • Yes, and the text in the first line left-aligned with the text in the second line (see my changed MWE)
    – Alex
    Dec 8 at 14:45










  • It is a solution yes, not very practical but I can enumerate my equations. Thank you for your help
    – Alex
    Dec 8 at 15:16










  • I've defined an, eqrel command to simplify typing.
    – Bernard
    Dec 8 at 15:36
















7














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
    Dec 8 at 14:40










  • You want because to be aligned with the = sign?
    – Bernard
    Dec 8 at 14:43










  • Yes, and the text in the first line left-aligned with the text in the second line (see my changed MWE)
    – Alex
    Dec 8 at 14:45










  • It is a solution yes, not very practical but I can enumerate my equations. Thank you for your help
    – Alex
    Dec 8 at 15:16










  • I've defined an, eqrel command to simplify typing.
    – Bernard
    Dec 8 at 15:36














7












7








7






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 Dec 8 at 16:51

























answered Dec 8 at 14:22









Bernard

164k769193




164k769193












  • Ok thank you it's interesting, even if I don't success to have that I want for now
    – Alex
    Dec 8 at 14:40










  • You want because to be aligned with the = sign?
    – Bernard
    Dec 8 at 14:43










  • Yes, and the text in the first line left-aligned with the text in the second line (see my changed MWE)
    – Alex
    Dec 8 at 14:45










  • It is a solution yes, not very practical but I can enumerate my equations. Thank you for your help
    – Alex
    Dec 8 at 15:16










  • I've defined an, eqrel command to simplify typing.
    – Bernard
    Dec 8 at 15:36


















  • Ok thank you it's interesting, even if I don't success to have that I want for now
    – Alex
    Dec 8 at 14:40










  • You want because to be aligned with the = sign?
    – Bernard
    Dec 8 at 14:43










  • Yes, and the text in the first line left-aligned with the text in the second line (see my changed MWE)
    – Alex
    Dec 8 at 14:45










  • It is a solution yes, not very practical but I can enumerate my equations. Thank you for your help
    – Alex
    Dec 8 at 15:16










  • I've defined an, eqrel command to simplify typing.
    – Bernard
    Dec 8 at 15:36
















Ok thank you it's interesting, even if I don't success to have that I want for now
– Alex
Dec 8 at 14:40




Ok thank you it's interesting, even if I don't success to have that I want for now
– Alex
Dec 8 at 14:40












You want because to be aligned with the = sign?
– Bernard
Dec 8 at 14:43




You want because to be aligned with the = sign?
– Bernard
Dec 8 at 14:43












Yes, and the text in the first line left-aligned with the text in the second line (see my changed MWE)
– Alex
Dec 8 at 14:45




Yes, and the text in the first line left-aligned with the text in the second line (see my changed MWE)
– Alex
Dec 8 at 14:45












It is a solution yes, not very practical but I can enumerate my equations. Thank you for your help
– Alex
Dec 8 at 15:16




It is a solution yes, not very practical but I can enumerate my equations. Thank you for your help
– Alex
Dec 8 at 15:16












I've defined an, eqrel command to simplify typing.
– Bernard
Dec 8 at 15:36




I've defined an, eqrel command to simplify typing.
– Bernard
Dec 8 at 15:36











6














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
    Dec 8 at 14:20










  • @Alex, of course. you just need to place ampersand before Because if you like to have it below right text
    – Zarko
    Dec 8 at 14:23












  • Sorry, I've changed my MWE to reveal better that I want
    – Alex
    Dec 8 at 14:40










  • @Alex, this is not possible to achieve with align, but with array is simple. see addendum to answer.
    – Zarko
    Dec 8 at 14:57










  • Yes it's perfect. But I can't enumerate my equations if necessary... Can I ?
    – Alex
    Dec 8 at 15:00
















6














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
    Dec 8 at 14:20










  • @Alex, of course. you just need to place ampersand before Because if you like to have it below right text
    – Zarko
    Dec 8 at 14:23












  • Sorry, I've changed my MWE to reveal better that I want
    – Alex
    Dec 8 at 14:40










  • @Alex, this is not possible to achieve with align, but with array is simple. see addendum to answer.
    – Zarko
    Dec 8 at 14:57










  • Yes it's perfect. But I can't enumerate my equations if necessary... Can I ?
    – Alex
    Dec 8 at 15:00














6












6








6






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 Dec 8 at 15:22

























answered Dec 8 at 14:12









Zarko

120k865155




120k865155












  • Thank you, but I want Because to be aligned with =. Is this possible ?
    – Alex
    Dec 8 at 14:20










  • @Alex, of course. you just need to place ampersand before Because if you like to have it below right text
    – Zarko
    Dec 8 at 14:23












  • Sorry, I've changed my MWE to reveal better that I want
    – Alex
    Dec 8 at 14:40










  • @Alex, this is not possible to achieve with align, but with array is simple. see addendum to answer.
    – Zarko
    Dec 8 at 14:57










  • Yes it's perfect. But I can't enumerate my equations if necessary... Can I ?
    – Alex
    Dec 8 at 15:00


















  • Thank you, but I want Because to be aligned with =. Is this possible ?
    – Alex
    Dec 8 at 14:20










  • @Alex, of course. you just need to place ampersand before Because if you like to have it below right text
    – Zarko
    Dec 8 at 14:23












  • Sorry, I've changed my MWE to reveal better that I want
    – Alex
    Dec 8 at 14:40










  • @Alex, this is not possible to achieve with align, but with array is simple. see addendum to answer.
    – Zarko
    Dec 8 at 14:57










  • Yes it's perfect. But I can't enumerate my equations if necessary... Can I ?
    – Alex
    Dec 8 at 15:00
















Thank you, but I want Because to be aligned with =. Is this possible ?
– Alex
Dec 8 at 14:20




Thank you, but I want Because to be aligned with =. Is this possible ?
– Alex
Dec 8 at 14:20












@Alex, of course. you just need to place ampersand before Because if you like to have it below right text
– Zarko
Dec 8 at 14:23






@Alex, of course. you just need to place ampersand before Because if you like to have it below right text
– Zarko
Dec 8 at 14:23














Sorry, I've changed my MWE to reveal better that I want
– Alex
Dec 8 at 14:40




Sorry, I've changed my MWE to reveal better that I want
– Alex
Dec 8 at 14:40












@Alex, this is not possible to achieve with align, but with array is simple. see addendum to answer.
– Zarko
Dec 8 at 14:57




@Alex, this is not possible to achieve with align, but with array is simple. see addendum to answer.
– Zarko
Dec 8 at 14:57












Yes it's perfect. But I can't enumerate my equations if necessary... Can I ?
– Alex
Dec 8 at 15:00




Yes it's perfect. But I can't enumerate my equations if necessary... Can I ?
– Alex
Dec 8 at 15:00


















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

flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

Mangá

 ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕