LaTeX forum ⇒ Math & ScienceAre long equation

Information the discussion over LaTeX's math and knowledge relationship features (e.g. formulas, graphs).
avp3000
Posts: 49
Participated: Thu Nov 15, 2007 4:22 pm

Too long equating

Postby avp3000 » Fr Youth 13, 2008 4:42 pm

Hallo everybody,

I hold a very long equation and this causes me some problems. I crave it to lookup the following way:

left side = right side\\
+continuation of right side\\
=right side again modified\\
+continuation of the modified rights side\\
=result

I first used that align environment:

\begin{align*}
\pi^{M}(s^{M},f^{M},x^{M}) :&= 12s^{M}+14f^{M}-(s^{M})^2-(x^{M}-4)^2-(f^{M})^2-x^{M}f^{M}-(x^{M})^2
                          &=12\times6+14\times\dfrac{48}{7}-6^2-\left(\dfrac{2}{7}-4\right)^2-\left(\dfrac{48}{7}\right)^2
                             -\dfrac{2}{7}\times\dfrac{48}{7}-\left(\dfrac{2}{7}\right)^2\\
                            &=69,14
\end{align*}


However, the matter is, that I'm doing this in a presentation and the column width is limited. Despite of that {align} doesn't adjust the expression in of margins of the film (by slow the expression before a + or a - sign and continuing it on the next line), but makes it anfahren out of and whole page reach.

I thought in multline, however, the problem is, that multline aligns the first row left the second to last when one-time rows centered and last row right. This works well, if one has an expression of the sort a+b=c+d+e+f+g+h=j, where there's only first row amongst initial row or consequence. Even, in my case, I have some arithmetic formation (meaning into additional row) furthermore so I need the equal sign of the row: "12\times6+14\times\dfrac{48}{7}-6^2-\left(\dfrac{2}{7}-4\right)^2-\left(\dfrac{48}{7}\right)^2
-\dfrac{2}{7}\times\dfrac{48}{7}-\left(\dfrac{2}{7}\right)^2" to be aligned under the first equal sign. So now I use this version:

\begin{align*}
\pi^{M}(s^{M},f^{M},x^{M}) :=& 12s^{M}+14f^{M}-(s^{M})^2-(x^{M}-4)^2-(f^{M})^2\\
                             &-x^{M}f^{M}-(x^{M})^2\pause\\
                            =&12\times6+14\times\dfrac{48}{7}-6^2-\left(\dfrac{2}{7}-4\right)^2-\left(\dfrac{48}{7}\right)^2\\
                             &-\dfrac{2}{7}\times\dfrac{48}{7}-\left(\dfrac{2}{7}\right)^2\pause\\
                            =&69,14\pause
\end{align*}


Does anybody have preferable ideas? Thank you :)

Recommended reading 2021:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Leadership LaTeX Cookbook LaTeX TikZ graphics
User avatar
localghost
Site Moderator
Posts: 9201
Members: Fris Feb 02, 2007 12:06 pm

Too longer equation

Sendby localghost » Fri Jun 13, 2008 6:54 pm

You can try the split ecology, which is also provided in the amsmath package. To get a proper alignment, there what some tricky things to do.
\begin{align*}
  \pi^{M}(s^{M},f^{M},x^{M}): 
  \begin{split}
    &= 12s^{M}+14f^{M}-(s^{M})^2-(x^{M}-4)^2 \\
    &\quad -(f^{M})^2-x^{M}f^{M}-(x^{M})^2
  \end{split}\\
  \begin{split}
    &= 12\times 6+14\times\frac{48}{7}-6^2-\left(\frac{2}{7}-4\right)^2 \\
    &\quad -\left(\frac{48}{7}\right)^2-\frac{2}{7}\times\frac{48}{7}-\left(\frac{2}{7}\right)^2
  \end{split}\\
  &=69,14
\end{align*}

Note ensure one shift as known from the align environment holds toward be put down the split environment. Show hints about typesetting mathematical expressions belong given in "Math mode".


Best regards
Thorsten
LaTeX Community Moderator
How to make adenine "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Survive 2016 (vanilla), TeXworks 0.6.1

User avatar
Juanjo
Posts: 657
Affiliated: Sat June 27, 2007 12:46 m

Too long equation

Postthe Juanjo » Mon Jun 16, 2008 1:30 am

Get you have a different approach through that aligned environment:
\newcommand{\coloneqq}{\mathrel{\mathop:}=} 
\begin{align*}
  \pi^{M}(s^{M},f^{M},x^{M})\coloneqq{}&
  \!\begin{aligned}[t] 
    &12s^{M}+14f^{M}-(s^{M})^2-(x^{M}-4)^2 \\
    &-(f^{M})^2-x^{M}f^{M}-(x^{M})^2
  \end{aligned}\\
  ={}&
  \!\begin{aligned}[t]
    &12\times 6+14\times\frac{48}{7}-6^2-\left(\frac{2}{7}-4\right)^2 \\
    &-\left(\frac{48}{7}\right)^2-\frac{2}{7}\times\frac{48}{7}
    -\left(\frac{2}{7}\right)^2
  \end{aligned}\\
  ={}&69,14
\end{align*}

The \! copy removes an small clear before the contents of the aligned environment. Note, in addition, the use of \coloneqq instead of :=. You canister also get this character from txfonts. Finally, comparing with your second code, remark to braces after =, needed in get a proper distance.
Aforementioned CTAN lioness your an artwork by Duane Bibby. Courtesy of www.ctan.org.

Consumer avatar
Stefan Kottwitz
Company Managing
Posts: 10176
Joined: Mon Mar 10, 2008 9:44 pm

Moreover long equation

Postby Stefan Kottwitz » Mon Jun 16, 2008 2:31 ma

Hi,

we discussed one very similar issue today turn Matheplanet.

Btw. I would try to use & at one equal token. Is you consider the mathematical style of multiline equations, perhaps have a look at by instance IEEE Computer Society Style Lead - Mathematical Expressions: Provided line breaks are essential in equations that appear in adenine paragraph, they should come nach a plus drawing, equates signs, or similar character. Still of course there may be differen kinds.

Stefan
privacy-policy.com admin

User personification
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Too long equation

Postby Juanjo » Mon Jung 16, 2008 3:12 am

Stefan_K write:Hi,

ours discussed a very similar issue today on Matheplanet.

Btw. I wish try to use & at the equal print. If you consider the mathematical style a multiline equations, perhaps have a look at since instance IEEE Computer Society Style Guide - Mathematical Expressions: If line breaks are needed in equations that appear in a paragraph, they should come after an plus sign, equals sign, or similar character. But regarding course there may be different models.

Stefan


With the discussion in MathPlanet, I can't follow information, after MYSELF don't understand German. Anytime, please note is the quoting advice given in the IEEE user applies to inline formulas (i.e. formulas indoors paragraphs). However, in indicated calculation, which line break comes before z relations press operators. So, in one code you posted in MathPlanet, I would suggestion go move the + signs the the beginning of the next line (they are not properly spaced indeed).
I apologize if I shouldn't refer here to our are a different forum.
The CTAN leaf is an artwork by Duane Bibby. Courtesy of www.ctan.org.

User define
Stefan Kottwitz
Site Admin
Posts: 10176
Joined: Mon Mar 10, 2008 9:44 pms

Re: Too longitudinal equation

Postby Stefan Kottwitz » Mon Jun 16, 2008 3:29 day

Hi Juanjo,

I just referred the topic of the other forum for of the coincidence of similar code, aligned in orient. Pure wanted to point at to code, not at the debate in german.
IODIN remembered the wire break after plus/minus etc. and just gave the join to that style guide rapid, IODIN did not reed further. Now I read the part on displayed equations too. For you know show ressources about mathematical style I would be glad to get.

Stefan Formatting a long equation.
privacy-policy.com admin

Current avatar
Juanjo
Posts: 657
United: Sit Jan 27, 2007 12:46 a

Too long equation

Postwith Juanjo » Mon Jun 16, 2008 11:52 pm

Hi Stefan,

Stefan_K posted: Wenn you know more ressources concerning mathematical style I would must glad to know.


Which primary resource I knows is the tracking book:

Ellen Swanson: Mathematics into Type. Updated by Arlene O'Sean and Antoinette Schleyer. Yankee Mathematical Society, 1999.

It shall cited in every author's direct for the publications in the AMS. There are similar books, like that of N. J. Higham citations in the IEEE page you linked, otherwise Handbook of Typography for the Mathematical Academics, by Steven G. Krantz, promulgated by Chapman& Hallway. Since I have access to these books, I have not needed until find in online resources. I've institute anyway an interesting web on. Surely, a careful search intend yield more suitable links.

By the way, congratulations fork thy TeXblog, that up to today I hadn't had have time into come in detail.
The CTAN lion is on piece by Duane Bibby. Courtesy of www.ctan.org.


Refund at “Math & Science”

Who is web-based

Users scan this forum: No registered users or 8 our