ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
	mf <massifr@fastwebnet.it>
Subject: Re: changing alignment inside a paragraph
Date: Tue, 10 Dec 2019 18:07:59 +0100	[thread overview]
Message-ID: <8e15ea38-f0ad-6a65-9271-2edfb8749b72@gmail.com> (raw)
In-Reply-To: <ebd94815-1a93-c9d5-28db-78881f395157@fastwebnet.it>

mf schrieb am 10.12.2019 um 12:27:
> Hello list, is there a way to achieve this?
>
> \def\FlushRightFromNextLine{\relax}
> \setupnarrower[left=0cm,right=11cm]
> \setupalign[stretch]
> \starttext
> This is what I'd like to type in my source:\par
> \blank
> \type{This is the text of an index term, that is normally justified,
> but I'd like the page numbers to be flushed to the right from
> their second line \FlushRightFromNextLine 34, 57, 101-104, 276, 345, 
> 401-403.}\par
> \blank
> This is the normal result:\par
> \blank
> \startnarrower[right]
> This is the text of an index term, that is normally justified,
> but I'd like the page numbers to be flushed to the right from
> their second line \FlushRightFromNextLine 34, 57, 101-104, 276, 345, 
> 401-403.
> \stopnarrower
> \blank
> This is the expected result:\par
> \blank
> \startnarrower[right]
> \parfillskip=0pt This is the text of an index term, that is normally 
> justified,
> but I'd like the page numbers to be flushed to the right from
> their second line 34, 57,\par
> \penalty10000 % no page break in the middle of page numbers
> \startalignment[flushright]
> 101-104, 276, 345, 401-403.\par
> \stopalignment
> \stopnarrower
> \stoptext
>
> The expected result is to be intended visually, because there might be 
> no need to break the text into two paragraphs.

Use the "end" keyword for the alignment.

\starttext

\startbuffer
This is the text of an index term, that is normally justified,
but I'd like the page numbers to be flushed to the right from
their second line 34, 57, 101-104, 276, 345, 401–403.
\stopbuffer

\typebuffer \getbuffer

\startbuffer
\startalignment[end]
This is the text of an index term, that is normally justified,
but I'd like the page numbers to be flushed to the right from
their second line 34, 57, 101-104, 276, 345, 401–403.
\stopalignment
\stopbuffer

\typebuffer \getbuffer

\stoptext

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2019-12-10 17:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-10 11:27 mf
2019-12-10 17:07 ` Wolfgang Schuster [this message]
2019-12-11 14:31 ` mf
2019-12-11 20:25   ` Wolfgang Schuster
2019-12-12 14:56     ` mf
2019-12-12 20:43       ` Wolfgang Schuster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8e15ea38-f0ad-6a65-9271-2edfb8749b72@gmail.com \
    --to=wolfgang.schuster.lists@gmail.com \
    --cc=massifr@fastwebnet.it \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).