From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/95838 Path: news.gmane.org!.POSTED!not-for-mail From: Jean-Pierre Delange Newsgroups: gmane.comp.tex.context Subject: space before/after colored framed text Date: Wed, 17 Aug 2016 16:36:50 +0200 Message-ID: References: <51127056-0D4D-45F5-87EA-471EF5F5DC2B@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0052261125051400749==" X-Trace: blaine.gmane.org 1471444663 6059 195.159.176.226 (17 Aug 2016 14:37:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 17 Aug 2016 14:37:43 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Aug 17 16:37:38 2016 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ba1yM-0001IE-L9 for gctc-ntg-context-518@m.gmane.org; Wed, 17 Aug 2016 16:37:38 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 0BDC4150B8; Wed, 17 Aug 2016 16:37:11 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wc_t6uiWYbrP; Wed, 17 Aug 2016 16:37:08 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id A7DA6150B7; Wed, 17 Aug 2016 16:37:08 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id AF282150B5 for ; Wed, 17 Aug 2016 16:37:07 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JsnWIW7N_V05 for ; Wed, 17 Aug 2016 16:37:06 +0200 (CEST) Original-Received: from smtp2-g21.free.fr (smtp2-g21.free.fr [212.27.42.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 4FF6B150B0 for ; Wed, 17 Aug 2016 16:36:56 +0200 (CEST) Original-Received: from [192.168.0.11] (unknown [78.208.237.21]) by smtp2-g21.free.fr (Postfix) with ESMTP id 8C1CC2002E6 for ; Wed, 17 Aug 2016 14:32:20 +0200 (CEST) In-Reply-To: <51127056-0D4D-45F5-87EA-471EF5F5DC2B@gmail.com> X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 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" Xref: news.gmane.org gmane.comp.tex.context:95838 Archived-At: This is a multi-part message in MIME format. --===============0052261125051400749== Content-Type: multipart/alternative; boundary="------------87CCAD850F28386D9260E77E" This is a multi-part message in MIME format. --------------87CCAD850F28386D9260E77E Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Dear list, I use for one of my own projects some code given by Wolfgang to Fabrice (see below), which is working fine : at the end of each chapter, I've placed a framed text as a summary (25 lines with few footnotes). I have 2 questions : 1. What are the keys to manage the space before and after the frame ? Here I have : \defineframedtext [MyFrame] [before={\blank}, after={\blank}, frame=off, background=MyFrame, %width=\textwidth, width=max, height=fit, style=regular] But the [before={\blank} command forces the framed text to be printed on the next page. Is there other keys to better fit this framed text ? 2. As you see, the key style is 'regular' here; I know it might be 'italics' or 'bold'. But I want to play with the size of the fonts only in this frame. How can achieve that ? Many thanks for your help. JP This is the sample code : % Begin framed text settings \defineframedtext [MyFrame] [before={\blank}, after={\blank}, frame=off, background=MyFrame, %width=\textwidth, width=max, height=fit, style=regular] \definelabel [Definition] [headstyle=\bf\smallcaps] \startuseMPgraphic{MyFrame} path b; picture p; %p := textext.rt("\white\Definition"); p := textext.rt("\white\framedtextparameter{Title}"); %p := textext.rt("\white\getvariable{text}{text1}"); p := p shifted (2BodyFontSize,OverlayHeight-ypart center p+.25ExHeight); b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth; fill OverlayBox withcolor lightgray; %\MPcolor{ fill b withcolor darkred; draw bottomboundary OverlayBox withpen pencircle scaled 1pt withcolor darkred; draw topboundary OverlayBox withpen pencircle scaled 1pt withcolor darkred; draw p; setbounds currentpicture to boundingbox currentpicture enlarged 2mm; \stopuseMPgraphic \defineoverlay [MyFrame] [\useMPgraphic{MyFrame}] % end framed text settings --------------87CCAD850F28386D9260E77E Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit Dear list,

I use for one of my own projects some code given by Wolfgang to Fabrice (see below), which is working fine : at the end of each chapter, I've placed a framed text as a summary (25 lines with few footnotes). I have 2 questions :

1. What are the keys to manage the space before and after the frame ? Here I have :
\defineframedtext

[MyFrame]

[before={\blank},

after={\blank},

frame=off,

background=MyFrame,

%width=\textwidth,

width=max,

height=fit,

style=regular]


But the [before={\blank} command forces the framed text to be printed on the next page. Is there other keys to better fit this framed text ?


2. As you see, the key style is 'regular' here; I know it might be 'italics' or 'bold'. But I want to play with the size of the fonts only in this frame. How can achieve that ?


Many thanks for your help.

JP


This is the sample codeĀ  :


% Begin framed text settings

\defineframedtext

[MyFrame]

[before={\blank},

after={\blank},

frame=off,

background=MyFrame,

%width=\textwidth,

width=max,

height=fit,

style=regular]


\definelabel

[Definition]

[headstyle=\bf\smallcaps]


\startuseMPgraphic{MyFrame}

path b;

picture p;

%p := textext.rt("\white\Definition");

p := textext.rt("\white\framedtextparameter{Title}");

%p := textext.rt("\white\getvariable{text}{text1}");

p := p shifted (2BodyFontSize,OverlayHeight-ypart center p+.25ExHeight);

b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth;

fill OverlayBox withcolor lightgray; %\MPcolor{

fill b withcolor darkred;

draw bottomboundary OverlayBox withpen pencircle scaled 1pt withcolor

darkred;

draw topboundary OverlayBox withpen pencircle scaled 1pt withcolor

darkred;

draw p;

setbounds currentpicture to boundingbox currentpicture enlarged 2mm;

\stopuseMPgraphic


\defineoverlay

[MyFrame]

[\useMPgraphic{MyFrame}]

% end framed text settings




--------------87CCAD850F28386D9260E77E-- --===============0052261125051400749== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============0052261125051400749==--