Hello all,
I'm learning a little bit of metapost language, using metafun manual.
I made some background for a title (surely the code is awful, thanks 
for suggestions of improvement) but it's static, i'd like to adapt it to 
the widthof the text. I don't know if it is possible from my code 
and if it is i don't know how to do !
Thanks for any help,
best regards, Roland
My code :
\setuplayout[width=fit,height=fit,header=0cm,topspace=1.8cm,footer=1.2cm,%
bottomspace=1cm,backspace=6cm,leftmargin=1.5cm,
leftmargindistance=0.5cm,rightmargin=1cm,rightmargindistance=0.5cm,
location=singlesided]

\startuniqueMPgraphic{essai}
path p,p',q,q';
p:=(0,0.1cm)--(12cm,0.3cm);
 q:=(11cm,-0.7cm)--(11.5cm,2.2cm);
p':=(11.7cm,1.3cm)--(-0.4cm,1.4cm);
 q':=(0.3cm,2.4cm)--(0.2cm,-0.3cm);
 draw p withpen pencircle scaled 1mm withcolor 0.3white;
 draw p' withpen pencircle scaled 1mm withcolor 0.3white;
 draw q withpen pencircle scaled 1mm withcolor 0.3white;
 draw q' withpen pencircle scaled 1mm withcolor 0.3white;
pair A; A:=q'intersectionpoint p';
pair B; B:=q intersectionpoint p';
pair C; C:=p intersectionpoint q;
pair D; D:=q'intersectionpoint p;
path s; s:= A--B--C--D--cycle;
fill s withcolor .8white;
\stopuniqueMPgraphic
\starttext
\defineoverlay[encadrement][\uniqueMPgraphic{essai}]
\framed[frame=off,background=encadrement]{\it\tfb\color[darkred]{Devoir de
mathématiques}}
\stoptext

___________________________________________________________________________________
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
___________________________________________________________________________________

Reply via email to