...start a new line(s) or page? (vertical spacing)

The 2 different methods of changing the default fontsize (here and here) showed us that putting text on different lines of our tex file didn't result in different lines in the output:

There are multiple ways to create a new line (or lines) and to save you time from having to insert line after line after line to push the output to the next page there's even a command to end the page and start a new one. Here is the tex file to illustrate one way LinesPage. The output is shown on the right in the following screen capture:

Let's review the code:

Line 1: The documentclass command tells us the document will be an article with a default fontsize of 12 points.

Lines 2 and 3 are comment lines which aren't part of the document being typed. The IDE (Gummi) has typeset them in blue so it's immediately obvious. The 2 comments are in a part of the document known as the preamble. The preamble is empty for now but as we create more demands on what the document must do, they'll be put in the preamble.

Line 4: The \begin{document} command tells us the document has begun. Since this document is an article, the first line will be indented.

Line 5: A normalsize "Hello world!" is printed after the indentation but the percent sign indicates that everything else is a comment (which will not be printed). Note that the IDE has once again typeset the comment in blue.

Line 6: Introducing a blank line starts a new paragraph. A new paragraph will start a new line and indent.

Line 7: Since Line 6 is blank the tiny "Hello world" follows the indentation.

Line 8: The blank line indicates that a new line will be started and then the text will be indented.

Line 9: The \noindent command prevents the indentation from taking place, so the scriptsize "Hello world!" begins at the left margin. If you ever want to begin your article without an indentation, put \noindent on the first line after \begin{document}. The line ends with \\ which indicates to put all text on the next line but don't indent.

Line 10: The footnote size text will be on a new line but not indented. That line ends with 2 \\ symbols. The first \\ will push the text to the next line without indenting, and the second \\ symbol will push the text to the line after that without indenting. The result is 1 blank line separating the small "Hello world!" from the footnote size "Hello world!".

Line 11: The small "Hello world!" ends with \\ [1in]. The [1in] is a nice option which specifies the vertical space to be inserted, so \\ [1in] will insert 1 inch of blank space between the next line without indenting. Although I've used inches, you get lots of choice on the units of length as well.

Lines 12-15: "Hello world" is printed 4 times. Note that Line 15 ends with \\ [-1in] which indicates that -1 inch of vertical space be inserted into the document.

Look carefully at the output! One inch of space should separate the small "Hello world!" from the normal size "Hello world!" but that's certainly not a normal size "Hello world!" below it. What's happening? Since line 15 has a put 1 inch of negative vertical space between it and the huge "Hello world!" on line 16, the huge "Hello world!" is put 1 inch above the LARGE "Hello world!".

Line 16: Prints the huge "Hello world!".

Line 17: The \newpage command ends the page and starts a new page with an indentation. This saves you from having to play around inserting lines to get the output onto the next page.

Line 18: Prints a Huge "Hello world!" after the indentation on page 2 of the output.

Line 19: Not surprisingly, \end{document} ends the document.

To summarize, an article always begins with and indentation, and the \noindent command will keep any unwanted indentations from taking place. Blank lines start a new line with and indentation while \\ starts a new line without an indentation. To put in k inches of vertical space, insert \\ [kin] into your document and \newpage ends the page and begins a fresh new page with an indentation. For those of you looking for another way to create vertical space, you can look into the \vspace command.

Leave a Reply

Your email address will not be published. Required fields are marked *

AlphaOmega Captcha Classica  –  Enter Security Code