summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-flushboth.html
blob: 6c0cc036add6a6741318f3a75f9251873e864c7c (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
<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&#8217;s a problem with the setting of <code>\</code><code>parindent</code> in the code: it&#8217;s
necessary because both the <code>\</code><code>ragged</code> commands set <code>\</code><code>parindent</code> to
zero, but the setting isn&#8217;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&#8217;s no knowing what you (or some
other class) will have done.
<p/>Any but a really old copy of Martin Schr&#246;der&#8217;s <i>ragged2e</i>
package has a <code>\</code><code>justifying</code> command to match its 
<a href="FAQ-ragright.html">versions of the LaTeX &#8216;ragged&#8217; 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="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/ms.zip">macros/latex/contrib/ms</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/ms/">browse the directory</a>); <a href="http://www.tex.ac.uk/tex-archive/help/Catalogue/entries/ragged2e.html">catalogue entry</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>