Changes

Jump to navigation Jump to search
365 bytes removed ,  12:06, 10 June 2020
m
no edit summary
< [[Bugs The basic commands are {{cmd|setupalign}} for the whole document, and workarounds]] {{cmd| startalignment}} for a given block. Additional [[FAQ:Category:Command/Alignment|alignment commands list]] >.
; Warning: ConTeXt uses <tt>flushleft</tt> and <tt>flushright</tt> options. The <tt>right</tt> and <tt>left</tt> alignments are '''backwards from the usual directions in all commands that accept an <tt>align=</tt> alignment option''', in the sense of "ragged left" and "ragged right". 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". For instanceAnd 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.
<texcode>\startalignment[left]This is some aligned text, with \type{align=left}.\stopalignment \startalignment[right]This is some aligned text, with \type{align=right}.\stopalignment</texcode> producesFor instance:
<contextsource="yes" text="produces">\setuppapersize[A5]
\startalignment[left]
This is some aligned text, with \type{align=left}alignment.
\stopalignment
\startalignmentframed[align=right,width=\textwidth]This is some aligned {Some framed text, with \type{align=right}.\stopalignment}
</context>
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 <tt>flushleft</tt> and <tt>flushright</tt> options, which do exactly the same thing, but in the "correct" direction. Thus:
 
<texcode>
\startalignment[flushleft]
This is some aligned text, with \type{align=flushleft}.
\stopalignment
\startalignment[flushright]
This is some aligned text, with \type{align=flushright}.
\stopalignment
</texcode>
produces
<contextsource="yes" text="produces">\setuppapersize[A5]
\startalignment[flushleft]
This is some aligned text, with \type{align=flushleft}alignment.
\stopalignment
\startalignmentframed[align=flushright,width=\textwidth]This is some aligned {Some framed text, with \type{align=flushright}.\stopalignment}
</context>
Incidentally, note that <cmd>leftaligned</cmd> and <cmd>rightaligned</cmd> also produce flush-left and flush-right alignment, with
 
<texcode>
\leftaligned{This is some \type{leftaligned} text.}
\rightaligned{This is some \type{rightaligned} text.}
</texcode>
producingIncidentally, note that {{cmd|leftaligned}} and {{cmd|rightaligned}} produce flush-left and flush-right alignment, with
<contextsource="yes" text="producing">\setuppapersize[A5]
\leftaligned{This is some \type{leftaligned} text.}
\rightaligned{This is some \type{rightaligned} text.}
</context>
 
[[Category:Basics]]

Navigation menu