Searching for punctuation in Preview
In Preview (v 5.3 on 10.6.8), if I search for a single letter such as k
in a pdf, the program will find and highlight every instance of that letter in the pdf.
However, if I search for a punctuation mark such as ?
or ;
, it will report Found on 0 pages
, even when the document is littered with such punctuation.
How can I get preview to search for punctuation?
The reason for this is that I wish to locate all instances of missing references (denoted as [?]
) in a pdf output from LaTeX
.
(Yes, I know that LaTeX
will tell me where they are in the source file, but I wish to find them in the pdf.)
A year late but may help others:
For me escaping it in double bracket works so try searching ":"
or "?"
.
Escaping in double quotes searches for whatever is between the quotes similar to the way google does their search options.
Does it have to be in Preview? Preview doesn't seem to have this functionality as of El Capitan (10.11). However, I have found and tested two ways that you can search PDF files for punctuation.
- Acrobat Reader
pdfgrep
Acrobat Reader
Using Adobe Acrobat, I simply entered the punctuation into the search field in this case a colon (:) and Acrobat found all instances of it.
Note: I did successfully test out the question mark (?) and it worked. Unfortunately, the only document I had at the ready had personal info on it so I couldn't use it as an example. However, I made sure to test different punctuation from periods, exclamation points, question marks, commas, etc. and all worked.
pdfgrep
pdfgrep is the PDF equivalent to the command line (CLI) utility grep
. The useage is simple:
pdfgrep [OPTIONS] PATTERN FILE
So, to search for a comma, and have it tell you what page number it occurs on, simply issue the command:
pdfgrep -n "?" foobar.pdf
pdfgrep
is FOSS software and available on Homebrew and MacPorts. See man pdfgrep
for more info.