From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/29345 Path: news.gmane.org!not-for-mail From: Taco Hoekwater Newsgroups: gmane.comp.tex.context Subject: Re: colored box background Date: Fri, 14 Jul 2006 11:49:56 +0200 Message-ID: <44B768C4.6020501@elvenkind.com> References: <315181E1-A702-421B-A167-856FB31413C5@science.uva.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1152870883 18191 80.91.229.2 (14 Jul 2006 09:54:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 14 Jul 2006 09:54:43 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Fri Jul 14 11:54:41 2006 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org 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 1G1KNY-0005wb-4Y for gctc-ntg-context-518@m.gmane.org; Fri, 14 Jul 2006 11:54:36 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 1A46C127F7; Fri, 14 Jul 2006 11:54:33 +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 13519-03; Fri, 14 Jul 2006 11:54:23 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 72B88127EE; Fri, 14 Jul 2006 11:50:29 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C6EFD127EE for ; Fri, 14 Jul 2006 11:50:24 +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 11194-02 for ; Fri, 14 Jul 2006 11:50:03 +0200 (CEST) Original-Received: from glenfiddich.elvenkind.com (elvenknd.xs4all.nl [213.84.171.68]) by ronja.ntg.nl (Postfix) with SMTP id 541F9127E1 for ; Fri, 14 Jul 2006 11:49:58 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by glenfiddich.elvenkind.com (Postfix) with ESMTP id C1A5C1B8C1 for ; Fri, 14 Jul 2006 11:49:57 +0200 (CEST) Original-Received: from glenfiddich.elvenkind.com ([127.0.0.1]) by localhost (glenfiddich.elvenkind.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 22768-05 for ; Fri, 14 Jul 2006 11:49:57 +0200 (CEST) Original-Received: from [10.10.0.6] (glenlivet.elvenkind.com [10.10.0.6]) by glenfiddich.elvenkind.com (Postfix) with ESMTP id 81C7B139F4 for ; Fri, 14 Jul 2006 11:49:57 +0200 (CEST) User-Agent: Mozilla Thunderbird 1.0.6-7.1.20060mdk (X11/20050322) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: <315181E1-A702-421B-A167-856FB31413C5@science.uva.nl> X-Virus-Scanned: by amavisd-new at elvenkind.net X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 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-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:29345 Archived-At: Hans van der Meer wrote: > Say I have a box, e.g. \setbox\thebox=\vbox{....} with dimensions > \wd\thebox etc. > What then is the most efficient and economic (in terms of complexity and > speed) way to generate a colored background for it? If you really want your code to be as efficient and minimalist as possible, you are better of with the plain format than with ConTeXt in any case. Personally I prefer to optimize on complexity and readability of my sources instead of on machine clock cycles. That said, metapost graphics are, in general, heavier than \framed. If you really need thousands and thousands of those boxes, a macro like: \def\bgcolorthebox#1% {\dontleavehmode \rlap{\color[#] {\vrule height \ht\thebox depth \dp\thebox width \wd\thebox}}% \box\thebox } can help. But if it is only a few, simply use \framed. Taco