Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotations do not behave well across page flips #12

Open
lenianiva opened this issue Feb 3, 2023 · 7 comments
Open

Annotations do not behave well across page flips #12

lenianiva opened this issue Feb 3, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@lenianiva
Copy link
Contributor

lenianiva commented Feb 3, 2023

If the equation to be labeled is on the bottom of one page and LaTeX does a pagebreak right after the equation, the labels will show up in the next page with no error messages. e.g.

\[ ... \eqnmarkbox[...]{...} ...
\]
% page flip here
\annotate{...} % shows up on the next page

This can be solved by inserting a \pagebreak right after \annotate.

@st--
Copy link
Owner

st-- commented Feb 8, 2023

Hi @vleni, do you think this is something that could be fixed within the annotate-equations package code? If you have any idea what it would take, please let me know (it's my first LaTeX package!) :) We should definitely mention this in the docs until (if) we can fix it properly, if you want to propose a Pull Request for that that'd be great, otherwise I'll try to get to it soon!

@lenianiva
Copy link
Contributor Author

I'll try to produce an example of this, but here is a solution with minipage: https://tex.stackexchange.com/questions/30734/how-make-sure-two-elements-stay-on-the-same-page

I don't know if there is a programmatic way to do it without user intervention though, since tikz is unaware of whether a page flip has happened.

If you can put \annotate commands in \[ ... \] environments it might solve the issue

@st-- st-- changed the title Annotations do not behave well across page filps Annotations do not behave well across page flips Feb 14, 2023
@lenianiva
Copy link
Contributor Author

Here's an example of it: https://archives.leni.sh/stanford/CS224w.pdf

The problem happens on page 43 and 44. An annotation which is supposed to go on the bottom of P43 is on P44.

@st-- st-- added the bug Something isn't working label Oct 9, 2024
@st--
Copy link
Owner

st-- commented Oct 9, 2024

@lenianiva you should indeed be able to put the \annotate inside the equation environment; does that resolve your issue? If you could share a minimal reproducible example, I'd be happy to try and have a look at resolving it or at least explaining the issue and workaround in the manual. :)

@st-- st-- mentioned this issue Oct 9, 2024
3 tasks
@lenianiva
Copy link
Contributor Author

@lenianiva you should indeed be able to put the \annotate inside the equation environment; does that resolve your issue? If you could share a minimal reproducible example, I'd be happy to try and have a look at resolving it or at least explaining the issue and workaround in the manual. :)

Yes! That solves it.

\[
	\vec m_u^{(l)}
	:= \eqnmarkbox[orange]{w}{\learnable W_{R(u \to v)}^{\mathsf{msg}}}
	\eqnmarkbox[BrickRed]{n}{\learnable N_{T(u)}} \vec h_u^{(l-1)}
\]
\annotate[yshift=-.3em]{left,below}{w}{Weight for each edge type}
\annotate[yshift=-.3em]{right,below}{n}{Linear head for each node type}
Screenshot 2024-10-22 at 15 21 24 Screenshot 2024-10-22 at 15 21 30
\[
	\vec m_u^{(l)}
	:= \eqnmarkbox[orange]{w}{\learnable W_{R(u \to v)}^{\mathsf{msg}}}
	\eqnmarkbox[BrickRed]{n}{\learnable N_{T(u)}} \vec h_u^{(l-1)}
	\annotate[yshift=-.3em]{left,below}{w}{Weight for each edge type}
	\annotate[yshift=-.3em]{right,below}{n}{Linear head for each node type}
\]
Screenshot 2024-10-22 at 15 23 11

@st--
Copy link
Owner

st-- commented Nov 5, 2024

@lenianiva it's a bit unfortunate that it now overlaps with the footnotes -- is that fixed by adding additional \vspace inside the \[ \]?

@lenianiva
Copy link
Contributor Author

@lenianiva it's a bit unfortunate that it now overlaps with the footnotes -- is that fixed by adding additional \vspace inside the \[ \]?

This is my solution for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants