From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/96270 Path: news.gmane.org!.POSTED!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: box width to fit longest line of text Date: Wed, 28 Sep 2016 23:40:09 +0200 Message-ID: <57EC38B9.1090507@gmail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7088477240696344212==" X-Trace: blaine.gmane.org 1475099021 11241 195.159.176.226 (28 Sep 2016 21:43:41 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 28 Sep 2016 21:43:41 +0000 (UTC) User-Agent: Postbox 5.0.2 (Macintosh/20160922) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Sep 28 23:43:37 2016 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bpMdS-0000px-2B for gctc-ntg-context-518@m.gmane.org; Wed, 28 Sep 2016 23:43:26 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 8C43E19B3E; Wed, 28 Sep 2016 23:40:27 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3a_qWDbgpjBB; Wed, 28 Sep 2016 23:40:26 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id DCBF319BEF; Wed, 28 Sep 2016 23:40:26 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id DBBC519B73 for ; Wed, 28 Sep 2016 23:40:25 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qHXViuDgk3RB for ; Wed, 28 Sep 2016 23:40:25 +0200 (CEST) Original-Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 6DD6619B3E for ; Wed, 28 Sep 2016 23:40:15 +0200 (CEST) Original-Received: by mail-wm0-f46.google.com with SMTP id l132so260188534wmf.0 for ; Wed, 28 Sep 2016 14:40:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to; bh=orQ4NtfXOB4DX8cejzA8u50VhT0SobsHN6dILzOi8qI=; b=yKf3VVgnRVOzTGR4EhbUh1agtE4gp9oKkZElL0ipv3impFCCeRmUXceXpwggU2QvA6 tb6BvimenUVG74aFYZIGVWZVBM86se1kl21H7OdrBxSCP2I1xjIoV3hffs+1ElwpCRb2 qrBx+FcGy+k51NeRG4cWHSY6xCogHBTWNY06r4UlFmgn38ZqRcOP2PXhg4rwrjr8O3Gv ZCFcgMfd7nfggYNgAqkULEKXdsSyQFxrISp6BXuR3yu0nme9Gc8nwfecft8VyzAS5ma3 jfwqY3bJz7aaEgOUhw70z6pwgZ06ifjDlh8KLn/GuzlbJ/H7rgutbxYMzGlx/VOMWbqj N5Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to; bh=orQ4NtfXOB4DX8cejzA8u50VhT0SobsHN6dILzOi8qI=; b=R2clYeK5xRWYTrd4HVR6TMU0epUfzvlIikRJX2AZ/2nnbOULCOM4NZN8JBRwXwqZYv zE2TOooq6qvGaJqHsupRC2U2mOjIt2VJDy8zTyWnIiNIjRXaaDZ5JX7IcFZcjRZRTDy8 ccMhXHVVJO+RJIXCzamzoLG3TnTkqzIxjvmI70w+yq5yjkvTHcHCcBOTvY3joIrKdJ8i dexH2VNWbQxUmmEbtmgxUKiL0MtTtB0QRZjbDIIHvGPRx4cRcKbL3ViNmFYLl84lHqnu fjejksmaN9UDKT21WkkIBKQLHDPNsFfRxlgwjy1g0/GUqK/M8LjZ4N0cUJ44TdgXZI4/ W+Gg== X-Gm-Message-State: AE9vXwN5v7kXsIOsbz1gwkn89KRppVM2mOo/Vk+3I8zHkoGh95VJeYVD4Xi+s/L6KvQrxg== X-Received: by 10.195.30.11 with SMTP id ka11mr28585888wjd.88.1475098814719; Wed, 28 Sep 2016 14:40:14 -0700 (PDT) Original-Received: from keima.home ([86.86.82.85]) by smtp.gmail.com with ESMTPSA id xy4sm10440682wjc.2.2016.09.28.14.40.13 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Sep 2016 14:40:14 -0700 (PDT) In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:96270 Archived-At: This is a multi-part message in MIME format. --===============7088477240696344212== Content-Type: multipart/alternative; boundary="------------060309010103080802010802" This is a multi-part message in MIME format. --------------060309010103080802010802 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit > Csikos Bela > 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 --------------060309010103080802010802 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
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
--------------060309010103080802010802-- --===============7088477240696344212== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============7088477240696344212==--