From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/95090 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Partial \framed Date: Mon, 06 Jun 2016 12:32:30 +0200 Message-ID: <5755513E.7030604@gmail.com> References: <64e58e9f-5c44-0a0d-64dd-fd5300768be2@gmx.es> <57553049.7020300@fehige.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0027375858721391225==" X-Trace: ger.gmane.org 1465209200 12349 80.91.229.3 (6 Jun 2016 10:33:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 6 Jun 2016 10:33:20 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Jun 06 12:33:08 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 plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b9rqG-00080p-1p for gctc-ntg-context-518@m.gmane.org; Mon, 06 Jun 2016 12:33:08 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 744FCED79; Mon, 6 Jun 2016 12:32:46 +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 aSlAKvgsLDPV; Mon, 6 Jun 2016 12:32:45 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id A0B26ED7C; Mon, 6 Jun 2016 12:32:45 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id D052FED7A for ; Mon, 6 Jun 2016 12:32:44 +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 y7DDpDrEfChm for ; Mon, 6 Jun 2016 12:32:43 +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 87E3AED79 for ; Mon, 6 Jun 2016 12:32:33 +0200 (CEST) Original-Received: by mail-wm0-f46.google.com with SMTP id k204so20723362wmk.0 for ; Mon, 06 Jun 2016 03:32:33 -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=pAquzuwZYoZuK+e6btG1T6djiqOEuAHfvP2YC72TOOY=; b=ZrXg1nLlpscSfZnv5h5J7eXPv9NQv8D40fjoYBz/04gqfcLWjXI4rsmvnlvUrsa/8L xVqRtTLrZIPsgc6492q/o3m1GzMc1dtbkZvTG/YkeMHGWIJEpZnvELG8Z/HdDku7Ko0q YUNdw3yUEOtGMFHNH/QZxikLYuF9LPw1QySTJibjhp+iiGIaLQ5yvg5WjValCuQr0SSy 0+KYxG+JQp3j75P8J8SwJg+amyg91lLqmSEf9E2ob9OOKyLlF+OtEuHAfQqWfsv4BHd/ S6ScRIiySkmpBUXEw8jYgNYre4JD/hSmOaGHC8m6I/eOiYJf8ERXgM/FZe1/wBB0XXNW aXBQ== 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=pAquzuwZYoZuK+e6btG1T6djiqOEuAHfvP2YC72TOOY=; b=UM53pXZf5plEfQ7jeoOjicTpq3FomNH4Ny1tgbe8sVlTk9c9ShtfE51s9ifhCbdMmp Bz//dm7XnhhCW1czVEOszOvMoWfIZZ7T8uQyaEOQHTAdQukqx8605WSSZCf6G0rfr2fp mWlPuW0S6jjqIPshFh/f+QP/Zfvnx25e9oAxqEod3DcaN2uqLRTwbYvXymgnlnwr7vik 8Les84+N7ZYk8nS6nty9rVgr3H9hcdwwpcmsIdcXk0cTA0UY8+LreoBCcnFSAjCIfSUr cBrR4JSV5hSkuUPfq5YG7fahSGcFDzFjwW8NLhteAN94gF6zArZgckraVEE2IHZdwqkk Orvw== X-Gm-Message-State: ALyK8tLwfRCLUHOtnhdI/GxC/YVqRSCO/dnamWT7DVf4yb1M2u9w/pKAp6KsyGU/rFZz3g== X-Received: by 10.28.195.69 with SMTP id t66mr9724871wmf.95.1465209153026; Mon, 06 Jun 2016 03:32:33 -0700 (PDT) Original-Received: from keima.localdomain (x2f26fd5.dyn.telefonica.de. [2.242.111.213]) by smtp.gmail.com with ESMTPSA id z7sm3299184wjk.6.2016.06.06.03.32.31 for (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Jun 2016 03:32:32 -0700 (PDT) User-Agent: Postbox 4.0.8 (Macintosh/20151105) In-Reply-To: <57553049.7020300@fehige.de> 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:95090 Archived-At: This is a multi-part message in MIME format. --===============0027375858721391225== Content-Type: multipart/alternative; boundary="------------090506010502020006070409" This is a multi-part message in MIME format. --------------090506010502020006070409 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable > Thomas Fehige > 6. Juni 2016 um 10:11 > I'm trying to put a piece of text in a partial frame that's meant to=20 > look like square brackets aligned with the left and right edges of the=20 > textblock. > > I tried to use two \framed constructions inside each other, the outer=20 > one with width=3Dtextwidth and negative toffset and boffset, the inner=20 > one with a smaller width, a fat rulethickness and the color of the=20 > background, expecting it to erase the outer frame where it's not needed= : > > \color[zier]{% > > \framed[% > > align=3Dmiddle, > > width=3D\textwidth, > > toffset=3D-4mm, > > boffset=3D-4mm, > > strut=3Dno, > > ]{% > > \color[paper]{\framed[% > > align=3Dmiddle, > > width=3D222mm, % i.e. \textwidth-4mm > > toffset=3D6mm, > > boffset=3D5mm, > > rulethickness=3D5mm > > ]{% > > \color[zier]{\tfd \strut Here's the text that is menat to look=20 > important; its length/number of lines is undetermined.\strut} > > }}% > > }% > > }% > > ... but it doesn't work. Apparently the inner frame is drawn before=20 > the outer one. Putting the wider frame inside the narrower results in=20 > alignment problems -- due to the overfull hbox, I presume. Your example is of not much use because it can=E2=80=99t be converted to = a PDF=20 (missing \starttext and empty lines). > Is there a simple solution in ConTeXt that I haven't found yet, or=20 > will I have to try some plain TeX box magic myself? You can use MetaPost to draw the frame/lines for the left and right borde= rs. \startuseMPgraphic{leftbracket} z[0] =3D (EmWidth,OverlayHeight) ; z[1] =3D (0,OverlayHeight) ; z[2] =3D (0,0) ; z[3] =3D (EmWidth,0) ; draw z[0]--z[1]--z[2]--z[3] withcolor \MPcolor{\overlaylinecolor} ; \stopuseMPgraphic \startuseMPgraphic{rightbracket} z[0] =3D (-EmWidth,OverlayHeight) ; z[1] =3D (0,OverlayHeight) ; z[2] =3D (0,0) ; z[3] =3D (-EmWidth,0) ; draw z[0]--z[1]--z[2]--z[3] withcolor \MPcolor{\overlaylinecolor} ; \stopuseMPgraphic \installleftframerenderer {bracket}{\useMPgraphic {leftbracket}} \installrightframerenderer{bracket}{\useMPgraphic{rightbracket}} \defineframed [bracketframed] [frame=3Doff, offset=3D1ex, leftframe=3Dbracket, rightframe=3Dbracket, framecolor=3Dred, foregroundstyle=3D\ssx, foregroundcolor=3Ddarkgray, align=3Dnormal, width=3Dmax] \starttext \bracketframed{\input knuth } \stoptext Wolfgang --------------090506010502020006070409 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
6.= =20 Juni 2016 um 10:11
I'm try= ing to put a piece of text in a partial frame that's meant to=20 look like square brackets aligned with the left and right edges of the=20 textblock.

I tried to use two \framed constructions inside each other, the=20 outer=20 one with width=3Dtextwidth and negative toffset and boffset, the inner on= e =20 with a smaller width, a fat rulethickness and the color of the=20 background, expecting it to erase the outer frame where it's not needed:

\color[zier]{%

\framed[%

align=3Dmiddle,

width=3D\textwidth,

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 tof= fset=3D-4mm,

boffset=3D-4mm,

strut=3Dno,

]{%

\color[paper]{\framed[%

align=3Dmiddle,

width=3D222mm, % i.e. \textwidth-4mm

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 toffset=3D6mm,

boffset=3D5mm,

rulethickness=3D5mm

]{%

\color[zier]{\tfd \strut Here's the text that is menat to look=20 important; its length/number of lines is undetermined.\strut}

}}%

}%

}%

... but it doesn't work. Apparently the inner frame is drawn before=20 the=20 outer one. Putting the wider frame inside the narrower results in=20 alignment problems --=C2=A0 due to the overfull hbox, I presume.
Your example is of not much use because it can=E2=80=99t be converted to = a PDF=20 (missing \starttext and empty lines).
Is=C2=A0 there a simple solu= tion in=20 ConTeXt that I haven't found yet, or will=20 I have to try some plain TeX box magic myself?
You can use MetaPost to draw the frame/lines for the left and right=20 borders.

\startuseMPgraphic{leftbracket}
=C2=A0=C2=A0=C2=A0 z[0] =3D (EmWidth,OverlayHeight) ;
=C2=A0=C2=A0=C2=A0 z[1] =3D (0,OverlayHeight) ;
=C2=A0=C2=A0=C2=A0 z[2] =3D (0,0) ;
=C2=A0=C2=A0=C2=A0 z[3] =3D (EmWidth,0) ;
=C2=A0=C2=A0=C2=A0 draw z[0]--z[1]--z[2]--z[3] withcolor \MPcolor{\overla= ylinecolor} ;
\stopuseMPgraphic

\startuseMPgraphic{rightbracket}
=C2=A0=C2=A0=C2=A0 z[0] =3D (-EmWidth,OverlayHeight) ;
=C2=A0=C2=A0=C2=A0 z[1] =3D (0,OverlayHeight) ;
=C2=A0=C2=A0=C2=A0 z[2] =3D (0,0) ;
=C2=A0=C2=A0=C2=A0 z[3] =3D (-EmWidth,0) ;
=C2=A0=C2=A0=C2=A0 draw z[0]--z[1]--z[2]--z[3] withcolor \MPcolor{\overla= ylinecolor} ;
\stopuseMPgraphic

\installleftframerenderer {bracket}{\useMPgraphic {leftbracket}}
\installrightframerenderer{bracket}{\useMPgraphic{rightbracket}}

\defineframed
=C2=A0 [bracketframed]
=C2=A0 [frame=3Doff,
=C2=A0=C2=A0 offset=3D1ex,
=C2=A0=C2=A0 leftframe=3Dbracket,
=C2=A0=C2=A0 rightframe=3Dbracket,
=C2=A0=C2=A0 framecolor=3Dred,
=C2=A0=C2=A0 foregroundstyle=3D\ssx,
=C2=A0=C2=A0 foregroundcolor=3Ddarkgray,
=C2=A0=C2=A0 align=3Dnormal,
=C2=A0=C2=A0 width=3Dmax]

\starttext
\bracketframed{\input knuth }
\stoptext

Wolfgang
--------------090506010502020006070409-- --===============0027375858721391225== 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= --===============0027375858721391225==--