Thanks again, Hraban and Wolfgang.
Both solutions work wonderfully.
Hraban’s solution has the slight advantage that \im{a} and \im{b} inherit the
current text color.
Matthias
> On Sep 16, 2025, at 1:19 PM, Wolfgang Schuster
> <[email protected]> wrote:
>
> Am 16.09.2025 um 18:36 schrieb Matthias Weber:
>> 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
>> <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.
>
> Alternative solution:
>
> \startuseMPgraphic{DiagonalRule}
>
> draw ulcorner OverlayBox -- lrcorner OverlayBox
> withpen pencircle scaled OverlayLineWidth
> withcolor OverlayLineColor
> ;
>
> label.llft("\framedparameter{diagonaltext:t}",urcorner OverlayBox) ;
> label.urt ("\framedparameter{diagonaltext:b}",llcorner OverlayBox) ;
>
> setbounds currentpicture to OverlayBox ;
>
> \stopuseMPgraphic
>
> \defineoverlay [DiagonalRule] [\useMPgraphic{DiagonalRule}]
>
> \starttext
>
> \bTABLE[width=.8cm,height=.8cm]
> \bTR
> \bTD[background=DiagonalRule,diagonaltext:t=\im{b},diagonaltext:b=\im{a}]
> %
> \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
>
> Wolfgang
>
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
___________________________________________________________________________________
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
___________________________________________________________________________________