From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/85991 Path: news.gmane.org!not-for-mail From: Elspeth McGullicuddy Newsgroups: gmane.comp.tex.context Subject: Colored text's background, which the more "lcd-mkiv"? Date: Fri, 17 Jan 2014 17:33:48 +0100 Message-ID: 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 1389976445 4301 80.91.229.3 (17 Jan 2014 16:34:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 Jan 2014 16:34:05 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Jan 17 17:34:14 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 1W4CMy-0007IS-7h for gctc-ntg-context-518@m.gmane.org; Fri, 17 Jan 2014 17:34:08 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 50C3C101EE; Fri, 17 Jan 2014 17:34:07 +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 rJW5VT5IrtPe; Fri, 17 Jan 2014 17:34:05 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 61C71101E8; Fri, 17 Jan 2014 17:34:05 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 3E6D8101E8 for ; Fri, 17 Jan 2014 17:34:04 +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 7T4+MzNKnO17 for ; Fri, 17 Jan 2014 17:34:03 +0100 (CET) Original-Received: from filter1-utr.mf.surf.net (filter1-utr.mf.surf.net [195.169.124.152]) by balder.ntg.nl (Postfix) with ESMTP id E49F2101E6 for ; Fri, 17 Jan 2014 17:34:02 +0100 (CET) Original-Received: from mail-oa0-x234.google.com (mail-oa0-x234.google.com [IPv6:2607:f8b0:4003:c02::234]) by filter1-utr.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s0HGXl49013975 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Fri, 17 Jan 2014 17:33:49 +0100 Original-Received: by mail-oa0-f52.google.com with SMTP id o6so4788089oag.39 for ; Fri, 17 Jan 2014 08:33:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=N7A6SLMJS5hRfuuhQ4fMQ8xtDM5hO2hOofrx3jRXG84=; b=rfjmbXEK6QZvJVZS/olG88UemJdnRF21DIbWVmKG7/lVOED6d9ieF5p7w8lhBDSnuy j6TnAeroFt7E/xYBDq2gavY6EGW3FuIUNejQVtJMiMHIxq1xkLVFLYbbyBvG3W7lBOTU t2JojmTKkhbhBV2GcgAJBtqk71I8rn8BGE7+75IoJRix4n1BqL7X8cMnUg0jJH8SF8gm uLdOlnvMKM3mHI3c0AJeXutoAyvzvTteQDp2otGqMfskU/tevW97/iIAdNSyBhgVaOf1 ETHqkLp97l5Z9eeJU10F6m9gw+aBBdSAXhPm/T/NtmXAHZdoZZmlVPwKB0uFLis6CBpl OaaA== X-Received: by 10.182.142.229 with SMTP id rz5mr2385747obb.12.1389976428219; Fri, 17 Jan 2014 08:33:48 -0800 (PST) Original-Received: by 10.76.33.129 with HTTP; Fri, 17 Jan 2014 08:33:48 -0800 (PST) X-Bayes-Prob: 0.9999 (Score 4.7, tokens from: @@RPTN) X-CanIt-Geo: ip=2607:f8b0:4003:c02::234; country=US X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 07Lf4xMyf - 35061bfeca37 - 20140117 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:85991 Archived-At: [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". 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". \starttext \startMPcode % numeric text; %% Try and uncomment this line drawarrow (0,0)--(3cm,1cm); \stopMPcode %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \definecolor [lightblue] [r=0.5, g=0.5, b=1] \definetextbackground [placeholder] [ location=text, background=color, backgroundcolor=lightblue, frame=on, corner=round, radius=0.8\lineheight, ] \placeholder{\input ward } % \placeholder{\input ward} %% Try and uncomment this line \stoptext % Local Variables: % mode: context % coding: utf-8 % End: Regards, Chris ___________________________________________________________________________________ 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 ___________________________________________________________________________________