1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
<head>
<title>UK TeX FAQ -- question label paraparam</title>
</head><body>
<h3>Why does it ignore paragraph parameters?</h3>
<p>When TeX is laying out text, it doesn't work from word to word, or
from line to line; the smallest complete unit it formats is the
paragraph. The paragraph is laid down in a buffer, as it appears, and
isn't touched further until the end-paragraph marker is processed.
It's at this point that the paragraph parameters have effect; and it's
because of this sequence that one often makes mistakes that lead to
the paragraph parameters not doing what one would have hoped (or
expected).
<p>Consider the following sequence of LaTeX:
<blockquote>
<pre>
{\raggedright % declaration for ragged text
Here's text to be ranged left in our output,
but it's the only such paragraph, so we now
end the group.}
Here's more that needn't be ragged...
</pre>
</blockquote>
TeX will open a group, and impose the ragged-setting parameters within
that group; it will then save a couple of sentences of text and
close the group (thus restoring the previous value of the
parameters that <code>\</code><code>raggedright</code> set). Then TeX encounters a blank
line, which it knows to treat as a <code>\</code><code>par</code> token, so it typesets the
two sentences; but because the enclosing group has now been closed,
the parameter settings have been lost, and the paragraph will be
typeset normally.
<p>The solution is simple: close the paragraph inside the group, so that
the setting parameters remain in place. An appropriate way of doing
that is to replace the last three lines above with:
<blockquote>
<pre>
end the group.\par}
Here's more that needn't be ragged...
</pre>
</blockquote>
In this way, the paragraph is completed while <code>\</code><code>raggedright</code>'s
parameters are still in force within the enclosing group.
<p>Another alternative is to define an environment that does the
appropriate job for you. For the above example, LaTeX already
defines an appropriate one:
<blockquote>
<pre>
\begin{flushleft}
Here's text to be ranged left...
\end{flushleft}
</pre>
</blockquote>
<p>In fact, there are a number of parameters for which TeX only
maintains one value per paragraph. A tiresome one is the set of upper
case/lower case translations, which (oddly enough) constrains
hyphenation of mutlilingual texts. Another that regularly creates
confusion is <a href="FAQ-baselinepar.html"><code>\</code><code>baselineskip</code></a>.
<p><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=paraparam">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=paraparam</a>
</body>
|