From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/89629 Path: news.gmane.org!not-for-mail From: Fabrice Couvreur Newsgroups: gmane.comp.tex.context Subject: Define a new type section with metafun Date: Fri, 26 Dec 2014 23:26:27 +0100 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1005529063==" X-Trace: ger.gmane.org 1419632827 6433 80.91.229.3 (26 Dec 2014 22:27:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Dec 2014 22:27:07 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Dec 26 23:27:03 2014 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Y4dLb-0000qJ-C7 for gctc-ntg-context-518@m.gmane.org; Fri, 26 Dec 2014 23:27:03 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9482B103F3 for ; Fri, 26 Dec 2014 23:27:02 +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 es8Gh_qZHCuQ for ; Fri, 26 Dec 2014 23:27:01 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 07EFB10256 for ; Fri, 26 Dec 2014 23:26:37 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 95801101EA for ; Fri, 26 Dec 2014 23:26:32 +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 N5_Jj912lBKK for ; Fri, 26 Dec 2014 23:26:30 +0100 (CET) Original-Received: from filter1-utr.mf.surf.net (filter1-utr.mf.surf.net [195.169.124.152]) by balder.ntg.nl (Postfix) with ESMTP id 7D7E3101E8 for ; Fri, 26 Dec 2014 23:26:30 +0100 (CET) Original-Received: from mail-ie0-x232.google.com (mail-ie0-x232.google.com [IPv6:2607:f8b0:4001:c03::232]) by filter1-utr.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id sBQMQSKS022738 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Fri, 26 Dec 2014 23:26:29 +0100 Original-Received: by mail-ie0-f178.google.com with SMTP id vy18so8072749iec.23 for ; Fri, 26 Dec 2014 14:26:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=kiFenF7lZXdmzawZui9ysd4NbtHCqBFZ1TdYUvxZgus=; b=i13V5y5heKMGlDayUwZpw+Y7zn25ccwpZNo4mdjRjIl4g5xZOThEZl51oztYeHp56I SeMN4WrL4cVn5DsASjM1jfansNGfGkFXGYOqzkv0SZGVDVo7QJQFPlj3mpz5yf1DVL3s BY4Z6x9uZrgiqLjsgvYeTeKtlldu+jU49RV2xujg3r0Ol9fwflK2VqQ4xSFtEaMiv05j 9ThNzFLNVza7aVrZ35rHpP3EPLblsFEAkhIZNGrVSBli5A8GSgrMle85Xu6jlaBSs4ru DU76Al2vfWlDKKDILjORiUcdplMHscnhJYeDjfn0QpaoBTK0I76VrM2269k+T+Y9iU9m 8H9g== X-Received: by 10.107.128.138 with SMTP id k10mr40897678ioi.69.1419632787798; Fri, 26 Dec 2014 14:26:27 -0800 (PST) Original-Received: by 10.50.239.38 with HTTP; Fri, 26 Dec 2014 14:26:27 -0800 (PST) X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2607:f8b0:4001:c03::232; country=US X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 07NwmqtXP - 935e123eb622 - 20141226 (trained as not-spam) Received-SPF: pass (filter1-utr.mf.surf.net: domain of fabrice1.couvreur@gmail.com designates 2607:f8b0:4001:c03::232 as permitted sender) receiver=filter1-utr.mf.surf.net; client-ip=2607:f8b0:4001:c03::232; envelope-from=; helo=mail-ie0-x232.google.com; identity=mailfrom X-Scanned-By: CanIt (www . roaringpenguin . 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:89629 Archived-At: --===============1005529063== Content-Type: multipart/alternative; boundary=001a113fbcc407427a050b260428 --001a113fbcc407427a050b260428 Content-Type: text/plain; charset=UTF-8 Hi, I wish red separation is exactly in the middle of the dial and the title of the section. Then, the line is too long, it should not exceed the boundary of the ellipse. Best regards, Fabrice % 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 p withcolor \MPcolor{\overlaylinecolor} ; draw (20,0)--(20,h) withcolor red ; \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 --001a113fbcc407427a050b260428 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
<= span id=3D"result_box" class=3D"" lang=3D"en">
Hi,
I wish red separation is exa= ctly in the middle of the d= ial and the title of the se= ction. Then, the line is too long, it should not excee= d the boundary of the ellip= se.
Best = regards,
= Fabrice

% macros=3Dmkvi
\setuppapersize[A4][A4]

\setupcolo= rs[state=3Dstart,cmyk=3Dyes,mpcmyk=3Dyes]
\definecolor[mycolor][c=3D0.45= ,m=3D0.00,y=3D0.1,k=3D0.00]
\definecolor[colortext][c=3D1,m=3D0.00,y=3D0= .3,k=3D0.3]

\starttext

\startuniqueMPgraphic{funny}
path p= ;
numeric h ;
h :=3D OverlayHeight ;
p:=3Dunitsquare xscaled \ove= rlaywidth yscaled \overlayheight superellipsed 0.9 ;
pickup pencircle sc= aled \overlaylinewidth ;
fill p withcolor \MPcolor{\overlaycolor} ;
d= raw p withcolor \MPcolor{\overlaylinecolor} ;
draw (20,0)--(20,h) withco= lor red ;
\stopuniqueMPgraphic

\defineoverlay[funny][\uniqueMPgra= phic{funny}]

\define[2]\MySectionCommand
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 {\framed
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 [background=3Dfunny,
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 frame=3Doff,
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 width=3D0.5\textwidth,
=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 align=3D{right},
=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 framecolor=3Dmycolor,
=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rulethickness=3D1.5pt,<= br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 backgroundc= olor=3Dwhite,
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 offset=3D4pt]
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= {\tfb #1\space\colortext#2}}

\setuphead[section][command=3D\MySecti= onCommand,ownnumber=3Dyes,numbercolor=3Dcolortext]

\section{A}{PLAN = DE L'ESPACE}
\stoptext
--001a113fbcc407427a050b260428-- --===============1005529063== 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= --===============1005529063==--