Am 19.02.24 um 23:15 schrieb Wolfgang Schuster:
Henning Hraban Ramm schrieb am 19.02.2024 um 22:39:
I guess I asked this a while ago, but I can’t find an answer: Is it possible to replace the lines of a TABLE with my own MetaPost graphics?
ATM I’m trying to place my MP lines behind a frame-less TABLE; it will probably work, but it’s a crutch…
The example below draws a custom border for the whole cell but you're free to draw only certain sides (leftboundary etc. helps) but don't forget to set the boundary box for the graphic (OverlayBox is the size of the cell).
%%%% begin example \startuseMPgraphic{dottedborder} draw OverlayBox withpen pencircle scaled 2 dashed withdots withcolor "red"; \stopuseMPgraphic
\defineoverlay[dottedborder][\useMPgraphic{dottedborder}]
\starttext
\bTABLE[frame=off,background=dottedborder]
Thank you! Since I needed only horizontal lines, I forced the height with an “invisible“ line: \startuseMPgraphic{dottedborder} draw (0,0)--(0,OverlayHeight) withpen pencircle scaled 0.001 withcolor white; draw (0,0)--(OverlayWidth,0) withpen pencircle scaled 2 dashed withdots withcolor "red"; \stopuseMPgraphic … but it would be visible on a colored background. I’m sure you can show me a better way… My real life example (p.2 in https://yemaya.fiee.net/s/DEEHs5m49yftiqW) involves sketchy lines, and there it’s a bit annoying that the row is not its own frame that could get a continuous background… Well, it’s good enough, I’ll settle for it. Hraban