Hi, Wolfgang wrote, there was some time already, a nice macro to draw a brace. In the code below, how to have the arrow and the text to the right of the brace ? Best regards, Fabrice \startuseMPgraphic{accolade} z1 = (-233,0) ; z2 = (-220,22) ; z3 = (-155,211) ; z4 = (-200,690) ; z5 = (-142,1033) ; z6 = (-97,1106) ; z7 = (-71,1125) ; z8 = (-61,1104) ; z9 = (-80,1077) ; z10 = (-108,1002) ; z11 = (-129,666) ; z12 = (-117,207) ; z13 = (-197,19) ; z14 = (-208,0) ; z15 = (-197,-19) ; z16 = (-117,-207) ; z17 = (-129,-666) ; z18 = (-108,-1026) ; z19 = (-80,-1077) ; z20 = (-61,-1104) ; z21 = (-71,-1125) ; z22 = (-97,-1106) ; z23 = (-143,-1031) ; z24 = (-199,-673) ; z25 = (-155,-211) ; z26 = (-220,-22) ; fill z1 for i=2 upto 14: .. z[i] endfor & z14 for j=15 upto 26: .. z[j] endfor .. z1 & cycle withcolor red ; \stopuseMPgraphic \defineoverlay[leftbrace] [\leftaligned {\scale[height=\overlayheight]{\useMPgraphic{accolade}}}] \defineoverlay[rightbrace][\rightaligned{\mirror{\scale[height=\overlayheight]{\useMPgraphic{accolade}}}}] \starttext \framedtext[frame=off,loffset=1em,roffset=1em,background={rightbrace}]{ La longueur est \unit{4 centimeter} ; on donne à $L$ la valeur $4$. La largeur est \unit{3 centimeter} ; on donne à $l$ la valeur $3$. } \dontleavehmode\startMPcode drawarrow (0,0)--(2cm,0) withpen pencircle scaled 1pt withcolor red ; \stopMPcode\hskip 1cm \color[red]{Initialisation} \stoptext
On 02/01/2015 01:39 PM, Fabrice Couvreur wrote:
Hi, Wolfgang wrote, there was some time already, a nice macro to draw a brace. In the code below, how to have the arrow and the text to the right of the brace?
Hi Fabrice, this does what you asked (vertical centering might be achieved with a table or something similar [I’m in a hurry right now]): \starttext \dontleavehmode\framedtext[frame=on,loffset=1em,roffset=1em,background={rightbrace}]{ La longueur est \unit{4 centimeter} ; on donne à $L$ la valeur $4$. La largeur est \unit{3 centimeter} ; on donne à $l$ la valeur $3$. } \startMPcode drawarrow (0,0)--(1cm,0) withpen pencircle scaled 1pt withcolor red ; \stopMPcode\hskip 0.5cm \color[red]{Initialisation} \stoptext \dontleavehmode should be at the begining of the paragraph. I hope it helps, Pablo -- http://www.ousia.tk
Hi Pablo, By searching, I found this : "Some commands like \framed http://wiki.contextgarden.net/Command/framed cause line breaks to happen if used in vertical mode, e.g. at the beginning of a line." This explains my problem and soultion you propose. Thanks, Fabrice
participants (3)
-
Fabrice
-
Fabrice Couvreur
-
Pablo Rodriguez