# Can anything be done to add superscript letters to words, without messing up PDF Search functionality?

I am creating a PDF Bible for personal use; it includes both footnotes (which are superscripted numbers appended to the end of certain words), and margin cross-references (which are superscripted letters prepended to the front of certain words).

The cross-references are nothing more than this command, applied to words in the text:

command: \newcommand{\mref}[1]{\textsuperscript{\textit{\textcolor{blue}{#1}}}}.

application:  does not annul a \mref{d}covenant previously \mref{e}ratified by God

Here's the Problem: PDF Search does find any word with a cross-ref in front of it!

I'm using the PDF in GoodNotes iOS app - which has a wonderful search capability, both for the text, and any handwritten notes.

The search function in GoodNotes does not find word-matches for words that are preceded by a superscripted letter. There's probably no fix for this ... but asking anyway ... Is there some optional method of separating the word from a superscript in such a way that a PDF document recognizes the word apart from the reference letter besides a physical space? Or to space, and back up the render some amount to make it look like the reference letter is next to the word ?

Or any other suggestions for this issue ?

• you could try simply adjusting the macro so that it has eg \nobreak\hspace{0pt} after the superscript before the word, or you can probably use pdf tagging to separate the word and the annotation. Feb 11 at 16:52
• @DavidCarlisle I doubt that \hspace{0pt} would change something, it wouldn't add something to the pdf so why should it matter. You probably would need a real space char. (I can't test that, adobe has no problems to find convenant in mwe.) Feb 11 at 17:31
• @DavidCarlisle ... experimenting with your ideas. The /nospace doesnt work (not for the goodnotes app). So far, \newcommand{\mref}[1]{\textsuperscript{\textit{\textcolor{blue}{#1 \hspace{-2.0pt}}}}} works for most cases (note: actual space between #1 and \hspace ) ... but failed for a few instances ... like a "b" in front of "without" ... I am trying to find the minimal negative \hspace value that works for everything ... My text size is \small ... next to try is -1.9pt ... there is such a small visual spacing with -2.0pt that it's not too bad. BLUF some amount of spacing is required. Feb 11 at 18:04
• @UlrikeFischer actualtext the word with itself? Feb 11 at 19:36
• You can add an actualtext with the accsupp package. Feb 11 at 19:52