Substitute for eqnarray?
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 :
How can I obtain absolutly the same results as eqnarray
with align
?
Note : I don't care the spacing problem with eqnarray
align eqnarray
|
show 5 more comments
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 :
How can I obtain absolutly the same results as eqnarray
with align
?
Note : I don't care the spacing problem with eqnarray
align eqnarray
Isbegin{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 aligneBecause
with=
– Alex
Dec 8 at 14:29
In that case it might make sense to change theeqnarray*
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'tbegin{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
|
show 5 more comments
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 :
How can I obtain absolutly the same results as eqnarray
with align
?
Note : I don't care the spacing problem with eqnarray
align eqnarray
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 :
How can I obtain absolutly the same results as eqnarray
with align
?
Note : I don't care the spacing problem with eqnarray
align eqnarray
align eqnarray
edited Dec 8 at 14:38
asked Dec 8 at 14:07
Alex
677
677
Isbegin{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 aligneBecause
with=
– Alex
Dec 8 at 14:29
In that case it might make sense to change theeqnarray*
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'tbegin{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
|
show 5 more comments
Isbegin{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 aligneBecause
with=
– Alex
Dec 8 at 14:29
In that case it might make sense to change theeqnarray*
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'tbegin{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
|
show 5 more comments
2 Answers
2
active
oldest
votes
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}
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 wantbecause
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
|
show 3 more comments
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}
adedndum:
apparently you looking for the following:
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}
Thank you, but I wantBecause
to be aligned with=
. Is this possible ?
– Alex
Dec 8 at 14:20
@Alex, of course. you just need to place ampersand beforeBecause
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 withalign
, but witharray
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
|
show 6 more comments
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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}
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 wantbecause
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
|
show 3 more comments
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}
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 wantbecause
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
|
show 3 more comments
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}
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}
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 wantbecause
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
|
show 3 more comments
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 wantbecause
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
|
show 3 more comments
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}
adedndum:
apparently you looking for the following:
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}
Thank you, but I wantBecause
to be aligned with=
. Is this possible ?
– Alex
Dec 8 at 14:20
@Alex, of course. you just need to place ampersand beforeBecause
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 withalign
, but witharray
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
|
show 6 more comments
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}
adedndum:
apparently you looking for the following:
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}
Thank you, but I wantBecause
to be aligned with=
. Is this possible ?
– Alex
Dec 8 at 14:20
@Alex, of course. you just need to place ampersand beforeBecause
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 withalign
, but witharray
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
|
show 6 more comments
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}
adedndum:
apparently you looking for the following:
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}
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}
adedndum:
apparently you looking for the following:
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}
edited Dec 8 at 15:22
answered Dec 8 at 14:12
Zarko
120k865155
120k865155
Thank you, but I wantBecause
to be aligned with=
. Is this possible ?
– Alex
Dec 8 at 14:20
@Alex, of course. you just need to place ampersand beforeBecause
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 withalign
, but witharray
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
|
show 6 more comments
Thank you, but I wantBecause
to be aligned with=
. Is this possible ?
– Alex
Dec 8 at 14:20
@Alex, of course. you just need to place ampersand beforeBecause
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 withalign
, but witharray
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
|
show 6 more comments
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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