From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/21326 Path: news.gmane.org!not-for-mail From: Mojca Miklavec Newsgroups: gmane.comp.tex.context Subject: Re: tweaking underlining Date: Mon, 11 Jul 2005 23:33:56 +0200 Message-ID: <6faad9f005071114334df96298@mail.gmail.com> References: <1120862975.9027.24.camel@localhost.localdomain> Reply-To: Mojca Miklavec , mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_10957_11849287.1121117636462" X-Trace: sea.gmane.org 1121117660 3886 80.91.229.2 (11 Jul 2005 21:34:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 11 Jul 2005 21:34:20 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Mon Jul 11 23:34:18 2005 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1Ds5ue-0007oZ-B5 for gctc-ntg-context-518@m.gmane.org; Mon, 11 Jul 2005 23:34:04 +0200 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 0B05812784; Mon, 11 Jul 2005 23:34:04 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 32577-01-4; Mon, 11 Jul 2005 23:33:59 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 93A2B127B0; Mon, 11 Jul 2005 23:33:59 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id A2747127B0 for ; Mon, 11 Jul 2005 23:33:58 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 32577-01-3 for ; Mon, 11 Jul 2005 23:33:57 +0200 (CEST) Original-Received: from nproxy.gmail.com (nproxy.gmail.com [64.233.182.202]) by ronja.ntg.nl (Postfix) with ESMTP id 57C6D12784 for ; Mon, 11 Jul 2005 23:33:57 +0200 (CEST) Original-Received: by nproxy.gmail.com with SMTP id a4so242165nfc for ; Mon, 11 Jul 2005 14:33:56 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:references; b=WeZzZoUswkgUS3nqGjRXus0keTmZW04v2yqEpJFmH5A/CNfDdcoI6au604x7eidZ1XT5sG/vwAToUioRB1Ezz82bLhZZtxX89xC4bZHmtoGWsRLY50Pf2sE2hvg4L9+1U5016GjJ8bWVVhwGBqOhxqIzdGWPkS2yR4IeY1vZIOE= Original-Received: by 10.48.3.17 with SMTP id 17mr166113nfc; Mon, 11 Jul 2005 14:33:56 -0700 (PDT) Original-Received: by 10.48.247.2 with HTTP; Mon, 11 Jul 2005 14:33:56 -0700 (PDT) Original-To: mailing list for ConTeXt users In-Reply-To: <1120862975.9027.24.camel@localhost.localdomain> X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on smtp.ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:21326 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:21326 ------=_Part_10957_11849287.1121117636462 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Stuart Jansen wrote: > Reading the list archives, it looks like there are certain advantages, > to performing underlining according to my example below: >=20 > =3D=3D=3D=3D=3D > \setupcolors[state=3Dstart] > \definetextbackground[underline][location=3Dtext,alternative=3D1,backgrou= nd=3D,frame=3Doff] > \definestartstop > [underline] > [before=3D{\starttextbackground[underline]}, > after=3D\stoptextbackground] > \starttext > \startunderline{}http://gurulabs.com/\stopunderline > \stoptext > =3D=3D=3D=3D=3D >=20 > I would like to tweak this a little however. Specifically, I'd like to > change the color of the line and move it down a point or two. The quick way to do it (but probably not the one you would really like): \definetextbackground [underline] [location=3Dtext, alternative=3D2, frame=3Doff, bottomframe=3Don, framecolor=3Dred, rulethickness=3D1pt] Even if you're satisfied with it, there's one problem. In every line there are two lines drawn: above and below the text. This leads to the (probably undesired) result: the first and the last rule are only half so thick as the rest. > In one thread, Hans hinted how to do this: >=20 > > you can redefine the metapost graphic, the main thing there is that > > you draw/fill something related to the multipar paths; it takes a bit > > of experimenting, but after a while you start seeing possibilities. > > See plus-rul.tex for an example of such a graphic. >=20 > I think I've tracked this reference down to the definition of > mpos:par:columnset, but at this point am lost as to how to proceed. > Metapost is still beyond me. Any hints would be much appreciated. Metapost graphics for backgrounds are doable once you understand some basics about metapost (MetaFun tutorial, Learning metapost by doing, Metapost manual, ...). Here's an example: \startuniqueMPgraphic{MyGraphic1} =09draw unitsquare xscaled \overlaywidth yscaled \overlayheight withcolor r= ed; \stopuniqueMPgraphic \startuniqueMPgraphic{MyGraphic2} =09save r, dist, offset; =09numeric r, dist, offset; =09% circle radius =09r :=3D 3pt; =09% distance between two circles =09dist :=3D 1cm; =09% distance between the bottom frame margin and the center of my pattern =09offset :=3D 5pt; =09 =09for i=3D0 upto floor((\overlaywidth-2r)/dist): =09=09draw fullcircle scaled 2r shifted (i*dist+r,-offset) withcolor blue; =09endfor; =09setbounds currentpicture to unitsquare xscaled \overlaywidth yscaled \overlayheight; \stopuniqueMPgraphic \defineoverlay [myframe1] [\uniqueMPgraphic{MyGraphic1}] \defineoverlay [myframe2] [\uniqueMPgraphic{MyGraphic2}] \framed[background=3Dmyframe1,frame=3Doff]{abc} % what does a linebreak after \framed[...]{...} do? \framed[background=3Dmyframe2,frame=3Don]{\dorecurse{15}{bla }}abc\crlf \framed[background=3Dmyframe2,frame=3Doff]{\dorecurse{17}{bla }} However, I have no idea how to apply the same to the underlining scheme of paragraphs. Saying \definetextbackground [underline] [location=3Dtext, alternative=3D2, background=3Dmyframe2] has absolutely no influence on how the frames are drawn. mpos:par:columnset is a name of a metapost graphic, defined in core-pos.tex. However, I tried to play with \definetextbackground [underline] [... mp=3Doneofmygraphics ...] which should change the background graphic, but also without any success. I thought also that perhaps making something like \setupMPvariables [mpos:par:columnset] [linecolor=3Dred, linewidth=3D10pt] would have any influence of how the frames are drawn, but it doesn't. My other try was trying to change the example on page 43/44 of columns.pdf. I replaced the whole body of {mpos:par:columnset:shade} graphic by a single statement, draw multipars[1] withcolor green; This works (it draws a frame around the whole paragraph in the first column), but I didn't find out how to access the variable with the bounding box of one line only. An interesting observation (feature/bug or maybe just a stupid usage?): Try to compile the example attached in the file. Mojca ------=_Part_10957_11849287.1121117636462 Content-Type: application/x-tex; name="test4.tex" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="test4.tex" DQpcc2V0dXBjb2xvcnMNCglbc3RhdGU9c3RhcnRdDQpcZGVmaW5lY29sb3INCglbc2hhZGVjb2xv cl1bcj0uNSxnPS41LGI9LjI1XSAlIHllbGxvdw0KXHN0YXJ0dXNlTVBncmFwaGlje21wb3M6cGFy OmNvbHVtbnNldDpteXVuZGVybGluZX0NCglmb3IgaT0xIHVwdG8gbm9mbXVsdGlwYXJzIDoNCgkJ ZHJhdyBiYm94IG11bHRpcGFyc1tpXSB3aXRoY29sb3IgZ3JlZW47DQoJZW5kZm9yIDsNCgkJZHJh dyBiYm94IG11bHRpcGFyc1sxXSB3aXRoY29sb3IgcmVkOw0KXHN0b3B1c2VNUGdyYXBoaWMNCg0K XGRlZmluZWNvbHVtbnNldA0KCVtleGFtcGxlXQ0KCVtuPTJdDQoNClxkZWZpbmV0ZXh0YmFja2dy b3VuZA0KCVt1bmRlcmxpbmVdDQoJW2xvY2F0aW9uPXRleHQsDQoJIGFsdGVybmF0aXZlPTEsDQoJ IGJhY2tncm91bmQ9LA0KCSBmcmFtZT1vbl0NClxkZWZpbmVzdGFydHN0b3ANCiBbdW5kZXJsaW5l XQ0KIFtiZWZvcmU9e1xzdGFydHRleHRiYWNrZ3JvdW5kW3VuZGVybGluZV19LA0KICBhZnRlcj1c c3RvcHRleHRiYWNrZ3JvdW5kXQ0KDQpcZGVmaW5ldGV4dGJhY2tncm91bmQNCglbc2hhZGVdDQoJ W2xvY2F0aW9uPXBhcmFncmFwaCwNCgkgYmFja2dyb3VuZGNvbG9yPXNoYWRlY29sb3IsDQoJIG1w PW1wb3M6cGFyOmNvbHVtbnNldDpteXVuZGVybGluZSwNCgkgbWV0aG9kPW1wb3M6cGFyOmNvbHVt bnNldCwNCgkgbGVmdG9mZnNldD1cdG9wc2tpcGdhcCwNCgkgYmVmb3JlPVxibGFuaywNCgkgYWZ0 ZXI9XGJsYW5rXQ0KDQpcc3RhcnR0ZXh0DQpcc3RhcnR1bmRlcmxpbmV7fVxpbnB1dCB0dWZ0ZVxz dG9wdW5kZXJsaW5lDQoNClxzdGFydGNvbHVtbnNldFtleGFtcGxlXQ0KXGRvcmVjdXJzZXsyfQ0K e1xzdGFydHRleHRiYWNrZ3JvdW5kW3NoYWRlXQ0KXGlucHV0IHR1ZnRlIGFiY2RlZmcNClxzdG9w dGV4dGJhY2tncm91bmR9DQpcc3RvcGNvbHVtbnNldA0KDQpcc3RvcHRleHQNCg0K ------=_Part_10957_11849287.1121117636462 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context ------=_Part_10957_11849287.1121117636462--