From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/104895 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Fabrice Couvreur Newsgroups: gmane.comp.tex.context Subject: Re: Frame with shadow for header Date: Tue, 27 Aug 2019 10:16:06 +0200 Message-ID: References: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0650081274265343284==" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="135795"; mail-complaints-to="usenet@blaine.gmane.org" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Aug 27 10:16:55 2019 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 esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i2Wes-000ZAm-BP for gctc-ntg-context-518@m.gmane.org; Tue, 27 Aug 2019 10:16:54 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 167531539CF; Tue, 27 Aug 2019 10:16:31 +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 5tz7WnyQ6IdA; Tue, 27 Aug 2019 10:16:29 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 5FB271539D0; Tue, 27 Aug 2019 10:16:29 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id A39791537E5 for ; Tue, 27 Aug 2019 10:16:27 +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 JFDNP0h8fm50 for ; Tue, 27 Aug 2019 10:16:26 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.128.51; helo=mail-wm1-f51.google.com; envelope-from=fabrice1.couvreur@gmail.com; receiver= Original-Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id B9A221520F2 for ; Tue, 27 Aug 2019 10:16:26 +0200 (CEST) Original-Received: by mail-wm1-f51.google.com with SMTP id g67so2011089wme.1 for ; Tue, 27 Aug 2019 01:16:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=SpQGbWR56ExsnCnKtBNNDGuIHFd7kCPL2b1QgQaaKMY=; b=Waywgh9zbT64GtDDQ+We43G1vfWpCESBHdnfumjjbtrsnAt1MPQtDHZNJWl7U6Gynn E6npk14crLdwEAiKwnpSYSYfZUrziXU82zT7SRGiGUlB8aE/bfgjIfvSDZf39zhjPC2J j+oMKDApZ1epB+8HRGLUPsRN1WAFq5zCj4VZlvHMTMyaEkL6yIhb/ekt1oEzUy5TFBLR JzeigA+0otACNvdfEYvnX46Ecn8W/AMlEl/ZXGqWQthSkpCpNLZXZXzqyHaWYyaguc89 boKwi2N0IFw0WfWuaQ9L8DfX4FW3bBfVvmPxICjs2ZYlU1zZ0bAdZiVq+UHHRri31VF+ Wf8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=SpQGbWR56ExsnCnKtBNNDGuIHFd7kCPL2b1QgQaaKMY=; b=Jh08u38WPo1E1bb8jPaUl2lkRBahAPkWWr3APWg5R8EXYGdZnfyJ/cEmT9Ej5GBx8T pKUR0RACVtklPqAy43FKSJ+7YWXXauk+sD5CZ5wZnFxP2dy4aJGfdnQlYtoBeeK+FtQ1 DfFFk7P3RXHLC2Z3caWbPYcrEwn99ePF8lTjD676w+0vu3rireejwXaJlN0O6BxXq5vj gsCwfxEMvw2bkb1gSXQm495yxvYsglJTV275LEAuGZ/fcMY8i/CGDMZxAqtX3ce9WTZ8 vFLGbOaEisoQwr5LTp6Zdd+QRDGHoQ4hMN17+gwyGa2A2AYVswW5d8C7JNrOd5hUVzpz gYRQ== X-Gm-Message-State: APjAAAWyZp8Kk/fnDPKZ1l8R22neSxa2UWepXW4uYB3YzO2IbR3Twxaq zuCSDzgam41XAovyxDlZMV5WC3tP6zqtwx86p6AJMZ/D/vs= X-Google-Smtp-Source: APXvYqyGJyyyRYCq08lX7zWtv8lgf4Drg6MiO9NCfXWpYNI9Ywq8txQtCa/cWw/azuztBO/C5lZXh1GdvNdUgpd6Vyc= X-Received: by 2002:a7b:c214:: with SMTP id x20mr26244877wmi.11.1566893785947; Tue, 27 Aug 2019 01:16:25 -0700 (PDT) In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 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:104895 Archived-At: --===============0650081274265343284== Content-Type: multipart/related; boundary="00000000000083b810059114e311" --00000000000083b810059114e311 Content-Type: multipart/alternative; boundary="00000000000083b80f059114e310" --00000000000083b80f059114e310 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Mikael, I did not think about using Metapost, I tried with the keys of the command \framed without success. I use the following code for my headings (thank you Aditya) and I would like to use your code instead. Thank you. Fabrice \setupbackgrounds [header] [text] [frame=3Doff, topframe=3Doff, bottomframe=3Doff, framecolor=3D, rulethickness=3D2pt] \defineframed [headerframed] [frame=3Doff, height=3Dfit, width=3Dfit] \definecolor[ColorA][0.8(white)] \startsetups [headertext] \setupheadertexts [{\startframed [headerframed] [foregroundstyle=3Dbold,background=3Dcolor,backgroundcolor=3DColorA] \getvariable{headertext}{title} n\high{o}\,\getvariable{headertext}{number} \stopframed}] \setupheadertexts [{\startframed [headerframed] [align=3Dflushleft,foregroundstyle=3D] Lyc=C3=A9e LA SALLE, Lille\\ \getvariable{headertext}{location}\space\endash\space Math=C3=A9mati= ques \stopframed}] [{\startframed [headerframed] [align=3Dflushright,foregroundstyle=3D] \date[d=3D\getvariable{headertext}{day},m=3D\getvariable{headertext}{month}= ,y=3D\getvariable{headertext}{year}] \stopframed}] \stopsetups \setvariable{headertext}{set}{\directsetup{headertext}} \startuseMPgraphic{framewithshadow} path p; p:=3Dorigin--(OverlayWidth,0)--(OverlayWidth,OverlayHeight)--(0,OverlayHeig= ht)--cycle; fill p shifted (2,-2); fill p withcolor 0.8white; draw p; setbounds currentpicture to p; \stopuseMPgraphic \defineoverlay[framewithshadow][\useMPgraphic{framewithshadow}] \starttext \setvariables [headertext] [title=3D{Devoir maison}, number=3D{6}, day=3D{22}, month=3D{08}, year=3D{2019}, location=3D{Seconde B}, time=3D{}] \framed[background=3Dframewithshadow,offset=3D4bp]{\bf DM no 7 : D=C3=A9riv= ation} \stoptext Le lun. 26 ao=C3=BBt 2019 =C3=A0 11:31, Mikael P. Sundqvist a =C3=A9crit : > On Mon, Aug 26, 2019 at 10:25 AM Fabrice Couvreur < > fabrice1.couvreur@gmail.com> wrote: > >> Hello, >> How to make a frame with an offset shadow as the attached picture ? The >> text inside the frame is a variable. >> Thank you. >> Fabrice >> >> >> [image: frame.png] >> >> >> ________________________________________________________________________= ___________ >> If your question is of interest to others as well, please add an entry t= o >> the Wiki! >> >> maillist : ntg-context@ntg.nl / >> http://www.ntg.nl/mailman/listinfo/ntg-context >> webpage : http://www.pragma-ade.nl / http://context.aanhet.net >> archive : https://bitbucket.org/phg/context-mirror/commits/ >> wiki : http://contextgarden.net >> >> ________________________________________________________________________= ___________ >> > > Hi, > > maybe something like this could work for you: > > \startuseMPgraphic{framewithshadow} > path p; > > p:=3Dorigin--(OverlayWidth,0)--(OverlayWidth,OverlayHeight)--(0,OverlayHe= ight)--cycle; > fill p shifted (2,-2); > fill p withcolor 0.7white; > draw p; > setbounds currentpicture to p; > \stopuseMPgraphic > > \defineoverlay[framewithshadow][\useMPgraphic{framewithshadow}] > > \starttext > \framed[background=3Dframewithshadow,offset=3D4bp]{\bf DM no 7 : D=C3=A9r= ivation} > \stoptext > > /Mikael > > _________________________________________________________________________= __________ > 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://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > _________________________________________________________________________= __________ > --00000000000083b80f059114e310 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Mikael,
I did not think about using Metapost, I tried with the keys of the com= mand \framed without success.
I use the followin= g code for my headings (thank you Aditya) and I would like to use your code= instead.
Thank you.
= Fabrice


<= /span>
\setupbackgrounds
=C2=A0 =C2=A0 [header]
=C2=A0 =C2= =A0 [text]
=C2=A0 =C2=A0 [frame=3Doff,
=C2=A0 =C2=A0 =C2=A0topframe= =3Doff,
=C2=A0 =C2=A0 =C2=A0bottomframe=3Doff,
=C2=A0 =C2=A0 =C2=A0fr= amecolor=3D,
=C2=A0 =C2=A0 =C2=A0rulethickness=3D2pt]

=C2=A0 \def= ineframed
=C2=A0 =C2=A0 [headerframed]
=C2=A0 =C2=A0 [frame=3Doff,=C2=A0 =C2=A0 =C2=A0height=3Dfit,
=C2=A0 =C2=A0 =C2=A0width=3Dfit]
<= br>=C2=A0 \definecolor[ColorA][0.8(white)]
=C2=A0

=C2=A0 \starts= etups [headertext]

=C2=A0 =C2=A0 \setupheadertexts
=C2=A0 =C2=A0 = =C2=A0 [{\startframed [headerframed]
=C2=A0 =C2=A0 =C2=A0 [foregroundsty= le=3Dbold,background=3Dcolor,backgroundcolor=3DColorA]
=C2=A0 =C2=A0 =C2= =A0 \getvariable{headertext}{title} n\high{o}\,\getvariable{headertext}{num= ber}
=C2=A0 =C2=A0 =C2=A0 \stopframed}]

=C2=A0 =C2=A0 \setupheade= rtexts
=C2=A0 =C2=A0 =C2=A0 [{\startframed [headerframed]
=C2=A0 =C2= =A0 =C2=A0 [align=3Dflushleft,foregroundstyle=3D]
=C2=A0 =C2=A0 =C2=A0 = =C2=A0Lyc=C3=A9e LA SALLE, Lille\\
=C2=A0 =C2=A0 =C2=A0 =C2=A0\getvariab= le{headertext}{location}\space\endash\space Math=C3=A9matiques
=C2=A0 = =C2=A0 =C2=A0 =C2=A0\stopframed}]
=C2=A0 =C2=A0
=C2=A0 =C2=A0 =C2=A0= [{\startframed [headerframed]
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [align= =3Dflushright,foregroundstyle=3D]
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \da= te[d=3D\getvariable{headertext}{day},m=3D\getvariable{headertext}{month},y= =3D\getvariable{headertext}{year}]
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \s= topframed}]

=C2=A0 \stopsetups

=C2=A0 \setvariable{headertext= }{set}{\directsetup{headertext}}

\startuseMPgraphic{framewithshadow}=
path p;
p:=3Dorigin--(OverlayWidth,0)--(OverlayWidth,OverlayHeight)-= -(0,OverlayHeight)--cycle;
fill p shifted (2,-2);
fill p withcolor 0.= 8white;
draw p;
setbounds currentpicture to p;
\stopuseMPgraphic
\defineoverlay[framewithshadow][\useMPgraphic{framewithshadow}]
\starttext
\setvariables
=C2=A0 =C2=A0[headertext]
=C2=A0 =C2=A0= [title=3D{Devoir maison},
=C2=A0 =C2=A0 number=3D{6},
=C2=A0 =C2=A0 d= ay=3D{22},
=C2=A0 =C2=A0 month=3D{08},
=C2=A0 =C2=A0 year=3D{2019},=C2=A0 =C2=A0 location=3D{Seconde B},
=C2=A0 =C2=A0 time=3D{}]
\fra= med[background=3Dframewithshadow,offset=3D4bp]{\bf DM no 7 : D=C3=A9rivatio= n}
\stoptext


=

Le=C2=A0lun. 26 ao=C3=BBt 2019 =C3=A0=C2=A011:31, Mikae= l P. Sundqvist <mickep@gmail.com= > a =C3=A9crit=C2=A0:
On Mon, Aug 26, 2019 at 10:25 = AM Fabrice Couvreur <fabrice1.couvreur@gmail.com> wrote:
Hello,
How to make a frame with an offset shadow as the attached picture ? The text inside the fram= e is a variable.
Thank you.
Fabrice




___________________________________________________________________________= ________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/nt= g-context
webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.net=
archive=C2=A0 : https://bitbucket.org/phg/context-m= irror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
___________________________________________________________________________= ________

Hi,

m= aybe something like this could work for you:

\startuseM= Pgraphic{framewithshadow}
path p;
p:=3Dorigin--(OverlayWidth,0)--(Ove= rlayWidth,OverlayHeight)--(0,OverlayHeight)--cycle;
fill p shifted (2,-2= );
fill p withcolor 0.7white;
draw p;
setbounds currentpicture to = p;
\stopuseMPgraphic

\defineoverlay[framewithshadow][\useMPgraphi= c{framewithshadow}]

\starttext
\framed[background=3Dframewithshad= ow,offset=3D4bp]{\bf DM no 7 : D=C3=A9rivation}
\stoptext

/Mikael=C2=A0
___________________________________________________________________________= ________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/nt= g-context
webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.net=
archive=C2=A0 : https://bitbucket.org/phg/context-m= irror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
___________________________________________________________________________= ________
--00000000000083b80f059114e310-- --00000000000083b810059114e311 Content-Type: image/png; name="frame.png" Content-Disposition: inline; filename="frame.png" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: ii_jzs4yaab1 iVBORw0KGgoAAAANSUhEUgAAAMwAAAA4CAAAAACUSkghAAAABGdBTUEAALGPC/xhBQAAACBjSFJN AAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAQY2FO dgAAB4AAAASwAAADWwAAAINq+JZyAAAFJElEQVRo3u2ae1DUVRTHP8tjF0FBlhUGTUh5qKCI61ji i4AwIl+YLiomKcxkaOMjwilnGq3UyBlnsEKzGvGVM6XkJlaiYECIYIohSwICsRgIxSgLCCzC9scG u8qqKf+09Dt/3T3fc8/+Pveee+7u7Ip0DByzGEAsAowAI8D8n2GsQB1m7u05KLkXpl2917xZsqoM O4PlM+YNo74xkM6MJjj44MBpADqRbuDADKQyE2AEGAFGgBFg/rNm1cejOQbQbevtbQ9UnQO5v165 chkCPR6c63e7YaaFsp8Bup28PSX/eHQig9p8KNTrwUkPjXyuHzsj8b+RWOgvl6aG7NTCUP/sPas7 AGh/PzHb37FPfNelrHr9KCV0doQiMjK5T4jUPz2x3X+S9pOZSr3j9NQfDerppJ0mH+1LAPUHG7r7 sTMS+RWc5RAWs7joEI6O0qWfKRUAyjnFUnmf8KblcU/Hv7QEQN1WDTh81CdGJhuKh5zJkSfj1W8A aQmuzgY1aEm4qSdr+y4GcIuTWfRjZ3rNY2mBEiDCMUUH6Ionmoo62PLiOMX2DoBWZXZu7uzd7g9O OXfCvmpAd/Cs0ao4bX3WVOxhLQDrovpzZgw2lm/nAzZLk3NmQfYsozov2dcZbXuhKiQYjQTE2g4J EDYWTgRM7YmpTVU490l59VQc2uZLGS5R1gXKto2ZNxZ5b2rxWVOUCovGl3yN4lYejX6RFre2pw3e wlrZF4VWSaA58YeVdNmgtnfvTAvOLPNYbvH43WwkFQBEifcDGSFG0qjJZ49Wxnq+XkBEXVlXxhx7 gJVQpVzWG5Py8YE+Kd2opDMq7Z2EX1fhIzuVHHhyB7HnChkz72idFx7qILe4hvj1uzZjv8nJce1a R+bXngP14pa342vC6yWvZGR+FanYlvwErdmaTgCRbO75Msq8jEMH+dI8j9Go8PkhOzk0sadJvbnQ EKNYtNBEIWg5UrRALFpR8MvgMQxx37YBLwlI5NNz/qLJIXBw3AJc5GkdljJLS5nMkmEuwIc1MYhe q02y8LMoWmM1GtUTlNlNfPWDV4/v33Fs/X2qL4i5C8NjDb48VYDhhec2UynHc5niRtoljcAIgnuU mNyUzQdWQOz53boGbbPEeNZFOwm42hQAHjaI9Wv8mDClTNEPvKenRdvZ/os9TbV0evgRLWUKtkT6 wgYAF4Myfdw30dffomKdw2af6hK973aj/laz7gS4+6hKephYe8Q/BkAEK7WrFSB6ZDu5bm8UUxhb fL+ek79qEs+hAkpV9y1lTNuqSNhTvsWHZgCxlrI8vTRN0wg1dwMevzVrVXU0qlT5exUzPrVGU6jO r2CG12RXrlXQpGrSB2kqqa+9XcXN2nvm1hlXR3pOz814S6WhRlWctTVhTTyERSedb83bNbpRTXU1 dKu6W6qB8OFWQeBH+p3vbchqI6CuOjeQCk13CQlj3vuzYYffxi4VreWdxbSUm4YR6SibctHYozkC oBOPHD8CuH4GnF/mqnQEB+4Az+s/eVSehnGumTBhhvHcozYRRtdp+gv2+tFvPwE63RA3ud5x7cJt v2k2RbngHs7dz8E9HMi3lgOXixsDJyrrQz07lVVTZ3K8AetYus6UWo4NEbXvB4e5h0Eaafyux06J LVZEm4QxP+uFEb4CCDACjAAjwAgwAowAY+ZmBXSXmzdDgxGMtV0M5v3jua+uF2bUTXISW80ZRnfv mek089Oi6z0zIPXpMnOapwBEwj8BBRgBRoAZEPY3I7Sx55vPdskAAAAASUVORK5CYII= --00000000000083b810059114e311-- --===============0650081274265343284== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============0650081274265343284==--