ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Henning Hraban Ramm <texml@fiee.net>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: [NTG-context] Re: MetaPost lines in tables?
Date: Wed, 21 Feb 2024 19:04:16 +0100	[thread overview]
Message-ID: <dba5729c-5191-41dc-8df4-20363f5a0e9e@fiee.net> (raw)
In-Reply-To: <d58ef5b3-0624-5321-3b34-ff25d7986ef8@gmail.com>

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
___________________________________________________________________________________
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
___________________________________________________________________________________

  reply	other threads:[~2024-02-21 18:08 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 [this message]
2024-02-21 18:43     ` Wolfgang Schuster
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=dba5729c-5191-41dc-8df4-20363f5a0e9e@fiee.net \
    --to=texml@fiee.net \
    --cc=ntg-context@ntg.nl \
    /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).