Hi. (Sorry for unclear question in topic.) I want to put a brace (right or left isn't matter now) in a TABLE (may be another table environment) like in below scheme a11 a12| a13 a21 a22| a23 a31 a32 a33 a41 a42 a43 a51 a52| a53 a61 a62| a63 Here '|' marks place and elements which should be grouped by a brace. Thanks in advance, Vladimir Lomov. P.S. I'm new in context and don't have any idea how to achieve this. I thought about graphics (metapost) to draw a brace or join two cells and draw big brace. And, yes I use mkiv and latest beta (context minimal). -- Show your affection, which will probably meet with pleasant response.
Am 20.05.10 11:45, schrieb Vladimir Lomov:
Hi.
(Sorry for unclear question in topic.)
I want to put a brace (right or left isn't matter now) in a TABLE (may be another table environment) like in below scheme
a11 a12| a13 a21 a22| a23 a31 a32 a33 a41 a42 a43 a51 a52| a53 a61 a62| a63
Here '|' marks place and elements which should be grouped by a brace.
Thanks in advance, Vladimir Lomov.
P.S. I'm new in context and don't have any idea how to achieve this. I thought about graphics (metapost) to draw a brace or join two cells and draw big brace. And, yes I use mkiv and latest beta (context minimal).
You can play with this: \def\linkeklammer {\setbox\scratchbox\hbox{$\left\{\vrule height .5\vsize depth .5\vsize width 0pt\relax\right.$}% \rightaligned{\hbox to .5\wd\scratchbox{\raise\dp\scratchbox\box\scratchbox\hss}}} \def\rechteklammer {\setbox\scratchbox\hbox{$\left.\vrule height .5\vsize depth .5\vsize width 0pt\relax\right\}$}% \leftaligned{\hbox to .5\wd\scratchbox{\hss\raise\dp\scratchbox\box\scratchbox}}} \defineoverlay[linkeklammer] [\linkeklammer] \defineoverlay[rechteklammer][\rechteklammer] \starttext \bTABLE \bTR[align={middle,middle},frame=off,offset=1ex] \bTD[background=linkeklammer] text \eTD \bTD text\\text\\text \eTD \bTD[background=rechteklammer] text \eTD \eTR \eTABLE \stoptext and this: \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 ; \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={leftbrace,rightbrace}]{\input knuth\par} \setupTABLE[frame=off,offset=1ex] \setupTABLE[row][each][align={middle,lohi}] \bTABLE \bTR \bTD[nr=3,background=leftbrace] drei \eTD \bTD[nr=2,background=leftbrace] zwei \eTD \bTD f \eTD \bTD o \eTD \bTD u \eTD \bTD r \eTD \bTD [nr=3,background=rightbrace] three \eTD \eTR \bTR \bTD [background=leftbrace] eins \eTD \bTD null \eTD \bTD [background=rightbrace] one \eTD \bTD [nr=2,background=rightbrace] two \eTD \eTR \bTR \bTD v \eTD \bTD i \eTD \bTD e \eTD \bTD r \eTD \eTR \eTABLE \stoptext Wolfgang
** Wolfgang Schuster [2010-05-20 13:04:15 +0200]: '>' = Wolfgang Schuster '>>' = Vladimir Lomov
Hi.
(Sorry for unclear question in topic.)
I want to put a brace (right or left isn't matter now) in a TABLE (may be another table environment) like in below scheme
a11 a12| a13 a21 a22| a23 a31 a32 a33 a41 a42 a43 a51 a52| a53 a61 a62| a63
Here '|' marks place and elements which should be grouped by a brace.
Thanks in advance, Vladimir Lomov.
P.S. I'm new in context and don't have any idea how to achieve this. I thought about graphics (metapost) to draw a brace or join two cells and draw big brace. And, yes I use mkiv and latest beta (context minimal).
You can play with this:
\def\linkeklammer {\setbox\scratchbox\hbox{$\left\{\vrule height .5\vsize depth .5\vsize width 0pt\relax\right.$}% \rightaligned{\hbox to .5\wd\scratchbox{\raise\dp\scratchbox\box\scratchbox\hss}}}
\def\rechteklammer {\setbox\scratchbox\hbox{$\left.\vrule height .5\vsize depth .5\vsize width 0pt\relax\right\}$}% \leftaligned{\hbox to .5\wd\scratchbox{\hss\raise\dp\scratchbox\box\scratchbox}}}
\defineoverlay[linkeklammer] [\linkeklammer] \defineoverlay[rechteklammer][\rechteklammer]
\starttext
\bTABLE \bTR[align={middle,middle},frame=off,offset=1ex] \bTD[background=linkeklammer] text \eTD \bTD text\\text\\text \eTD \bTD[background=rechteklammer] text \eTD \eTR \eTABLE
\stoptext
and this:
\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 ; \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={leftbrace,rightbrace}]{\input knuth\par}
\setupTABLE[frame=off,offset=1ex] \setupTABLE[row][each][align={middle,lohi}] \bTABLE \bTR \bTD[nr=3,background=leftbrace] drei \eTD \bTD[nr=2,background=leftbrace] zwei \eTD \bTD f \eTD \bTD o \eTD \bTD u \eTD \bTD r \eTD \bTD [nr=3,background=rightbrace] three \eTD \eTR \bTR \bTD [background=leftbrace] eins \eTD \bTD null \eTD \bTD [background=rightbrace] one \eTD \bTD [nr=2,background=rightbrace] two \eTD \eTR \bTR \bTD v \eTD \bTD i \eTD \bTD e \eTD \bTD r \eTD \eTR \eTABLE
\stoptext
Thank you Wolfgang for examples. Now I got idea of background. Nice. But actually I want something different. I couldn't describe this more clearly than before so I attach PDF file that shows what I want to do. (I made it with the help of asymptote: first I made a table in LaTeX, then the table was put in background and after braces and letters were placed on top of the table.) I thought may be there is context (mkiv) way to do this, i.e. one could specify which rows in a column to be grouped and what symbol will be put after a brace. If there is no simple (elegant, context-way?) solution then I have to use "non-elegant" (imho, ugly) way: add an additional column with brace and symbol. --- WBR, Vladimir Lomov. P.S. I'm impressed how you made a brace in metapost. I alway wonder how people could write numbers that gives a nice figure (may be by triali and error?). -- The reason that every major university maintains a department of mathematics is that it's cheaper than institutionalizing all those people.
participants (2)
-
Vladimir Lomov
-
Wolfgang Schuster