Math & ScienceAltering Equation Alignment

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
mgu
Posts: 1
Joined: Mon Apr 16, 2012 12:09 am

Altering Equation Alignment

Post by mgu »

Hi, I am trying to typeset a really long equation that involves splitting, alignment, and automatic sizing of brackets. The equation has the following structure:

Equation=Fraction_1*Polynomial_1+Fraction_2*Polynomial_2+Fraction_3*Polynomial_3...

Every polynomial exceeds the width of a page, so it needs to be split as well. The type of alignment I want to achieve is as follows:

Code: Select all

Equation=&Fraction_1*(@Polynomial_1_Part_1+\\
                      @Polynomial_1_Part_2+\\
                      @Polynomial_1_Part_3+...)+\\
         &New_Fraction_2*(#Polynomial_2_Part_1+\\
                          #Polynomial_2_Part_2+\\
                          #Polynomial_2_Part_3+...)+\\
         &New_New_Fraction_3*($Polynomial_3_Part_1+\\
                              $Polynomial_3_Part_2+\\
                              $Polynomial_3_Part_3+...)+...
(I am using '@', '#', '$', and '&' to distinguish the different alignments.) In other words, the alignment is to be set between polynomials that are multiplied by the same fraction (i.e. '@', '#', and '$' in the above expression) as well as between the fractions (i.e. '&' in the above expression). What is the best way to go about this? The split environment does not seem to work well. I need to add a tag to the alignment operator or something to that effect. Does anyone have any suggestions? Thank you.
Last edited by localghost on Mon Apr 16, 2012 4:51 pm, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

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

Altering Equation Alignment

Post by Juanjo »

The following code may provide you some hints:

Code: Select all

\documentclass[a4paper]{article} 
\usepackage{amsmath}
\begin{document}

\begin{equation}
   \begin{split}
      f(x,y)={}&
      \frac{1}{2}
      \begin{aligned}[t]
         \Bigl(& 1 + x - y + 2 x^2 - 3 x y + 4 y^2 \\
         & - 7 x^3 + 6 x^2 y - 5 x y^2 + 9 y^3 \\
         & + 11 x^4 -3 x^3 y + 3 x^2 y^2 + 2 x y^3 - 5 y^4\Bigr)
      \end{aligned} \\
      & + \frac{3}{4}
      \begin{aligned}[t]
         \Bigl(& {-}2 + x - 2 y + 3 x^2 - 4 x y + 2 y^2 \\
         & + 4 x^3 - 5 x^2 y + 3 x y^2 + 8 y^3 \\
         & + x^4 + 2 x^3 y - 2 x^2 y^2 + 2 x y^3 - 5 y^4\Bigr)
      \end{aligned} \\
      & - \frac{4}{9}
      \begin{aligned}[t]
         \Bigl(& 3 - 2 x - 2 y + 3 x^2 + 9 x y -3 y^2 \\
         & + 4 x^3 + 4 x^2 y + 3 x y^2 + 7 y^3 \\
         & + x^4 + 3 x^3 y + 2 x^2 y^2 + 2 x y^3 + 4 y^4\Bigr)
       \end{aligned}
   \end{split}
\end{equation}

\end{document}
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
Post Reply