annotate-equations icon indicating copy to clipboard operation
annotate-equations copied to clipboard

can't layer eqnmarkbox with eqnmark (can't make hierarchical labels)

Open codercahol opened this issue 2 years ago • 4 comments

I want to create layered/hierarchical labels. For example, a group of terms within parentheses are the "background contribution" and the individual terms might be the "first order" and "trailing order". The overbar/curly brace shown in the original demo by Sibin covers this usecase but there is no easy way of replicating that with the current package.

Right now, in the following cod the annotation for \eqnmarkbox{Background} does not appear, only the colored box appears:

\begin{equation}
y(x) = \eqnmarkbox[blue]{Background}{
    (\eqnmark[red]{term1}{A}     +       \eqnmark[green]{term2}{B})
}
\end{equation}
\annotate[yshift=-1em]{below}{Background}{background term}
\annotate[yshift=0.5em]{left}{A}{first term}
\annotate[yshift=1em]{}{B}{second term}

codercahol avatar Jul 13 '23 06:07 codercahol

(Next time, it would be great if you could provide the code for reproducing your issue as a complete, self-contained and compilable "minimal reproducible example"! It's much easier if I can simply copy&paste and compile to see what the issue is, instead of first having to figure out what to put into the preamble...)

st-- avatar Jul 18 '23 14:07 st--

I had to fix your example a bit (the node labels are term1 and term2, not A and B), ~but then it seems to work fine for me:~ image

Edit: just realized it was the annotation text, not the background highlighting, that wasn't working. Ok, this is actually a bug. I think the issue might be the internal handling of the node counter :thinking: I'll have to get back to this after I'm back from holidays though.

st-- avatar Jul 18 '23 14:07 st--