ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Gavin via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Gavin <gavinpublic@comcast.net>
Subject: Re: Mathematical MetaFun Mania
Date: Thu, 15 Dec 2022 09:15:47 -0700	[thread overview]
Message-ID: <4D785BE1-91F2-4E90-82A9-155E7E29DBC9@comcast.net> (raw)
In-Reply-To: <8f54f916-907b-12cf-9525-ff4a40665ae2@freedom.nl>

[-- Attachment #1: Type: text/plain, Size: 952 bytes --]

Hi Hans and List,

>> 2) Can I tell \connectboxanchors to use my MetaPost code and pass key=value pairs like I do with \setMPpositiongraphic?
> see attached ... the 'cross pages' feature is in the upcoming

This indeed passes key=value pairs, but I cannot get it to pass mine. Is there some intermediate step? Your example has a key=value pair in \connectboxanchors and which is accessed in the MetaPost code. The pair, and MetaPost code are:

  rulethickness=1pt
  mpvard “rulethickness"

However, if I change the pair and MPcode to (see attached example for full code)

  myrulethickness=1pt
  mpvard “myrulethickness"

it doesn’t work. Similarly, you have a pair and MPcode that don’t match.

  rulecolor=darkgreen
  mpvars "linecolor"

This may be a historical fluke, but it suggests that there is some intermediate translation that I am missing. Any way I can name and pass by own key=value pairs?

Thanks!
Gavin


[-- Attachment #2: mpvarQuestion.tex --]
[-- Type: application/octet-stream, Size: 1522 bytes --]

% !TEX useAlternatePath
% !TEX useConTeXtSyncParser

\continuewhenlmtxmode

\usemodule[article-basic]

\starttext

\startMPpositiongraphic{mypos:boxanchor:top}
    begingroup ;
        save f, t, p ; pair f, t ; path p ;
        f := positionxy(mpvars("from")) ;
        t := positionxy(mpvars("to")) ;
        p := f { up } .. t ;
        drawarrow p
            withpen pencircle scaled mpvard "rulethickness"
            withcolor mpvars "linecolor" ; % historically different names
        positioninregion ;
    endgroup ;
\stopMPpositiongraphic

\startMPpositiongraphic{mypos:boxanchor:bottom}
    begingroup ;
        save f, t, p ; pair f, t ; path p ;
        f := positionxy(mpvars("from")) ;
        t := positionxy(mpvars("to")) ;
        p := f { down } .. t ;
        drawarrow p
            withpen pencircle scaled mpvard "myrulethickness"
            withcolor mpvars "linecolor" ; % historically different names
        positioninregion ;
    endgroup ;
\stopMPpositiongraphic

\startboxanchoring[+]
\connectboxanchors[top]    [top]    [distance=1ex,rulethickness=1pt,rulecolor=darkgreen,mp=mypos:boxanchor:top]    {c1}{c2}
\connectboxanchors[bottom] [bottom] [distance=1ex,myrulethickness=1pt,rulecolor=darkred,  mp=mypos:boxanchor:bottom] {c2}{c3}
\startformula
    \mathboxanchored[nucleus]{c1}{e}_{\alpha}
    \mathboxanchored[nucleus]{c2}{e}^{\mu}
    \mathboxanchored[nucleus]{c3}{e}_{\dot{\beta}} = \frac{1}{\sqrt{2}}
    \sigma_{\alpha\dot{\beta}}^{\mu}
\stopformula
\stopboxanchoring

\stoptext

[-- Attachment #3: Type: text/plain, Size: 496 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2022-12-15 16:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-15  3:20 Gavin via ntg-context
2022-12-15 10:36 ` Hans Hagen via ntg-context
2022-12-15 16:15   ` Gavin via ntg-context [this message]
2022-12-15 17:21     ` Hans Hagen via ntg-context
2022-12-15 21:54       ` Otared Kavian via ntg-context
2022-12-16 16:42         ` Hans Hagen via ntg-context
2022-12-16 16:55         ` Hans Hagen via ntg-context
2022-12-18 11:03           ` Alexandre Christe via ntg-context
2022-12-21 14:05             ` Gavin via ntg-context
2022-12-21 14:29               ` Sans Math fonts, for example Computer Modern Bright Oliver Sieber via ntg-context
2022-12-21 14:41                 ` Mikael Sundqvist via ntg-context
2022-12-21 16:00               ` Mathematical MetaFun Mania Hans Hagen via ntg-context

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=4D785BE1-91F2-4E90-82A9-155E7E29DBC9@comcast.net \
    --to=ntg-context@ntg.nl \
    --cc=gavinpublic@comcast.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).