Difference between revisions of "Right and left"
Jump to navigation
Jump to search
m (Right and left moved to right and left) |
m |
||
(10 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | + | The basic commands are {{cmd|setupalign}} for the whole document, and {{cmd|startalignment}} for a given block. Additional [[:Category:Command/Alignment|alignment commands list]]. | |
− | The <tt>right</tt> and <tt>left</tt> alignments are backwards from the usual directions in all commands that accept an alignment option. For instance | + | ; 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 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". 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. |
+ | |||
+ | For instance: | ||
<context source="yes" text="produces"> | <context source="yes" text="produces"> | ||
+ | \setuppapersize[A5] | ||
\startalignment[left] | \startalignment[left] | ||
This is some aligned text, with \type{left} alignment. | This is some aligned text, with \type{left} alignment. | ||
Line 11: | Line 14: | ||
</context> | </context> | ||
− | |||
− | + | ||
<context source="yes" text="produces"> | <context source="yes" text="produces"> | ||
+ | \setuppapersize[A5] | ||
\startalignment[flushleft] | \startalignment[flushleft] | ||
This is some aligned text, with \type{flushleft} alignment. | This is some aligned text, with \type{flushleft} alignment. | ||
Line 23: | Line 26: | ||
</context> | </context> | ||
− | Incidentally, note that | + | |
+ | Incidentally, note that {{cmd|leftaligned}} and {{cmd|rightaligned}} produce flush-left and flush-right alignment, with | ||
<context source="yes" text="producing"> | <context source="yes" text="producing"> | ||
+ | \setuppapersize[A5] | ||
\leftaligned{This is some \type{leftaligned} text.} | \leftaligned{This is some \type{leftaligned} text.} | ||
\rightaligned{This is some \type{rightaligned} text.} | \rightaligned{This is some \type{rightaligned} text.} | ||
</context> | </context> | ||
+ | |||
+ | [[Category:Basics]] |
Latest revision as of 12:06, 10 June 2020
The basic commands are \setupalign for the whole document, and \startalignment for a given block. Additional alignment commands list.
- Warning
- ConTeXt uses flushleft and flushright options. The right and left alignments are backwards from the usual directions in all commands that accept an 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". 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.
For instance:
\setuppapersize[A5] \startalignment[left] This is some aligned text, with \type{left} alignment. \stopalignment \framed[align=right,width=\textwidth]{Some framed text, with \type{align=right}.}
produces
\setuppapersize[A5] \startalignment[flushleft] This is some aligned text, with \type{flushleft} alignment. \stopalignment \framed[align=flushright,width=\textwidth]{Some framed text, with \type{align=flushright}.}
produces
Incidentally, note that \leftaligned and \rightaligned produce flush-left and flush-right alignment, with
\setuppapersize[A5] \leftaligned{This is some \type{leftaligned} text.} \rightaligned{This is some \type{rightaligned} text.}
producing