Results 1 to 6 of 6

Math Help - LaTeX question

  1. #1
    MHF Contributor Mathstud28's Avatar
    Joined
    Mar 2008
    From
    Pennsylvania
    Posts
    3,641

    LaTeX question

    How do you align a series of equations in the center like Krizalid does in this thread?

    http://www.mathhelpforum.com/math-he...opic-sums.html

    I tried to duplicate the appropriate LaTeX code but don't seem to be able to. Could someone tell me what I'm doing wrong?

    \begin{aligned}\int{f(x)g(x)}dx&<br />
=f(x)+200g(x)&<br />
=5\end{aligned}

    Code:
    \begin{aligned}\int{f(x)g(x)}dx&
    =f(x)+200g(x)&
    =5\end{aligned}
    Follow Math Help Forum on Facebook and Google+

  2. #2
    A riddle wrapped in an enigma
    masters's Avatar
    Joined
    Jan 2008
    From
    Big Stone Gap, Virginia
    Posts
    2,551
    Thanks
    12
    Awards
    1
    Quote Originally Posted by Mathstud28 View Post
    How do you align a series of equations in the center like Krizalid does in this thread?

    http://www.mathhelpforum.com/math-he...opic-sums.html

    I tried to duplicate the appropriate LaTeX code but don't seem to be able to. Could someone tell me what I'm doing wrong?

    \begin{aligned}\int{f(x)g(x)}dx&<br />
=f(x)+200g(x)&<br />
=5\end{aligned}

    \begin{aligned}\int{f(x)g(x)}dx&<br />
=f(x)+200g(x) \\ &<br />
=5\end{aligned}
    You left out the "new line" code \\ after your &
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Moo
    Moo is offline
    A Cute Angle Moo's Avatar
    Joined
    Mar 2008
    From
    P(I'm here)=1/3, P(I'm there)=t+1/3
    Posts
    5,618
    Thanks
    6
    You can also use \hfill in case you want the parts between & & to be aligned to the left.

    Another command to align things is \begin{gathered} \end{gathered} :
    \begin{gathered}<br />
p \text{ is a prime.} \hfill \\<br />
\text{In } \mathbb{Z}/p \mathbb{Z},~ \forall \overline{n},~ \overline{n}^p-\overline{n}= \prod_{k=0}^{n-1} (\overline{n}-k) \hfill \end{gathered}
    Code:
    \begin{gathered}
    p \text{ is a prime.} \hfill \\
    \text{In } \mathbb{Z}/p \mathbb{Z},~ \forall \overline{n},~ \overline{n}^p-\overline{n}= \prod_{k=0}^{n-1} (\overline{n}-k) \hfill \end{gathered}
    \begin{gathered}<br />
p \text{ is a prime.} \\<br />
\text{In } \mathbb{Z}/p \mathbb{Z},~ \forall \overline{n},~ \overline{n}^p-\overline{n}= \prod_{k=0}^{n-1} (\overline{n}-k) \end{gathered}
    Code:
    \begin{gathered}
    p \text{ is a prime.} \hfill \\
    \text{In } \mathbb{Z}/p \mathbb{Z},~ \forall \overline{n},~ \overline{n}^p-\overline{n}= \prod_{k=0}^{n-1} (\overline{n}-k) \end{gathered}
    (without \hfill)
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor Mathstud28's Avatar
    Joined
    Mar 2008
    From
    Pennsylvania
    Posts
    3,641
    \begin{aligned}\int{f(x)g(x)}dx&\\<br />
=f(x)+200g(x)&\\<br />
=5<br />
\end{aligned}

    How do I get them lined up correctly?

    Code:
    \begin{aligned}\int{f(x)g(x)}dx&\\
    =f(x)+200g(x)&\\
    =5
    \end{aligned}
    Follow Math Help Forum on Facebook and Google+

  5. #5
    o_O
    o_O is offline
    Primero Espada
    o_O's Avatar
    Joined
    Mar 2008
    From
    Canada
    Posts
    1,407
    The &'s help you align them. Play around with them and you should be able to catch on:

    \begin{aligned} <br />
& \int{f(x)g(x)}dx \\<br />
&  =  f(x)+200g(x) \\ <br />
& = 5<br />
\end{aligned}<br />

    Code:
    \begin{aligned} 
    & \int{f(x)g(x)}dx \\
    &  =  f(x)+200g(x) \\ 
    & = 5
    \end{aligned}
    __________________________________________________ ____

    \begin{aligned} <br />
\int{f(x)g(x)}dx  & = f(x)+200g(x) \\ <br />
& =  5<br />
\end{aligned}<br />

    Code:
    \begin{aligned} 
    \int{f(x)g(x)}dx & = f(x)+200g(x) \\ 
    & = 5
    \end{aligned}
    Follow Math Help Forum on Facebook and Google+

  6. #6
    MHF Contributor Mathstud28's Avatar
    Joined
    Mar 2008
    From
    Pennsylvania
    Posts
    3,641
    \begin{aligned}<br />
A_n&=\int{f(x)g(x)}dx\\<br />
&=f(x)+200g(x)\\<br />
&=5\\<br />
&=4+1\\<br />
&=\frac{5!}{4!}\\<br />
&=\frac{\int_0^{\infty}t^5e^{-t}dt}{\int_0^{\infty}t^4e^{-t}dt}<br />
\end{aligned}
    Thank you
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Question in LaTeX
    Posted in the LaTeX Help Forum
    Replies: 0
    Last Post: May 27th 2010, 01:53 AM
  2. Question checking LaTeX output
    Posted in the LaTeX Help Forum
    Replies: 2
    Last Post: December 28th 2009, 10:26 PM
  3. LaTex inside of LaTex
    Posted in the LaTeX Help Forum
    Replies: 2
    Last Post: November 12th 2009, 11:07 AM
  4. Question about getting Latex to work
    Posted in the LaTeX Help Forum
    Replies: 3
    Last Post: November 18th 2008, 01:31 PM
  5. LaTex Question
    Posted in the LaTeX Help Forum
    Replies: 2
    Last Post: January 20th 2008, 03:16 PM

Search Tags


/mathhelpforum @mathhelpforum