Divided cells and bullet points in tables
Hi, I'm trying to create a table with the following formatting: 1. The top left cell is divided in two by a diagonal line with separate text into each triangle 2. Another cell in the table body has a bulleted list I've had no success with the first. With the second I've tried using the \startitemize command. It generates the bullet points but places all the items on a single line and hence pushing the table wider than the page. I've also tried using \par or \newline but to no avail. I have been using tabulate for the table; is there another table library that might make this work? Any help would be much appreciated. Thank you, Malte.
On 2012-08-30 Malte Stien
1. The top left cell is divided in two by a diagonal line with separate text into each triangle
This should get you started: http://article.gmane.org/gmane.comp.tex.context/67721
2. Another cell in the table body has a bulleted list
This is possible with natural tables. Marco
Hi Malte,
1. The top left cell is divided in two by a diagonal line with separate text into each triangle
This should get you started: http://article.gmane.org/gmane.comp.tex.context/67721
That solution is very hackish and the result ugly. Here is a more clean solution. It has (at least ) one caveat: Because the first tabulate column is set in paragraph mode, it will eat up as much space as *possible*, in contrast to occupying as much space as *necessary*. That is why the width of the column has to be set explicitly. \startuseMPgraphic{DiagonalRule} rulethickness := \frameddimension{rulethickness}; drawoptions( withpen pencircle scaled rulethickness withcolor \MPcolor{\framedparameter{framecolor}}); pair leftcorner, rightcorner; leftcorner := (rulethickness, \overlayheight-rulethickness); rightcorner := (\overlaywidth-rulethickness, rulethickness); draw leftcorner -- rightcorner; \stopuseMPgraphic \defineoverlay [DiagonalRule] [\useMPgraphic{DiagonalRule}] \define[2]\DiagonalLabel{% \setuptabulate [after={\blank[\frameddimension{offset}]}] \starttabulate [|p|r|] \NC \NC #2 \NC\NR \NC #1 \NC \NC\NR \stoptabulate } \starttext \setupTABLE [1] [width=2cm] \bTABLE \bTR \bTD [background=DiagonalRule] \DiagonalLabel{Foo}{Bar} \eTD \bTD Second \eTD \bTD Third \eTD \eTR \bTR \bTD Alpha \eTD \bTD Beta \eTD \bTD Gamma \eTD \eTR \eTABLE \stoptext Marco
Am 30.08.2012 um 13:48 schrieb Malte Stien
Hi,
I'm trying to create a table with the following formatting:
1. The top left cell is divided in two by a diagonal line with separate text into each triangle 2. Another cell in the table body has a bulleted list
I've had no success with the first. With the second I've tried using the \startitemize command. It generates the bullet points but places all the items on a single line and hence pushing the table wider than the page. I've also tried using \par or \newline but to no avail.
I have been using tabulate for the table; is there another table library that might make this work?
Use natural tables or xtables where you can use the background/overlay mechanism. \startuseMPgraphic{table:line:diagonal} draw lrcorner OverlayBox -- ulcorner OverlayBox withpen pencircle scaled \frameddimension{rulethickness} withcolor \MPcolor{\framedparameter{framecolor}} ; draw textext.llft("\strut\getvariable{table:diagonal}{first}") shifted (OverlayWidth-\frameddimension{offset},OverlayHeight-\frameddimension{offset}) ; draw textext.urt ("\strut\getvariable{table:diagonal}{second}") shifted (\frameddimension{offset},\frameddimension{offset}) ; setbounds currentpicture to OverlayBox ; \stopuseMPgraphic \defineoverlay[table:line:diagonal][\useMPgraphic{table:line:diagonal}] \starttext \bTABLE[width=4cm,height=4cm] \bTR \bTD[background=table:line:diagonal] \setgvariables[table:diagonal][first=Risk,second=Probabality] \eTD \bTD C1 \eTD \bTD C2 \eTD \eTR \bTR \bTD R1 \eTD \bTD \startitemize \startitem Item 1 \stopitem \startitem Item 2 \stopitem \stopitemize \eTD \bTD \eTD \eTR \bTR \bTD R2 \eTD \bTD \eTD \bTD \eTD \eTR \eTABLE \stoptext Wolfgang
participants (3)
-
Malte Stien
-
Marco Patzer
-
Wolfgang Schuster