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

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

strawMarmalade
Copy link

This pull-request addresses issue #587

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

@ahrm
Copy link
Owner

ahrm commented Aug 1, 2023

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.

@strawMarmalade
Copy link
Author

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants