[Tex/LaTex] \pdfmarkupcomment does not highlight what it is supposed to

pdfcomment

Basically I have the same problem as in the closed thread
\pdfmarkupcomment works in MWE, but doesn't work in my thesis.

Simple MWE, even longer files work fine, the text gets highlighted as it is supposed to.

My main paper consists out of several .tex-files (in different subdirectories) that get included (or not) depending on boolean variables.
Wheras other pdfcomment-commands work fine, the pdfmarkupcomment does not work at all.

Anybody seen something similar?

Best Answer

I can reproduce the problem. There seems to be a bug in soulpos.sty, which is used in \pdfmarkupcomment. When used in included files soulpos.sty only produces a .upa file but no .upb file. Therefore there are no positions to place the PDF annotation.

soulpos.tex

\documentclass{report}
\usepackage{soulpos}
\usepackage[rgb]{xcolor}
%\newcommand\myinclude[1]{\clearpage\input{#1}}
\ulposdef{\ulflag}{%
\mbox{%
\color{red}\rule[-.85ex]{.25\ulwidth}{1.5pt}%
\color{yellow}\rule[-.85ex]{.5\ulwidth}{1.5pt}%
\color{red}\rule[-.85ex]{.25\ulwidth}{1.5pt}}}
\begin{document}
\include{./subdir/test}
\end{document}

test.tex

foo \ulflag{Test} bar

I already filed a bug report to Javier Bezos. Hopefully, he will be able to fix it asap.

As a workaround, which might break other features the usage of \myinclude instead of \include will work:

\newcommand\myinclude[1]{\clearpage\input{#1}}
Related Question