Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Latex Multiple Linebreaks

I use LaTeX to type up programming homeworks for classes. I need to do this:

my line of text blah blah blah  new line of text with blank line between  

I know I can use double slash to break lines \\, but LaTeX will only take the first line break (complains about more) and starts a new line, it produces this :

my line of text blah blah blah   new line of text with blank line between  

How can I get that extra line break in there so I can have space between my lines of text?

like image 521
rlb.usa Avatar asked Feb 03 '10 22:02

rlb.usa


People also ask

How do I insert multiple line breaks in LaTeX?

There are three commands here that work the same in the example: \\ (two backslashes) \newline. \hfill \break.

How do I keep multiple blank lines in LaTeX?

\newpage \begin{center} \vspace*{1in} ABSTRACT \\ \vfill \singlespacing TITLE SINGLE-SPACED IN ALL CAPS, SAME SIZE AS THE REST OF THE TEXT \vfill %Should be 3 blank lines here. \doublespacing My name \\ My department \\ My degree \end{center} \vfill %Should be 3 blank lines here. Put text of the abstract here.

How do you skip 5 lines in LaTeX?

Latex has come up with another way to add a line break or skip a line within the data. Therefore, we will be using the \break command in the code to do so. Before that, we have added new text data as a paragraph within the \begin and \end command as below. Execute and run this code file by using both arrow icons.

How do I add a new line in LaTeX?

The \\ command tells LaTeX to start a new line. It has an optional argument, extra-space , that specifies how much extra vertical space is to be inserted before the next line. This can be a negative amount.


2 Answers

Line break accepts an optional argument in brackets, a vertical length:

line 1 \\[4in] line 2 

To make this more scalable with respect to font size, you can use other lengths, such as \\[3\baselineskip], or \\[3ex].

like image 115
Seth Johnson Avatar answered Sep 24 '22 20:09

Seth Johnson


Do you want more space between paragraphs? Then you can change the parameter \parskip.

For example, try

\setlength{\parskip}{10pt plus 1pt minus 1pt} 

This means that the space between paragraphs is usually 10pt, but can grow or shrink by up to 1pt. This means you give LaTeX the ability to change it up to one 1pt in order to achieve a better page layout. You can remove the plus and minus parts to make it always your specified length.

If you are trying to display source code, try the listings package or use verbatim. If you are trying to typeset pseudocode, try the algorithm package.

like image 28
tkerwin Avatar answered Sep 22 '22 20:09

tkerwin