From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
Henning Hraban Ramm <texml@fiee.net>
Subject: [NTG-context] Re: MetaPost lines in tables?
Date: Wed, 21 Feb 2024 19:43:46 +0100 [thread overview]
Message-ID: <1739c9f7-6522-f702-87eb-e3f7231e7532@gmail.com> (raw)
In-Reply-To: <dba5729c-5191-41dc-8df4-20363f5a0e9e@fiee.net>
Henning Hraban Ramm schrieb am 21.02.2024 um 19:04:
> 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…
\startuseMPgraphic{dottedborder}
draw bottomboundary OverlayBox withpen pencircle scaled 2 dashed
withdots withcolor "red";
setbounds currentpicture to OverlayBox;
\stopuseMPgraphic
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / 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
___________________________________________________________________________________
next prev parent reply other threads:[~2024-02-21 18:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-19 21:39 [NTG-context] " Henning Hraban Ramm
2024-02-19 22:15 ` [NTG-context] " Wolfgang Schuster
2024-02-21 18:04 ` Henning Hraban Ramm
2024-02-21 18:43 ` Wolfgang Schuster [this message]
2024-02-21 18:47 ` Henning Hraban Ramm
2024-02-22 17:35 ` Hans Hagen via ntg-context
2024-02-22 18:12 ` Henning Hraban Ramm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1739c9f7-6522-f702-87eb-e3f7231e7532@gmail.com \
--to=wolfgang.schuster.lists@gmail.com \
--cc=ntg-context@ntg.nl \
--cc=texml@fiee.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).