How do you insert a break using latex?

In summary, to insert a line break using LaTeX, you can use the align* environment to give multiple lines and use the \\ command to indicate a line break within the environment. Alternatively, you can use the array environment or put a paragraph break (\par) at the beginning of each line.
  • #1
darryw
127
0
How do you insert a break using latex?

Homework Statement


all my equations come out on one sinle line.. please help??

Homework Equations





The Attempt at a Solution

 
Physics news on Phys.org
  • #2


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.
 
  • #3


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.
 
  • #4


latex is so awesome..
thanks you
 
  • #5


using this, \\ within the latex environment isn't making a line break. What am i doing wrong??
 
  • #6


for example..

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

this is copied and pasted from the above post but it won't do the line breaks.. (??) thank you
 
  • #7


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.
 
  • #8


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

thanks
 
  • #9


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.
 
  • #10


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.
 
  • #11


i guess i don't understand what an environment is.. can you tell me exactly what i should type to get a line break? thanks
 
  • #12


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.
 
  • #13


can someone please explain how to insert line break?? please?
i don't understand how to do this, except by starting new latex line everytime i want a break.
thanks
 
  • #14


i tries using yungmans method but this doesn't work, as can be seen from this example...
[tex]testing 123
testing456
testing 678
[/tex]
 
  • #15


What exactly do i put into latex so that there is a line break between testing 123 and testing 456?
 
  • #16


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


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 a lot of stuff to type for a simple line break, isn't it?? or is this common?? fyi, I am 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 isn't the 3rd line starting at the far left? thanks
 
  • #18


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]
 
  • #19


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]
 

1. How do you insert a line break in the middle of a paragraph using LaTeX?

To insert a line break in the middle of a paragraph using LaTeX, use the command \\ or \newline at the desired location. This will create a new line without starting a new paragraph.

2. How do you insert a page break in LaTeX?

To insert a page break in LaTeX, use the command \newpage at the desired location. This will start a new page and move all the text after the command to the new page.

3. How do you insert a line break without creating a new paragraph in LaTeX?

To insert a line break without creating a new paragraph in LaTeX, use the command \\* or \linebreak at the desired location. This will create a new line without starting a new paragraph, and it will also prevent a page break from occurring at that location.

4. How do you insert a conditional line break in LaTeX?

To insert a conditional line break in LaTeX, use the command \\[length] at the desired location. This will create a line break with the specified length only if it is necessary to avoid an overfull or underfull line.

5. How do you insert a non-breaking space in LaTeX?

To insert a non-breaking space in LaTeX, use the command ~ at the desired location. This will prevent a line break from occurring at that space, even if the text is justified. It is commonly used to prevent a name or number from being split across lines.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
783
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
23
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
973
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
967
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
901
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
2K
Back
Top