From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/72041 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: custom command \myframedsection does not always work. Bug? Date: Sun, 30 Oct 2011 18:42:22 +0100 Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1319996575 31281 80.91.229.12 (30 Oct 2011 17:42:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 30 Oct 2011 17:42:55 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Oct 30 18:42:46 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RKZPC-00013G-DS for gctc-ntg-context-518@m.gmane.org; Sun, 30 Oct 2011 18:42:46 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C4EB2CB0C9; Sun, 30 Oct 2011 18:42:45 +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 yBUXe-HmncFX; Sun, 30 Oct 2011 18:42:45 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 966B6CB0BC; Sun, 30 Oct 2011 18:42:39 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E9DC3CB0BC for ; Sun, 30 Oct 2011 18:42:37 +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 RQdKToRThu2O for ; Sun, 30 Oct 2011 18:42:26 +0100 (CET) Original-Received: from filter4-ams.mf.surf.net (filter4-ams.mf.surf.net [192.87.102.72]) by balder.ntg.nl (Postfix) with ESMTP id CD70BCB0BB for ; Sun, 30 Oct 2011 18:42:26 +0100 (CET) Original-Received: from mail-fx0-f41.google.com (mail-fx0-f41.google.com [209.85.161.41]) by filter4-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p9UHgPLO013092 for ; Sun, 30 Oct 2011 18:42:26 +0100 Original-Received: by faat2 with SMTP id t2so7041738faa.14 for ; Sun, 30 Oct 2011 10:42:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=82zrmZe7p8zUkYSF3UD+rtCnJ18CyPIcyGoQnx3KXco=; b=CZWNtKqR22swRu9h0XLZDCwvDxVQkXxy55XKllHZIzndPkZwqRtlVkbddHfD6zPGIF B2NeVTLuCGSwjg6VhUr6SUTa5OzGQMIhkxTXo9Ed1Aa4X5NqG1vCkNkJ8y2pTfhvhULf ihgyKhxeeKTFNOHsMCn16mFsi6jH8oP83QYJw= Original-Received: by 10.223.76.135 with SMTP id c7mr23038136fak.14.1319996545849; Sun, 30 Oct 2011 10:42:25 -0700 (PDT) Original-Received: from [192.168.2.35] (p5B0EFAEB.dip.t-dialin.net. [91.14.250.235]) by mx.google.com with ESMTPS id y17sm32695129faf.1.2011.10.30.10.42.24 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 30 Oct 2011 10:42:25 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.1251.1) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.161.41; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 03FP5GqV8 - 0cc7da8d7020 - 20111030 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.72 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 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 Xref: news.gmane.org gmane.comp.tex.context:72041 Archived-At: Am 30.10.2011 um 16:00 schrieb Curiouslearn: > Hi All, > > Please see the working example below. I have defined a command called > \myframedsection. It works the first two times I use it, but not the > third time. I think it has something to do with using > \startitemize...\stopitemize before the command is used the third > time. But I am not sure. Can someone please tell me why it is not > working, and how I can change my definition so that it works? Is this > a bug? > > \definehead[mysection][section] > \setuphead[mysection][color=blue*:3] > > \def\myframedsection#1{\bgroup\vskip 0.5in > \framed[background=color, backgroundcolor=gray:10] > {\mysection{#1}}% > \egroup} No wonder you get unexpected results with this definition, better solutions are \definehead[myframedsection][section] \setuphead [myframedsection] [before={\blank[0.5in]\startframedtext[background=color,backgroundcolor=gray:10]}, after={\stopframedtext\blank[0.25in]}, color=blue*:3] and \define[2]\MyframedsectionCommand {\framed [background=color,backgroundcolor=gray:10,align=flushleft] {\hbox to 2cm{#1}\vtop{\hsize=\dimexpr\hsize-2cm\relax#2}}} \definehead[myframedsection][section] \setuphead [myframedsection] [before={\blank[0.5in]}, command=\MyframedsectionCommand, style=blue*:3] Wolfgang ___________________________________________________________________________________ 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 ___________________________________________________________________________________