Left-side equations are indexed as well and can be smart-jumped to
This pull-request addresses issue https://github.com/ahrm/sioyek/issues/587
When indexing equations, left-side equations will be indexed as well.
When equations are on the left-hand side, for whatever reason for non-optimal OCR, the equation is trailed by some character, so that we have to compare distance of the last
I don't think this is true for all PDFs. This might be specific to the PDFs that you are testing.
Yeah, you're probably right. When I latex my own pdfs with equations on the left side, there is no trailing character (but these will nowadays have hyperlinks anyways which would make this detection obsolete). Otherwise, I've tested it against two other examples of OCR'ed pdfs (using ocrmypdf) which both have the described issue.
However, even in the case that a PDF does not have such a trailing character after an equation, it should be relatively insignificant. After all, if a matching regex is not the actual equation, then it's probably part of a body of text and the distance between its last character and the character two further is still relatively small and should not be indexed. But I agree with you that it is not an optimal solution.