How to squeeze a long equation?
I am writing in IEEEtran two-column environment and has a display formula like this sqrt{frac{1^{2}}{0.111222}(0.111222times1.111163+0.066987^{2}times0.111222)-1}=sqrt{0.111222}=0.111222
. Before the first equal sign is a long square root. This square root is just a little bit wider than the column. Is there a way I can squeeze the square root within the column as a first line and put the rest beginning with the "=" as a second line?
equations line-breaking
add a comment |
I am writing in IEEEtran two-column environment and has a display formula like this sqrt{frac{1^{2}}{0.111222}(0.111222times1.111163+0.066987^{2}times0.111222)-1}=sqrt{0.111222}=0.111222
. Before the first equal sign is a long square root. This square root is just a little bit wider than the column. Is there a way I can squeeze the square root within the column as a first line and put the rest beginning with the "=" as a second line?
equations line-breaking
3
Can't you write0.111222 times (1.111163+0.066987^2)
?
– Ulrike Fischer
2 hours ago
I did not notice that, but those are meant to be random numbers, not necessarily the same.
– nanjun
36 mins ago
@nanjun A general solution doesn't exist, it would be better to have a “real world” example.
– egreg
12 mins ago
add a comment |
I am writing in IEEEtran two-column environment and has a display formula like this sqrt{frac{1^{2}}{0.111222}(0.111222times1.111163+0.066987^{2}times0.111222)-1}=sqrt{0.111222}=0.111222
. Before the first equal sign is a long square root. This square root is just a little bit wider than the column. Is there a way I can squeeze the square root within the column as a first line and put the rest beginning with the "=" as a second line?
equations line-breaking
I am writing in IEEEtran two-column environment and has a display formula like this sqrt{frac{1^{2}}{0.111222}(0.111222times1.111163+0.066987^{2}times0.111222)-1}=sqrt{0.111222}=0.111222
. Before the first equal sign is a long square root. This square root is just a little bit wider than the column. Is there a way I can squeeze the square root within the column as a first line and put the rest beginning with the "=" as a second line?
equations line-breaking
equations line-breaking
asked 2 hours ago
nanjun
13816
13816
3
Can't you write0.111222 times (1.111163+0.066987^2)
?
– Ulrike Fischer
2 hours ago
I did not notice that, but those are meant to be random numbers, not necessarily the same.
– nanjun
36 mins ago
@nanjun A general solution doesn't exist, it would be better to have a “real world” example.
– egreg
12 mins ago
add a comment |
3
Can't you write0.111222 times (1.111163+0.066987^2)
?
– Ulrike Fischer
2 hours ago
I did not notice that, but those are meant to be random numbers, not necessarily the same.
– nanjun
36 mins ago
@nanjun A general solution doesn't exist, it would be better to have a “real world” example.
– egreg
12 mins ago
3
3
Can't you write
0.111222 times (1.111163+0.066987^2)
?– Ulrike Fischer
2 hours ago
Can't you write
0.111222 times (1.111163+0.066987^2)
?– Ulrike Fischer
2 hours ago
I did not notice that, but those are meant to be random numbers, not necessarily the same.
– nanjun
36 mins ago
I did not notice that, but those are meant to be random numbers, not necessarily the same.
– nanjun
36 mins ago
@nanjun A general solution doesn't exist, it would be better to have a “real world” example.
– egreg
12 mins ago
@nanjun A general solution doesn't exist, it would be better to have a “real world” example.
– egreg
12 mins ago
add a comment |
4 Answers
4
active
oldest
votes
For the math expression you provided -- I have no idea how representative it is of the real material in your document -- it suffices to rearrange the position of the denominator in order to make the material before the =
symbol fit in a column; then, use an align*
environment to split the full expression across two lines.
documentclass{IEEEtran}
usepackage{amsmath} % for 'align*' env.
begin{document}
hrule % just to illustrate width of column
begin{align*}
&sqrt{frac{1^{2}(0.111222times1.111163
+0.066987^{2}times0.111222)}{0.111222}-1}\
&quad=sqrt{0.111222}=0.111222 % place remaining material on 2nd line
end{align*}
end{document}
@Sebastiano - Yes I did. Sorry for not replying sooner. Will write shortly.
– Mico
1 hour ago
add a comment |
Try using split
or multiline
in the amsmath
package. There are a couple of examples on page 2 of "Short Math Guide".
Try:
documentclass{IEEEtran}
usepackage{amsmath}
begin{document}
begin{equation}
begin{split}
sqrt{frac{1^{2}}{0.111222}(0.111222times1.111163}&\
overline{rule{0pt}{5mm}{}+0.066987^{2}times0.111222)-1}&\
=sqrt{0.111222}=0.111222&
end{split}
end{equation}
begin{multline}
sqrt{frac{1^{2}}{0.111222}(0.111222times1.111163}\
overline{rule{0pt}{5mm}{}+0.066987^{2}times0.111222)-1}\
=sqrt{0.111222}=0.111222
end{multline}
end{document}
and adjust the 5mm in rule
to get the overline
spacing to look right.
Some other options to adjust the overline
spacing
1
I think this is more a comment than an answer
– CarLaTeX
1 hour ago
1
Sorry, I don't have enough rep to comment on the post. I'm working on a more complete answer at the moment.
– xerxes25
1 hour ago
Ok, don't worry, you can edit it
– CarLaTeX
1 hour ago
It would be better if your code employed theIEEEtran
document class, which is employed by the OP, in order to demonstrate that your solution meets the OP's objective of fitting everything inside the width of a column.
– Mico
1 hour ago
@Mico thanks, fixed it. I was using 'multicol' in my test doc but removed it for simplicity when I posted the answer. Your suggestion makes more sense. Still new to this and learning something new every day!
– xerxes25
56 mins ago
|
show 1 more comment
The answer is yes. Here's an illustration (followed by an explanation).
documentclass{IEEEtran}
usepackage{amsmath}
newcommand*squeezespaces[1]{% %% <- #1 is a number between 0 and 1
thickmuskip=#1thickmuskip
medmuskip=#1medmuskip
thinmuskip=#1thinmuskip
nulldelimiterspace=#1nulldelimiterspace
scriptspace=#1scriptspace
}
begin{document}
This is a long equation This is a long equation This is a long equation
This is a long equation This is a long equation This is a long equation
[ %% vv Unaltered vv
sqrt{frac{1^{2}}{0.111222}
(0.111222times1.111163+0.066987^{2}times0.111222)-1}
= sqrt{0.111222}=0.111222
]
This is a long equation This is a long equation This is a long equation
This is a long equation This is a long equation This is a long equation
[ %% vv Squeezed and split vv
begin{split} %% <- split up equation, &'s will be aligned
kern 4em & kern-4em %% <- move anchor right by 4em
mbox{$squeezespaces{0.5} %% <- reduce whitespace, switch to textstyle
sqrt{frac{1^{2}}{0.111222}
(0.111222times1.111163+0.066987^{2}times0.111222)-1}
$}
\&
= sqrt{0.111222}
\& %% <- leave this out if you want
= 0.111222
end{split}
]
This is a long equation This is a long equation This is a long equation
This is a long equation This is a long equation This is a long equation
end{document}
I've done the following:
I've used the
split
environment fromamsmath
to split up the equation in three lines. You can reduce this to two lines by removing the second\&
.To place the anchor (
&
) at the right spot, I've inserted a horizontal space in front of it and a negative horizontal space of equal magnitude after it withmkern 4em & mkern-4em
.
The amount of whitespace inserted at several places in an equation is governed by the following lengths:
thickmuskip
(space around e.g.=
),medmuskip
(space around e.g.+
),thinmuskip
(e.g. ,
),nulldelimiterspace
(space around fractions) andscriptspace
(space after sub-/superscripts). I've halved each of these lengths usingsqueezespaces{0.5}
(which is defined in the preamble).
Doing this affects an entire equation and it can't be done inside
split
, so I've put the square root inside anmbox{$<…>$}
and usedsqueezespaces{0.5}
in the inner math environment. You can replace0.5
by another number between0
and1
if you want.
A side-effect of putting the
sqrt
in a box is that it is set intextstyle
, which also saves space because it makes e.g. fractions smaller. You could also have accomplished this by usingtfrac
instead offrac
or by insertingtextstyle
right beforesqrt
(or at the beginning of its first argument).
If you don't want text style fractions you should use
mbox{$displaystyle<…>$}
.
add a comment |
documentclass{IEEEtran}
usepackage{amsmath}
begin{document}
hrule
begin{align*}
&begin{aligned}[t]
Bigl[frac{1^2}{0.111222}(0.111222×1.111163 \
&+ 0.066987^{2}times0.111222)-1Bigr]^{frac12}
end{aligned}\
&= sqrt{0.111222} \
&= 0.111222
end{align*}
hrule
end{document}
Another option is to use 4 decimal-digits numbers (this is quite a standard in some software like MATLAB) unless these extra digits are very important.
begin{align*}
&sqrt{frac{1^2}{0.1112}(0.1112times1.1112 + 0.0670^2times0.1112)-1} \
&quad = sqrt{0.1112} \
&quad = 0.1112
end{align*}
Thanks. Would prefer to still keep the "square root sign" instead of writing to the power of 1/2.
– nanjun
14 mins ago
Then, Mico's answer is the way to go, IMO.
– AboAmmar
12 mins ago
add a comment |
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%2f467942%2fhow-to-squeeze-a-long-equation%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
For the math expression you provided -- I have no idea how representative it is of the real material in your document -- it suffices to rearrange the position of the denominator in order to make the material before the =
symbol fit in a column; then, use an align*
environment to split the full expression across two lines.
documentclass{IEEEtran}
usepackage{amsmath} % for 'align*' env.
begin{document}
hrule % just to illustrate width of column
begin{align*}
&sqrt{frac{1^{2}(0.111222times1.111163
+0.066987^{2}times0.111222)}{0.111222}-1}\
&quad=sqrt{0.111222}=0.111222 % place remaining material on 2nd line
end{align*}
end{document}
@Sebastiano - Yes I did. Sorry for not replying sooner. Will write shortly.
– Mico
1 hour ago
add a comment |
For the math expression you provided -- I have no idea how representative it is of the real material in your document -- it suffices to rearrange the position of the denominator in order to make the material before the =
symbol fit in a column; then, use an align*
environment to split the full expression across two lines.
documentclass{IEEEtran}
usepackage{amsmath} % for 'align*' env.
begin{document}
hrule % just to illustrate width of column
begin{align*}
&sqrt{frac{1^{2}(0.111222times1.111163
+0.066987^{2}times0.111222)}{0.111222}-1}\
&quad=sqrt{0.111222}=0.111222 % place remaining material on 2nd line
end{align*}
end{document}
@Sebastiano - Yes I did. Sorry for not replying sooner. Will write shortly.
– Mico
1 hour ago
add a comment |
For the math expression you provided -- I have no idea how representative it is of the real material in your document -- it suffices to rearrange the position of the denominator in order to make the material before the =
symbol fit in a column; then, use an align*
environment to split the full expression across two lines.
documentclass{IEEEtran}
usepackage{amsmath} % for 'align*' env.
begin{document}
hrule % just to illustrate width of column
begin{align*}
&sqrt{frac{1^{2}(0.111222times1.111163
+0.066987^{2}times0.111222)}{0.111222}-1}\
&quad=sqrt{0.111222}=0.111222 % place remaining material on 2nd line
end{align*}
end{document}
For the math expression you provided -- I have no idea how representative it is of the real material in your document -- it suffices to rearrange the position of the denominator in order to make the material before the =
symbol fit in a column; then, use an align*
environment to split the full expression across two lines.
documentclass{IEEEtran}
usepackage{amsmath} % for 'align*' env.
begin{document}
hrule % just to illustrate width of column
begin{align*}
&sqrt{frac{1^{2}(0.111222times1.111163
+0.066987^{2}times0.111222)}{0.111222}-1}\
&quad=sqrt{0.111222}=0.111222 % place remaining material on 2nd line
end{align*}
end{document}
answered 1 hour ago
Mico
273k30369756
273k30369756
@Sebastiano - Yes I did. Sorry for not replying sooner. Will write shortly.
– Mico
1 hour ago
add a comment |
@Sebastiano - Yes I did. Sorry for not replying sooner. Will write shortly.
– Mico
1 hour ago
@Sebastiano - Yes I did. Sorry for not replying sooner. Will write shortly.
– Mico
1 hour ago
@Sebastiano - Yes I did. Sorry for not replying sooner. Will write shortly.
– Mico
1 hour ago
add a comment |
Try using split
or multiline
in the amsmath
package. There are a couple of examples on page 2 of "Short Math Guide".
Try:
documentclass{IEEEtran}
usepackage{amsmath}
begin{document}
begin{equation}
begin{split}
sqrt{frac{1^{2}}{0.111222}(0.111222times1.111163}&\
overline{rule{0pt}{5mm}{}+0.066987^{2}times0.111222)-1}&\
=sqrt{0.111222}=0.111222&
end{split}
end{equation}
begin{multline}
sqrt{frac{1^{2}}{0.111222}(0.111222times1.111163}\
overline{rule{0pt}{5mm}{}+0.066987^{2}times0.111222)-1}\
=sqrt{0.111222}=0.111222
end{multline}
end{document}
and adjust the 5mm in rule
to get the overline
spacing to look right.
Some other options to adjust the overline
spacing
1
I think this is more a comment than an answer
– CarLaTeX
1 hour ago
1
Sorry, I don't have enough rep to comment on the post. I'm working on a more complete answer at the moment.
– xerxes25
1 hour ago
Ok, don't worry, you can edit it
– CarLaTeX
1 hour ago
It would be better if your code employed theIEEEtran
document class, which is employed by the OP, in order to demonstrate that your solution meets the OP's objective of fitting everything inside the width of a column.
– Mico
1 hour ago
@Mico thanks, fixed it. I was using 'multicol' in my test doc but removed it for simplicity when I posted the answer. Your suggestion makes more sense. Still new to this and learning something new every day!
– xerxes25
56 mins ago
|
show 1 more comment
Try using split
or multiline
in the amsmath
package. There are a couple of examples on page 2 of "Short Math Guide".
Try:
documentclass{IEEEtran}
usepackage{amsmath}
begin{document}
begin{equation}
begin{split}
sqrt{frac{1^{2}}{0.111222}(0.111222times1.111163}&\
overline{rule{0pt}{5mm}{}+0.066987^{2}times0.111222)-1}&\
=sqrt{0.111222}=0.111222&
end{split}
end{equation}
begin{multline}
sqrt{frac{1^{2}}{0.111222}(0.111222times1.111163}\
overline{rule{0pt}{5mm}{}+0.066987^{2}times0.111222)-1}\
=sqrt{0.111222}=0.111222
end{multline}
end{document}
and adjust the 5mm in rule
to get the overline
spacing to look right.
Some other options to adjust the overline
spacing
1
I think this is more a comment than an answer
– CarLaTeX
1 hour ago
1
Sorry, I don't have enough rep to comment on the post. I'm working on a more complete answer at the moment.
– xerxes25
1 hour ago
Ok, don't worry, you can edit it
– CarLaTeX
1 hour ago
It would be better if your code employed theIEEEtran
document class, which is employed by the OP, in order to demonstrate that your solution meets the OP's objective of fitting everything inside the width of a column.
– Mico
1 hour ago
@Mico thanks, fixed it. I was using 'multicol' in my test doc but removed it for simplicity when I posted the answer. Your suggestion makes more sense. Still new to this and learning something new every day!
– xerxes25
56 mins ago
|
show 1 more comment
Try using split
or multiline
in the amsmath
package. There are a couple of examples on page 2 of "Short Math Guide".
Try:
documentclass{IEEEtran}
usepackage{amsmath}
begin{document}
begin{equation}
begin{split}
sqrt{frac{1^{2}}{0.111222}(0.111222times1.111163}&\
overline{rule{0pt}{5mm}{}+0.066987^{2}times0.111222)-1}&\
=sqrt{0.111222}=0.111222&
end{split}
end{equation}
begin{multline}
sqrt{frac{1^{2}}{0.111222}(0.111222times1.111163}\
overline{rule{0pt}{5mm}{}+0.066987^{2}times0.111222)-1}\
=sqrt{0.111222}=0.111222
end{multline}
end{document}
and adjust the 5mm in rule
to get the overline
spacing to look right.
Some other options to adjust the overline
spacing
Try using split
or multiline
in the amsmath
package. There are a couple of examples on page 2 of "Short Math Guide".
Try:
documentclass{IEEEtran}
usepackage{amsmath}
begin{document}
begin{equation}
begin{split}
sqrt{frac{1^{2}}{0.111222}(0.111222times1.111163}&\
overline{rule{0pt}{5mm}{}+0.066987^{2}times0.111222)-1}&\
=sqrt{0.111222}=0.111222&
end{split}
end{equation}
begin{multline}
sqrt{frac{1^{2}}{0.111222}(0.111222times1.111163}\
overline{rule{0pt}{5mm}{}+0.066987^{2}times0.111222)-1}\
=sqrt{0.111222}=0.111222
end{multline}
end{document}
and adjust the 5mm in rule
to get the overline
spacing to look right.
Some other options to adjust the overline
spacing
edited 37 mins ago
answered 1 hour ago
xerxes25
538
538
1
I think this is more a comment than an answer
– CarLaTeX
1 hour ago
1
Sorry, I don't have enough rep to comment on the post. I'm working on a more complete answer at the moment.
– xerxes25
1 hour ago
Ok, don't worry, you can edit it
– CarLaTeX
1 hour ago
It would be better if your code employed theIEEEtran
document class, which is employed by the OP, in order to demonstrate that your solution meets the OP's objective of fitting everything inside the width of a column.
– Mico
1 hour ago
@Mico thanks, fixed it. I was using 'multicol' in my test doc but removed it for simplicity when I posted the answer. Your suggestion makes more sense. Still new to this and learning something new every day!
– xerxes25
56 mins ago
|
show 1 more comment
1
I think this is more a comment than an answer
– CarLaTeX
1 hour ago
1
Sorry, I don't have enough rep to comment on the post. I'm working on a more complete answer at the moment.
– xerxes25
1 hour ago
Ok, don't worry, you can edit it
– CarLaTeX
1 hour ago
It would be better if your code employed theIEEEtran
document class, which is employed by the OP, in order to demonstrate that your solution meets the OP's objective of fitting everything inside the width of a column.
– Mico
1 hour ago
@Mico thanks, fixed it. I was using 'multicol' in my test doc but removed it for simplicity when I posted the answer. Your suggestion makes more sense. Still new to this and learning something new every day!
– xerxes25
56 mins ago
1
1
I think this is more a comment than an answer
– CarLaTeX
1 hour ago
I think this is more a comment than an answer
– CarLaTeX
1 hour ago
1
1
Sorry, I don't have enough rep to comment on the post. I'm working on a more complete answer at the moment.
– xerxes25
1 hour ago
Sorry, I don't have enough rep to comment on the post. I'm working on a more complete answer at the moment.
– xerxes25
1 hour ago
Ok, don't worry, you can edit it
– CarLaTeX
1 hour ago
Ok, don't worry, you can edit it
– CarLaTeX
1 hour ago
It would be better if your code employed the
IEEEtran
document class, which is employed by the OP, in order to demonstrate that your solution meets the OP's objective of fitting everything inside the width of a column.– Mico
1 hour ago
It would be better if your code employed the
IEEEtran
document class, which is employed by the OP, in order to demonstrate that your solution meets the OP's objective of fitting everything inside the width of a column.– Mico
1 hour ago
@Mico thanks, fixed it. I was using 'multicol' in my test doc but removed it for simplicity when I posted the answer. Your suggestion makes more sense. Still new to this and learning something new every day!
– xerxes25
56 mins ago
@Mico thanks, fixed it. I was using 'multicol' in my test doc but removed it for simplicity when I posted the answer. Your suggestion makes more sense. Still new to this and learning something new every day!
– xerxes25
56 mins ago
|
show 1 more comment
The answer is yes. Here's an illustration (followed by an explanation).
documentclass{IEEEtran}
usepackage{amsmath}
newcommand*squeezespaces[1]{% %% <- #1 is a number between 0 and 1
thickmuskip=#1thickmuskip
medmuskip=#1medmuskip
thinmuskip=#1thinmuskip
nulldelimiterspace=#1nulldelimiterspace
scriptspace=#1scriptspace
}
begin{document}
This is a long equation This is a long equation This is a long equation
This is a long equation This is a long equation This is a long equation
[ %% vv Unaltered vv
sqrt{frac{1^{2}}{0.111222}
(0.111222times1.111163+0.066987^{2}times0.111222)-1}
= sqrt{0.111222}=0.111222
]
This is a long equation This is a long equation This is a long equation
This is a long equation This is a long equation This is a long equation
[ %% vv Squeezed and split vv
begin{split} %% <- split up equation, &'s will be aligned
kern 4em & kern-4em %% <- move anchor right by 4em
mbox{$squeezespaces{0.5} %% <- reduce whitespace, switch to textstyle
sqrt{frac{1^{2}}{0.111222}
(0.111222times1.111163+0.066987^{2}times0.111222)-1}
$}
\&
= sqrt{0.111222}
\& %% <- leave this out if you want
= 0.111222
end{split}
]
This is a long equation This is a long equation This is a long equation
This is a long equation This is a long equation This is a long equation
end{document}
I've done the following:
I've used the
split
environment fromamsmath
to split up the equation in three lines. You can reduce this to two lines by removing the second\&
.To place the anchor (
&
) at the right spot, I've inserted a horizontal space in front of it and a negative horizontal space of equal magnitude after it withmkern 4em & mkern-4em
.
The amount of whitespace inserted at several places in an equation is governed by the following lengths:
thickmuskip
(space around e.g.=
),medmuskip
(space around e.g.+
),thinmuskip
(e.g. ,
),nulldelimiterspace
(space around fractions) andscriptspace
(space after sub-/superscripts). I've halved each of these lengths usingsqueezespaces{0.5}
(which is defined in the preamble).
Doing this affects an entire equation and it can't be done inside
split
, so I've put the square root inside anmbox{$<…>$}
and usedsqueezespaces{0.5}
in the inner math environment. You can replace0.5
by another number between0
and1
if you want.
A side-effect of putting the
sqrt
in a box is that it is set intextstyle
, which also saves space because it makes e.g. fractions smaller. You could also have accomplished this by usingtfrac
instead offrac
or by insertingtextstyle
right beforesqrt
(or at the beginning of its first argument).
If you don't want text style fractions you should use
mbox{$displaystyle<…>$}
.
add a comment |
The answer is yes. Here's an illustration (followed by an explanation).
documentclass{IEEEtran}
usepackage{amsmath}
newcommand*squeezespaces[1]{% %% <- #1 is a number between 0 and 1
thickmuskip=#1thickmuskip
medmuskip=#1medmuskip
thinmuskip=#1thinmuskip
nulldelimiterspace=#1nulldelimiterspace
scriptspace=#1scriptspace
}
begin{document}
This is a long equation This is a long equation This is a long equation
This is a long equation This is a long equation This is a long equation
[ %% vv Unaltered vv
sqrt{frac{1^{2}}{0.111222}
(0.111222times1.111163+0.066987^{2}times0.111222)-1}
= sqrt{0.111222}=0.111222
]
This is a long equation This is a long equation This is a long equation
This is a long equation This is a long equation This is a long equation
[ %% vv Squeezed and split vv
begin{split} %% <- split up equation, &'s will be aligned
kern 4em & kern-4em %% <- move anchor right by 4em
mbox{$squeezespaces{0.5} %% <- reduce whitespace, switch to textstyle
sqrt{frac{1^{2}}{0.111222}
(0.111222times1.111163+0.066987^{2}times0.111222)-1}
$}
\&
= sqrt{0.111222}
\& %% <- leave this out if you want
= 0.111222
end{split}
]
This is a long equation This is a long equation This is a long equation
This is a long equation This is a long equation This is a long equation
end{document}
I've done the following:
I've used the
split
environment fromamsmath
to split up the equation in three lines. You can reduce this to two lines by removing the second\&
.To place the anchor (
&
) at the right spot, I've inserted a horizontal space in front of it and a negative horizontal space of equal magnitude after it withmkern 4em & mkern-4em
.
The amount of whitespace inserted at several places in an equation is governed by the following lengths:
thickmuskip
(space around e.g.=
),medmuskip
(space around e.g.+
),thinmuskip
(e.g. ,
),nulldelimiterspace
(space around fractions) andscriptspace
(space after sub-/superscripts). I've halved each of these lengths usingsqueezespaces{0.5}
(which is defined in the preamble).
Doing this affects an entire equation and it can't be done inside
split
, so I've put the square root inside anmbox{$<…>$}
and usedsqueezespaces{0.5}
in the inner math environment. You can replace0.5
by another number between0
and1
if you want.
A side-effect of putting the
sqrt
in a box is that it is set intextstyle
, which also saves space because it makes e.g. fractions smaller. You could also have accomplished this by usingtfrac
instead offrac
or by insertingtextstyle
right beforesqrt
(or at the beginning of its first argument).
If you don't want text style fractions you should use
mbox{$displaystyle<…>$}
.
add a comment |
The answer is yes. Here's an illustration (followed by an explanation).
documentclass{IEEEtran}
usepackage{amsmath}
newcommand*squeezespaces[1]{% %% <- #1 is a number between 0 and 1
thickmuskip=#1thickmuskip
medmuskip=#1medmuskip
thinmuskip=#1thinmuskip
nulldelimiterspace=#1nulldelimiterspace
scriptspace=#1scriptspace
}
begin{document}
This is a long equation This is a long equation This is a long equation
This is a long equation This is a long equation This is a long equation
[ %% vv Unaltered vv
sqrt{frac{1^{2}}{0.111222}
(0.111222times1.111163+0.066987^{2}times0.111222)-1}
= sqrt{0.111222}=0.111222
]
This is a long equation This is a long equation This is a long equation
This is a long equation This is a long equation This is a long equation
[ %% vv Squeezed and split vv
begin{split} %% <- split up equation, &'s will be aligned
kern 4em & kern-4em %% <- move anchor right by 4em
mbox{$squeezespaces{0.5} %% <- reduce whitespace, switch to textstyle
sqrt{frac{1^{2}}{0.111222}
(0.111222times1.111163+0.066987^{2}times0.111222)-1}
$}
\&
= sqrt{0.111222}
\& %% <- leave this out if you want
= 0.111222
end{split}
]
This is a long equation This is a long equation This is a long equation
This is a long equation This is a long equation This is a long equation
end{document}
I've done the following:
I've used the
split
environment fromamsmath
to split up the equation in three lines. You can reduce this to two lines by removing the second\&
.To place the anchor (
&
) at the right spot, I've inserted a horizontal space in front of it and a negative horizontal space of equal magnitude after it withmkern 4em & mkern-4em
.
The amount of whitespace inserted at several places in an equation is governed by the following lengths:
thickmuskip
(space around e.g.=
),medmuskip
(space around e.g.+
),thinmuskip
(e.g. ,
),nulldelimiterspace
(space around fractions) andscriptspace
(space after sub-/superscripts). I've halved each of these lengths usingsqueezespaces{0.5}
(which is defined in the preamble).
Doing this affects an entire equation and it can't be done inside
split
, so I've put the square root inside anmbox{$<…>$}
and usedsqueezespaces{0.5}
in the inner math environment. You can replace0.5
by another number between0
and1
if you want.
A side-effect of putting the
sqrt
in a box is that it is set intextstyle
, which also saves space because it makes e.g. fractions smaller. You could also have accomplished this by usingtfrac
instead offrac
or by insertingtextstyle
right beforesqrt
(or at the beginning of its first argument).
If you don't want text style fractions you should use
mbox{$displaystyle<…>$}
.
The answer is yes. Here's an illustration (followed by an explanation).
documentclass{IEEEtran}
usepackage{amsmath}
newcommand*squeezespaces[1]{% %% <- #1 is a number between 0 and 1
thickmuskip=#1thickmuskip
medmuskip=#1medmuskip
thinmuskip=#1thinmuskip
nulldelimiterspace=#1nulldelimiterspace
scriptspace=#1scriptspace
}
begin{document}
This is a long equation This is a long equation This is a long equation
This is a long equation This is a long equation This is a long equation
[ %% vv Unaltered vv
sqrt{frac{1^{2}}{0.111222}
(0.111222times1.111163+0.066987^{2}times0.111222)-1}
= sqrt{0.111222}=0.111222
]
This is a long equation This is a long equation This is a long equation
This is a long equation This is a long equation This is a long equation
[ %% vv Squeezed and split vv
begin{split} %% <- split up equation, &'s will be aligned
kern 4em & kern-4em %% <- move anchor right by 4em
mbox{$squeezespaces{0.5} %% <- reduce whitespace, switch to textstyle
sqrt{frac{1^{2}}{0.111222}
(0.111222times1.111163+0.066987^{2}times0.111222)-1}
$}
\&
= sqrt{0.111222}
\& %% <- leave this out if you want
= 0.111222
end{split}
]
This is a long equation This is a long equation This is a long equation
This is a long equation This is a long equation This is a long equation
end{document}
I've done the following:
I've used the
split
environment fromamsmath
to split up the equation in three lines. You can reduce this to two lines by removing the second\&
.To place the anchor (
&
) at the right spot, I've inserted a horizontal space in front of it and a negative horizontal space of equal magnitude after it withmkern 4em & mkern-4em
.
The amount of whitespace inserted at several places in an equation is governed by the following lengths:
thickmuskip
(space around e.g.=
),medmuskip
(space around e.g.+
),thinmuskip
(e.g. ,
),nulldelimiterspace
(space around fractions) andscriptspace
(space after sub-/superscripts). I've halved each of these lengths usingsqueezespaces{0.5}
(which is defined in the preamble).
Doing this affects an entire equation and it can't be done inside
split
, so I've put the square root inside anmbox{$<…>$}
and usedsqueezespaces{0.5}
in the inner math environment. You can replace0.5
by another number between0
and1
if you want.
A side-effect of putting the
sqrt
in a box is that it is set intextstyle
, which also saves space because it makes e.g. fractions smaller. You could also have accomplished this by usingtfrac
instead offrac
or by insertingtextstyle
right beforesqrt
(or at the beginning of its first argument).
If you don't want text style fractions you should use
mbox{$displaystyle<…>$}
.
edited 37 secs ago
answered 50 mins ago
Circumscribe
4,6461432
4,6461432
add a comment |
add a comment |
documentclass{IEEEtran}
usepackage{amsmath}
begin{document}
hrule
begin{align*}
&begin{aligned}[t]
Bigl[frac{1^2}{0.111222}(0.111222×1.111163 \
&+ 0.066987^{2}times0.111222)-1Bigr]^{frac12}
end{aligned}\
&= sqrt{0.111222} \
&= 0.111222
end{align*}
hrule
end{document}
Another option is to use 4 decimal-digits numbers (this is quite a standard in some software like MATLAB) unless these extra digits are very important.
begin{align*}
&sqrt{frac{1^2}{0.1112}(0.1112times1.1112 + 0.0670^2times0.1112)-1} \
&quad = sqrt{0.1112} \
&quad = 0.1112
end{align*}
Thanks. Would prefer to still keep the "square root sign" instead of writing to the power of 1/2.
– nanjun
14 mins ago
Then, Mico's answer is the way to go, IMO.
– AboAmmar
12 mins ago
add a comment |
documentclass{IEEEtran}
usepackage{amsmath}
begin{document}
hrule
begin{align*}
&begin{aligned}[t]
Bigl[frac{1^2}{0.111222}(0.111222×1.111163 \
&+ 0.066987^{2}times0.111222)-1Bigr]^{frac12}
end{aligned}\
&= sqrt{0.111222} \
&= 0.111222
end{align*}
hrule
end{document}
Another option is to use 4 decimal-digits numbers (this is quite a standard in some software like MATLAB) unless these extra digits are very important.
begin{align*}
&sqrt{frac{1^2}{0.1112}(0.1112times1.1112 + 0.0670^2times0.1112)-1} \
&quad = sqrt{0.1112} \
&quad = 0.1112
end{align*}
Thanks. Would prefer to still keep the "square root sign" instead of writing to the power of 1/2.
– nanjun
14 mins ago
Then, Mico's answer is the way to go, IMO.
– AboAmmar
12 mins ago
add a comment |
documentclass{IEEEtran}
usepackage{amsmath}
begin{document}
hrule
begin{align*}
&begin{aligned}[t]
Bigl[frac{1^2}{0.111222}(0.111222×1.111163 \
&+ 0.066987^{2}times0.111222)-1Bigr]^{frac12}
end{aligned}\
&= sqrt{0.111222} \
&= 0.111222
end{align*}
hrule
end{document}
Another option is to use 4 decimal-digits numbers (this is quite a standard in some software like MATLAB) unless these extra digits are very important.
begin{align*}
&sqrt{frac{1^2}{0.1112}(0.1112times1.1112 + 0.0670^2times0.1112)-1} \
&quad = sqrt{0.1112} \
&quad = 0.1112
end{align*}
documentclass{IEEEtran}
usepackage{amsmath}
begin{document}
hrule
begin{align*}
&begin{aligned}[t]
Bigl[frac{1^2}{0.111222}(0.111222×1.111163 \
&+ 0.066987^{2}times0.111222)-1Bigr]^{frac12}
end{aligned}\
&= sqrt{0.111222} \
&= 0.111222
end{align*}
hrule
end{document}
Another option is to use 4 decimal-digits numbers (this is quite a standard in some software like MATLAB) unless these extra digits are very important.
begin{align*}
&sqrt{frac{1^2}{0.1112}(0.1112times1.1112 + 0.0670^2times0.1112)-1} \
&quad = sqrt{0.1112} \
&quad = 0.1112
end{align*}
edited 2 mins ago
answered 18 mins ago
AboAmmar
33k22882
33k22882
Thanks. Would prefer to still keep the "square root sign" instead of writing to the power of 1/2.
– nanjun
14 mins ago
Then, Mico's answer is the way to go, IMO.
– AboAmmar
12 mins ago
add a comment |
Thanks. Would prefer to still keep the "square root sign" instead of writing to the power of 1/2.
– nanjun
14 mins ago
Then, Mico's answer is the way to go, IMO.
– AboAmmar
12 mins ago
Thanks. Would prefer to still keep the "square root sign" instead of writing to the power of 1/2.
– nanjun
14 mins ago
Thanks. Would prefer to still keep the "square root sign" instead of writing to the power of 1/2.
– nanjun
14 mins ago
Then, Mico's answer is the way to go, IMO.
– AboAmmar
12 mins ago
Then, Mico's answer is the way to go, IMO.
– AboAmmar
12 mins ago
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%2f467942%2fhow-to-squeeze-a-long-equation%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
3
Can't you write
0.111222 times (1.111163+0.066987^2)
?– Ulrike Fischer
2 hours ago
I did not notice that, but those are meant to be random numbers, not necessarily the same.
– nanjun
36 mins ago
@nanjun A general solution doesn't exist, it would be better to have a “real world” example.
– egreg
12 mins ago