Equation Array Exceed Right Margineqnarray vs alignHow to prevent text generated with `Sweave` from running...

Time travel short story where a man arrives in the late 19th century in a time machine and then sends the machine back into the past

Opposite of a diet

Is there any easy technique written in Bhagavad GITA to control lust?

Failed to fetch jessie backports repository

What is difference between behavior and behaviour

Why is delta-v is the most useful quantity for planning space travel?

Is it okay / does it make sense for another player to join a running game of Munchkin?

Tiptoe or tiphoof? Adjusting words to better fit fantasy races

Dot above capital letter not centred

Can I Retrieve Email Addresses from BCC?

Was the picture area of a CRT a parallelogram (instead of a true rectangle)?

Generic lambda vs generic function give different behaviour

Greatest common substring

Why did Kant, Hegel, and Adorno leave some words and phrases in the Greek alphabet?

Why Were Madagascar and New Zealand Discovered So Late?

How was Earth single-handedly capable of creating 3 of the 4 gods of chaos?

Coordinate position not precise

Is there a problem with hiding "forgot password" until it's needed?

Is exact Kanji stroke length important?

Is there an Impartial Brexit Deal comparison site?

Why is `const int& k = i; ++i; ` possible?

Everything Bob says is false. How does he get people to trust him?

when is out of tune ok?

Is a roofing delivery truck likely to crack my driveway slab?



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













5















I write equations in eqnarrayuse Latex, but there are lines that exceed the right margin, how to fix it?



This is my code:



begin{eqnarray}    
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_{11}k_1f_y)nonumber\
&=&h(f_i+p_1hf_t+q_{11}hf_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_{21}hf_if_y+q_{22} h(f_i+p_1hf_t+q_{11}hf_if_y)f_y)nonumber\
&=&h(f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y +q_22h^2p_1f_tf_y+q_{11}q{22}h^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_{31}k_1f_y+q_{32}k_2f_y+q_{33}k_3f_y)nonumber\
&=&h(f_i+p_3hf_t+q_{31}hf_if_y+q_{32} h(f_i+p_1hf_t+q_{11}hf_if_y)f_y +q_{33}h(f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y+q_{22}h^2p_1f_tf_y+q_{21}q_{22}h^2f_i(f_y)^2)f_y)nonumber\
&=&h(f_i+p_3hf_t+q_{31}hf_if_y+q_{32}hf_if_y +p_1q_{32}h^2f_tf_y +q_{11}q_{32}h^2f_i(f_y)^2+q_{33}hf_if_y+p_2q_{33}h^2f_tf_y+q_{21}q_{33}h^2f_i(f_y)^2+q_{22}q_{33}h^2f_i(f_y)^2+q_{22}q_{33}p_1h^3f_t(f_y)^2+q_{11}q_{22}q_{33}h^3f_i(f_y)^3)\
end{eqnarray}


and this is the result:



enter image description here










share|improve this question




















  • 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
    Mar 15 at 1:07











  • I got it, thank you.

    – liswyhy
    Mar 15 at 1:15








  • 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
    Mar 15 at 3:54


















5















I write equations in eqnarrayuse Latex, but there are lines that exceed the right margin, how to fix it?



This is my code:



begin{eqnarray}    
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_{11}k_1f_y)nonumber\
&=&h(f_i+p_1hf_t+q_{11}hf_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_{21}hf_if_y+q_{22} h(f_i+p_1hf_t+q_{11}hf_if_y)f_y)nonumber\
&=&h(f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y +q_22h^2p_1f_tf_y+q_{11}q{22}h^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_{31}k_1f_y+q_{32}k_2f_y+q_{33}k_3f_y)nonumber\
&=&h(f_i+p_3hf_t+q_{31}hf_if_y+q_{32} h(f_i+p_1hf_t+q_{11}hf_if_y)f_y +q_{33}h(f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y+q_{22}h^2p_1f_tf_y+q_{21}q_{22}h^2f_i(f_y)^2)f_y)nonumber\
&=&h(f_i+p_3hf_t+q_{31}hf_if_y+q_{32}hf_if_y +p_1q_{32}h^2f_tf_y +q_{11}q_{32}h^2f_i(f_y)^2+q_{33}hf_if_y+p_2q_{33}h^2f_tf_y+q_{21}q_{33}h^2f_i(f_y)^2+q_{22}q_{33}h^2f_i(f_y)^2+q_{22}q_{33}p_1h^3f_t(f_y)^2+q_{11}q_{22}q_{33}h^3f_i(f_y)^3)\
end{eqnarray}


and this is the result:



enter image description here










share|improve this question




















  • 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
    Mar 15 at 1:07











  • I got it, thank you.

    – liswyhy
    Mar 15 at 1:15








  • 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
    Mar 15 at 3:54
















5












5








5


0






I write equations in eqnarrayuse Latex, but there are lines that exceed the right margin, how to fix it?



This is my code:



begin{eqnarray}    
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_{11}k_1f_y)nonumber\
&=&h(f_i+p_1hf_t+q_{11}hf_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_{21}hf_if_y+q_{22} h(f_i+p_1hf_t+q_{11}hf_if_y)f_y)nonumber\
&=&h(f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y +q_22h^2p_1f_tf_y+q_{11}q{22}h^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_{31}k_1f_y+q_{32}k_2f_y+q_{33}k_3f_y)nonumber\
&=&h(f_i+p_3hf_t+q_{31}hf_if_y+q_{32} h(f_i+p_1hf_t+q_{11}hf_if_y)f_y +q_{33}h(f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y+q_{22}h^2p_1f_tf_y+q_{21}q_{22}h^2f_i(f_y)^2)f_y)nonumber\
&=&h(f_i+p_3hf_t+q_{31}hf_if_y+q_{32}hf_if_y +p_1q_{32}h^2f_tf_y +q_{11}q_{32}h^2f_i(f_y)^2+q_{33}hf_if_y+p_2q_{33}h^2f_tf_y+q_{21}q_{33}h^2f_i(f_y)^2+q_{22}q_{33}h^2f_i(f_y)^2+q_{22}q_{33}p_1h^3f_t(f_y)^2+q_{11}q_{22}q_{33}h^3f_i(f_y)^3)\
end{eqnarray}


and this is the result:



enter image description here










share|improve this question
















I write equations in eqnarrayuse Latex, but there are lines that exceed the right margin, how to fix it?



This is my code:



begin{eqnarray}    
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_{11}k_1f_y)nonumber\
&=&h(f_i+p_1hf_t+q_{11}hf_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_{21}hf_if_y+q_{22} h(f_i+p_1hf_t+q_{11}hf_if_y)f_y)nonumber\
&=&h(f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y +q_22h^2p_1f_tf_y+q_{11}q{22}h^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_{31}k_1f_y+q_{32}k_2f_y+q_{33}k_3f_y)nonumber\
&=&h(f_i+p_3hf_t+q_{31}hf_if_y+q_{32} h(f_i+p_1hf_t+q_{11}hf_if_y)f_y +q_{33}h(f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y+q_{22}h^2p_1f_tf_y+q_{21}q_{22}h^2f_i(f_y)^2)f_y)nonumber\
&=&h(f_i+p_3hf_t+q_{31}hf_if_y+q_{32}hf_if_y +p_1q_{32}h^2f_tf_y +q_{11}q_{32}h^2f_i(f_y)^2+q_{33}hf_if_y+p_2q_{33}h^2f_tf_y+q_{21}q_{33}h^2f_i(f_y)^2+q_{22}q_{33}h^2f_i(f_y)^2+q_{22}q_{33}p_1h^3f_t(f_y)^2+q_{11}q_{22}q_{33}h^3f_i(f_y)^3)\
end{eqnarray}


and this is the result:



enter image description here







equations margins eqnarray






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 15 at 5:36









Mico

284k31388778




284k31388778










asked Mar 15 at 0:58









liswyhyliswyhy

434




434








  • 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
    Mar 15 at 1:07











  • I got it, thank you.

    – liswyhy
    Mar 15 at 1:15








  • 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
    Mar 15 at 3:54
















  • 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
    Mar 15 at 1:07











  • I got it, thank you.

    – liswyhy
    Mar 15 at 1:15








  • 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
    Mar 15 at 3:54










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
Mar 15 at 1:07





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
Mar 15 at 1:07













I got it, thank you.

– liswyhy
Mar 15 at 1:15







I got it, thank you.

– liswyhy
Mar 15 at 1:15






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
Mar 15 at 3:54







@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
Mar 15 at 3:54












2 Answers
2






active

oldest

votes


















7














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.



documentclass{article}
usepackage[tbtags]{amsmath} % for math

begin{document}
begin{align}
k_1 &= hf(t_i, y_i)=hf_i label{k1_RK_4}
\
begin{split}
k_2 &= hf(t_i+p_1h, y_i+q_{11}k_1) \
&= h(f_i+p_1hf_t+q_{11}k_1f_y) \
&= h(f_i+p_1hf_t+q_{11}hf_if_y)
end{split}
\
begin{split}
k_3 &= hf(t_i+p_2h, y_i+q_{21}k_1+q_{22}k_2) \
&= h(f_i+p_2hf_t+q_{21}k_1f_y+q_{22}k_2f_y) \
&= h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}h(f_i+p_1hf_t+q_{11}hf_if_y)f_y] \
&= h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y+q_{22}h^2p_1f_tf_y+
q_{11}q_{22}h^2!f_i(f_y)^2]
end{split}
\
begin{split}
k_4 &= hf(t_i+p_3h, y_i+q_{31}k_1+q_{32}k_2+q_{33}k_3) \
&= h(f_i+p_3hf_t+q_{31}k_1f_y+q_{32}k_2f_y+q_{33}k_3f_y) \
&= h{f_i+p_3hf_t+q_{31}hf_if_y+q_{32}h(f_i+p_1hf_t+q_{11}hf_if_y)f_y \
&qquad +q_{33}h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y+q_{22}h^2p_1f_tf_y \
&qquad +q_{21}q_{22}h^2!f_i(f_y)^2]f_y} \
&= h{f_i+p_3hf_t+q_{31}hf_if_y+q_{32}hf_if_y+p_1q_{32}h^2!f_tf_y+
q_{11}q_{32}h^2!f_i(f_y)^2 \
&qquad +q_{33}hf_if_y+p_2q_{33}h^2!f_tf_y+q_{21}q_{33}h^2!f_i(f_y)^2+
q_{22}q_{33}h^2!f_i(f_y)^2 \
&qquad+q_{22}q_{33}p_1h^3!f_t(f_y)^2+q_{11}q_{22}q_{33}h^3!f_i(f_y)^3}
end{split}
end{align}

end{document}


enter image description here






share|improve this answer


























  • Can multline be another solution? P.S. Nice answer!

    – manooooh
    Mar 15 at 8:29






  • 2





    +1. You may want to point out explicitly the role that setting the option tbtags plays here. :-)

    – Mico
    Mar 15 at 8:31



















8














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.



enter image description here



documentclass{article}
usepackage{amsmath} % for 'align' environment and 'notag' macro

begin{document}
begin{align}
k_1 &= hf(t_i, y_i)=hf_i label{k1_RK_4}\
k_2 &= hf(t_i+p_1h, y_i+q_{11}k_1) notag\
&= h(f_i+p_1hf_t+q_{11}k_1f_y) notag\
&= h(f_i+p_1hf_t+q_{11}hf_if_y)\
k_3 &= hf(t_i+p_2h, y_i+q_{21}k_1+q_{22}k_2) notag\
&= h(f_i+p_2hf_t+q_{21}k_1f_y+q_{22}k_2f_y) notag\
&= h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}h(f_i+p_1hf_t+q_{11}hf_if_y)f_y] notag\
&= h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y+q_{22}h^2p_1f_tf_y+q_{11}q_{22}h^2!f_i(f_y)^2]\
k_4 &= hf(t_i+p_3h, y_i+q_{31}k_1+q_{32}k_2+q_{33}k_3) notag\
&= h(f_i+p_3hf_t+q_{31}k_1f_y+q_{32}k_2f_y+q_{33}k_3f_y) notag\
&= h{f_i+p_3hf_t+q_{31}hf_if_y+q_{32}h(f_i+p_1hf_t+q_{11}hf_if_y)f_y notag\
&qquad +q_{33}h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y+q_{22}h^2p_1f_tf_y notag\
&qquad +q_{21}q_{22}h^2!f_i(f_y)^2]f_y} notag\
&= h{f_i+p_3hf_t+q_{31}hf_if_y+q_{32}hf_if_y+p_1q_{32}h^2!f_tf_y+q_{11}q_{32}h^2!f_i(f_y)^2 notag\
&qquad +q_{33}hf_if_y+p_2q_{33}h^2!f_tf_y+q_{21}q_{33}h^2!f_i(f_y)^2+q_{22}q_{33}h^2!f_i(f_y)^2 notag\
&qquad+q_{22}q_{33}p_1h^3!f_t(f_y)^2+q_{11}q_{22}q_{33}h^3!f_i(f_y)^3}
end{align}
end{document}





share|improve this answer
























  • 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
    Mar 15 at 8:35











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
});


}
});














draft saved

draft discarded


















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









7














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.



documentclass{article}
usepackage[tbtags]{amsmath} % for math

begin{document}
begin{align}
k_1 &= hf(t_i, y_i)=hf_i label{k1_RK_4}
\
begin{split}
k_2 &= hf(t_i+p_1h, y_i+q_{11}k_1) \
&= h(f_i+p_1hf_t+q_{11}k_1f_y) \
&= h(f_i+p_1hf_t+q_{11}hf_if_y)
end{split}
\
begin{split}
k_3 &= hf(t_i+p_2h, y_i+q_{21}k_1+q_{22}k_2) \
&= h(f_i+p_2hf_t+q_{21}k_1f_y+q_{22}k_2f_y) \
&= h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}h(f_i+p_1hf_t+q_{11}hf_if_y)f_y] \
&= h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y+q_{22}h^2p_1f_tf_y+
q_{11}q_{22}h^2!f_i(f_y)^2]
end{split}
\
begin{split}
k_4 &= hf(t_i+p_3h, y_i+q_{31}k_1+q_{32}k_2+q_{33}k_3) \
&= h(f_i+p_3hf_t+q_{31}k_1f_y+q_{32}k_2f_y+q_{33}k_3f_y) \
&= h{f_i+p_3hf_t+q_{31}hf_if_y+q_{32}h(f_i+p_1hf_t+q_{11}hf_if_y)f_y \
&qquad +q_{33}h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y+q_{22}h^2p_1f_tf_y \
&qquad +q_{21}q_{22}h^2!f_i(f_y)^2]f_y} \
&= h{f_i+p_3hf_t+q_{31}hf_if_y+q_{32}hf_if_y+p_1q_{32}h^2!f_tf_y+
q_{11}q_{32}h^2!f_i(f_y)^2 \
&qquad +q_{33}hf_if_y+p_2q_{33}h^2!f_tf_y+q_{21}q_{33}h^2!f_i(f_y)^2+
q_{22}q_{33}h^2!f_i(f_y)^2 \
&qquad+q_{22}q_{33}p_1h^3!f_t(f_y)^2+q_{11}q_{22}q_{33}h^3!f_i(f_y)^3}
end{split}
end{align}

end{document}


enter image description here






share|improve this answer


























  • Can multline be another solution? P.S. Nice answer!

    – manooooh
    Mar 15 at 8:29






  • 2





    +1. You may want to point out explicitly the role that setting the option tbtags plays here. :-)

    – Mico
    Mar 15 at 8:31
















7














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.



documentclass{article}
usepackage[tbtags]{amsmath} % for math

begin{document}
begin{align}
k_1 &= hf(t_i, y_i)=hf_i label{k1_RK_4}
\
begin{split}
k_2 &= hf(t_i+p_1h, y_i+q_{11}k_1) \
&= h(f_i+p_1hf_t+q_{11}k_1f_y) \
&= h(f_i+p_1hf_t+q_{11}hf_if_y)
end{split}
\
begin{split}
k_3 &= hf(t_i+p_2h, y_i+q_{21}k_1+q_{22}k_2) \
&= h(f_i+p_2hf_t+q_{21}k_1f_y+q_{22}k_2f_y) \
&= h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}h(f_i+p_1hf_t+q_{11}hf_if_y)f_y] \
&= h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y+q_{22}h^2p_1f_tf_y+
q_{11}q_{22}h^2!f_i(f_y)^2]
end{split}
\
begin{split}
k_4 &= hf(t_i+p_3h, y_i+q_{31}k_1+q_{32}k_2+q_{33}k_3) \
&= h(f_i+p_3hf_t+q_{31}k_1f_y+q_{32}k_2f_y+q_{33}k_3f_y) \
&= h{f_i+p_3hf_t+q_{31}hf_if_y+q_{32}h(f_i+p_1hf_t+q_{11}hf_if_y)f_y \
&qquad +q_{33}h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y+q_{22}h^2p_1f_tf_y \
&qquad +q_{21}q_{22}h^2!f_i(f_y)^2]f_y} \
&= h{f_i+p_3hf_t+q_{31}hf_if_y+q_{32}hf_if_y+p_1q_{32}h^2!f_tf_y+
q_{11}q_{32}h^2!f_i(f_y)^2 \
&qquad +q_{33}hf_if_y+p_2q_{33}h^2!f_tf_y+q_{21}q_{33}h^2!f_i(f_y)^2+
q_{22}q_{33}h^2!f_i(f_y)^2 \
&qquad+q_{22}q_{33}p_1h^3!f_t(f_y)^2+q_{11}q_{22}q_{33}h^3!f_i(f_y)^3}
end{split}
end{align}

end{document}


enter image description here






share|improve this answer


























  • Can multline be another solution? P.S. Nice answer!

    – manooooh
    Mar 15 at 8:29






  • 2





    +1. You may want to point out explicitly the role that setting the option tbtags plays here. :-)

    – Mico
    Mar 15 at 8:31














7












7








7







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.



documentclass{article}
usepackage[tbtags]{amsmath} % for math

begin{document}
begin{align}
k_1 &= hf(t_i, y_i)=hf_i label{k1_RK_4}
\
begin{split}
k_2 &= hf(t_i+p_1h, y_i+q_{11}k_1) \
&= h(f_i+p_1hf_t+q_{11}k_1f_y) \
&= h(f_i+p_1hf_t+q_{11}hf_if_y)
end{split}
\
begin{split}
k_3 &= hf(t_i+p_2h, y_i+q_{21}k_1+q_{22}k_2) \
&= h(f_i+p_2hf_t+q_{21}k_1f_y+q_{22}k_2f_y) \
&= h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}h(f_i+p_1hf_t+q_{11}hf_if_y)f_y] \
&= h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y+q_{22}h^2p_1f_tf_y+
q_{11}q_{22}h^2!f_i(f_y)^2]
end{split}
\
begin{split}
k_4 &= hf(t_i+p_3h, y_i+q_{31}k_1+q_{32}k_2+q_{33}k_3) \
&= h(f_i+p_3hf_t+q_{31}k_1f_y+q_{32}k_2f_y+q_{33}k_3f_y) \
&= h{f_i+p_3hf_t+q_{31}hf_if_y+q_{32}h(f_i+p_1hf_t+q_{11}hf_if_y)f_y \
&qquad +q_{33}h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y+q_{22}h^2p_1f_tf_y \
&qquad +q_{21}q_{22}h^2!f_i(f_y)^2]f_y} \
&= h{f_i+p_3hf_t+q_{31}hf_if_y+q_{32}hf_if_y+p_1q_{32}h^2!f_tf_y+
q_{11}q_{32}h^2!f_i(f_y)^2 \
&qquad +q_{33}hf_if_y+p_2q_{33}h^2!f_tf_y+q_{21}q_{33}h^2!f_i(f_y)^2+
q_{22}q_{33}h^2!f_i(f_y)^2 \
&qquad+q_{22}q_{33}p_1h^3!f_t(f_y)^2+q_{11}q_{22}q_{33}h^3!f_i(f_y)^3}
end{split}
end{align}

end{document}


enter image description here






share|improve this answer















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.



documentclass{article}
usepackage[tbtags]{amsmath} % for math

begin{document}
begin{align}
k_1 &= hf(t_i, y_i)=hf_i label{k1_RK_4}
\
begin{split}
k_2 &= hf(t_i+p_1h, y_i+q_{11}k_1) \
&= h(f_i+p_1hf_t+q_{11}k_1f_y) \
&= h(f_i+p_1hf_t+q_{11}hf_if_y)
end{split}
\
begin{split}
k_3 &= hf(t_i+p_2h, y_i+q_{21}k_1+q_{22}k_2) \
&= h(f_i+p_2hf_t+q_{21}k_1f_y+q_{22}k_2f_y) \
&= h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}h(f_i+p_1hf_t+q_{11}hf_if_y)f_y] \
&= h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y+q_{22}h^2p_1f_tf_y+
q_{11}q_{22}h^2!f_i(f_y)^2]
end{split}
\
begin{split}
k_4 &= hf(t_i+p_3h, y_i+q_{31}k_1+q_{32}k_2+q_{33}k_3) \
&= h(f_i+p_3hf_t+q_{31}k_1f_y+q_{32}k_2f_y+q_{33}k_3f_y) \
&= h{f_i+p_3hf_t+q_{31}hf_if_y+q_{32}h(f_i+p_1hf_t+q_{11}hf_if_y)f_y \
&qquad +q_{33}h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y+q_{22}h^2p_1f_tf_y \
&qquad +q_{21}q_{22}h^2!f_i(f_y)^2]f_y} \
&= h{f_i+p_3hf_t+q_{31}hf_if_y+q_{32}hf_if_y+p_1q_{32}h^2!f_tf_y+
q_{11}q_{32}h^2!f_i(f_y)^2 \
&qquad +q_{33}hf_if_y+p_2q_{33}h^2!f_tf_y+q_{21}q_{33}h^2!f_i(f_y)^2+
q_{22}q_{33}h^2!f_i(f_y)^2 \
&qquad+q_{22}q_{33}p_1h^3!f_t(f_y)^2+q_{11}q_{22}q_{33}h^3!f_i(f_y)^3}
end{split}
end{align}

end{document}


enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 15 at 9:26

























answered Mar 15 at 8:00









egregegreg

729k8819263237




729k8819263237













  • Can multline be another solution? P.S. Nice answer!

    – manooooh
    Mar 15 at 8:29






  • 2





    +1. You may want to point out explicitly the role that setting the option tbtags plays here. :-)

    – Mico
    Mar 15 at 8:31



















  • Can multline be another solution? P.S. Nice answer!

    – manooooh
    Mar 15 at 8:29






  • 2





    +1. You may want to point out explicitly the role that setting the option tbtags plays here. :-)

    – Mico
    Mar 15 at 8:31

















Can multline be another solution? P.S. Nice answer!

– manooooh
Mar 15 at 8:29





Can multline be another solution? P.S. Nice answer!

– manooooh
Mar 15 at 8:29




2




2





+1. You may want to point out explicitly the role that setting the option tbtags plays here. :-)

– Mico
Mar 15 at 8:31





+1. You may want to point out explicitly the role that setting the option tbtags plays here. :-)

– Mico
Mar 15 at 8:31











8














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.



enter image description here



documentclass{article}
usepackage{amsmath} % for 'align' environment and 'notag' macro

begin{document}
begin{align}
k_1 &= hf(t_i, y_i)=hf_i label{k1_RK_4}\
k_2 &= hf(t_i+p_1h, y_i+q_{11}k_1) notag\
&= h(f_i+p_1hf_t+q_{11}k_1f_y) notag\
&= h(f_i+p_1hf_t+q_{11}hf_if_y)\
k_3 &= hf(t_i+p_2h, y_i+q_{21}k_1+q_{22}k_2) notag\
&= h(f_i+p_2hf_t+q_{21}k_1f_y+q_{22}k_2f_y) notag\
&= h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}h(f_i+p_1hf_t+q_{11}hf_if_y)f_y] notag\
&= h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y+q_{22}h^2p_1f_tf_y+q_{11}q_{22}h^2!f_i(f_y)^2]\
k_4 &= hf(t_i+p_3h, y_i+q_{31}k_1+q_{32}k_2+q_{33}k_3) notag\
&= h(f_i+p_3hf_t+q_{31}k_1f_y+q_{32}k_2f_y+q_{33}k_3f_y) notag\
&= h{f_i+p_3hf_t+q_{31}hf_if_y+q_{32}h(f_i+p_1hf_t+q_{11}hf_if_y)f_y notag\
&qquad +q_{33}h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y+q_{22}h^2p_1f_tf_y notag\
&qquad +q_{21}q_{22}h^2!f_i(f_y)^2]f_y} notag\
&= h{f_i+p_3hf_t+q_{31}hf_if_y+q_{32}hf_if_y+p_1q_{32}h^2!f_tf_y+q_{11}q_{32}h^2!f_i(f_y)^2 notag\
&qquad +q_{33}hf_if_y+p_2q_{33}h^2!f_tf_y+q_{21}q_{33}h^2!f_i(f_y)^2+q_{22}q_{33}h^2!f_i(f_y)^2 notag\
&qquad+q_{22}q_{33}p_1h^3!f_t(f_y)^2+q_{11}q_{22}q_{33}h^3!f_i(f_y)^3}
end{align}
end{document}





share|improve this answer
























  • 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
    Mar 15 at 8:35
















8














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.



enter image description here



documentclass{article}
usepackage{amsmath} % for 'align' environment and 'notag' macro

begin{document}
begin{align}
k_1 &= hf(t_i, y_i)=hf_i label{k1_RK_4}\
k_2 &= hf(t_i+p_1h, y_i+q_{11}k_1) notag\
&= h(f_i+p_1hf_t+q_{11}k_1f_y) notag\
&= h(f_i+p_1hf_t+q_{11}hf_if_y)\
k_3 &= hf(t_i+p_2h, y_i+q_{21}k_1+q_{22}k_2) notag\
&= h(f_i+p_2hf_t+q_{21}k_1f_y+q_{22}k_2f_y) notag\
&= h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}h(f_i+p_1hf_t+q_{11}hf_if_y)f_y] notag\
&= h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y+q_{22}h^2p_1f_tf_y+q_{11}q_{22}h^2!f_i(f_y)^2]\
k_4 &= hf(t_i+p_3h, y_i+q_{31}k_1+q_{32}k_2+q_{33}k_3) notag\
&= h(f_i+p_3hf_t+q_{31}k_1f_y+q_{32}k_2f_y+q_{33}k_3f_y) notag\
&= h{f_i+p_3hf_t+q_{31}hf_if_y+q_{32}h(f_i+p_1hf_t+q_{11}hf_if_y)f_y notag\
&qquad +q_{33}h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y+q_{22}h^2p_1f_tf_y notag\
&qquad +q_{21}q_{22}h^2!f_i(f_y)^2]f_y} notag\
&= h{f_i+p_3hf_t+q_{31}hf_if_y+q_{32}hf_if_y+p_1q_{32}h^2!f_tf_y+q_{11}q_{32}h^2!f_i(f_y)^2 notag\
&qquad +q_{33}hf_if_y+p_2q_{33}h^2!f_tf_y+q_{21}q_{33}h^2!f_i(f_y)^2+q_{22}q_{33}h^2!f_i(f_y)^2 notag\
&qquad+q_{22}q_{33}p_1h^3!f_t(f_y)^2+q_{11}q_{22}q_{33}h^3!f_i(f_y)^3}
end{align}
end{document}





share|improve this answer
























  • 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
    Mar 15 at 8:35














8












8








8







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.



enter image description here



documentclass{article}
usepackage{amsmath} % for 'align' environment and 'notag' macro

begin{document}
begin{align}
k_1 &= hf(t_i, y_i)=hf_i label{k1_RK_4}\
k_2 &= hf(t_i+p_1h, y_i+q_{11}k_1) notag\
&= h(f_i+p_1hf_t+q_{11}k_1f_y) notag\
&= h(f_i+p_1hf_t+q_{11}hf_if_y)\
k_3 &= hf(t_i+p_2h, y_i+q_{21}k_1+q_{22}k_2) notag\
&= h(f_i+p_2hf_t+q_{21}k_1f_y+q_{22}k_2f_y) notag\
&= h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}h(f_i+p_1hf_t+q_{11}hf_if_y)f_y] notag\
&= h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y+q_{22}h^2p_1f_tf_y+q_{11}q_{22}h^2!f_i(f_y)^2]\
k_4 &= hf(t_i+p_3h, y_i+q_{31}k_1+q_{32}k_2+q_{33}k_3) notag\
&= h(f_i+p_3hf_t+q_{31}k_1f_y+q_{32}k_2f_y+q_{33}k_3f_y) notag\
&= h{f_i+p_3hf_t+q_{31}hf_if_y+q_{32}h(f_i+p_1hf_t+q_{11}hf_if_y)f_y notag\
&qquad +q_{33}h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y+q_{22}h^2p_1f_tf_y notag\
&qquad +q_{21}q_{22}h^2!f_i(f_y)^2]f_y} notag\
&= h{f_i+p_3hf_t+q_{31}hf_if_y+q_{32}hf_if_y+p_1q_{32}h^2!f_tf_y+q_{11}q_{32}h^2!f_i(f_y)^2 notag\
&qquad +q_{33}hf_if_y+p_2q_{33}h^2!f_tf_y+q_{21}q_{33}h^2!f_i(f_y)^2+q_{22}q_{33}h^2!f_i(f_y)^2 notag\
&qquad+q_{22}q_{33}p_1h^3!f_t(f_y)^2+q_{11}q_{22}q_{33}h^3!f_i(f_y)^3}
end{align}
end{document}





share|improve this answer













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.



enter image description here



documentclass{article}
usepackage{amsmath} % for 'align' environment and 'notag' macro

begin{document}
begin{align}
k_1 &= hf(t_i, y_i)=hf_i label{k1_RK_4}\
k_2 &= hf(t_i+p_1h, y_i+q_{11}k_1) notag\
&= h(f_i+p_1hf_t+q_{11}k_1f_y) notag\
&= h(f_i+p_1hf_t+q_{11}hf_if_y)\
k_3 &= hf(t_i+p_2h, y_i+q_{21}k_1+q_{22}k_2) notag\
&= h(f_i+p_2hf_t+q_{21}k_1f_y+q_{22}k_2f_y) notag\
&= h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}h(f_i+p_1hf_t+q_{11}hf_if_y)f_y] notag\
&= h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y+q_{22}h^2p_1f_tf_y+q_{11}q_{22}h^2!f_i(f_y)^2]\
k_4 &= hf(t_i+p_3h, y_i+q_{31}k_1+q_{32}k_2+q_{33}k_3) notag\
&= h(f_i+p_3hf_t+q_{31}k_1f_y+q_{32}k_2f_y+q_{33}k_3f_y) notag\
&= h{f_i+p_3hf_t+q_{31}hf_if_y+q_{32}h(f_i+p_1hf_t+q_{11}hf_if_y)f_y notag\
&qquad +q_{33}h[f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y+q_{22}h^2p_1f_tf_y notag\
&qquad +q_{21}q_{22}h^2!f_i(f_y)^2]f_y} notag\
&= h{f_i+p_3hf_t+q_{31}hf_if_y+q_{32}hf_if_y+p_1q_{32}h^2!f_tf_y+q_{11}q_{32}h^2!f_i(f_y)^2 notag\
&qquad +q_{33}hf_if_y+p_2q_{33}h^2!f_tf_y+q_{21}q_{33}h^2!f_i(f_y)^2+q_{22}q_{33}h^2!f_i(f_y)^2 notag\
&qquad+q_{22}q_{33}p_1h^3!f_t(f_y)^2+q_{11}q_{22}q_{33}h^3!f_i(f_y)^3}
end{align}
end{document}






share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 15 at 5:58









MicoMico

284k31388778




284k31388778













  • 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
    Mar 15 at 8:35



















  • 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
    Mar 15 at 8:35

















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
Mar 15 at 8:35





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
Mar 15 at 8:35


















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Nidaros erkebispedøme

Birsay

Where did Arya get these scars? Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara Favourite questions and answers from the 1st quarter of 2019Why did Arya refuse to end it?Has the pronunciation of Arya Stark's name changed?Has Arya forgiven people?Why did Arya Stark lose her vision?Why can Arya still use the faces?Has the Narrow Sea become narrower?Does Arya Stark know how to make poisons outside of the House of Black and White?Why did Nymeria leave Arya?Why did Arya not kill the Lannister soldiers she encountered in the Riverlands?What is the current canonical age of Sansa, Bran and Arya Stark?