ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* environment flushright
@ 2016-06-08 10:11 Thomas A. Schmitz
  2016-06-10 11:22 ` Wolfgang Schuster
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas A. Schmitz @ 2016-06-08 10:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi all,

for a translation of poetry, I would like to have an environment which will typeset a split line in a way that the second part will be flushright - is this possible? So instead of

bla bla bla bla
bla

I get 

bla bla bla bla
            bla

if (and only if) there’s a line break.

Thanks, and all best

Thomas
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: environment flushright
  2016-06-08 10:11 environment flushright Thomas A. Schmitz
@ 2016-06-10 11:22 ` Wolfgang Schuster
  2016-06-10 12:42   ` Thomas A. Schmitz
  0 siblings, 1 reply; 10+ messages in thread
From: Wolfgang Schuster @ 2016-06-10 11:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 662 bytes --]

> Thomas A. Schmitz <mailto:thomas.schmitz@uni-bonn.de>
> 8. Juni 2016 um 12:11
> Hi all,
>
> for a translation of poetry, I would like to have an environment which 
> will typeset a split line in a way that the second part will be 
> flushright - is this possible? So instead of
>
> bla bla bla bla
> bla
>
> I get
>
> bla bla bla bla
> bla
>
> if (and only if) there’s a line break.
>
> Thanks, and all best
Is indenting a solution for you?

\definenarrower
   [thomas]
   [left=4cm,
    default=left,
    before={\setupindenting[yes,-4cm]}]

\starttext

\startnarrow[thomas]
\input knuth
\stopnarrow

\stoptext

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 1737 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: environment flushright
  2016-06-10 11:22 ` Wolfgang Schuster
@ 2016-06-10 12:42   ` Thomas A. Schmitz
  2016-06-10 15:17     ` Hans Hagen
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas A. Schmitz @ 2016-06-10 12:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> On 10 Jun 2016, at 13:22, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:
> 
> Is indenting a solution for you?
> 
> \definenarrower
>   [thomas]
>   [left=4cm,
>    default=left,
>    before={\setupindenting[yes,-4cm]}]

Hi Wolfgang, 

thanks for your suggestion. That’s what I have right now, but this won’t make the lines flushright, and that’s what the publisher wants. I have every line of translation wrapped into an environment, and there is never more that one line break, so my question boils down to: how can I inject a \hfill after this line break? Or any low level trickery with \rlap etc.?

Thomas
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: environment flushright
  2016-06-10 12:42   ` Thomas A. Schmitz
@ 2016-06-10 15:17     ` Hans Hagen
  2016-06-10 15:56       ` Aditya Mahajan
  0 siblings, 1 reply; 10+ messages in thread
From: Hans Hagen @ 2016-06-10 15:17 UTC (permalink / raw)
  To: ntg-context

On 6/10/2016 2:42 PM, Thomas A. Schmitz wrote:
>
>> On 10 Jun 2016, at 13:22, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:
>>
>> Is indenting a solution for you?
>>
>> \definenarrower
>>   [thomas]
>>   [left=4cm,
>>    default=left,
>>    before={\setupindenting[yes,-4cm]}]
>
> Hi Wolfgang,
>
> thanks for your suggestion. That’s what I have right now, but this won’t make the lines flushright, and that’s what the publisher wants. I have every line of translation wrapped into an environment, and there is never more that one line break, so my question boils down to: how can I inject a \hfill after this line break? Or any low level trickery with \rlap etc.?

\starttext

\showframe

\setuplayout[width=4cm]

% \raggedright

\leftskip    \zeropoint plus  \plustwo\bodyfontsize
\rightskip   \zeropoint plus  1fill
\parfillskip \zeropoint plus -1fill
\spaceskip   \interwordspace
\xspaceskip  .5\emwidth

but just a test for a very long line

\stoptext



-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: environment flushright
  2016-06-10 15:17     ` Hans Hagen
@ 2016-06-10 15:56       ` Aditya Mahajan
  2016-06-10 17:06         ` Hans Hagen
  2016-06-11  8:32         ` Wolfgang Schuster
  0 siblings, 2 replies; 10+ messages in thread
From: Aditya Mahajan @ 2016-06-10 15:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, 10 Jun 2016, Hans Hagen wrote:

> \leftskip    \zeropoint plus  \plustwo\bodyfontsize
> \rightskip   \zeropoint plus  1fill
> \parfillskip \zeropoint plus -1fill
> \spaceskip   \interwordspace
> \xspaceskip  .5\emwidth

Would it be useful to add this (and middle align last line) as two new 
alignment options?

Aditya
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: environment flushright
  2016-06-10 15:56       ` Aditya Mahajan
@ 2016-06-10 17:06         ` Hans Hagen
  2016-06-11  1:15           ` Aditya Mahajan
  2016-06-11  8:48           ` Wolfgang Schuster
  2016-06-11  8:32         ` Wolfgang Schuster
  1 sibling, 2 replies; 10+ messages in thread
From: Hans Hagen @ 2016-06-10 17:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 6/10/2016 5:56 PM, Aditya Mahajan wrote:
> On Fri, 10 Jun 2016, Hans Hagen wrote:
>
>> \leftskip    \zeropoint plus  \plustwo\bodyfontsize
>> \rightskip   \zeropoint plus  1fill
>> \parfillskip \zeropoint plus -1fill
>> \spaceskip   \interwordspace
>> \xspaceskip  .5\emwidth
>
> Would it be useful to add this (and middle align last line) as two new
> alignment options?

as usual the question is then ... what keywords etc (maybe wolfgang has 
a suggestion)

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: environment flushright
  2016-06-10 17:06         ` Hans Hagen
@ 2016-06-11  1:15           ` Aditya Mahajan
  2016-06-11  8:48           ` Wolfgang Schuster
  1 sibling, 0 replies; 10+ messages in thread
From: Aditya Mahajan @ 2016-06-11  1:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, 10 Jun 2016, Hans Hagen wrote:

> On 6/10/2016 5:56 PM, Aditya Mahajan wrote:
>> On Fri, 10 Jun 2016, Hans Hagen wrote:
>>
>>> \leftskip    \zeropoint plus  \plustwo\bodyfontsize
>>> \rightskip   \zeropoint plus  1fill
>>> \parfillskip \zeropoint plus -1fill
>>> \spaceskip   \interwordspace
>>> \xspaceskip  .5\emwidth
>>
>> Would it be useful to add this (and middle align last line) as two new
>> alignment options?
>
> as usual the question is then ... what keywords etc (maybe wolfgang has 
> a suggestion)

My suggestion will be 'lastmiddle' and 'lastright'. Would it be possible 
to define these in such a way that

\startalignment[flushleft,lastright]
  and
\startalignment[normal,lastright]

both "do the right thing". If only lastright (or lastmiddle) is used, that 
should be equal to "normal,lastright".

Aditya
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: environment flushright
  2016-06-10 15:56       ` Aditya Mahajan
  2016-06-10 17:06         ` Hans Hagen
@ 2016-06-11  8:32         ` Wolfgang Schuster
  1 sibling, 0 replies; 10+ messages in thread
From: Wolfgang Schuster @ 2016-06-11  8:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 288 bytes --]

> Aditya Mahajan <mailto:adityam@umich.edu>
> 10. Juni 2016 um 17:56
> On Fri, 10 Jun 2016, Hans Hagen wrote:
>
>
> Would it be useful to add this (and middle align last line) as two new 
> alignment options?
You can center the last line in a paragraph with the "last" keyword.

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 1270 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: environment flushright
  2016-06-10 17:06         ` Hans Hagen
  2016-06-11  1:15           ` Aditya Mahajan
@ 2016-06-11  8:48           ` Wolfgang Schuster
  2016-06-13 13:44             ` Hans Hagen
  1 sibling, 1 reply; 10+ messages in thread
From: Wolfgang Schuster @ 2016-06-11  8:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 621 bytes --]

> Hans Hagen <mailto:pragma@wxs.nl>
> 10. Juni 2016 um 19:06
>
>
> as usual the question is then ... what keywords etc (maybe wolfgang 
> has a suggestion)
When you don’t want a new variable you can use "end".


The alignment doesn’t work well with short paragraphs.

%% begin example
\starttext

\showframe

\leftskip    \zeropoint plus  \plustwo\bodyfontsize
\rightskip   \zeropoint plus  1fill
\parfillskip \zeropoint plus -1fill
\spaceskip   \interwordspace
\xspaceskip  .5\emwidth

What does happen with a short paragraph?

Make it even shorter!

\stoptext
%% end example

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 1708 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: environment flushright
  2016-06-11  8:48           ` Wolfgang Schuster
@ 2016-06-13 13:44             ` Hans Hagen
  0 siblings, 0 replies; 10+ messages in thread
From: Hans Hagen @ 2016-06-13 13:44 UTC (permalink / raw)
  To: ntg-context

On 6/11/2016 10:48 AM, Wolfgang Schuster wrote:
>> Hans Hagen <mailto:pragma@wxs.nl>
>> 10. Juni 2016 um 19:06
>>
>>
>> as usual the question is then ... what keywords etc (maybe wolfgang
>> has a suggestion)
> When you don’t want a new variable you can use "end".

next beta

\starttext

\showframe \showboxes

\setupalign[end]

\dostepwiserecurse{5}{8}{1}{
     \hsize #1cm
     What does happen with a short paragraph?\par
}

\stoptext

> The alignment doesn’t work well with short paragraphs.

lua magic needed

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-06-13 13:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-08 10:11 environment flushright Thomas A. Schmitz
2016-06-10 11:22 ` Wolfgang Schuster
2016-06-10 12:42   ` Thomas A. Schmitz
2016-06-10 15:17     ` Hans Hagen
2016-06-10 15:56       ` Aditya Mahajan
2016-06-10 17:06         ` Hans Hagen
2016-06-11  1:15           ` Aditya Mahajan
2016-06-11  8:48           ` Wolfgang Schuster
2016-06-13 13:44             ` Hans Hagen
2016-06-11  8:32         ` Wolfgang Schuster

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).