Difference between revisions of "Command/wordright"

From Wiki
Jump to navigation Jump to search
 
(7 intermediate revisions by 2 users not shown)
Line 17: Line 17:
 
The left part is placed flush left, even if the paragraph is middle-aligned or right-aligned. The wordright text is placed on the same line, but flush against the right. If there isn't enough space left on the line, the left part will still be aligned flush left, but the wordright text will be placed on the next line. {{cmd|wordright}} ends the paragraph; any text that follows it will start a new paragraph.</cd:description>
 
The left part is placed flush left, even if the paragraph is middle-aligned or right-aligned. The wordright text is placed on the same line, but flush against the right. If there isn't enough space left on the line, the left part will still be aligned flush left, but the wordright text will be placed on the next line. {{cmd|wordright}} ends the paragraph; any text that follows it will start a new paragraph.</cd:description>
 
<cd:examples><cd:example title=""><context source="yes">
 
<cd:examples><cd:example title=""><context source="yes">
\setuppapersize[A5]
+
\setuppapersize[A7]
 
\setupwhitespace[big]
 
\setupwhitespace[big]
  
\setupnarrower[middle=3.5cm]
+
\starttext
 +
 
 +
\startalignment[normal]
 +
    Normal justified text, bla bla bla, lorem ipsum dolor sit amet.
 +
    No one loves pain for its own sake... \wordright{...right?}
 +
\stopalignment
 +
 
 +
\thinrule
  
\startnarrower
 
 
\startalignment[normal]
 
\startalignment[normal]
 
     Normal justified text, bla bla bla, lorem ipsum dolor sit amet.
 
     Normal justified text, bla bla bla, lorem ipsum dolor sit amet.
 
     No one loves pain for its own sake... \wordright{...right?} New paragraph.
 
     No one loves pain for its own sake... \wordright{...right?} New paragraph.
 
\stopalignment
 
\stopalignment
 +
 +
\thinrule
  
 
\startalignment[middle]
 
\startalignment[middle]
     Centered. \crlf
+
     Centered. \\
 
     Left. \wordright{Right.}
 
     Left. \wordright{Right.}
 
\stopalignment
 
\stopalignment
\stopnarrower
+
 
 +
\stoptext
 
</context>
 
</context>
 
</cd:example></cd:examples>
 
</cd:example></cd:examples>
Line 42: Line 51:
 
<cd:commandref name="setupalign"></cd:commandref>
 
<cd:commandref name="setupalign"></cd:commandref>
 
<cd:commandref name="rightaligned">to right-align a single line</cd:commandref>
 
<cd:commandref name="rightaligned">to right-align a single line</cd:commandref>
<cd:commandref name="startalignment">to align paragraphs</cd:commandref></cd:seealso>
+
<cd:commandref name="startalignment">to align paragraphs</cd:commandref>
 +
<cd:commandref name="hfill">The TeX <code>\hfill</code> command, which is not documented on this wiki.</cd:commandref></cd:seealso>
 
</cd:commandgroup>
 
</cd:commandgroup>

Latest revision as of 14:35, 17 November 2021


\wordright

Summary

On an otherwise left-aligned line, place some text at the very right, and end the paragraph.

Settings

\wordright[...]{...}
[...]right dimension
{...}content

Description

First, the paragraph is line-broken normally. The last line consists of two parts: call the 'normal' bit the left part, and the \wordright bit the wordright text.

The left part is placed flush left, even if the paragraph is middle-aligned or right-aligned. The wordright text is placed on the same line, but flush against the right. If there isn't enough space left on the line, the left part will still be aligned flush left, but the wordright text will be placed on the next line. \wordright ends the paragraph; any text that follows it will start a new paragraph.

Examples

Example 1

\setuppapersize[A7]
\setupwhitespace[big]

\starttext

\startalignment[normal]
    Normal justified text, bla bla bla, lorem ipsum dolor sit amet.
    No one loves pain for its own sake... \wordright{...right?}
\stopalignment

\thinrule

\startalignment[normal]
    Normal justified text, bla bla bla, lorem ipsum dolor sit amet.
    No one loves pain for its own sake... \wordright{...right?} New paragraph.
\stopalignment

\thinrule

\startalignment[middle]
    Centered. \\
    Left. \wordright{Right.}
\stopalignment

\stoptext

Notes

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: