Created attachment 134886 [details] Video showing the bug SUMMARY STEPS TO REPRODUCE 1. Open any pdf (tested with two) containing uncommon characters (see attachments) 2. Try to select the said characters with the text selection tool OBSERVED RESULT The selection tool selects more than just the character, somehow selecting the line below as well. This can be seen when trying to copy the selection (in Kate for instance). It not only copies the character but also the line below it (if there is one, else it copies only the selected text, as expected). I thought it might be an issue with the pdf but trying the same thing with Firefox's pdf reader doesn't give me this behavior so it has something to do with Okular. EXPECTED RESULT The selection tool should behave the same way with those uncommon characters. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Manjaro 20.2 (available in About System) KDE Plasma Version: KDE Plasma 5.20.4 KDE Frameworks Version: 5.77 Qt Version: 5.15 ADDITIONAL INFORMATION I noticed that when trying to read with Okular a txt file with those characters in it, Okular fails to do it. Maybe something to do with the encoding? Also not related to the bug, but just want to thank every contributor to Okular, it really is an amazing tool!
Created attachment 134888 [details] Pdf containing uncommon characters
Oops, just saw a few typos in my initial report, too bad I can't edit it... Sorry for that.
I did some tests and apparently it's only happening when the PDF was made with LaTeX. The same characters in LaTeX documents having problems with Okular don't have any issue if they are found in, for instance, a document made with LibreOffice. Therefore, I guess it's not an issue with Okular but rather with LaTeX. I don't know if something can be done on Okular's side, so I'll leave it open for the time being but feel free to close it if nothing can be done.
The only thing wrong is the PDF file, it is reporting a bigger than needed bounding box for the "special" characters like ∇ so when we select that character we make the rectangle bigger. It could maybe be changed to not have a rectangle but N rectangles if one of the characters in the middle is taller, but that would look weird real soon.
You are right, the PDF is really strange. This issue is one of many I encounter while selecting text in this document whereas before it, I've never stumbled upon anything like that. I don't know how it was made, but the funny thing is that I have received two different PDFs from two different persons with the same issues. Might it be related to the fact that the two of them were transferred through Moodle (this being the other common thing between the two in addition to LaTeX)? I don't know, I'm just curious how these things come to happen. All in all, as you said, it's not really an issue with Okular. I'll change the title.