On 01/13/2015 10:43 PM, Fabrice Couvreur wrote:
> Hi,
> I wish the second frameis centered with the first frame. I guess this is
> the figure that prevents this. However, even by reducing the value of u,
> it does not work.
> Best regards,
> Fabrice

Hi Fabrice,

I think that the figure gives a different width to center the frame.

Reducing the value of u to 0.175cm does work (although this is almost
useless :-)).

An xtable may do what you need:

%~ \showframe
\definecolor[Border][c=0.00, m=0.00, y=0.00, k=0.25]

\defineframed
   [Myframed]
   [width=0.6\textwidth,
    foregroundstyle={\switchtobodyfont[10pt]},
    align={high,flushleft},
    frame=off,
    framecolor=0.625white,
    background=borderline,
    ]

\definefiller[dots][left=\dontleavehmode,right=\hskip\zeropoint\par]

\starttext

\startuniqueMPgraphic{borderline}
path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
draw p withcolor \MPcolor{Border} dashed evenly withpen pencircle scaled
1.2pt ;
\stopuniqueMPgraphic

\defineoverlay[borderline][\uniqueMPgraphic{borderline}]

\startxtable[frame=off]
    \startxrow
        \startxcell[align=normal]
Compléter chacun des algorithmes ci-dessous afin qu'ils affichent en
\unit{square meter}, puis en hectares, la superficie d'un terrain
rectangulaire de longueur $L$ mètres et de largeur $l$ mètres, saisies
en entrée.
        \stopxcell
        \startxcell
\switchtobodyfont[7pt]
\startMPcode
numeric u;
u=0.7cm;
z0=(0,0) ;
z1=(2.5u,0) ;
z2=(2.5u,2.5u) ;
z3=(0,2.5u) ;
z4=(-0.2u,0) ;
z5=(-0.2u,2.5u) ;
z6=(0,2.7u) ;
z7=(2.5u,2.7u) ;
z8=(1.25u,1.25u) ;
drawdblarrow z4--z5 ;
drawdblarrow z6--z7 ;
fill z0--z1--z2--z3--cycle withcolor green ;
draw z0--z1--z2--z3--cycle ;
label.top("\unit{100 meter}",0.5[z6,z7]) ;
label.lft("\unit{100 meter}",0.5[z4,z5]) ;
\stopMPcode
        \stopxcell
    \stopxrow
\stopxtable
\startbuffer
\input knuth
\stopbuffer

\blank[big]
\startmidaligned
\Myframed{\getbuffer}
\stopmidaligned

\startbuffer
\input ward
\stopbuffer

\blank[big]
\startmidaligned
\Myframed{\getbuffer}
\stopmidaligned
\stoptext

I hope it helps,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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