Right and left

From ConTeXt wiki
Revision as of 02:08, 6 September 2005 by Brooks (talk | contribs) (Expanded, with examples and the new "flushleft" and "flushright".)

< Bugs and workarounds | FAQ >

The right and left alignments are backwards from the usual directions in all commands that accept an align= option. For instance,

\startalignment[left]
This is some aligned text, with \type{align=left}.
\stopalignment

\startalignment[right]
This is some aligned text, with \type{align=right}.
\stopalignment

produces

Unfortunately, when Hans was first writing this part of ConTeXt, he was thinking of "ragged right" and "ragged left" alignment, rather than "flush left" and "flush right". And now that it's been this way a while, it's impossible to change it, because changing it would break backward compatibility with all of the existing documents that use it.

If you'd rather not try to remember that it's backwards, ConTeXt now supports flushleft and flushright options, which do exactly the same thing, but in the "correct" direction. Thus:

\startalignment[flushleft]
This is some aligned text, with \type{align=flushleft}.
\stopalignment

\startalignment[flushright]
This is some aligned text, with \type{align=flushright}.
\stopalignment

produces

Incidentally, note that \leftaligned and \rightaligned also produce flush-left and flush-right alignment, with

\leftaligned{This is some \type{leftaligned} text.}
\rightaligned{This is some \type{rightaligned} text.}

producing