From: Mikael Sundqvist <mickep@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: [NTG-context] Re: Question about matrices with vertical and horizontal lines (and now adding arrows between cells)
Date: Thu, 27 Feb 2025 21:52:06 +0100 [thread overview]
Message-ID: <CAHy-LL-6ZTC43C8s8xYWhk40Jwz7fiuXEuVfey7zxDXesOwc7g@mail.gmail.com> (raw)
In-Reply-To: <FFBB0296-727B-46DF-B1E9-961D1625FF50@gmail.com>
Hi,
On Thu, Feb 27, 2025 at 9:04 PM Matthias Weber
<matthiasweber64@gmail.com> wrote:
>
> Thanks!
>
> Now, I would like to have arrows between cells. I have tried using overlays (see below), and I understand that an overlay is centered within the cell. How do I move the arrow so that it points from 6 to 7, for instance?
> (Starting a little to the right and above the 6, ending below and to the left of the 7)
>
> Matthias
>
>
>
> \starttext
> \startuseMPgraphic{DiagonalArrow}
> numeric w, h;
> w := OverlayWidth ;
> h := OverlayHeight ;
> draw lmt_arrow [ path =((.5*w,.5*w) -- (2*w,2*w)), ]
> withpen pencircle
> scaled (h/40)
> withcolor "darkgreen" ;
> \stopuseMPgraphic
>
> \defineoverlay
> [DiagonalArrow]
> [\useMPgraphic{DiagonalArrow}]
>
>
> \setupTABLE[c][width=1cm,offset=overlay,align={middle,lohi}]
> \setupTABLE[r][height=1cm]
> \bTABLE
> \bTR \bTD 17 \eTD \bTD 24 \eTD \bTD 1 \eTD \bTD 8\eTD \bTD 15 \eTD \eTR
> \bTR \bTD 23 \eTD \bTD 5 \eTD \bTD 7 \eTD \bTD 14\eTD \bTD 16 \eTD \eTR
> \bTR \bTD 4 \eTD \bTD [background=DiagonalArrow] 6 \eTD \bTD 13 \eTD \bTD 20\eTD \bTD 22 \eTD \eTR
> \bTR \bTD 10 \eTD \bTD 12 \eTD \bTD 19 \eTD \bTD 21\eTD \bTD 3 \eTD \eTR
> \bTR \bTD 11 \eTD \bTD 18 \eTD \bTD 25 \eTD \bTD 2\eTD \bTD 9 \eTD \eTR
> \eTABLE
> \stopExample
>
> \stoptext
>
Maybe https://www.pragma-ade.com/general/manuals/metafun-p.pdf,
section 5, Positional graphics, is what you look for?
/Mikael
___________________________________________________________________________________
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:[~2025-02-27 20:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-27 2:16 [NTG-context] Question about matrices with vertical and horizontal lines Matthias Weber
2025-02-27 11:09 ` [NTG-context] " Mikael Sundqvist
2025-02-27 20:03 ` [NTG-context] Re: Question about matrices with vertical and horizontal lines (and now adding arrows between cells) Matthias Weber
2025-02-27 20:52 ` Mikael Sundqvist [this message]
2025-02-27 21:14 ` Matthias Weber
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=CAHy-LL-6ZTC43C8s8xYWhk40Jwz7fiuXEuVfey7zxDXesOwc7g@mail.gmail.com \
--to=mickep@gmail.com \
--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).