(eplain.info)Justification


Next: Tables Prev: Indexing Up: User definitions
Enter node , (file) or (file)node

4.13 Justification
==================

Eplain defines three commands to conveniently justify multiple lines of
text: '\flushright', '\flushleft', and '\center'.

   They all work in the same way; let's take '\center' as the example.
To start centering lines, you say '\center' inside a group; to stop, you
end the group. Between the two commands, each end-of-line in the input
file also starts a new line in the output file.

   The entire block of text is broken into paragraphs at blank lines, so
all the TeX paragraph-shaping parameters apply in the usual way. This is
convenient, but it implies something else that isn't so convenient:
changes to any linespacing parameters, such as '\baselineskip', will
have _no effect_ on the paragraph in which they are changed. TeX does
not handle linespacing changes within a paragraph (because it doesn't
know where the line breaks are until the end of the paragraph).

   The space between paragraphs is by default one blank line's worth.
You can adjust this space by assigning to '\blanklineskipamount'; this
(vertical) glue is inserted after each blank line.

   Here is an example:

     {\center First line.

        Second line, with a blank line before.
     }

This produces:

                              First line.
                Second line, with a blank line before.

   You may wish to use the justification macros inside of your own
macros. Just be sure to put them in a group. For example, here is how a
title macro might be defined:

     \def\title{\begingroup\titlefont\center}
     \def\endtitle{\endgroup}

   In addition, Eplain defines '\raggedleft', analogous to plain TeX's
'\raggedright'. This macro is also typically used inside a group, but
unlike the environments above, TeX does normal line breaking; that is,
ends-of-lines in the input file aren't treated specially. Just like
plain's '\raggedright', it also resets '\spaceskip' and '\xspaceskip' so
that interword spacing is uniform. It also sets '\parfillskip' to zero
so that last lines of paragraphs are also "ragged left". Finally,
'\leftskip''s new value is taken from a new glue register,
'\raggedleft'; its default value is '0pt plus 2em', the same as
'\raggedright''s '\rightskip'.

   Here's an example:

     {\raggedleft This text will be set ragged left,
     although the left margin won't be too ragged by default.
     You may well want to increase the value of
     {\tt \char`\\raggedleftskip} before calling the macro.
     It's necessary to end the paragraph before ending the group
     or the setting won't have any effect, so: {\tt \char`\\par}
     }

   Despite '\raggedleft' resetting '\parfillskip' to zero, TeX's line
breaking may still prefer to make the last line of a paragraph
considerably shorter than the rest, to minimize overall badness.
Increasing '\raggedleftskip' may help somewhat, but using
'\emergencystretch', retaining interword stretchability by assigning
'\leftskip' directly, or even forcing line breaks may be necessary.


automatically generated by info2www version 1.2.2.9