From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/86000 Path: news.gmane.org!not-for-mail From: Elspeth McGullicuddy Newsgroups: gmane.comp.tex.context Subject: Re: Colored text's background, which the more "lcd-mkiv"? Date: Fri, 17 Jan 2014 20:33:57 +0100 Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1389987236 6347 80.91.229.3 (17 Jan 2014 19:33:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 Jan 2014 19:33:56 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Jan 17 20:34:05 2014 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W4FB6-0001hL-N8 for gctc-ntg-context-518@m.gmane.org; Fri, 17 Jan 2014 20:34:04 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id CC69B101E1; Fri, 17 Jan 2014 20:34:03 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id SieorlyaZT1f; Fri, 17 Jan 2014 20:34:02 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 6D8DA101E6; Fri, 17 Jan 2014 20:34:02 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 86DB0101E6 for ; Fri, 17 Jan 2014 20:34:01 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 3b9cE33K2br7 for ; Fri, 17 Jan 2014 20:33:59 +0100 (CET) Original-Received: from filter5-til.mf.surf.net (filter5-til.mf.surf.net [194.171.167.221]) by balder.ntg.nl (Postfix) with ESMTP id AD8D5101E1 for ; Fri, 17 Jan 2014 20:33:59 +0100 (CET) Original-Received: from mail-ob0-x230.google.com (mail-ob0-x230.google.com [IPv6:2607:f8b0:4003:c01::230]) by filter5-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s0HJXva3005769 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Fri, 17 Jan 2014 20:33:58 +0100 Original-Received: by mail-ob0-f176.google.com with SMTP id gq1so2786035obb.35 for ; Fri, 17 Jan 2014 11:33:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=U56vN+brUsrLRffoU28a2gEJq+RnjfiKOUikvok9n4g=; b=g8pA3QOBX4a6ttLB3Uthu5W6RDIyr6G+PZM4FU6D3Kbcd4X9f4yB1T5VAZlDnTeQYX iGRKiFYbsQrDcKboSu2/GMrHFcgt79qq5JjnJVlp8FeFKGJdwBWGwUk6B8/8bzIx0Ty1 p8WCWn5yj5jhyRV53Yq3lScsGCeA0dsTKae2ebiswNfjpt7nUFOqhSaCHWPT7tWW9Dk+ M3vC/2av5yF2A0xjEHE60crndyZHmYgk1Dx68bGQVd1zVUOPgGzvPowsh1rx5vJmoxih hH7CO1AZXxduFH8BYHcHz++0OPS1LhJP57Khm+sl2fNhqATB/WN1lfIzIeuwSdCwVeEk K8vw== X-Received: by 10.182.153.226 with SMTP id vj2mr3190407obb.26.1389987237265; Fri, 17 Jan 2014 11:33:57 -0800 (PST) Original-Received: by 10.76.33.129 with HTTP; Fri, 17 Jan 2014 11:33:57 -0800 (PST) In-Reply-To: X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=2607:f8b0:4003:c01::230; country=US X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0WLf7xWbp - dc708809b8a5 - 20140117 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 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-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:86000 Archived-At: On Fri, Jan 17, 2014 at 6:16 PM, Aditya Mahajan wrote: > On Fri, 17 Jan 2014, Elspeth McGullicuddy wrote: > >> [Colored text's background, which the more "lcd-mkiv"?; >> plus: Metapost variable "text" with "\definetextbackground"; >> plus: {\input ward}] >> >> Hi list, >> >> What would be the best, also the more up to date, way to put colored >> background behind text, that could cross page boundaries. >> >> I have found three ways of doing this: I would like to know which is >> best practice, and also the more "lua context document" fashion. >> >> 1- Using "\startbar[underbar] \input zapf \stopbar" as described p. 39 >> of "hybrid.pdf". > > > Use this one, unless the underbars are indequate, as was the case for the OP > of the TeX.SX question. This one is very easy to use, but I liked the rounded corners of the example. Also I want it to fill the whole background, as it is the case with \definetextbackground: it starts where you tell it to start, then fill the whole text area, not only where there actually are glyphs, so it keeps going on even if you put a \pagebreak, and stop when you tell it to stop. Instead \startbar[underbar] put color only where there are glyphs, which is not what I'm looking for, unless there is way to do other wise, but it would contradict the name underbar, so it seems unlikely. So I think I'll go to \definetextbackground. And try some experiments with the "MPposition" stuffs. > >> 2- Using "\startMPpositionmethod{mpos:placeholder}", found in >> >> http://tex.stackexchange.com/questions/125162/rounded-box-around-placeholder-text-that-supports-line-breaking/125323 >> (Thanks to Aditya). >> A bit tricky, but perhaps the more versatile or universal? >> >> 3- Start with: "\definetextbackground" (same ref. as previous). >> >> %%%%%%%%%%%%% >> >> % About the third one I have had some difficulties, that might be >> thought of as a bug. >> % You might want and try the following example: it doesn't work if you >> have a MetaPost variable >> % whose name is "text". > > > > (Untested). Normally this means that there is already a variable with the > name text. You can use: Yes it's what I gathered. It took me some time to do so, though. I didn't know of the "nuewnumeric" which is a good shortcut. Thanks for this quick answer, Chris > > save text; numeric text; > > or > > newnumeric text; > > which is shortcut for the former. > > 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 ___________________________________________________________________________________