0

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 ?

RichWalt
  • 171
  • 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. – David Carlisle Feb 11 '22 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.) – Ulrike Fischer Feb 11 '22 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. – RichWalt Feb 11 '22 at 18:04
  • @UlrikeFischer actualtext the word with itself? – David Carlisle Feb 11 '22 at 19:36
  • @DavidCarlisle It could work but probably not for all viewers. For me adobe finds the actualtext but sumatra doesn't. – Ulrike Fischer Feb 11 '22 at 19:41
  • @UlrikeFischer ... what do you mean by actual text the word with itself ? – RichWalt Feb 11 '22 at 19:48
  • 1
    You can add an actualtext with the accsupp package. – Ulrike Fischer Feb 11 '22 at 19:52
  • @UlrikeFischer ... thanks, interesting. For now, \newcommand{\mref}[1]{\textsuperscript{\textit{\textcolor{blue}{#1 \hspace{-2.0pt}}}}} seems to work for fairly well. Visually, with size \small{} the space is not too bad. – RichWalt Feb 11 '22 at 19:55
  • You could try a\pdffakespace b (assuming that you use pdflatex) – Ulrike Fischer Feb 11 '22 at 19:59
  • Regarding the use of accsupp package, this question, https://tex.stackexchange.com/questions/241968/how-to-protect-a-word-from-finding-by-google-search-machines, focuses on protection against google search, but the same logic applies for PDF search, as well. – Steven B. Segletes Feb 12 '22 at 00:32

0 Answers0