From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/46498 Path: news.gmane.org!not-for-mail From: Fabrice Newsgroups: gmane.comp.tex.context Subject: FunnyFrame in an enumeration. Date: Tue, 23 Dec 2008 23:51:45 -0500 Message-ID: <97369C02-1053-43C2-993E-0A1F65FEFB3F@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v930.3) Content-Type: text/plain; charset="us-ascii"; Format="flowed"; DelSp="yes" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1230094594 28143 80.91.229.12 (24 Dec 2008 04:56:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Dec 2008 04:56:34 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Wed Dec 24 05:57:39 2008 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 lo.gmane.org with esmtp (Exim 4.50) id 1LFLoQ-0005Pa-DE for gctc-ntg-context-518@m.gmane.org; Wed, 24 Dec 2008 05:57:38 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id B2AA41FC43; Wed, 24 Dec 2008 05:56:23 +0100 (CET) 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 32483-06-5; Wed, 24 Dec 2008 05:55:24 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 71C3E1FC11; Wed, 24 Dec 2008 05:55:24 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id B32E51FC44 for ; Wed, 24 Dec 2008 05:55:21 +0100 (CET) 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 00278-03 for ; Wed, 24 Dec 2008 05:54:22 +0100 (CET) Original-Received: from yx-out-1718.google.com (yx-out-1718.google.com [74.125.44.152]) by ronja.ntg.nl (Postfix) with ESMTP id 793881FC11 for ; Wed, 24 Dec 2008 05:51:48 +0100 (CET) Original-Received: by yx-out-1718.google.com with SMTP id 3so1038117yxi.74 for ; Tue, 23 Dec 2008 20:51:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :content-type:content-transfer-encoding:mime-version:subject:date :x-mailer; bh=TshmixF+EFSpoDSpglkMQve2FT0YtsuHdSEehIwutjU=; b=LP/GuJldqdFzMJKEk4D74NFZ0lAGwq4d48u6ASAx1vkn/rNR5US+9rbwL5LGlF41Ls LsNxeRxAtIuvnLF1NK2gmYas+v3V6ETLwhZclVmrvOnZx7cqe+tcpVGCVLHZISFF4otl sf643dJ1G0OwlyLDeeYMqG3JCsBUn9gWheMA4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:content-type:content-transfer-encoding :mime-version:subject:date:x-mailer; b=Uo7iG1IYUJMP3Wg6yyD9aPqBE/Pxz+4wbhWgPmKNiUBNp2PMJMr7ggphyFKXkBVAhk h1QVBqg4cjxCYWx/bK6I4CMXJ27hg9XszGsavd5dEXs6Iw5lTcx0ypb6g4dZDqF6bfLG 6D0h4lr8J5upuY8ETZDC1L/DjPZ1M9B6S+qbQ= Original-Received: by 10.65.188.14 with SMTP id q14mr6552284qbp.56.1230094307034; Tue, 23 Dec 2008 20:51:47 -0800 (PST) Original-Received: from ?192.168.2.11? (bas2-montreal45-1279781507.dsl.bell.ca [76.71.234.131]) by mx.google.com with ESMTPS id 25sm18706802qbw.23.2008.12.23.20.51.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 23 Dec 2008 20:51:46 -0800 (PST) X-Mailer: Apple Mail (2.930.3) X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.11 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:46498 Archived-At: Hi, Playing with metafun, I saw the FunnyFrame example (page 239 MetaFun screen manual), where a framed is put around some paragraph and this frame has a small framed title inserted at the top of the framed paragraph. I would like to do a similar output but in the context of an enumeration. I am able to obtain the main frame by a proper definition of the \definenumeration, but not the title ! For clarity, a sample test file is provided below. I have tried to look in the mailing list for some examples that can help me, but no luck ! Do you think this is something feasible ? I wouldl take any hint ! Thanks, Fabrice. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %[ The main code of this example came actullay from a thread in 2000 by Hans.] % http://archive.contextgarden.net/message/20000929.130642.dc591d10.en.html \setupcolors[state=start] \def\FrameText#1% {\startuseMPgraphic{FunnyFrame} picture p ; numeric w, h, o ; p := btex \strut#1 etex ; w := \overlaywidth ; h := \overlayheight ; o := \the\bodyfontsize/2 ; p := p shifted (4o,h-ypart center p) ; draw p ; drawoptions (withpen pencircle scaled 1pt withcolor red) ; draw (3o,h)--(0,h)--(0,0)--(w,0)--(w,h)--(xpart urcorner p+o,h) ; draw boundingbox p enlarged(o,0) withcolor red ; setbounds currentpicture to unitsquare xyscaled(w,h) ; \stopuseMPgraphic} \defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}] \defineframedtext[FunnyText][frame=off,background=FunnyFrame,width= \hsize] \def\StartFrame#1{\FrameText{#1}\startFunnyText} \def\StopFrame {\stopFunnyText } \starttext \StartFrame{A nice place for a title} The value of variables inside this fence are isolated from the values outside. \StopFrame \defineenumeration[Definition] [width=fit, before=\StartFrame{}, after=\StopFrame, text={Definition} ] \startDefinition The text of the definition. The sentence "{\bf Definition 1}" should be in the above small box. \stopDefinition \stoptext %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ___________________________________________________________________________________ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________