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: \hpos in math
Date: Tue, 6 Dec 2022 06:22:09 -0700	[thread overview]
Message-ID: <92EB18D7-92EE-41F5-B0AE-E1246E9E15A0@comcast.net> (raw)
In-Reply-To: <eaa0dee7-10ef-fadb-9131-b681c1a1cbe7@freedom.nl>

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

Hi Hans,

> On Dec 6, 2022, at 2:15 AM, Hans Hagen via ntg-context <ntg-context@ntg.nl> wrote:
> On 12/6/2022 12:39 AM, Gavin via ntg-context wrote:
>> 1) Is there a mathematics version of \hpos? The contents of \hpos are set as text, even when \hpos is in mathematics, so I wrote an \mpos macro that uses \hpos but sets the contents as display-style math. This isn’t great for spacing, and it does't adapt to different math styles. \framed has a math version, \mframed, that sets the contents in the appropriate math style. If anyone know a way to accomplish that with \hpos, I’d love to know.
> 
> there actually is a subsystem that keeps math as-is-it (styles and spacing and such), see attached

I tried using \mathboxanchored, and was able to get the bottom two equations shown here. (The top equation uses \hpos, for comparison.)


[-- Attachment #2: mathboxanchored.pdf --]
[-- Type: application/pdf, Size: 15881 bytes --]

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


There are two problems that I didn’t know how to fix.

1) The line connects to the box including the subscript or superscript, not just to the e.
2) I cannot make multiple connections to a single object, like the e^\mu in the center. If I try to connect top and bottom, I get no connections anywhere in the entire document.

The code for the formulas is:

\startformula
  % Each \connectboxanchors works alone, but both together make trouble:
    \connectboxanchors[top][top]{X}{Y}
    %\connectboxanchors[bottom][bottom]{Y}{Z}
  \mathboxanchored{X}{e}_\alpha \mathboxanchored{Y}{e}^\mu \mathboxanchored{Z}{e}_{\dot\beta}
    = \textfrac{1}{\sqrt{2}}\sigma_{\alpha\dot\beta}^\mu
\stopformula

I added code to turn the arrow produced by \connectboxanchors into my contraction overlay, but that doesn’t affect these issues.

> in your example we need a way to anchor on just the 'e' right? or do you want it on the e + super/subscript?

Yes, we only need to anchor to e. 

Thanks!
Gavin

[-- Attachment #4: 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-06 13:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-05 23:39 Gavin via ntg-context
2022-12-06  9:15 ` Hans Hagen via ntg-context
2022-12-06 13:22   ` Gavin via ntg-context [this message]
2022-12-07 12:42     ` \hpos in math - Half solved Gavin via ntg-context
2022-12-07 15:30       ` Hans Hagen via ntg-context
2022-12-07 22:25       ` Hans Hagen via ntg-context
2022-12-08  0:03         ` Gavin via ntg-context
2022-12-08  6:14           ` Mikael Sundqvist via ntg-context
2022-12-08 19:54             ` Otared Kavian via ntg-context
2022-12-08 21:47               ` 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=92EB18D7-92EE-41F5-B0AE-E1246E9E15A0@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).