From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/16010 Path: main.gmane.org!not-for-mail From: Brooks Moses Newsgroups: gmane.comp.tex.context Subject: Some problems with framing typed text. Date: Tue, 10 Aug 2004 10:30:07 -0700 Sender: ntg-context-bounces@ntg.nl Message-ID: <4.3.1.2.20040810101921.00b335b8@cits1.stanford.edu> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Trace: sea.gmane.org 1092159022 12747 80.91.224.253 (10 Aug 2004 17:30:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 10 Aug 2004 17:30:22 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Tue Aug 10 19:30:11 2004 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BuaRv-0004Uu-00 for ; Tue, 10 Aug 2004 19:30:11 +0200 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id CCA4A1277F; Tue, 10 Aug 2004 19:30:10 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 04503-01; Tue, 10 Aug 2004 19:30:08 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id D8C9112778; Tue, 10 Aug 2004 19:30:07 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 053E112778 for ; Tue, 10 Aug 2004 19:30:07 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 04443-03 for ; Tue, 10 Aug 2004 19:30:06 +0200 (CEST) Original-Received: from smtp3.Stanford.EDU (unknown [171.67.16.138]) by ronja.ntg.nl (Postfix) with ESMTP id 265CA1276B for ; Tue, 10 Aug 2004 19:30:05 +0200 (CEST) Original-Received: from Brooks1.stanford.edu (DNab42a61c.Stanford.EDU [171.66.166.28]) by smtp3.Stanford.EDU (8.12.11/8.12.11) with ESMTP id i7AHTx73010818 for ; Tue, 10 Aug 2004 10:30:02 -0700 X-Sender: brooks@cits1.stanford.edu X-Mailer: QUALCOMM Windows Eudora Version 4.3.1 Original-To: ConTeXt users list X-Virus-Scanned: by 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: , Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: by amavisd-new at ntg.nl Xref: main.gmane.org gmane.comp.tex.context:16010 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:16010 In the document I'm working on, I'd like to put some typed code bits in frames, to get an appearance sort of like the code excerpts on the ConTeXtWiki. However, I've found myself needing to do a couple of rather ugly hacks to get that to work right, and I'm hoping for some suggestions on how to avoid that. Here's what I have so far: \def\typebufferframed[#1]{% \vskip\parskip \framed[background=color, backgroundcolor=gray, frame=on, strut=yes, offset=2mm, width=broad, framecolor=black, align=right]% {\vskip -11mm\typebuffer[#1]\vskip -5mm}} \starttext Plain text before the code. \startbuffer[ex1] This is an example. \stopbuffer \typebufferframed[ex1] Plain text after the code. \stoptext The hacks that I'd like to get rid of: It would be nice not to have to put the code in a buffer before typing it, since in general I only use these once. However, if I put \starttyping and \stoptyping inside a framed command (even if I don't encapsulate it in another function) it breaks, and putting \startframedtext in the before= command and \stopframedtext in the after= command of \setuptyping also doesn't work. The spacing, when I do things the way that I'm doing them, is all wrong. The \vskip\parskip at the top is reasonably ok (although a bit annoying), but I'd really like to figure out how to get rid of the large negative \vskip's inside the frame. Thanks! - Brooks