sioyek icon indicating copy to clipboard operation
sioyek copied to clipboard

Left-side equations are indexed as well and can be smart-jumped to

Open strawMarmalade opened this issue 2 years ago • 3 comments

This pull-request addresses issue https://github.com/ahrm/sioyek/issues/587

When indexing equations, left-side equations will be indexed as well.

strawMarmalade avatar Aug 01 '23 09:08 strawMarmalade

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.

ahrm avatar Aug 01 '23 10:08 ahrm

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.

strawMarmalade avatar Aug 01 '23 10:08 strawMarmalade

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.

strawMarmalade avatar Aug 01 '23 11:08 strawMarmalade