ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* box width to fit longest line of text
@ 2016-09-28 21:36 Csikos Bela
  2016-09-28 21:40 ` Wolfgang Schuster
  0 siblings, 1 reply; 3+ messages in thread
From: Csikos Bela @ 2016-09-28 21:36 UTC (permalink / raw)
  To: ntg-context

Dear context users:

I'd like to handle a block of text with 2 or more lines where the block width should be equal
to the longest line in the block. I'd like the lines be center aligned in the block.
Something like this:

        line1
second longerline
    another line

In latex I can do it using parbox like this:

\parbox{\widthof{second longerline}}{\centering{}line1\\second longerline\\another line}

How can achieve the same or similar in context?

Thanks in advance,

bcsikos

___________________________________________________________________________________
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] 3+ messages in thread

* Re: box width to fit longest line of text
  2016-09-28 21:36 box width to fit longest line of text Csikos Bela
@ 2016-09-28 21:40 ` Wolfgang Schuster
  2016-09-29 15:37   ` Csikos Bela
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Schuster @ 2016-09-28 21:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

> Csikos Bela <mailto:bcsikos425@freemail.hu>
> 28. September 2016 um 23:36
> Dear context users:
>
> I'd like to handle a block of text with 2 or more lines where the 
> block width should be equal
> to the longest line in the block. I'd like the lines be center aligned 
> in the block.
> Something like this:
>
> line1
> second longerline
> another line
>
> In latex I can do it using parbox like this:
>
> \parbox{\widthof{second longerline}}{\centering{}line1\\second 
> longerline\\another line}
>
> How can achieve the same or similar in context?
\starttext

\startframed[align=middle]
line\\
second longer line\\
another line
\stopframed

\stoptext

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 1717 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] 3+ messages in thread

* Re: box width to fit longest line of text
  2016-09-28 21:40 ` Wolfgang Schuster
@ 2016-09-29 15:37   ` Csikos Bela
  0 siblings, 0 replies; 3+ messages in thread
From: Csikos Bela @ 2016-09-29 15:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Wolfgang Schuster írta:

>>  Dear context users:I'd
>> like to handle a block of text with 2 or more lines where the block 
>>width should be equalto the longest line in the block. I'd like the 
>>lines be center aligned in the block.Something like this:   
>>     line1second longerline    another lineIn latex I 
>>can do it using parbox like this:\parbox{\widthof{second 
>>longerline}}{\centering{}line1\\second longerline\\another line}How
>> can achieve the same or similar in context?
>
>
>\starttext
>
>\startframed[align=middle]
>line\\
>second longer line\\
>another line
>\stopframed
>
>\stoptext

Thank you Wolfgang. It works.

bcsikos
___________________________________________________________________________________
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] 3+ messages in thread

end of thread, other threads:[~2016-09-29 15:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-28 21:36 box width to fit longest line of text Csikos Bela
2016-09-28 21:40 ` Wolfgang Schuster
2016-09-29 15:37   ` Csikos Bela

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