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: mathboxanchored.pdf
Description: Adobe PDF document

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
___________________________________________________________________________________
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 via email to