ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen via ntg-context <ntg-context@ntg.nl>
To: ntg-context@ntg.nl
Cc: Hans Hagen <j.hagen@xs4all.nl>
Subject: Re: \hpos in math - Half solved
Date: Wed, 7 Dec 2022 23:25:51 +0100	[thread overview]
Message-ID: <87e286f8-9785-28b8-93ba-6ac46cce404e@xs4all.nl> (raw)
In-Reply-To: <C197037B-6D29-472B-B43E-2A645CBA7E38@comcast.net>

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

On 12/7/2022 1:42 PM, Gavin via ntg-context wrote:
> Hi List,
> 
> I solved my original problem 2, allowing me to reuse the same \hpos labels in different equations without interference. I added an equation counter and set up my custom math version of \hpos to use the count as part of the label internally. I tried to do this with a regular ConTeXt counter, but had all sorts of mysterious, wrong behavior. When I switched to using a Lua counter, everything worked immediately. So, while there is nothing brilliant about this solution, I’ll share it for anyone who might want to do something similar in the future.
attached an example by Mikael ... it should work with tonights update

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------

[-- Attachment #2: 221206-3.mkxl --]
[-- Type: text/plain, Size: 1334 bytes --]

 \usemodule[article-basic]

\starttext

\startboxanchoring[+]
\connectboxanchors[top]    [top]    [distance=1ex] {c1}{c2}
\connectboxanchors[bottom] [bottom] [distance=1ex] {d1}{d2}
\startformula
    \mathboxanchored[nucleus]{c1}{e}_{\alpha}
    \mathboxanchored[nucleus]{c2}{e}^{\mu}
    \mathboxanchored[nucleus]{d1}{todo}
    \mathboxanchored[nucleus]{d2}{e}_{\dot{\beta}} = \frac{1}{\sqrt{2}}
    \sigma_{\alpha,\dot{\beta}}^{\mu}
\stopformula
\stopboxanchoring

\startboxanchoring[+]
\connectboxanchors[top]    [top]    [distance=0.5ex,arrow=no] {c1}{c2}
\connectboxanchors[bottom] [bottom] [distance=0.5ex,arrow=no] {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

\startboxanchoring[+]
\connectboxanchors[top]    [top]    [text={\smallinfofont upper limits}]{b1}{b2}
\connectboxanchors[bottom] [bottom] [text={\smallinfofont lower limits}]{a1}{a2}
\startformula
\int_{\mathboxanchored{a1}{0}}^{\mathboxanchored{b1}{1}} \frac{1}{1+x^2} \dd x
=
\int_{\mathboxanchored{a2}{0}}^{\pi\mathboxanchored{b2}{/}4} \frac{1}{1+\tan^2 t}(1+\tan^2 t)\dd t
\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
___________________________________________________________________________________

  parent reply	other threads:[~2022-12-07 22:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-05 23:39 \hpos in math Gavin via ntg-context
2022-12-06  9:15 ` Hans Hagen via ntg-context
2022-12-06 13:22   ` Gavin via ntg-context
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 [this message]
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=87e286f8-9785-28b8-93ba-6ac46cce404e@xs4all.nl \
    --to=ntg-context@ntg.nl \
    --cc=j.hagen@xs4all.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).