Aligning height-differing equation lines in tabularx
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I have the following array of equations produced by tabularx
, in which I want the rows in the left and right panels to be aligned such that they look like they're written on the same line of binder paper, for example. But since the equations are apparently aligned at the very top, the tall summand symbols in the right panel lead to the following aesthetic horror:
How can I fix the alignment? A MWE appears below.
documentclassarticle
usepackage[utf8]inputenc
usepackageamsmath
usepackagetabularx
begindocument
begintabularx0.5textwidthXX
beginalign*
X_n1^(j) &:= X_n1\
&vdots \
X_nC^(j) &:= X_nC
endalign*
&
beginalign*
Y_n1 &:= widehatalpha_11 + sum_j=3^C widehatalpha_j1 X_nj + epsilon_n1\
&vdots \
Y_nW &:= widehatalpha_1W + sum_j=3^C widehatalpha_jW X_nj + epsilon_nW
endalign*
endtabularx
enddocument
vertical-alignment align tabularx
add a comment |Â
up vote
3
down vote
favorite
I have the following array of equations produced by tabularx
, in which I want the rows in the left and right panels to be aligned such that they look like they're written on the same line of binder paper, for example. But since the equations are apparently aligned at the very top, the tall summand symbols in the right panel lead to the following aesthetic horror:
How can I fix the alignment? A MWE appears below.
documentclassarticle
usepackage[utf8]inputenc
usepackageamsmath
usepackagetabularx
begindocument
begintabularx0.5textwidthXX
beginalign*
X_n1^(j) &:= X_n1\
&vdots \
X_nC^(j) &:= X_nC
endalign*
&
beginalign*
Y_n1 &:= widehatalpha_11 + sum_j=3^C widehatalpha_j1 X_nj + epsilon_n1\
&vdots \
Y_nW &:= widehatalpha_1W + sum_j=3^C widehatalpha_jW X_nj + epsilon_nW
endalign*
endtabularx
enddocument
vertical-alignment align tabularx
1
Why do you needtabularx
here?
â Werner
Aug 29 at 21:02
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I have the following array of equations produced by tabularx
, in which I want the rows in the left and right panels to be aligned such that they look like they're written on the same line of binder paper, for example. But since the equations are apparently aligned at the very top, the tall summand symbols in the right panel lead to the following aesthetic horror:
How can I fix the alignment? A MWE appears below.
documentclassarticle
usepackage[utf8]inputenc
usepackageamsmath
usepackagetabularx
begindocument
begintabularx0.5textwidthXX
beginalign*
X_n1^(j) &:= X_n1\
&vdots \
X_nC^(j) &:= X_nC
endalign*
&
beginalign*
Y_n1 &:= widehatalpha_11 + sum_j=3^C widehatalpha_j1 X_nj + epsilon_n1\
&vdots \
Y_nW &:= widehatalpha_1W + sum_j=3^C widehatalpha_jW X_nj + epsilon_nW
endalign*
endtabularx
enddocument
vertical-alignment align tabularx
I have the following array of equations produced by tabularx
, in which I want the rows in the left and right panels to be aligned such that they look like they're written on the same line of binder paper, for example. But since the equations are apparently aligned at the very top, the tall summand symbols in the right panel lead to the following aesthetic horror:
How can I fix the alignment? A MWE appears below.
documentclassarticle
usepackage[utf8]inputenc
usepackageamsmath
usepackagetabularx
begindocument
begintabularx0.5textwidthXX
beginalign*
X_n1^(j) &:= X_n1\
&vdots \
X_nC^(j) &:= X_nC
endalign*
&
beginalign*
Y_n1 &:= widehatalpha_11 + sum_j=3^C widehatalpha_j1 X_nj + epsilon_n1\
&vdots \
Y_nW &:= widehatalpha_1W + sum_j=3^C widehatalpha_jW X_nj + epsilon_nW
endalign*
endtabularx
enddocument
vertical-alignment align tabularx
asked Aug 29 at 20:42
half-pass
1183
1183
1
Why do you needtabularx
here?
â Werner
Aug 29 at 21:02
add a comment |Â
1
Why do you needtabularx
here?
â Werner
Aug 29 at 21:02
1
1
Why do you need
tabularx
here?â Werner
Aug 29 at 21:02
Why do you need
tabularx
here?â Werner
Aug 29 at 21:02
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
4
down vote
accepted
As I don't understand why you use a tabularx environment for your equations, except perhaps to have the whole alignment near the left margin, I propose this very simple solution with alignat2
, which displays two columns of alignment, with a controllable space between them. To have them near the leftmargin, I used the fleqn
environment from nccmath
(remove it if you want the equations be centred), and added some improvements from mathtools
. In particular, coloneqq
which provides a :=
, with the colon centred on the maths axis, and vertical dots centred w.r.t. :=
:
documentclassarticle
usepackage[utf8]inputenc
usepackagemathtools, nccmath
begindocument
Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text.
beginfleqn[2em]
beginalignat*2
X_n1^(j) &coloneqq X_n1
&qquad Y_n1 &coloneqq widehatalpha_11 + sum_j=3^C widehatalpha_j1 X_nj + epsilon_n1\[-1ex]
&vdotswithincoloneqq & & vdotswithincoloneqq \[-1ex]
X_nC^(j) &coloneqq X_nC
& Y_nW &coloneqq widehatalpha_1W + sum_j=3^C widehatalpha_jW X_nj + epsilon_nW
endalignat*
endfleqn
enddocument
add a comment |Â
up vote
5
down vote
I'm not sure what's the need of tabularx
in this case:
documentclassarticle
usepackageamsmath,mathtools
begindocument
beginalign*
X_n1^(j) &coloneqq X_n1
&
Y_n1 &coloneqq widehatalpha_11 +
sum_j=3^C widehatalpha_j1 X_nj + epsilon_n1
\[-3ex]
&vdotswithincoloneqq & &vdotswithincoloneqq
\[-2ex]
X_nC^(j) &coloneqq X_nC
&
Y_nW &:= widehatalpha_1W +
sum_j=3^C widehatalpha_jW X_nj + epsilon_nW
endalign*
enddocument
You are absolutely right. In the presence of multiple correct answers, I'm accepting Bernard's since it was the first chronologically. Thanks.
â half-pass
Aug 29 at 21:45
add a comment |Â
up vote
4
down vote
A quick fix using vphantom
.
This creates a 'phantom' zero width box with a vertical height equal to the size of sum_j=3^C
.
documentclassarticle
usepackage[utf8]inputenc
usepackageamsmath
usepackagetabularx
begindocument
begintabularx0.5textwidthXX
beginalign*
X_n1^(j) &:= X_n1 vphantomsum_j=3^C\
&vdots \
X_nC^(j) &:= X_nC vphantomsum_j=3^C
endalign*
&
beginalign*
Y_n1 &:= widehatalpha_11 + sum_j=3^C widehatalpha_j1 X_nj + epsilon_n1\
&vdots \
Y_nW &:= widehatalpha_1W + sum_j=3^C widehatalpha_jW X_nj + epsilon_nW
endalign*
endtabularx
enddocument
You are absolutely right. In the presence of multiple correct answers, I'm accepting Bernard's since it was the first chronologically. Thanks.
â half-pass
Aug 29 at 21:46
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
As I don't understand why you use a tabularx environment for your equations, except perhaps to have the whole alignment near the left margin, I propose this very simple solution with alignat2
, which displays two columns of alignment, with a controllable space between them. To have them near the leftmargin, I used the fleqn
environment from nccmath
(remove it if you want the equations be centred), and added some improvements from mathtools
. In particular, coloneqq
which provides a :=
, with the colon centred on the maths axis, and vertical dots centred w.r.t. :=
:
documentclassarticle
usepackage[utf8]inputenc
usepackagemathtools, nccmath
begindocument
Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text.
beginfleqn[2em]
beginalignat*2
X_n1^(j) &coloneqq X_n1
&qquad Y_n1 &coloneqq widehatalpha_11 + sum_j=3^C widehatalpha_j1 X_nj + epsilon_n1\[-1ex]
&vdotswithincoloneqq & & vdotswithincoloneqq \[-1ex]
X_nC^(j) &coloneqq X_nC
& Y_nW &coloneqq widehatalpha_1W + sum_j=3^C widehatalpha_jW X_nj + epsilon_nW
endalignat*
endfleqn
enddocument
add a comment |Â
up vote
4
down vote
accepted
As I don't understand why you use a tabularx environment for your equations, except perhaps to have the whole alignment near the left margin, I propose this very simple solution with alignat2
, which displays two columns of alignment, with a controllable space between them. To have them near the leftmargin, I used the fleqn
environment from nccmath
(remove it if you want the equations be centred), and added some improvements from mathtools
. In particular, coloneqq
which provides a :=
, with the colon centred on the maths axis, and vertical dots centred w.r.t. :=
:
documentclassarticle
usepackage[utf8]inputenc
usepackagemathtools, nccmath
begindocument
Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text.
beginfleqn[2em]
beginalignat*2
X_n1^(j) &coloneqq X_n1
&qquad Y_n1 &coloneqq widehatalpha_11 + sum_j=3^C widehatalpha_j1 X_nj + epsilon_n1\[-1ex]
&vdotswithincoloneqq & & vdotswithincoloneqq \[-1ex]
X_nC^(j) &coloneqq X_nC
& Y_nW &coloneqq widehatalpha_1W + sum_j=3^C widehatalpha_jW X_nj + epsilon_nW
endalignat*
endfleqn
enddocument
add a comment |Â
up vote
4
down vote
accepted
up vote
4
down vote
accepted
As I don't understand why you use a tabularx environment for your equations, except perhaps to have the whole alignment near the left margin, I propose this very simple solution with alignat2
, which displays two columns of alignment, with a controllable space between them. To have them near the leftmargin, I used the fleqn
environment from nccmath
(remove it if you want the equations be centred), and added some improvements from mathtools
. In particular, coloneqq
which provides a :=
, with the colon centred on the maths axis, and vertical dots centred w.r.t. :=
:
documentclassarticle
usepackage[utf8]inputenc
usepackagemathtools, nccmath
begindocument
Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text.
beginfleqn[2em]
beginalignat*2
X_n1^(j) &coloneqq X_n1
&qquad Y_n1 &coloneqq widehatalpha_11 + sum_j=3^C widehatalpha_j1 X_nj + epsilon_n1\[-1ex]
&vdotswithincoloneqq & & vdotswithincoloneqq \[-1ex]
X_nC^(j) &coloneqq X_nC
& Y_nW &coloneqq widehatalpha_1W + sum_j=3^C widehatalpha_jW X_nj + epsilon_nW
endalignat*
endfleqn
enddocument
As I don't understand why you use a tabularx environment for your equations, except perhaps to have the whole alignment near the left margin, I propose this very simple solution with alignat2
, which displays two columns of alignment, with a controllable space between them. To have them near the leftmargin, I used the fleqn
environment from nccmath
(remove it if you want the equations be centred), and added some improvements from mathtools
. In particular, coloneqq
which provides a :=
, with the colon centred on the maths axis, and vertical dots centred w.r.t. :=
:
documentclassarticle
usepackage[utf8]inputenc
usepackagemathtools, nccmath
begindocument
Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text.
beginfleqn[2em]
beginalignat*2
X_n1^(j) &coloneqq X_n1
&qquad Y_n1 &coloneqq widehatalpha_11 + sum_j=3^C widehatalpha_j1 X_nj + epsilon_n1\[-1ex]
&vdotswithincoloneqq & & vdotswithincoloneqq \[-1ex]
X_nC^(j) &coloneqq X_nC
& Y_nW &coloneqq widehatalpha_1W + sum_j=3^C widehatalpha_jW X_nj + epsilon_nW
endalignat*
endfleqn
enddocument
edited Aug 29 at 23:25
Al-Motasem Aldaoudeyeh
1,155211
1,155211
answered Aug 29 at 21:21
Bernard
156k763189
156k763189
add a comment |Â
add a comment |Â
up vote
5
down vote
I'm not sure what's the need of tabularx
in this case:
documentclassarticle
usepackageamsmath,mathtools
begindocument
beginalign*
X_n1^(j) &coloneqq X_n1
&
Y_n1 &coloneqq widehatalpha_11 +
sum_j=3^C widehatalpha_j1 X_nj + epsilon_n1
\[-3ex]
&vdotswithincoloneqq & &vdotswithincoloneqq
\[-2ex]
X_nC^(j) &coloneqq X_nC
&
Y_nW &:= widehatalpha_1W +
sum_j=3^C widehatalpha_jW X_nj + epsilon_nW
endalign*
enddocument
You are absolutely right. In the presence of multiple correct answers, I'm accepting Bernard's since it was the first chronologically. Thanks.
â half-pass
Aug 29 at 21:45
add a comment |Â
up vote
5
down vote
I'm not sure what's the need of tabularx
in this case:
documentclassarticle
usepackageamsmath,mathtools
begindocument
beginalign*
X_n1^(j) &coloneqq X_n1
&
Y_n1 &coloneqq widehatalpha_11 +
sum_j=3^C widehatalpha_j1 X_nj + epsilon_n1
\[-3ex]
&vdotswithincoloneqq & &vdotswithincoloneqq
\[-2ex]
X_nC^(j) &coloneqq X_nC
&
Y_nW &:= widehatalpha_1W +
sum_j=3^C widehatalpha_jW X_nj + epsilon_nW
endalign*
enddocument
You are absolutely right. In the presence of multiple correct answers, I'm accepting Bernard's since it was the first chronologically. Thanks.
â half-pass
Aug 29 at 21:45
add a comment |Â
up vote
5
down vote
up vote
5
down vote
I'm not sure what's the need of tabularx
in this case:
documentclassarticle
usepackageamsmath,mathtools
begindocument
beginalign*
X_n1^(j) &coloneqq X_n1
&
Y_n1 &coloneqq widehatalpha_11 +
sum_j=3^C widehatalpha_j1 X_nj + epsilon_n1
\[-3ex]
&vdotswithincoloneqq & &vdotswithincoloneqq
\[-2ex]
X_nC^(j) &coloneqq X_nC
&
Y_nW &:= widehatalpha_1W +
sum_j=3^C widehatalpha_jW X_nj + epsilon_nW
endalign*
enddocument
I'm not sure what's the need of tabularx
in this case:
documentclassarticle
usepackageamsmath,mathtools
begindocument
beginalign*
X_n1^(j) &coloneqq X_n1
&
Y_n1 &coloneqq widehatalpha_11 +
sum_j=3^C widehatalpha_j1 X_nj + epsilon_n1
\[-3ex]
&vdotswithincoloneqq & &vdotswithincoloneqq
\[-2ex]
X_nC^(j) &coloneqq X_nC
&
Y_nW &:= widehatalpha_1W +
sum_j=3^C widehatalpha_jW X_nj + epsilon_nW
endalign*
enddocument
answered Aug 29 at 21:41
egreg
680k8318083056
680k8318083056
You are absolutely right. In the presence of multiple correct answers, I'm accepting Bernard's since it was the first chronologically. Thanks.
â half-pass
Aug 29 at 21:45
add a comment |Â
You are absolutely right. In the presence of multiple correct answers, I'm accepting Bernard's since it was the first chronologically. Thanks.
â half-pass
Aug 29 at 21:45
You are absolutely right. In the presence of multiple correct answers, I'm accepting Bernard's since it was the first chronologically. Thanks.
â half-pass
Aug 29 at 21:45
You are absolutely right. In the presence of multiple correct answers, I'm accepting Bernard's since it was the first chronologically. Thanks.
â half-pass
Aug 29 at 21:45
add a comment |Â
up vote
4
down vote
A quick fix using vphantom
.
This creates a 'phantom' zero width box with a vertical height equal to the size of sum_j=3^C
.
documentclassarticle
usepackage[utf8]inputenc
usepackageamsmath
usepackagetabularx
begindocument
begintabularx0.5textwidthXX
beginalign*
X_n1^(j) &:= X_n1 vphantomsum_j=3^C\
&vdots \
X_nC^(j) &:= X_nC vphantomsum_j=3^C
endalign*
&
beginalign*
Y_n1 &:= widehatalpha_11 + sum_j=3^C widehatalpha_j1 X_nj + epsilon_n1\
&vdots \
Y_nW &:= widehatalpha_1W + sum_j=3^C widehatalpha_jW X_nj + epsilon_nW
endalign*
endtabularx
enddocument
You are absolutely right. In the presence of multiple correct answers, I'm accepting Bernard's since it was the first chronologically. Thanks.
â half-pass
Aug 29 at 21:46
add a comment |Â
up vote
4
down vote
A quick fix using vphantom
.
This creates a 'phantom' zero width box with a vertical height equal to the size of sum_j=3^C
.
documentclassarticle
usepackage[utf8]inputenc
usepackageamsmath
usepackagetabularx
begindocument
begintabularx0.5textwidthXX
beginalign*
X_n1^(j) &:= X_n1 vphantomsum_j=3^C\
&vdots \
X_nC^(j) &:= X_nC vphantomsum_j=3^C
endalign*
&
beginalign*
Y_n1 &:= widehatalpha_11 + sum_j=3^C widehatalpha_j1 X_nj + epsilon_n1\
&vdots \
Y_nW &:= widehatalpha_1W + sum_j=3^C widehatalpha_jW X_nj + epsilon_nW
endalign*
endtabularx
enddocument
You are absolutely right. In the presence of multiple correct answers, I'm accepting Bernard's since it was the first chronologically. Thanks.
â half-pass
Aug 29 at 21:46
add a comment |Â
up vote
4
down vote
up vote
4
down vote
A quick fix using vphantom
.
This creates a 'phantom' zero width box with a vertical height equal to the size of sum_j=3^C
.
documentclassarticle
usepackage[utf8]inputenc
usepackageamsmath
usepackagetabularx
begindocument
begintabularx0.5textwidthXX
beginalign*
X_n1^(j) &:= X_n1 vphantomsum_j=3^C\
&vdots \
X_nC^(j) &:= X_nC vphantomsum_j=3^C
endalign*
&
beginalign*
Y_n1 &:= widehatalpha_11 + sum_j=3^C widehatalpha_j1 X_nj + epsilon_n1\
&vdots \
Y_nW &:= widehatalpha_1W + sum_j=3^C widehatalpha_jW X_nj + epsilon_nW
endalign*
endtabularx
enddocument
A quick fix using vphantom
.
This creates a 'phantom' zero width box with a vertical height equal to the size of sum_j=3^C
.
documentclassarticle
usepackage[utf8]inputenc
usepackageamsmath
usepackagetabularx
begindocument
begintabularx0.5textwidthXX
beginalign*
X_n1^(j) &:= X_n1 vphantomsum_j=3^C\
&vdots \
X_nC^(j) &:= X_nC vphantomsum_j=3^C
endalign*
&
beginalign*
Y_n1 &:= widehatalpha_11 + sum_j=3^C widehatalpha_j1 X_nj + epsilon_n1\
&vdots \
Y_nW &:= widehatalpha_1W + sum_j=3^C widehatalpha_jW X_nj + epsilon_nW
endalign*
endtabularx
enddocument
edited Aug 29 at 20:56
answered Aug 29 at 20:49
Milo
5,51321345
5,51321345
You are absolutely right. In the presence of multiple correct answers, I'm accepting Bernard's since it was the first chronologically. Thanks.
â half-pass
Aug 29 at 21:46
add a comment |Â
You are absolutely right. In the presence of multiple correct answers, I'm accepting Bernard's since it was the first chronologically. Thanks.
â half-pass
Aug 29 at 21:46
You are absolutely right. In the presence of multiple correct answers, I'm accepting Bernard's since it was the first chronologically. Thanks.
â half-pass
Aug 29 at 21:46
You are absolutely right. In the presence of multiple correct answers, I'm accepting Bernard's since it was the first chronologically. Thanks.
â half-pass
Aug 29 at 21:46
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f448400%2faligning-height-differing-equation-lines-in-tabularx%23new-answer', 'question_page');
);
Post as a guest
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
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
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
1
Why do you need
tabularx
here?â Werner
Aug 29 at 21:02