Dear All (a last question for today…)
I am following the example from the wiki at
https://wiki.contextgarden.net/Tables/Natural_tables_with_TABLE#Diagonal_rules
The first part is just copied, and works fine.
I would like the cells to be perfect squares, which is why I added \setupTABLE
[start] [width=.8cm, height=.8cm].
That works, too, but the letter a from the diagonal label is now in the second
row. I don’t know whether I need to modify the definition of
DiagonalLabel, or my setupTABLE isn’t right.
Thanks (again, and again, and again)!
Matthias
\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 [start] [width=.8cm, height=.8cm]
\bTABLE
\bTR
\bTD [background=DiagonalRule]
\DiagonalLabel{$a$}{$b$}
\eTD
\bTD 0 \eTD
\bTD 1 \eTD
\eTR
\bTR
\bTD 0 \eTD
\bTD 1 \eTD
\bTD 2 \eTD
\eTR
\bTR
\bTD 2 \eTD
\bTD 2 \eTD
\bTD 2 \eTD
\eTR
\eTABLE
\stoptext___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : [email protected] /
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________