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

Homework Help: How do you insert a break using latex?

  1. May 9, 2010 #1
    How do you insert a break using latex???

    1. The problem statement, all variables and given/known data
    all my equations come out on one sinle line.. please help??

    2. Relevant equations



    3. The attempt at a solution
     
  2. jcsd
  3. May 10, 2010 #2

    sylas

    User Avatar
    Science Advisor

    Re: How do you insert a break using latex???

    I don't think this is a homework question...

    Try using a LaTeX environment designed to give multiple lines. I like using align* Here's an example.

    [tex]\begin{align*}
    a & = b + c + c \\
    & = b + 2c \\
    b & = a - 2c
    \end{align*}[/tex]

    Within the environment, lines are separated by \\, and the & character marks an alignment point within each line. As usual, click on the equation to see the LaTeX code used.
     
  4. May 10, 2010 #3
    Re: How do you insert a break using latex???

    In addition to the above comment, you may want to give us a snippet of your latex code so that we can see the problem firsthand.
     
  5. May 10, 2010 #4
    Re: How do you insert a break using latex???

    latex is so awesome..
    thanks you
     
  6. May 17, 2010 #5
    Re: How do you insert a break using latex???

    using this, \\ within the latex environment isnt making a line break. What am i doing wrong??
     
  7. May 17, 2010 #6
    Re: How do you insert a break using latex???

    for example..

    [tex]a & = b + c + c \\
    & = b + 2c \\
    b & = a - 2[/tex]

    this is copied and pasted from the above post but it wont do the line breaks.. (??) thank you
     
  8. May 17, 2010 #7

    Mark44

    Staff: Mentor

    Re: How do you insert a break using latex???

    Sylas's script looks like this (with extra spaces in the tex tags so that what's inside doesn't render).
    [ tex]\begin{align*}a & = b + c + c \\& = b + 2c \\b & = a - 2c\end{align*}[ /tex]

    You don't have the \begin{align*} and \end{align*} tags.
     
  9. May 17, 2010 #8
    Re: How do you insert a break using latex???

    sylas said that "Within the environment, lines are separated by \\, and the & character marks an alignment point within each line."
    so why doesnt just inserting \\ give line break? (basically i just want to know the simplest fastest way to get a line break)

    thanks
     
  10. May 17, 2010 #9

    Mark44

    Staff: Mentor

    Re: How do you insert a break using latex???

    I think that by "within the environment" he meant the content between the \begin{} and \end{} tags. If that's not what he meant he can correct me.
     
  11. May 17, 2010 #10

    Fredrik

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Re: How do you insert a break using latex???

    Did you notice that Sylas also said "Try using a LaTeX environment designed to give multiple lines"? The environment is defined by the begin and end commands.

    But your question is still valid, because in my LEd (LaTeX Editor), I seem to be able to start a new line with \\ anywhere. I guess it only works in some of the environments here.
     
  12. May 17, 2010 #11
    Re: How do you insert a break using latex???

    i guess i dont understand what an environment is.. can you tell me exactly what i should type to get a line break? thanks
     
  13. May 17, 2010 #12
    Re: How do you insert a break using latex???

    I just do it the dumb way. I start and end a line one at a time. Why do you want to save the typing of (tex) and (/tex) and have to go through all the trouble to do this. Just start one line, end the line, hit return and start another line. Notice I use ( ) instead [ ] so it won't go to Latex.
     
  14. May 23, 2010 #13
    Re: How do you insert a break using latex???

    can someone please explain how to insert line break?? please?
    i dont understand how to do this, except by starting new latex line everytime i want a break.
    thanks
     
  15. May 23, 2010 #14
    Re: How do you insert a break using latex???

    i tries using yungmans method but this doesnt work, as can be seen from this example...
    [tex]testing 123
    testing456
    testing 678
    [/tex]
     
  16. May 23, 2010 #15
    Re: How do you insert a break using latex???

    What exactly do i put into latex so that there is a line break between testing 123 and testing 456?
     
  17. May 23, 2010 #16
    Re: How do you insert a break using latex???

    [tex]begin{align*}
    a & = b + c + c \\
    & = b + 2c \\
    b & = a - 2c
    \end{align*}
    [/tex]
     
  18. May 23, 2010 #17
    Re: How do you insert a break using latex???

    Ive been experimenting with latex: am i right in saying that to the only way to get line breaks is to type "begin{align*}" at beginning of latex, then type "\end{align*}" at the end of latex, and also to type "\\" for the exact location of desired line break?
    To me (dont know anything about code) this seems like alot of stuff to type for a simple line break, isnt it?? or is this common?? fyi, im not insulting latex, i think its great, but in comparison to <br> it seems sort of over the top, no? is there a simpler way to get line break, or is this the simplest way? thank you

    [tex]\begin{align*}a = b\\ + c + c = b + 2c \\ b = a - 2c \end{align*}[/tex]

    also, in the above latex, why isnt the 3rd line starting at the far left? thanks
     
  19. May 23, 2010 #18

    LCKurtz

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Re: How do you insert a break using latex???

    Try this:

    [tex]
    \begin{array}{c}
    \sin^2\theta + \cos^2\theta = 1\\
    F(x) = \int_0^xf(t)dt\\
    \sin^2\theta + \cos^2\theta = 1
    \end{array}
    [/tex]
     
  20. May 23, 2010 #19

    LCKurtz

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Re: How do you insert a break using latex???

    You can also avoid the array thing by putting a paragraph break at the beginning of each line like this:

    [tex]
    \par\sin^2\theta + \cos^2\theta = 1
    \par F(x) = \int_0^xf(t)dt
    \par\sin^2\theta + \cos^2\theta = 1
    [/tex]
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook