st-- / annotate-equations

LaTeX package and annotated examples for annotating equations using TikZ.
MIT License
449 stars 18 forks source link

Annotations do not behave well across page flips #12

Open lenianiva opened 1 year ago

lenianiva commented 1 year ago

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-- commented 1 year ago

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 commented 1 year ago

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

lenianiva commented 1 month ago

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.