Equation Array Exceed Right Margineqnarray vs alignHow to prevent text generated with `Sweave` from running off the right margin?Equation array troublesMulti-line equations in latexEquation left marginMinted. Code highlighting right marginHow to prevent the label of a long equation running into the right margin?Modify right MarginRight margin exceedsArray in multiple linesVertical alignment of different systems of equations
DD4T webapp using discovery service gets 'invalid_grant'
Why doesn't using two cd commands in bash script execute the second command?
Min function accepting varying number of arguments in C++17
Instead of Universal Basic Income, why not Universal Basic NEEDS?
Will a pinhole camera work with instant film?
Declaring defaulted assignment operator as constexpr: which compiler is right?
Co-worker team leader wants to inject his friend's awful software into our development. What should I say to our common boss?
Why do Australian milk farmers need to protest supermarkets' milk price?
Employee lack of ownership
Know when to turn notes upside-down(eighth notes, sixteen notes, etc.)
Good allowance savings plan?
Ban on all campaign finance?
How could a female member of a species produce eggs unto death?
Professor being mistaken for a grad student
Pass associative array as parameter list to script
Are all passive ability checks floors for active ability checks?
Did CP/M support custom hardware using device drivers?
Russian cases: A few examples, I'm really confused
Why must traveling waves have the same amplitude to form a standing wave?
Gravity magic - How does it work?
What should tie a collection of short-stories together?
I need to drive a 7/16" nut but am unsure how to use the socket I bought for my screwdriver
Why did it take so long to abandon sail after steamships were demonstrated?
Can elves maintain concentration in a trance?
Equation Array Exceed Right Margin
eqnarray vs alignHow to prevent text generated with `Sweave` from running off the right margin?Equation array troublesMulti-line equations in latexEquation left marginMinted. Code highlighting right marginHow to prevent the label of a long equation running into the right margin?Modify right MarginRight margin exceedsArray in multiple linesVertical alignment of different systems of equations
I write equations in eqnarray
use Latex, but there are lines that exceed the right margin, how to fix it?
This is my code:
begineqnarray
k_1&=&hf(t_i, y_i)=hf_i label$k_1$ RK-4\
k_2&=&hf(t_i+p_1h, y_i+q_11_k1)nonumber\
&=&h(f_i+p_1hf_t+q_11k_1f_y)nonumber\
&=&h(f_i+p_1hf_t+q_11hf_if_y)\
k_3&=&hf(t_i+p_2h,y_i+q_21k_1+q_22k_2)nonumber\
&=&h(f_i+p_2hf_t+q_21k_1f_y+q_22k_2f_y)nonumber\
&=&h(f_i+p_2hf_t+q_21hf_if_y+q_22 h(f_i+p_1hf_t+q_11hf_if_y)f_y)nonumber\
&=&h(f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y +q_22h^2p_1f_tf_y+q_11q22h^2f_i(f_y)^2)\
k_4&=&hf(t_i+p_3h, y_i+q_31k_1+q_32k_2+q_33k_3)nonumber\
&=&h(f_i+p_3hf_t+q_31k_1f_y+q_32k_2f_y+q_33k_3f_y)nonumber\
&=&h(f_i+p_3hf_t+q_31hf_if_y+q_32 h(f_i+p_1hf_t+q_11hf_if_y)f_y +q_33h(f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y+q_22h^2p_1f_tf_y+q_21q_22h^2f_i(f_y)^2)f_y)nonumber\
&=&h(f_i+p_3hf_t+q_31hf_if_y+q_32hf_if_y +p_1q_32h^2f_tf_y +q_11q_32h^2f_i(f_y)^2+q_33hf_if_y+p_2q_33h^2f_tf_y+q_21q_33h^2f_i(f_y)^2+q_22q_33h^2f_i(f_y)^2+q_22q_33p_1h^3f_t(f_y)^2+q_11q_22q_33h^3f_i(f_y)^3)\
endeqnarray
and this is the result:
equations margins eqnarray
New contributor
add a comment |
I write equations in eqnarray
use Latex, but there are lines that exceed the right margin, how to fix it?
This is my code:
begineqnarray
k_1&=&hf(t_i, y_i)=hf_i label$k_1$ RK-4\
k_2&=&hf(t_i+p_1h, y_i+q_11_k1)nonumber\
&=&h(f_i+p_1hf_t+q_11k_1f_y)nonumber\
&=&h(f_i+p_1hf_t+q_11hf_if_y)\
k_3&=&hf(t_i+p_2h,y_i+q_21k_1+q_22k_2)nonumber\
&=&h(f_i+p_2hf_t+q_21k_1f_y+q_22k_2f_y)nonumber\
&=&h(f_i+p_2hf_t+q_21hf_if_y+q_22 h(f_i+p_1hf_t+q_11hf_if_y)f_y)nonumber\
&=&h(f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y +q_22h^2p_1f_tf_y+q_11q22h^2f_i(f_y)^2)\
k_4&=&hf(t_i+p_3h, y_i+q_31k_1+q_32k_2+q_33k_3)nonumber\
&=&h(f_i+p_3hf_t+q_31k_1f_y+q_32k_2f_y+q_33k_3f_y)nonumber\
&=&h(f_i+p_3hf_t+q_31hf_if_y+q_32 h(f_i+p_1hf_t+q_11hf_if_y)f_y +q_33h(f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y+q_22h^2p_1f_tf_y+q_21q_22h^2f_i(f_y)^2)f_y)nonumber\
&=&h(f_i+p_3hf_t+q_31hf_if_y+q_32hf_if_y +p_1q_32h^2f_tf_y +q_11q_32h^2f_i(f_y)^2+q_33hf_if_y+p_2q_33h^2f_tf_y+q_21q_33h^2f_i(f_y)^2+q_22q_33h^2f_i(f_y)^2+q_22q_33p_1h^3f_t(f_y)^2+q_11q_22q_33h^3f_i(f_y)^3)\
endeqnarray
and this is the result:
equations margins eqnarray
New contributor
3
The equation is too wide because it is too wide. However, you already know how to introduce line breaks. Please note that most users have switched toalign
instead ofeqnarray
. (However, the latter does not solve the problem automatically,breqn
does in principle but I personally would rather break the lines by hand than usingbreqn
.)
– marmot
12 hours ago
I got it, thank you.
– liswyhy
12 hours ago
1
@liswyhy Just to remind you that the>
s in your code block prevent your code from being compilable. Removing that is better. (and I did it for you.)
– JouleV
9 hours ago
add a comment |
I write equations in eqnarray
use Latex, but there are lines that exceed the right margin, how to fix it?
This is my code:
begineqnarray
k_1&=&hf(t_i, y_i)=hf_i label$k_1$ RK-4\
k_2&=&hf(t_i+p_1h, y_i+q_11_k1)nonumber\
&=&h(f_i+p_1hf_t+q_11k_1f_y)nonumber\
&=&h(f_i+p_1hf_t+q_11hf_if_y)\
k_3&=&hf(t_i+p_2h,y_i+q_21k_1+q_22k_2)nonumber\
&=&h(f_i+p_2hf_t+q_21k_1f_y+q_22k_2f_y)nonumber\
&=&h(f_i+p_2hf_t+q_21hf_if_y+q_22 h(f_i+p_1hf_t+q_11hf_if_y)f_y)nonumber\
&=&h(f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y +q_22h^2p_1f_tf_y+q_11q22h^2f_i(f_y)^2)\
k_4&=&hf(t_i+p_3h, y_i+q_31k_1+q_32k_2+q_33k_3)nonumber\
&=&h(f_i+p_3hf_t+q_31k_1f_y+q_32k_2f_y+q_33k_3f_y)nonumber\
&=&h(f_i+p_3hf_t+q_31hf_if_y+q_32 h(f_i+p_1hf_t+q_11hf_if_y)f_y +q_33h(f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y+q_22h^2p_1f_tf_y+q_21q_22h^2f_i(f_y)^2)f_y)nonumber\
&=&h(f_i+p_3hf_t+q_31hf_if_y+q_32hf_if_y +p_1q_32h^2f_tf_y +q_11q_32h^2f_i(f_y)^2+q_33hf_if_y+p_2q_33h^2f_tf_y+q_21q_33h^2f_i(f_y)^2+q_22q_33h^2f_i(f_y)^2+q_22q_33p_1h^3f_t(f_y)^2+q_11q_22q_33h^3f_i(f_y)^3)\
endeqnarray
and this is the result:
equations margins eqnarray
New contributor
I write equations in eqnarray
use Latex, but there are lines that exceed the right margin, how to fix it?
This is my code:
begineqnarray
k_1&=&hf(t_i, y_i)=hf_i label$k_1$ RK-4\
k_2&=&hf(t_i+p_1h, y_i+q_11_k1)nonumber\
&=&h(f_i+p_1hf_t+q_11k_1f_y)nonumber\
&=&h(f_i+p_1hf_t+q_11hf_if_y)\
k_3&=&hf(t_i+p_2h,y_i+q_21k_1+q_22k_2)nonumber\
&=&h(f_i+p_2hf_t+q_21k_1f_y+q_22k_2f_y)nonumber\
&=&h(f_i+p_2hf_t+q_21hf_if_y+q_22 h(f_i+p_1hf_t+q_11hf_if_y)f_y)nonumber\
&=&h(f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y +q_22h^2p_1f_tf_y+q_11q22h^2f_i(f_y)^2)\
k_4&=&hf(t_i+p_3h, y_i+q_31k_1+q_32k_2+q_33k_3)nonumber\
&=&h(f_i+p_3hf_t+q_31k_1f_y+q_32k_2f_y+q_33k_3f_y)nonumber\
&=&h(f_i+p_3hf_t+q_31hf_if_y+q_32 h(f_i+p_1hf_t+q_11hf_if_y)f_y +q_33h(f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y+q_22h^2p_1f_tf_y+q_21q_22h^2f_i(f_y)^2)f_y)nonumber\
&=&h(f_i+p_3hf_t+q_31hf_if_y+q_32hf_if_y +p_1q_32h^2f_tf_y +q_11q_32h^2f_i(f_y)^2+q_33hf_if_y+p_2q_33h^2f_tf_y+q_21q_33h^2f_i(f_y)^2+q_22q_33h^2f_i(f_y)^2+q_22q_33p_1h^3f_t(f_y)^2+q_11q_22q_33h^3f_i(f_y)^3)\
endeqnarray
and this is the result:
equations margins eqnarray
equations margins eqnarray
New contributor
New contributor
edited 7 hours ago
Mico
283k31388775
283k31388775
New contributor
asked 12 hours ago
liswyhyliswyhy
363
363
New contributor
New contributor
3
The equation is too wide because it is too wide. However, you already know how to introduce line breaks. Please note that most users have switched toalign
instead ofeqnarray
. (However, the latter does not solve the problem automatically,breqn
does in principle but I personally would rather break the lines by hand than usingbreqn
.)
– marmot
12 hours ago
I got it, thank you.
– liswyhy
12 hours ago
1
@liswyhy Just to remind you that the>
s in your code block prevent your code from being compilable. Removing that is better. (and I did it for you.)
– JouleV
9 hours ago
add a comment |
3
The equation is too wide because it is too wide. However, you already know how to introduce line breaks. Please note that most users have switched toalign
instead ofeqnarray
. (However, the latter does not solve the problem automatically,breqn
does in principle but I personally would rather break the lines by hand than usingbreqn
.)
– marmot
12 hours ago
I got it, thank you.
– liswyhy
12 hours ago
1
@liswyhy Just to remind you that the>
s in your code block prevent your code from being compilable. Removing that is better. (and I did it for you.)
– JouleV
9 hours ago
3
3
The equation is too wide because it is too wide. However, you already know how to introduce line breaks. Please note that most users have switched to
align
instead of eqnarray
. (However, the latter does not solve the problem automatically, breqn
does in principle but I personally would rather break the lines by hand than using breqn
.)– marmot
12 hours ago
The equation is too wide because it is too wide. However, you already know how to introduce line breaks. Please note that most users have switched to
align
instead of eqnarray
. (However, the latter does not solve the problem automatically, breqn
does in principle but I personally would rather break the lines by hand than using breqn
.)– marmot
12 hours ago
I got it, thank you.
– liswyhy
12 hours ago
I got it, thank you.
– liswyhy
12 hours ago
1
1
@liswyhy Just to remind you that the
>
s in your code block prevent your code from being compilable. Removing that is better. (and I did it for you.)– JouleV
9 hours ago
@liswyhy Just to remind you that the
>
s in your code block prevent your code from being compilable. Removing that is better. (and I did it for you.)– JouleV
9 hours ago
add a comment |
2 Answers
2
active
oldest
votes
In addition to inserting some line breaks by hand in the final two rows, you also need to fix some of the notation by adding curly braces as needed in the terms q_11
, q_21
, q_22
, etc. (And _k1
should be k_1
, right?) When the parenthetic structures are nested, it helps readers if square brackets and curly braces are used in addition to round parentheses, to help detect the orders of the parentheses.
And you most definitely should not be using the badly deprecated eqnarray
environment. Use the align
environment, which is provided by the amsmath
package, instead.
documentclassarticle
usepackageamsmath % for 'align' environment and 'notag' macro
begindocument
beginalign
k_1 &= hf(t_i, y_i)=hf_i labelk1_RK_4\
k_2 &= hf(t_i+p_1h, y_i+q_11k_1) notag\
&= h(f_i+p_1hf_t+q_11k_1f_y) notag\
&= h(f_i+p_1hf_t+q_11hf_if_y)\
k_3 &= hf(t_i+p_2h, y_i+q_21k_1+q_22k_2) notag\
&= h(f_i+p_2hf_t+q_21k_1f_y+q_22k_2f_y) notag\
&= h[f_i+p_2hf_t+q_21hf_if_y+q_22h(f_i+p_1hf_t+q_11hf_if_y)f_y] notag\
&= h[f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y+q_22h^2p_1f_tf_y+q_11q_22h^2!f_i(f_y)^2]\
k_4 &= hf(t_i+p_3h, y_i+q_31k_1+q_32k_2+q_33k_3) notag\
&= h(f_i+p_3hf_t+q_31k_1f_y+q_32k_2f_y+q_33k_3f_y) notag\
&= hf_i+p_3hf_t+q_31hf_if_y+q_32h(f_i+p_1hf_t+q_11hf_if_y)f_y notag\
&qquad +q_33h[f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y+q_22h^2p_1f_tf_y notag\
&qquad +q_21q_22h^2!f_i(f_y)^2]f_y notag\
&= hf_i+p_3hf_t+q_31hf_if_y+q_32hf_if_y+p_1q_32h^2!f_tf_y+q_11q_32h^2!f_i(f_y)^2 notag\
&qquad +q_33hf_if_y+p_2q_33h^2!f_tf_y+q_21q_33h^2!f_i(f_y)^2+q_22q_33h^2!f_i(f_y)^2 notag\
&qquad+q_22q_33p_1h^3!f_t(f_y)^2+q_11q_22q_33h^3!f_i(f_y)^3
endalign
enddocument
I forgot to mention another adjustment I made: I inserted negative thinspace (!
) in all instances of eitherh^2
orh^3
being followed byf
. This avoids creating "visual holes" in the formulas.
– Mico
4 hours ago
add a comment |
Besides the standard advice of not using eqnarray
for whatsoever reason, see eqnarray vs align, I'd recommend using split
for this, so to divide each block into a single unit.
With the tbtags
option, we ensure that the number attached to a split
equation is added at the bottom (when equation numbers are on the right) or at the top.
documentclassarticle
usepackage[tbtags]amsmath % for math
begindocument
beginalign
k_1 &= hf(t_i, y_i)=hf_i labelk1_RK_4
\
beginsplit
k_2 &= hf(t_i+p_1h, y_i+q_11k_1) \
&= h(f_i+p_1hf_t+q_11k_1f_y) \
&= h(f_i+p_1hf_t+q_11hf_if_y)
endsplit
\
beginsplit
k_3 &= hf(t_i+p_2h, y_i+q_21k_1+q_22k_2) \
&= h(f_i+p_2hf_t+q_21k_1f_y+q_22k_2f_y) \
&= h[f_i+p_2hf_t+q_21hf_if_y+q_22h(f_i+p_1hf_t+q_11hf_if_y)f_y] \
&= h[f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y+q_22h^2p_1f_tf_y+
q_11q_22h^2!f_i(f_y)^2]
endsplit
\
beginsplit
k_4 &= hf(t_i+p_3h, y_i+q_31k_1+q_32k_2+q_33k_3) \
&= h(f_i+p_3hf_t+q_31k_1f_y+q_32k_2f_y+q_33k_3f_y) \
&= hf_i+p_3hf_t+q_31hf_if_y+q_32h(f_i+p_1hf_t+q_11hf_if_y)f_y \
&qquad +q_33h[f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y+q_22h^2p_1f_tf_y \
&qquad +q_21q_22h^2!f_i(f_y)^2]f_y \
&= hf_i+p_3hf_t+q_31hf_if_y+q_32hf_if_y+p_1q_32h^2!f_tf_y+
q_11q_32h^2!f_i(f_y)^2 \
&qquad +q_33hf_if_y+p_2q_33h^2!f_tf_y+q_21q_33h^2!f_i(f_y)^2+
q_22q_33h^2!f_i(f_y)^2 \
&qquad+q_22q_33p_1h^3!f_t(f_y)^2+q_11q_22q_33h^3!f_i(f_y)^3
endsplit
endalign
enddocument
Canmultline
be another solution? P.S. Nice answer!
– manooooh
5 hours ago
1
+1. You may want to point out explicitly the role that setting the optiontbtags
plays here. :-)
– Mico
4 hours 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
);
);
liswyhy is a new contributor. Be nice, and check out our Code of Conduct.
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%2f479557%2fequation-array-exceed-right-margin%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
In addition to inserting some line breaks by hand in the final two rows, you also need to fix some of the notation by adding curly braces as needed in the terms q_11
, q_21
, q_22
, etc. (And _k1
should be k_1
, right?) When the parenthetic structures are nested, it helps readers if square brackets and curly braces are used in addition to round parentheses, to help detect the orders of the parentheses.
And you most definitely should not be using the badly deprecated eqnarray
environment. Use the align
environment, which is provided by the amsmath
package, instead.
documentclassarticle
usepackageamsmath % for 'align' environment and 'notag' macro
begindocument
beginalign
k_1 &= hf(t_i, y_i)=hf_i labelk1_RK_4\
k_2 &= hf(t_i+p_1h, y_i+q_11k_1) notag\
&= h(f_i+p_1hf_t+q_11k_1f_y) notag\
&= h(f_i+p_1hf_t+q_11hf_if_y)\
k_3 &= hf(t_i+p_2h, y_i+q_21k_1+q_22k_2) notag\
&= h(f_i+p_2hf_t+q_21k_1f_y+q_22k_2f_y) notag\
&= h[f_i+p_2hf_t+q_21hf_if_y+q_22h(f_i+p_1hf_t+q_11hf_if_y)f_y] notag\
&= h[f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y+q_22h^2p_1f_tf_y+q_11q_22h^2!f_i(f_y)^2]\
k_4 &= hf(t_i+p_3h, y_i+q_31k_1+q_32k_2+q_33k_3) notag\
&= h(f_i+p_3hf_t+q_31k_1f_y+q_32k_2f_y+q_33k_3f_y) notag\
&= hf_i+p_3hf_t+q_31hf_if_y+q_32h(f_i+p_1hf_t+q_11hf_if_y)f_y notag\
&qquad +q_33h[f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y+q_22h^2p_1f_tf_y notag\
&qquad +q_21q_22h^2!f_i(f_y)^2]f_y notag\
&= hf_i+p_3hf_t+q_31hf_if_y+q_32hf_if_y+p_1q_32h^2!f_tf_y+q_11q_32h^2!f_i(f_y)^2 notag\
&qquad +q_33hf_if_y+p_2q_33h^2!f_tf_y+q_21q_33h^2!f_i(f_y)^2+q_22q_33h^2!f_i(f_y)^2 notag\
&qquad+q_22q_33p_1h^3!f_t(f_y)^2+q_11q_22q_33h^3!f_i(f_y)^3
endalign
enddocument
I forgot to mention another adjustment I made: I inserted negative thinspace (!
) in all instances of eitherh^2
orh^3
being followed byf
. This avoids creating "visual holes" in the formulas.
– Mico
4 hours ago
add a comment |
In addition to inserting some line breaks by hand in the final two rows, you also need to fix some of the notation by adding curly braces as needed in the terms q_11
, q_21
, q_22
, etc. (And _k1
should be k_1
, right?) When the parenthetic structures are nested, it helps readers if square brackets and curly braces are used in addition to round parentheses, to help detect the orders of the parentheses.
And you most definitely should not be using the badly deprecated eqnarray
environment. Use the align
environment, which is provided by the amsmath
package, instead.
documentclassarticle
usepackageamsmath % for 'align' environment and 'notag' macro
begindocument
beginalign
k_1 &= hf(t_i, y_i)=hf_i labelk1_RK_4\
k_2 &= hf(t_i+p_1h, y_i+q_11k_1) notag\
&= h(f_i+p_1hf_t+q_11k_1f_y) notag\
&= h(f_i+p_1hf_t+q_11hf_if_y)\
k_3 &= hf(t_i+p_2h, y_i+q_21k_1+q_22k_2) notag\
&= h(f_i+p_2hf_t+q_21k_1f_y+q_22k_2f_y) notag\
&= h[f_i+p_2hf_t+q_21hf_if_y+q_22h(f_i+p_1hf_t+q_11hf_if_y)f_y] notag\
&= h[f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y+q_22h^2p_1f_tf_y+q_11q_22h^2!f_i(f_y)^2]\
k_4 &= hf(t_i+p_3h, y_i+q_31k_1+q_32k_2+q_33k_3) notag\
&= h(f_i+p_3hf_t+q_31k_1f_y+q_32k_2f_y+q_33k_3f_y) notag\
&= hf_i+p_3hf_t+q_31hf_if_y+q_32h(f_i+p_1hf_t+q_11hf_if_y)f_y notag\
&qquad +q_33h[f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y+q_22h^2p_1f_tf_y notag\
&qquad +q_21q_22h^2!f_i(f_y)^2]f_y notag\
&= hf_i+p_3hf_t+q_31hf_if_y+q_32hf_if_y+p_1q_32h^2!f_tf_y+q_11q_32h^2!f_i(f_y)^2 notag\
&qquad +q_33hf_if_y+p_2q_33h^2!f_tf_y+q_21q_33h^2!f_i(f_y)^2+q_22q_33h^2!f_i(f_y)^2 notag\
&qquad+q_22q_33p_1h^3!f_t(f_y)^2+q_11q_22q_33h^3!f_i(f_y)^3
endalign
enddocument
I forgot to mention another adjustment I made: I inserted negative thinspace (!
) in all instances of eitherh^2
orh^3
being followed byf
. This avoids creating "visual holes" in the formulas.
– Mico
4 hours ago
add a comment |
In addition to inserting some line breaks by hand in the final two rows, you also need to fix some of the notation by adding curly braces as needed in the terms q_11
, q_21
, q_22
, etc. (And _k1
should be k_1
, right?) When the parenthetic structures are nested, it helps readers if square brackets and curly braces are used in addition to round parentheses, to help detect the orders of the parentheses.
And you most definitely should not be using the badly deprecated eqnarray
environment. Use the align
environment, which is provided by the amsmath
package, instead.
documentclassarticle
usepackageamsmath % for 'align' environment and 'notag' macro
begindocument
beginalign
k_1 &= hf(t_i, y_i)=hf_i labelk1_RK_4\
k_2 &= hf(t_i+p_1h, y_i+q_11k_1) notag\
&= h(f_i+p_1hf_t+q_11k_1f_y) notag\
&= h(f_i+p_1hf_t+q_11hf_if_y)\
k_3 &= hf(t_i+p_2h, y_i+q_21k_1+q_22k_2) notag\
&= h(f_i+p_2hf_t+q_21k_1f_y+q_22k_2f_y) notag\
&= h[f_i+p_2hf_t+q_21hf_if_y+q_22h(f_i+p_1hf_t+q_11hf_if_y)f_y] notag\
&= h[f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y+q_22h^2p_1f_tf_y+q_11q_22h^2!f_i(f_y)^2]\
k_4 &= hf(t_i+p_3h, y_i+q_31k_1+q_32k_2+q_33k_3) notag\
&= h(f_i+p_3hf_t+q_31k_1f_y+q_32k_2f_y+q_33k_3f_y) notag\
&= hf_i+p_3hf_t+q_31hf_if_y+q_32h(f_i+p_1hf_t+q_11hf_if_y)f_y notag\
&qquad +q_33h[f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y+q_22h^2p_1f_tf_y notag\
&qquad +q_21q_22h^2!f_i(f_y)^2]f_y notag\
&= hf_i+p_3hf_t+q_31hf_if_y+q_32hf_if_y+p_1q_32h^2!f_tf_y+q_11q_32h^2!f_i(f_y)^2 notag\
&qquad +q_33hf_if_y+p_2q_33h^2!f_tf_y+q_21q_33h^2!f_i(f_y)^2+q_22q_33h^2!f_i(f_y)^2 notag\
&qquad+q_22q_33p_1h^3!f_t(f_y)^2+q_11q_22q_33h^3!f_i(f_y)^3
endalign
enddocument
In addition to inserting some line breaks by hand in the final two rows, you also need to fix some of the notation by adding curly braces as needed in the terms q_11
, q_21
, q_22
, etc. (And _k1
should be k_1
, right?) When the parenthetic structures are nested, it helps readers if square brackets and curly braces are used in addition to round parentheses, to help detect the orders of the parentheses.
And you most definitely should not be using the badly deprecated eqnarray
environment. Use the align
environment, which is provided by the amsmath
package, instead.
documentclassarticle
usepackageamsmath % for 'align' environment and 'notag' macro
begindocument
beginalign
k_1 &= hf(t_i, y_i)=hf_i labelk1_RK_4\
k_2 &= hf(t_i+p_1h, y_i+q_11k_1) notag\
&= h(f_i+p_1hf_t+q_11k_1f_y) notag\
&= h(f_i+p_1hf_t+q_11hf_if_y)\
k_3 &= hf(t_i+p_2h, y_i+q_21k_1+q_22k_2) notag\
&= h(f_i+p_2hf_t+q_21k_1f_y+q_22k_2f_y) notag\
&= h[f_i+p_2hf_t+q_21hf_if_y+q_22h(f_i+p_1hf_t+q_11hf_if_y)f_y] notag\
&= h[f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y+q_22h^2p_1f_tf_y+q_11q_22h^2!f_i(f_y)^2]\
k_4 &= hf(t_i+p_3h, y_i+q_31k_1+q_32k_2+q_33k_3) notag\
&= h(f_i+p_3hf_t+q_31k_1f_y+q_32k_2f_y+q_33k_3f_y) notag\
&= hf_i+p_3hf_t+q_31hf_if_y+q_32h(f_i+p_1hf_t+q_11hf_if_y)f_y notag\
&qquad +q_33h[f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y+q_22h^2p_1f_tf_y notag\
&qquad +q_21q_22h^2!f_i(f_y)^2]f_y notag\
&= hf_i+p_3hf_t+q_31hf_if_y+q_32hf_if_y+p_1q_32h^2!f_tf_y+q_11q_32h^2!f_i(f_y)^2 notag\
&qquad +q_33hf_if_y+p_2q_33h^2!f_tf_y+q_21q_33h^2!f_i(f_y)^2+q_22q_33h^2!f_i(f_y)^2 notag\
&qquad+q_22q_33p_1h^3!f_t(f_y)^2+q_11q_22q_33h^3!f_i(f_y)^3
endalign
enddocument
answered 7 hours ago
MicoMico
283k31388775
283k31388775
I forgot to mention another adjustment I made: I inserted negative thinspace (!
) in all instances of eitherh^2
orh^3
being followed byf
. This avoids creating "visual holes" in the formulas.
– Mico
4 hours ago
add a comment |
I forgot to mention another adjustment I made: I inserted negative thinspace (!
) in all instances of eitherh^2
orh^3
being followed byf
. This avoids creating "visual holes" in the formulas.
– Mico
4 hours ago
I forgot to mention another adjustment I made: I inserted negative thinspace (
!
) in all instances of either h^2
or h^3
being followed by f
. This avoids creating "visual holes" in the formulas.– Mico
4 hours ago
I forgot to mention another adjustment I made: I inserted negative thinspace (
!
) in all instances of either h^2
or h^3
being followed by f
. This avoids creating "visual holes" in the formulas.– Mico
4 hours ago
add a comment |
Besides the standard advice of not using eqnarray
for whatsoever reason, see eqnarray vs align, I'd recommend using split
for this, so to divide each block into a single unit.
With the tbtags
option, we ensure that the number attached to a split
equation is added at the bottom (when equation numbers are on the right) or at the top.
documentclassarticle
usepackage[tbtags]amsmath % for math
begindocument
beginalign
k_1 &= hf(t_i, y_i)=hf_i labelk1_RK_4
\
beginsplit
k_2 &= hf(t_i+p_1h, y_i+q_11k_1) \
&= h(f_i+p_1hf_t+q_11k_1f_y) \
&= h(f_i+p_1hf_t+q_11hf_if_y)
endsplit
\
beginsplit
k_3 &= hf(t_i+p_2h, y_i+q_21k_1+q_22k_2) \
&= h(f_i+p_2hf_t+q_21k_1f_y+q_22k_2f_y) \
&= h[f_i+p_2hf_t+q_21hf_if_y+q_22h(f_i+p_1hf_t+q_11hf_if_y)f_y] \
&= h[f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y+q_22h^2p_1f_tf_y+
q_11q_22h^2!f_i(f_y)^2]
endsplit
\
beginsplit
k_4 &= hf(t_i+p_3h, y_i+q_31k_1+q_32k_2+q_33k_3) \
&= h(f_i+p_3hf_t+q_31k_1f_y+q_32k_2f_y+q_33k_3f_y) \
&= hf_i+p_3hf_t+q_31hf_if_y+q_32h(f_i+p_1hf_t+q_11hf_if_y)f_y \
&qquad +q_33h[f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y+q_22h^2p_1f_tf_y \
&qquad +q_21q_22h^2!f_i(f_y)^2]f_y \
&= hf_i+p_3hf_t+q_31hf_if_y+q_32hf_if_y+p_1q_32h^2!f_tf_y+
q_11q_32h^2!f_i(f_y)^2 \
&qquad +q_33hf_if_y+p_2q_33h^2!f_tf_y+q_21q_33h^2!f_i(f_y)^2+
q_22q_33h^2!f_i(f_y)^2 \
&qquad+q_22q_33p_1h^3!f_t(f_y)^2+q_11q_22q_33h^3!f_i(f_y)^3
endsplit
endalign
enddocument
Canmultline
be another solution? P.S. Nice answer!
– manooooh
5 hours ago
1
+1. You may want to point out explicitly the role that setting the optiontbtags
plays here. :-)
– Mico
4 hours ago
add a comment |
Besides the standard advice of not using eqnarray
for whatsoever reason, see eqnarray vs align, I'd recommend using split
for this, so to divide each block into a single unit.
With the tbtags
option, we ensure that the number attached to a split
equation is added at the bottom (when equation numbers are on the right) or at the top.
documentclassarticle
usepackage[tbtags]amsmath % for math
begindocument
beginalign
k_1 &= hf(t_i, y_i)=hf_i labelk1_RK_4
\
beginsplit
k_2 &= hf(t_i+p_1h, y_i+q_11k_1) \
&= h(f_i+p_1hf_t+q_11k_1f_y) \
&= h(f_i+p_1hf_t+q_11hf_if_y)
endsplit
\
beginsplit
k_3 &= hf(t_i+p_2h, y_i+q_21k_1+q_22k_2) \
&= h(f_i+p_2hf_t+q_21k_1f_y+q_22k_2f_y) \
&= h[f_i+p_2hf_t+q_21hf_if_y+q_22h(f_i+p_1hf_t+q_11hf_if_y)f_y] \
&= h[f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y+q_22h^2p_1f_tf_y+
q_11q_22h^2!f_i(f_y)^2]
endsplit
\
beginsplit
k_4 &= hf(t_i+p_3h, y_i+q_31k_1+q_32k_2+q_33k_3) \
&= h(f_i+p_3hf_t+q_31k_1f_y+q_32k_2f_y+q_33k_3f_y) \
&= hf_i+p_3hf_t+q_31hf_if_y+q_32h(f_i+p_1hf_t+q_11hf_if_y)f_y \
&qquad +q_33h[f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y+q_22h^2p_1f_tf_y \
&qquad +q_21q_22h^2!f_i(f_y)^2]f_y \
&= hf_i+p_3hf_t+q_31hf_if_y+q_32hf_if_y+p_1q_32h^2!f_tf_y+
q_11q_32h^2!f_i(f_y)^2 \
&qquad +q_33hf_if_y+p_2q_33h^2!f_tf_y+q_21q_33h^2!f_i(f_y)^2+
q_22q_33h^2!f_i(f_y)^2 \
&qquad+q_22q_33p_1h^3!f_t(f_y)^2+q_11q_22q_33h^3!f_i(f_y)^3
endsplit
endalign
enddocument
Canmultline
be another solution? P.S. Nice answer!
– manooooh
5 hours ago
1
+1. You may want to point out explicitly the role that setting the optiontbtags
plays here. :-)
– Mico
4 hours ago
add a comment |
Besides the standard advice of not using eqnarray
for whatsoever reason, see eqnarray vs align, I'd recommend using split
for this, so to divide each block into a single unit.
With the tbtags
option, we ensure that the number attached to a split
equation is added at the bottom (when equation numbers are on the right) or at the top.
documentclassarticle
usepackage[tbtags]amsmath % for math
begindocument
beginalign
k_1 &= hf(t_i, y_i)=hf_i labelk1_RK_4
\
beginsplit
k_2 &= hf(t_i+p_1h, y_i+q_11k_1) \
&= h(f_i+p_1hf_t+q_11k_1f_y) \
&= h(f_i+p_1hf_t+q_11hf_if_y)
endsplit
\
beginsplit
k_3 &= hf(t_i+p_2h, y_i+q_21k_1+q_22k_2) \
&= h(f_i+p_2hf_t+q_21k_1f_y+q_22k_2f_y) \
&= h[f_i+p_2hf_t+q_21hf_if_y+q_22h(f_i+p_1hf_t+q_11hf_if_y)f_y] \
&= h[f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y+q_22h^2p_1f_tf_y+
q_11q_22h^2!f_i(f_y)^2]
endsplit
\
beginsplit
k_4 &= hf(t_i+p_3h, y_i+q_31k_1+q_32k_2+q_33k_3) \
&= h(f_i+p_3hf_t+q_31k_1f_y+q_32k_2f_y+q_33k_3f_y) \
&= hf_i+p_3hf_t+q_31hf_if_y+q_32h(f_i+p_1hf_t+q_11hf_if_y)f_y \
&qquad +q_33h[f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y+q_22h^2p_1f_tf_y \
&qquad +q_21q_22h^2!f_i(f_y)^2]f_y \
&= hf_i+p_3hf_t+q_31hf_if_y+q_32hf_if_y+p_1q_32h^2!f_tf_y+
q_11q_32h^2!f_i(f_y)^2 \
&qquad +q_33hf_if_y+p_2q_33h^2!f_tf_y+q_21q_33h^2!f_i(f_y)^2+
q_22q_33h^2!f_i(f_y)^2 \
&qquad+q_22q_33p_1h^3!f_t(f_y)^2+q_11q_22q_33h^3!f_i(f_y)^3
endsplit
endalign
enddocument
Besides the standard advice of not using eqnarray
for whatsoever reason, see eqnarray vs align, I'd recommend using split
for this, so to divide each block into a single unit.
With the tbtags
option, we ensure that the number attached to a split
equation is added at the bottom (when equation numbers are on the right) or at the top.
documentclassarticle
usepackage[tbtags]amsmath % for math
begindocument
beginalign
k_1 &= hf(t_i, y_i)=hf_i labelk1_RK_4
\
beginsplit
k_2 &= hf(t_i+p_1h, y_i+q_11k_1) \
&= h(f_i+p_1hf_t+q_11k_1f_y) \
&= h(f_i+p_1hf_t+q_11hf_if_y)
endsplit
\
beginsplit
k_3 &= hf(t_i+p_2h, y_i+q_21k_1+q_22k_2) \
&= h(f_i+p_2hf_t+q_21k_1f_y+q_22k_2f_y) \
&= h[f_i+p_2hf_t+q_21hf_if_y+q_22h(f_i+p_1hf_t+q_11hf_if_y)f_y] \
&= h[f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y+q_22h^2p_1f_tf_y+
q_11q_22h^2!f_i(f_y)^2]
endsplit
\
beginsplit
k_4 &= hf(t_i+p_3h, y_i+q_31k_1+q_32k_2+q_33k_3) \
&= h(f_i+p_3hf_t+q_31k_1f_y+q_32k_2f_y+q_33k_3f_y) \
&= hf_i+p_3hf_t+q_31hf_if_y+q_32h(f_i+p_1hf_t+q_11hf_if_y)f_y \
&qquad +q_33h[f_i+p_2hf_t+q_21hf_if_y+q_22hf_if_y+q_22h^2p_1f_tf_y \
&qquad +q_21q_22h^2!f_i(f_y)^2]f_y \
&= hf_i+p_3hf_t+q_31hf_if_y+q_32hf_if_y+p_1q_32h^2!f_tf_y+
q_11q_32h^2!f_i(f_y)^2 \
&qquad +q_33hf_if_y+p_2q_33h^2!f_tf_y+q_21q_33h^2!f_i(f_y)^2+
q_22q_33h^2!f_i(f_y)^2 \
&qquad+q_22q_33p_1h^3!f_t(f_y)^2+q_11q_22q_33h^3!f_i(f_y)^3
endsplit
endalign
enddocument
edited 4 hours ago
answered 5 hours ago
egregegreg
726k8819223230
726k8819223230
Canmultline
be another solution? P.S. Nice answer!
– manooooh
5 hours ago
1
+1. You may want to point out explicitly the role that setting the optiontbtags
plays here. :-)
– Mico
4 hours ago
add a comment |
Canmultline
be another solution? P.S. Nice answer!
– manooooh
5 hours ago
1
+1. You may want to point out explicitly the role that setting the optiontbtags
plays here. :-)
– Mico
4 hours ago
Can
multline
be another solution? P.S. Nice answer!– manooooh
5 hours ago
Can
multline
be another solution? P.S. Nice answer!– manooooh
5 hours ago
1
1
+1. You may want to point out explicitly the role that setting the option
tbtags
plays here. :-)– Mico
4 hours ago
+1. You may want to point out explicitly the role that setting the option
tbtags
plays here. :-)– Mico
4 hours ago
add a comment |
liswyhy is a new contributor. Be nice, and check out our Code of Conduct.
liswyhy is a new contributor. Be nice, and check out our Code of Conduct.
liswyhy is a new contributor. Be nice, and check out our Code of Conduct.
liswyhy is a new contributor. Be nice, and check out our Code of Conduct.
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.
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%2f479557%2fequation-array-exceed-right-margin%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
The equation is too wide because it is too wide. However, you already know how to introduce line breaks. Please note that most users have switched to
align
instead ofeqnarray
. (However, the latter does not solve the problem automatically,breqn
does in principle but I personally would rather break the lines by hand than usingbreqn
.)– marmot
12 hours ago
I got it, thank you.
– liswyhy
12 hours ago
1
@liswyhy Just to remind you that the
>
s in your code block prevent your code from being compilable. Removing that is better. (and I did it for you.)– JouleV
9 hours ago