Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Raymono

macrumors newbie
Original poster
Sep 21, 2023
2
1
As the title says - pdf document has words like "try_move", but even with exact phrase selected, search does not find it. Also, copy paste to the clipboard (command-C) does not capture the '_' underscore characters - instead they are converted to ' ' space.

This is the document I'm looking at:
 
Out of curiosity, I created a PDF with some underscores. Then I opened the PDF in Preview on a computer running macOS 13.6 (and a second computer running macOS 12.6.9). I am able to successfully search for underscores. I am also able to successfully copy underscores from the body and paste them into the search box.

screenshot_preview_search_underscore.png


I did not try the linked PDF. Could that PDF possibly contain abnormal underscore characters?
 
  • Like
Reactions: Raymono
In your case it´s a special font mapping of a font called CMTI10. The Space character (UTF-8: 20) is visualized by a Low Line character (UTF-8: 5F). You can find that out by Copy and Paste the text into a Hex Editor.

Practically you must search for "try move" not for "try_move".
It has nothing to do with macOS or Preview, just blame the font.

There might be some reason why the linked PDF makes use of such a font, maybe the document´s origin from Tex (LaTex). Ask the authors Don Woods and Don Knuth to find out more. Finally, they did that text in 1998 and maybe there was no better way of doing what they did at that time.
 
In your case it´s a special font mapping of a font called CMTI10. The Space character (UTF-8: 20) is visualized by a Low Line character (UTF-8: 5F). You can find that out by Copy and Paste the text into a Hex Editor.

Practically you must search for "try move" not for "try_move".
It has nothing to do with macOS or Preview, just blame the font.

There might be some reason why the linked PDF makes use of such a font, maybe the document´s origin from Tex (LaTex). Ask the authors Don Woods and Don Knuth to find out more. Finally, they did that text in 1998 and maybe there was no better way of doing what they did at that time.
Many thanks - I'd love to get a reply from Don Knuth, but not holding my breath.
 
  • Like
Reactions: organicCPU
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.