Hi, I wish the second frame is 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 \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] \startsetups[table:initialize] \setupTABLE[start] [align={lohi,right} offset=1ex, frame=off, ] \setupTABLE[column][first][width=0.25\textwidth] \setupTABLE[column][2][width=0.35\textwidth] \stopsetups \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}] \placefigure[right,none]{}{ \start \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 \stop} 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. \startbuffer \input knuth \stopbuffer \blank[big] \startmidaligned \Myframed{\getbuffer} \stopmidaligned \startbuffer \input ward \stopbuffer \blank[big] \startmidaligned \Myframed{\getbuffer} \stopmidaligned \stoptext
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
Am 14.01.2015 um 13:14 schrieb Pablo Rodriguez
: \defineframed [Myframed] [width=0.6\textwidth, foregroundstyle={\switchtobodyfont[10pt]}, align={high,flushleft}, frame=off, framecolor=0.625white, background=borderline, ]
You can replace the framed command with a framed text environment, e.g. \defineframedtext [Myframed] [width=0.6\textwidth, foregroundstyle={\switchtobodyfont[10pt]}, align={high,flushleft}, frame=off, framecolor=0.625white, background=borderline, location=middle, offset=.5ex] and change
\startmidaligned \Myframed{\getbuffer} \stopmidaligned
to \startMyframed \getbuffer \stopMyframed Wolfgang
Dear Pablo, Following a post to which you had already answered, I have been able to do using a XTABLE. But I wanted to know if it was possible to do otherwise. But apparently not, so I'll hold your solution. Dear Wolfgang, Why is it better to use a framed text environment?
Am 14.01.2015 um 18:50 schrieb Fabrice
: Dear Pablo, Following a post to which you had already answered, I have been able to do using a XTABLE. But I wanted to know if it was possible to do otherwise. But apparently not, so I'll hold your solution.
Dear Wolfgang, Why is it better to use a framed text environment?
With framedtext you need only one environment to put a frame around your text and center it (you can also set the distance before and after the environment) while the \framed command requires you to center the content with additional commands, you have to add also a manual blank command to set a distance before/after the text. Wolfgang
On 01/14/2015 06:50 PM, Fabrice wrote:
Dear Pablo, Following a post to which you had already answered, I have been able to do using a XTABLE. But I wanted to know if it was possible to do otherwise. But apparently not, so I'll hold your solution.
Hi Fabrice, I guess that placing an invisible object besides the second frame would do the same. This looks like a more complex workaround to me. I must confess that I don’t know whether there are another approaches to the issue you are facing. Pablo
Dear Wolfgang, Why is it better to use a framed text environment? ___________________________________________________________________________________ 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 ___________________________________________________________________________________
participants (4)
-
Fabrice
-
Fabrice Couvreur
-
Pablo Rodriguez
-
Wolfgang Schuster