2

I would like to use the pdfcomment package to make some annotations to a pdf. It seems to conflict with polyglossia:

\documentclass{memoir}
\usepackage{xcolor,pdfcomment,polyglossia}
\setmainlanguage{english}
\setotherlanguage{german}
\begin{document}
Some text.
\pdfmarkupcomment[markup=Squiggly,color=green,author={somebody}]{Some \emph{more} text. \textgerman{Etwas Text}.}{some suggestion}
\end{document}                    

Gives me the following error:

! Argument of \\textgerman has an extra }.
<inserted text> 
                \par 
l.7 ... \textgerman{Etwas Text}.}{some suggestion}

If I replace the \textgerman by \emph the file builds fine.

  • 1
    Use \protect\textgerman{Etwas Text} – user31729 Mar 18 '18 at 9:08
  • @ChristianHupfer that will make it compile again, but then the squiggly underline disappears. – muk.li Mar 18 '18 at 9:49
1

You can register \textgerman with soul:

\documentclass{memoir}
\usepackage{xcolor,polyglossia}
\usepackage[draft]{pdfcomment}
\setmainlanguage{english}
\setotherlanguage{german}

\AtBeginDocument{\soulregister{\textgerman}{1}}

\begin{document}

Some text.
\pdfmarkupcomment[
  markup=Squiggly,
  color=green,
  author={somebody}
]{Some \emph{more} text. \textgerman{Etwas Text}.}{some suggestion}

\end{document}

enter image description here

  • That solves it for this problem, but now I ran into a similar problem with biblatex's \cite etc. commands, it seems they cannot be dealt with in the same way. – muk.li Mar 19 '18 at 9:59
  • Here prefixing the \cite command with \protect works. – muk.li Mar 19 '18 at 10:03
  • @muk.li soul is quite fragile; sometimes \mbox{} around an offending entry helps. – egreg Mar 19 '18 at 10:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.