blob: b0895f82e77885ad1d99ab949b3c94e58aafd9ae (
plain)
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
|
<head>
<title>UK TeX FAQ -- question label flushboth</title>
</head><body>
<h3>Cancelling <code>\</code><code>ragged</code> commands</h3>
<p>LaTeX provides commands <code>\</code><code>raggedright</code> and <code>\</code><code>raggedleft</code>, but
none to cancel their effect. The <code>\</code><code>centering</code> command is
implemented in the same way as the <code>\</code><code>ragged*</code> commands, and suffers
in the same way.
<p>The following code (to be inserted in a package of your own, or as
<a href="FAQ-atsigns.html">internal LaTeX code</a>) defines a command that
restores flush justification at both margins:
<pre>
\def\flushboth{%
\let\\\@normalcr
\@rightskip\z@skip \rightskip\@rightskip
\leftskip\z@skip
\parindent 1.5em\relax}
</pre>
There’s a problem with the setting of <code>\</code><code>parindent</code> in the code: it’s
necessary because both the <code>\</code><code>ragged</code> commands set <code>\</code><code>parindent</code> to
zero, but the setting isn’t a constant of nature: documents using a
standard LaTeX class with <code>twocolumn</code> option will have <code>1.0em</code> by
default, and there’s no knowing what you (or some other class) will
have done.
<p>If you are using Martin Schröder’s <i>ragged2e</i> package, it is
worth updating to the latest release (January 2003), which has a
<code>\</code><code>justifying</code> command to match its
<a href="FAQ-ragright.html">versions of the LaTeX ‘ragged’ commands</a>. The
package also provides a
<code>justify</code> environment, which permits areas of justified
text in a larger area which is ragged.
<dl>
<dt><tt><i>ragged2e.sty</i></tt><dd>Distributed as part of <a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/ms.zip">macros/latex/contrib/ms</a> (<a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/ms.tar.gz">gzipped tar</a>, <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/ms/">browse</a>)
</dl>
<p><p><p><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=flushboth">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=flushboth</a>
</body>
|