Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

LaTeX multiline equation is not working!

  1. Mar 17, 2010 #1
    Hi all,

    I am using LeD and texlive09 for latex editing. I want to render a multi-line equation and for that I am trying with "\\" - this operator. But it is not rendering. I have included "amsmath" package. I am clueless about why the problem happens. Please help me...

    Regards
    Sam
     
  2. jcsd
  3. Mar 17, 2010 #2
    What are you trying to type? You can even just enter it into your reply to test if it works. Quote my reply to see what I typed below:

    [tex]
    \begin{gather*}
    \nabla \cdot \vec E = \frac{\rho}{\epsilon_0} \\
    \nabla \times \vec E = -\dfrac{\partial \vec B}{\partial t} \\
    \nabla \cdot \vec B = 0 \\
    \nabla \times \vec B = \mu_0\epsilon_0\dfrac{\partial \vec E}{\partial t} + \mu_0 \vec J
    \end{gather*}
    [/tex]
     
  4. Mar 17, 2010 #3
    Yes it works! But it doesn't show up the reference to the equation in toc. using \begin{equation} it should work...shouldn't it?

    regards
    Sam
     
  5. Mar 17, 2010 #4

    minger

    User Avatar
    Science Advisor

    You typically have to enter an additional environment. I don't believe the standard compiler I use allows multiline equations simply inside of the equation environment. I use the split environment, e.g.
    [tex]
    \begin{equation}
    \begin{split}
    a &= b + 1\\
    c &= a + 10
    \end{split}
    \end{equation}
    [/tex]

    Code (Text):

    \begin{equation}
    \begin{split}
    a &= b + 1\\
    c &= a + 10
    \end{split}
    \end{equation}
     
     
  6. Mar 17, 2010 #5

    Hepth

    User Avatar
    Gold Member

    I always use "\begin{eqnarray}" then your \\ will work., though it numbers the lines.

    If the problem persists it may be you're trying to break up brackets:

    Code (Text):
    \begin{equation}
    \begin{array}{c}
    this is a test \left(hello \\
    hello two \right)
    \end{array}
    \end{equation}
    gives an error but

    Code (Text):
    \begin{equation}
    \begin{array}{c}
    this is a test (hello \\
    hello two )
    \end{array}
    \end{equation}
    doesn't. Can't split the \left( and \right)'s up
     
    Last edited: Mar 18, 2010
  7. Apr 20, 2010 #6
    You cannot split \left<stuff> and \right<stuff>
    You must use "fake" right/left instead:

    Code (Text):
    \begin{equation}
    \begin{array}{c}
    this is a test \left(hello \right.\\
    \left. hello two \right)
    \end{array}
    \end{equation}
     
  8. Apr 22, 2010 #7
    There are several environments that essentially perform the same thing with subtle differences.

    I personally use {align} if I want to reference every line.
     
  9. Apr 24, 2010 #8
    hi!!

    I have this equation that I want to split in 4 parts.

    \[ d(x,z) = \mid x-z \mid _{p} = \mid (x-y) + (y-z) \mid _{p} \leqslant \mbox{ max (} \mid x-y \mid _{p} \mbox{, } \mid y-z \mid _{p} \mbox{)} = \mbox{ max (} d(x,y), d(y,z) \mbox{).} \]

    I have tried : \[ d(x,z) = & \left(\mid x-z \mid _{p} \right. \\
    & \left. = \mid (x-y) + (y-z) \mid _{p} \right. \\
    & \left. \leqslant \mbox{ max (} \mid x-y \mid _{p} \mbox{, } \mid y-z \mid _{p} \mbox{)} \right. \\
    & \left. \mbox{ max (} d(x,y), d(y,z) \mbox{).} \] \right) \]

    But it is not working.

    Can you help me? Thank you,
    Miha
     
  10. Apr 27, 2010 #9
    [tex]
    \begin{align} d(x,z) &= \mid x-z \mid _{p} \\
    &= \mid (x-y) + (y-z) \mid _{p} \\
    &\leqslant \mbox{ max (} \mid x-y \mid _{p} \mbox{, } \mid y-z \mid _{p} \mbox{)} \\
    &= \mbox{ max (} d(x,y), d(y,z) \mbox{).}
    \end{align}
    [/tex]

    If you don't want equation numbers, use the starred versions of align,
    [tex]
    \begin{align*} d(x,z) &= \mid x-z \mid _{p} \\
    &= \mid (x-y) + (y-z) \mid _{p} \\
    &\leqslant \mbox{ max (} \mid x-y \mid _{p} \mbox{, } \mid y-z \mid _{p} \mbox{)} \\
    &= \mbox{ max (} d(x,y), d(y,z) \mbox{).}
    \end{align*}
    [/tex]
     
  11. Apr 29, 2010 #10
    Thank you very much!!

    regards,
    miha
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: LaTeX multiline equation is not working!
  1. LaTeX Equation Tag (Replies: 2)

  2. Latex equations Help (Replies: 2)

Loading...