# Avoid that star symbol is searchable with questionmark "?"

Given the following minimal example:

\documentclass{article}
\begin{document}
$a \star b$.
\end{document}


This produces the desired output in the PDF file.

However, my problem is that if I search in the PDF file (with CTRL-F) for the questionmark character "?" (without quotation marks), that this specific star symbol is found by the search engine as if it were a questionmark (although it is a star).

This is annoying, because I like to search my final PDF for questionmarks in order to find outdated labels/citations etc. quickly. If there are lots of symbols like \star, that are found as "false positives", this workflow gets tedious and error prone.

Question: Is there a way to fix this issue? I want to use symbols like \star in my document but I don't want to find them in the final PDF when searching for questionmarks.

• May 31, 2019 at 10:30
• As a side note: Why don't you use LaTeX's warning messages to find undefined references? May 31, 2019 at 11:18
• @schtandard Mainly as a double safety check and because the log files can become quite long from warnings that are intentionally ignored (might be because the original template is already shipped like that). May 31, 2019 at 11:45

You can try glyphtounicode:

\documentclass{article}
\input glyphtounicode
\pdfgentounicode=1
\begin{document}
$a \star b$.
\end{document}

• +1: Is there a reference for glyphtounicode somewhere? May 31, 2019 at 10:07
• @Dr.ManuelKuehner See the pdftex documentation. May 31, 2019 at 10:10
• That seems to work, thank you. May 31, 2019 at 10:11
• @SampleTime Possible alternative: The pdftex manuals states, that the ctan.org/pkg/cmap package has the same effect (LATEX users could load the cmap package to achieve the same effect.). But I think that Ulrike's approach is more general and safer (see tex.stackexchange.com/questions/451235). May 31, 2019 at 10:27