From: Hans Hagen <pragma@wxs.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Define a new type section with metafun
Date: Sun, 28 Dec 2014 00:49:28 +0100 [thread overview]
Message-ID: <549F4588.9000503@wxs.nl> (raw)
In-Reply-To: <1CE8D4669B764E13A4362DFD9D130EB9@CJ3001517A>
On 12/28/2014 12:01 AM, Akira Kakuto wrote:
> Dear Fabrice,
>
> A try and error method which you may not want:
>
> % macros=mkvi
> \setuppapersize[A4][A4]
>
> \setupcolors[state=start,cmyk=yes,mpcmyk=yes]
> \definecolor[mycolor][c=0.45,m=0.00,y=0.1,k=0.00]
> \definecolor[colortext][c=1,m=0.00,y=0.3,k=0.3]
>
> \starttext
>
> \startuniqueMPgraphic{funny}
> path p ;
> numeric h ;
> h := OverlayHeight ;
> p:=unitsquare xscaled \overlaywidth yscaled \overlayheight superellipsed
> 0.9 ;
> pickup pencircle scaled \overlaylinewidth ;
> fill p withcolor \MPcolor{\overlaycolor} ;
> draw (20,1)--(20,h-1) withcolor red ;
> draw p withcolor \MPcolor{\overlaylinecolor} ;
> \stopuniqueMPgraphic
>
> \defineoverlay[funny][\uniqueMPgraphic{funny}]
>
> \define[2]\MySectionCommand
> {\framed
> [background=funny,
> frame=off,
> width=0.5\textwidth,
> align={right},
> framecolor=mycolor,
> rulethickness=1.5pt,
> backgroundcolor=white,
> offset=4pt]
> {\tfb #1\space\colortext#2}}
>
> \setuphead[section][command=\MySectionCommand,ownnumber=yes,numbercolor=colortext]
>
>
> \section{A}{PLAN DE L'ESPACE}
> \stoptext
or reshuffle the drawing a bit and clip
\startuniqueMPgraphic{funny}
numeric h ; h := OverlayHeight ;
path p ; p := unitsquare xscaled \overlaywidth yscaled
\overlayheight superellipsed 0.9 ;
pickup pencircle scaled \overlaylinewidth ;
fill p withcolor \MPcolor{\overlaycolor} ;
draw (20,-1)--(20,h+1) withcolor red ;
clip currentpicture to p ;
draw p withcolor \MPcolor{\overlaylinecolor} ;
\stopuniqueMPgraphic
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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:[~2014-12-27 23:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-27 23:01 Akira Kakuto
2014-12-27 23:49 ` Hans Hagen [this message]
2014-12-28 11:25 ` Fabrice
2014-12-28 12:00 ` Fabrice
2014-12-28 17:27 ` Hans Hagen
2014-12-29 10:25 ` Fabrice
-- strict thread matches above, loose matches on Subject: below --
2014-12-26 22:26 Fabrice Couvreur
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=549F4588.9000503@wxs.nl \
--to=pragma@wxs.nl \
--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).