From: Jean-Pierre Delange <adeimantos@free.fr>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: space before/after colored framed text
Date: Wed, 17 Aug 2016 16:36:50 +0200 [thread overview]
Message-ID: <d31697d5-9942-7b32-f993-7f2bfa085920@free.fr> (raw)
In-Reply-To: <51127056-0D4D-45F5-87EA-471EF5F5DC2B@gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 1883 bytes --]
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
[-- Attachment #1.2: Type: text/html, Size: 10367 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
next prev parent reply other threads:[~2016-08-17 14:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-17 12:20 \startalign \stopalign equation number placement seems wrong Mikael P. Sundqvist
2016-08-17 13:23 ` Otared Kavian
2016-08-17 14:36 ` Jean-Pierre Delange [this message]
2016-08-17 15:14 ` space before/after colored framed text Thomas A. Schmitz
2016-08-17 15:57 ` Jean-Pierre Delange
2016-08-17 17:02 ` Pablo Rodriguez
2016-08-17 21:59 ` Jean-Pierre Delange
2016-08-18 18:58 ` Pablo Rodriguez
2016-08-28 15:08 ` \startalign \stopalign equation number placement seems wrong Mikael P. Sundqvist
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d31697d5-9942-7b32-f993-7f2bfa085920@free.fr \
--to=adeimantos@free.fr \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).