• 沒有找到結果。

Remember

!

The M

O

RE fonts

you

usein adocument,the more readable and beautiful it beco

m e s

.

6.3 Spacing

6.3.1 Line Spacing

If you want to use larger inter-line spacing in a document, you can change its value by putting the

\linespread{factor }

command into the preamble of your document. Use \linespread{1.3} for

“one and a half” line spacing, and \linespread{1.6} for “double” line spac-ing. Normally the lines are not spread, so the default line spread factor is 1.

Note that the effect of the \linespread command is rather drastic and not appropriate for published work. So if you have a good reason for changing the line spacing you might want to use the command:

\setlength{\baselineskip}{1.5\baselineskip}

{\setlength{\baselineskip}%

{1.5\baselineskip}

This paragraph is typeset with the baseline skip set to 1.5 of what it was before. Note the par command at the end of the paragraph.\par}

This paragraph has a clear purpose, it shows that after the curly brace has been closed, everything is back to normal.

This paragraph is typeset with the baseline skip set to 1.5 of what it was before. Note the par command at the end of the paragraph.

This paragraph has a clear purpose, it shows that after the curly brace has been closed, everything is back to normal.

6.3.2 Paragraph Formatting

In LATEX, there are two parameters influencing paragraph layout. By placing a definition like

\setlength{\parindent}{0pt}

\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}

in the preamble of the input file, you can change the layout of paragraphs.

These two commands increase the space between two paragraphs while set-ting the paragraph indent to zero.

The plus and minus parts of the length above tell TEX that it can com-press and expand the inter paragraph skip by the amount specified, if this is necessary to properly fit the paragraphs onto the page.

In continental Europe, paragraphs are often separated by some space and not indented. But beware, this also has its effect on the table of contents.

Its lines get spaced more loosely now as well. To avoid this, you might want to move the two commands from the preamble into your document to some place after the \tableofcontents or to not use them at all, because you’ll find that most professional books use indenting and not spacing to separate paragraphs.

If you want to indent a paragraph that is not indented, you can use

\indent

at the beginning of the paragraph.2 Obviously, this will only have an effect when \parindent is not set to zero.

To create a non-indented paragraph, you can use

\noindent

as the first command of the paragraph. This might come in handy when you start a document with body text and not with a sectioning command.

6.3.3 Horizontal Space

LATEX determines the spaces between words and sentences automatically. To add horizontal space, use:

\hspace{length}

If such a space should be kept even if it falls at the end or the start of a line, use \hspace* instead of \hspace. The length in the simplest case is just a number plus a unit. The most important units are listed in Table6.5.

This\hspace{1.5cm}is a space

of 1.5 cm. This is a space of 1.5 cm.

The command

\stretch{n}

generates a special rubber space. It stretches until all the remaining space

2To indent the first paragraph after each section head, use the indentfirst package in the ‘tools’ bundle.

6.3 Spacing 111

Table 6.5: TEX Units.

mm millimetre≈ 1/25 inch cm centimetre = 10 mm in inch = 25.4 mm

pt point≈ 1/72 inch ≈ 13 mm

em approx width of an ‘M’ in the current font ex approx height of an ‘x’ in the current font

on a line is filled up. If two \hspace{\stretch{n}} commands are issued on the same line, they grow according to the stretch factor.

x\hspace{\stretch{1}}

x\hspace{\stretch{3}}x x x x

When using horizontal space together with text, it may make sense to make the space adjust its size relative to the size of the current font. This can be done by using the text-relative units em and ex:

{\Large{}big\hspace{1em}y}\\

{\tiny{}tin\hspace{1em}y}

big y

tin y

6.3.4 Vertical Space

The space between paragraphs, sections, subsections, . . . is determined au-tomatically by LATEX. If necessary, additional vertical space between two paragraphs can be added with the command:

\vspace{length}

This command should normally be used between two empty lines. If the space should be preserved at the top or at the bottom of a page, use the starred version of the command, \vspace*, instead of \vspace.

The \stretch command, in connection with \pagebreak, can be used to typeset text on the last line of a page, or to centre text vertically on a page.

Some text \ldots

\vspace{\stretch{1}}

This goes onto the last line of the page.\pagebreak

Additional space between two lines of the same paragraph or within a table is specified with the

\\[length]

command.

With \bigskip and \smallskip you can skip a predefined amount of vertical space without having to worry about exact numbers.