How can I get a fraction with a matrix in the numerator and denominator?
up vote
7
down vote
favorite
The above fraction is what I would like to achieve
What I have so far is
$ begin{bmatrix}
0 \
0 \
1 \
1
end{bmatrix} - frac{ begin{bmatrix}
0 & 0 & 1 & 1
end{bmatrix} begin{bmatrix}
1 \
1 \
1 \
1
end{bmatrix}}{begin{bmatrix}
1 & 1 & 1 & 1
end{bmatrix} begin{bmatrix}
1 \
1 \
1 \
1
end{bmatrix} }$
and it looks like this
How can I achieve my desired result?
fractions
|
show 3 more comments
up vote
7
down vote
favorite
The above fraction is what I would like to achieve
What I have so far is
$ begin{bmatrix}
0 \
0 \
1 \
1
end{bmatrix} - frac{ begin{bmatrix}
0 & 0 & 1 & 1
end{bmatrix} begin{bmatrix}
1 \
1 \
1 \
1
end{bmatrix}}{begin{bmatrix}
1 & 1 & 1 & 1
end{bmatrix} begin{bmatrix}
1 \
1 \
1 \
1
end{bmatrix} }$
and it looks like this
How can I achieve my desired result?
fractions
2
You also get several errors from that input.
– egreg
Nov 14 at 17:09
what are the errors? my code compiles so I didn't notice any errors
– user130306
Nov 14 at 17:16
The second$
causes TeX to leave math mode before your equation is finished. You should put it all the way at the end (afterend{bmatrix} }
). You may want to instead use[...]
orbegin{equation}...end{equation}
instead of$...$
since this looks like a display equation rather than an inline equation.
– Circumscribe
Nov 14 at 17:20
2
The fixed code compiles normally and has the expected result for me.
– Bernard
Nov 14 at 17:25
1
yes I know, I corrected the misplaced$
and got my desired outcome so my question no longer needs an answer
– user130306
Nov 14 at 18:27
|
show 3 more comments
up vote
7
down vote
favorite
up vote
7
down vote
favorite
The above fraction is what I would like to achieve
What I have so far is
$ begin{bmatrix}
0 \
0 \
1 \
1
end{bmatrix} - frac{ begin{bmatrix}
0 & 0 & 1 & 1
end{bmatrix} begin{bmatrix}
1 \
1 \
1 \
1
end{bmatrix}}{begin{bmatrix}
1 & 1 & 1 & 1
end{bmatrix} begin{bmatrix}
1 \
1 \
1 \
1
end{bmatrix} }$
and it looks like this
How can I achieve my desired result?
fractions
The above fraction is what I would like to achieve
What I have so far is
$ begin{bmatrix}
0 \
0 \
1 \
1
end{bmatrix} - frac{ begin{bmatrix}
0 & 0 & 1 & 1
end{bmatrix} begin{bmatrix}
1 \
1 \
1 \
1
end{bmatrix}}{begin{bmatrix}
1 & 1 & 1 & 1
end{bmatrix} begin{bmatrix}
1 \
1 \
1 \
1
end{bmatrix} }$
and it looks like this
How can I achieve my desired result?
fractions
fractions
edited Nov 14 at 17:23
asked Nov 14 at 17:03
user130306
1362
1362
2
You also get several errors from that input.
– egreg
Nov 14 at 17:09
what are the errors? my code compiles so I didn't notice any errors
– user130306
Nov 14 at 17:16
The second$
causes TeX to leave math mode before your equation is finished. You should put it all the way at the end (afterend{bmatrix} }
). You may want to instead use[...]
orbegin{equation}...end{equation}
instead of$...$
since this looks like a display equation rather than an inline equation.
– Circumscribe
Nov 14 at 17:20
2
The fixed code compiles normally and has the expected result for me.
– Bernard
Nov 14 at 17:25
1
yes I know, I corrected the misplaced$
and got my desired outcome so my question no longer needs an answer
– user130306
Nov 14 at 18:27
|
show 3 more comments
2
You also get several errors from that input.
– egreg
Nov 14 at 17:09
what are the errors? my code compiles so I didn't notice any errors
– user130306
Nov 14 at 17:16
The second$
causes TeX to leave math mode before your equation is finished. You should put it all the way at the end (afterend{bmatrix} }
). You may want to instead use[...]
orbegin{equation}...end{equation}
instead of$...$
since this looks like a display equation rather than an inline equation.
– Circumscribe
Nov 14 at 17:20
2
The fixed code compiles normally and has the expected result for me.
– Bernard
Nov 14 at 17:25
1
yes I know, I corrected the misplaced$
and got my desired outcome so my question no longer needs an answer
– user130306
Nov 14 at 18:27
2
2
You also get several errors from that input.
– egreg
Nov 14 at 17:09
You also get several errors from that input.
– egreg
Nov 14 at 17:09
what are the errors? my code compiles so I didn't notice any errors
– user130306
Nov 14 at 17:16
what are the errors? my code compiles so I didn't notice any errors
– user130306
Nov 14 at 17:16
The second
$
causes TeX to leave math mode before your equation is finished. You should put it all the way at the end (after end{bmatrix} }
). You may want to instead use [...]
or begin{equation}...end{equation}
instead of $...$
since this looks like a display equation rather than an inline equation.– Circumscribe
Nov 14 at 17:20
The second
$
causes TeX to leave math mode before your equation is finished. You should put it all the way at the end (after end{bmatrix} }
). You may want to instead use [...]
or begin{equation}...end{equation}
instead of $...$
since this looks like a display equation rather than an inline equation.– Circumscribe
Nov 14 at 17:20
2
2
The fixed code compiles normally and has the expected result for me.
– Bernard
Nov 14 at 17:25
The fixed code compiles normally and has the expected result for me.
– Bernard
Nov 14 at 17:25
1
1
yes I know, I corrected the misplaced
$
and got my desired outcome so my question no longer needs an answer– user130306
Nov 14 at 18:27
yes I know, I corrected the misplaced
$
and got my desired outcome so my question no longer needs an answer– user130306
Nov 14 at 18:27
|
show 3 more comments
2 Answers
2
active
oldest
votes
up vote
10
down vote
You could use the bsmallmatrix
environment, provided by the mathtools
package, to render the row and column vectors in the frac
expression more compactly.
documentclass{article}
usepackage{mathtools}
begin{document}
[
begin{bmatrix}
0 \ 0 \ 1 \ 1
end{bmatrix}
- frac{
begin{bsmallmatrix}
0 & 0 & 1 & 1
end{bsmallmatrix}
begin{bsmallmatrix}
1 \ 1 \ 1 \ 1
end{bsmallmatrix}}{%
begin{bsmallmatrix}
1 & 1 & 1 & 1
end{bsmallmatrix}
begin{bsmallmatrix}
1 \ 1 \ 1 \ 1
end{bsmallmatrix} }
begin{bmatrix}
1 \ 1 \ 1 \ 1
end{bmatrix}
]
end{document}
add a comment |
up vote
9
down vote
documentclass{article}
usepackage{tabstackengine}
stackMath
newcommandFrac[2]{frac{addstackgap{#1}}{addstackgap{#2}}}
begin{document}
[
setstacktabbedgap{1ex}
bracketVectorstack{0\0\1\1} -
Frac{
bracketMatrixstack{0&0&1&1}bracketVectorstack{1\1\1\1}
}{
bracketMatrixstack{1&1&1&1}bracketVectorstack{1\1\1\1}
}
bracketVectorstack{1\1\1\1}
]
end{document}
The smaller size of Frac
is also possible, with a small redefinition:
documentclass{article}
usepackage{tabstackengine}
stackMath
newcommandFrac[2]{{%
setstackgap{L}{.7normalbaselineskip}TABstackMathstyle{scriptstyle}%
frac{addstackgap{#1}}{addstackgap{#2}}%
}}
begin{document}
[
setstacktabbedgap{1ex}
bracketVectorstack{0\0\1\1} -
Frac{
bracketMatrixstack{0&0&1&1}bracketMatrixstack{1\1\1\1}
}{
bracketMatrixstack{1&1&1&1}bracketMatrixstack{1\1\1\1}
}
bracketVectorstack{1\1\1\1}
]
end{document}
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
10
down vote
You could use the bsmallmatrix
environment, provided by the mathtools
package, to render the row and column vectors in the frac
expression more compactly.
documentclass{article}
usepackage{mathtools}
begin{document}
[
begin{bmatrix}
0 \ 0 \ 1 \ 1
end{bmatrix}
- frac{
begin{bsmallmatrix}
0 & 0 & 1 & 1
end{bsmallmatrix}
begin{bsmallmatrix}
1 \ 1 \ 1 \ 1
end{bsmallmatrix}}{%
begin{bsmallmatrix}
1 & 1 & 1 & 1
end{bsmallmatrix}
begin{bsmallmatrix}
1 \ 1 \ 1 \ 1
end{bsmallmatrix} }
begin{bmatrix}
1 \ 1 \ 1 \ 1
end{bmatrix}
]
end{document}
add a comment |
up vote
10
down vote
You could use the bsmallmatrix
environment, provided by the mathtools
package, to render the row and column vectors in the frac
expression more compactly.
documentclass{article}
usepackage{mathtools}
begin{document}
[
begin{bmatrix}
0 \ 0 \ 1 \ 1
end{bmatrix}
- frac{
begin{bsmallmatrix}
0 & 0 & 1 & 1
end{bsmallmatrix}
begin{bsmallmatrix}
1 \ 1 \ 1 \ 1
end{bsmallmatrix}}{%
begin{bsmallmatrix}
1 & 1 & 1 & 1
end{bsmallmatrix}
begin{bsmallmatrix}
1 \ 1 \ 1 \ 1
end{bsmallmatrix} }
begin{bmatrix}
1 \ 1 \ 1 \ 1
end{bmatrix}
]
end{document}
add a comment |
up vote
10
down vote
up vote
10
down vote
You could use the bsmallmatrix
environment, provided by the mathtools
package, to render the row and column vectors in the frac
expression more compactly.
documentclass{article}
usepackage{mathtools}
begin{document}
[
begin{bmatrix}
0 \ 0 \ 1 \ 1
end{bmatrix}
- frac{
begin{bsmallmatrix}
0 & 0 & 1 & 1
end{bsmallmatrix}
begin{bsmallmatrix}
1 \ 1 \ 1 \ 1
end{bsmallmatrix}}{%
begin{bsmallmatrix}
1 & 1 & 1 & 1
end{bsmallmatrix}
begin{bsmallmatrix}
1 \ 1 \ 1 \ 1
end{bsmallmatrix} }
begin{bmatrix}
1 \ 1 \ 1 \ 1
end{bmatrix}
]
end{document}
You could use the bsmallmatrix
environment, provided by the mathtools
package, to render the row and column vectors in the frac
expression more compactly.
documentclass{article}
usepackage{mathtools}
begin{document}
[
begin{bmatrix}
0 \ 0 \ 1 \ 1
end{bmatrix}
- frac{
begin{bsmallmatrix}
0 & 0 & 1 & 1
end{bsmallmatrix}
begin{bsmallmatrix}
1 \ 1 \ 1 \ 1
end{bsmallmatrix}}{%
begin{bsmallmatrix}
1 & 1 & 1 & 1
end{bsmallmatrix}
begin{bsmallmatrix}
1 \ 1 \ 1 \ 1
end{bsmallmatrix} }
begin{bmatrix}
1 \ 1 \ 1 \ 1
end{bmatrix}
]
end{document}
answered Nov 14 at 19:55
Mico
271k30369756
271k30369756
add a comment |
add a comment |
up vote
9
down vote
documentclass{article}
usepackage{tabstackengine}
stackMath
newcommandFrac[2]{frac{addstackgap{#1}}{addstackgap{#2}}}
begin{document}
[
setstacktabbedgap{1ex}
bracketVectorstack{0\0\1\1} -
Frac{
bracketMatrixstack{0&0&1&1}bracketVectorstack{1\1\1\1}
}{
bracketMatrixstack{1&1&1&1}bracketVectorstack{1\1\1\1}
}
bracketVectorstack{1\1\1\1}
]
end{document}
The smaller size of Frac
is also possible, with a small redefinition:
documentclass{article}
usepackage{tabstackengine}
stackMath
newcommandFrac[2]{{%
setstackgap{L}{.7normalbaselineskip}TABstackMathstyle{scriptstyle}%
frac{addstackgap{#1}}{addstackgap{#2}}%
}}
begin{document}
[
setstacktabbedgap{1ex}
bracketVectorstack{0\0\1\1} -
Frac{
bracketMatrixstack{0&0&1&1}bracketMatrixstack{1\1\1\1}
}{
bracketMatrixstack{1&1&1&1}bracketMatrixstack{1\1\1\1}
}
bracketVectorstack{1\1\1\1}
]
end{document}
add a comment |
up vote
9
down vote
documentclass{article}
usepackage{tabstackengine}
stackMath
newcommandFrac[2]{frac{addstackgap{#1}}{addstackgap{#2}}}
begin{document}
[
setstacktabbedgap{1ex}
bracketVectorstack{0\0\1\1} -
Frac{
bracketMatrixstack{0&0&1&1}bracketVectorstack{1\1\1\1}
}{
bracketMatrixstack{1&1&1&1}bracketVectorstack{1\1\1\1}
}
bracketVectorstack{1\1\1\1}
]
end{document}
The smaller size of Frac
is also possible, with a small redefinition:
documentclass{article}
usepackage{tabstackengine}
stackMath
newcommandFrac[2]{{%
setstackgap{L}{.7normalbaselineskip}TABstackMathstyle{scriptstyle}%
frac{addstackgap{#1}}{addstackgap{#2}}%
}}
begin{document}
[
setstacktabbedgap{1ex}
bracketVectorstack{0\0\1\1} -
Frac{
bracketMatrixstack{0&0&1&1}bracketMatrixstack{1\1\1\1}
}{
bracketMatrixstack{1&1&1&1}bracketMatrixstack{1\1\1\1}
}
bracketVectorstack{1\1\1\1}
]
end{document}
add a comment |
up vote
9
down vote
up vote
9
down vote
documentclass{article}
usepackage{tabstackengine}
stackMath
newcommandFrac[2]{frac{addstackgap{#1}}{addstackgap{#2}}}
begin{document}
[
setstacktabbedgap{1ex}
bracketVectorstack{0\0\1\1} -
Frac{
bracketMatrixstack{0&0&1&1}bracketVectorstack{1\1\1\1}
}{
bracketMatrixstack{1&1&1&1}bracketVectorstack{1\1\1\1}
}
bracketVectorstack{1\1\1\1}
]
end{document}
The smaller size of Frac
is also possible, with a small redefinition:
documentclass{article}
usepackage{tabstackengine}
stackMath
newcommandFrac[2]{{%
setstackgap{L}{.7normalbaselineskip}TABstackMathstyle{scriptstyle}%
frac{addstackgap{#1}}{addstackgap{#2}}%
}}
begin{document}
[
setstacktabbedgap{1ex}
bracketVectorstack{0\0\1\1} -
Frac{
bracketMatrixstack{0&0&1&1}bracketMatrixstack{1\1\1\1}
}{
bracketMatrixstack{1&1&1&1}bracketMatrixstack{1\1\1\1}
}
bracketVectorstack{1\1\1\1}
]
end{document}
documentclass{article}
usepackage{tabstackengine}
stackMath
newcommandFrac[2]{frac{addstackgap{#1}}{addstackgap{#2}}}
begin{document}
[
setstacktabbedgap{1ex}
bracketVectorstack{0\0\1\1} -
Frac{
bracketMatrixstack{0&0&1&1}bracketVectorstack{1\1\1\1}
}{
bracketMatrixstack{1&1&1&1}bracketVectorstack{1\1\1\1}
}
bracketVectorstack{1\1\1\1}
]
end{document}
The smaller size of Frac
is also possible, with a small redefinition:
documentclass{article}
usepackage{tabstackengine}
stackMath
newcommandFrac[2]{{%
setstackgap{L}{.7normalbaselineskip}TABstackMathstyle{scriptstyle}%
frac{addstackgap{#1}}{addstackgap{#2}}%
}}
begin{document}
[
setstacktabbedgap{1ex}
bracketVectorstack{0\0\1\1} -
Frac{
bracketMatrixstack{0&0&1&1}bracketMatrixstack{1\1\1\1}
}{
bracketMatrixstack{1&1&1&1}bracketMatrixstack{1\1\1\1}
}
bracketVectorstack{1\1\1\1}
]
end{document}
edited Nov 14 at 20:13
answered Nov 14 at 17:42
Steven B. Segletes
152k9192399
152k9192399
add a comment |
add a comment |
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%2f459980%2fhow-can-i-get-a-fraction-with-a-matrix-in-the-numerator-and-denominator%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
2
You also get several errors from that input.
– egreg
Nov 14 at 17:09
what are the errors? my code compiles so I didn't notice any errors
– user130306
Nov 14 at 17:16
The second
$
causes TeX to leave math mode before your equation is finished. You should put it all the way at the end (afterend{bmatrix} }
). You may want to instead use[...]
orbegin{equation}...end{equation}
instead of$...$
since this looks like a display equation rather than an inline equation.– Circumscribe
Nov 14 at 17:20
2
The fixed code compiles normally and has the expected result for me.
– Bernard
Nov 14 at 17:25
1
yes I know, I corrected the misplaced
$
and got my desired outcome so my question no longer needs an answer– user130306
Nov 14 at 18:27