I am using the pdfcomment package to annotate my PDF file, allowing comments to be hidden and revealed upon mouse hover. However, when I include a mathematical formula in the comments, it generates an error. Below is the Minimal Working Example (MWE) to reproduce the issue:
\documentclass{article}
\usepackage{pdfcomment}
\begin{document}
A comment appears here: \pdfcomment{Use this formula: $y = \frac{u}{v}$}
\end{document}
The math formula is not processed and generates the following errors/warnings:
Package hyperref Warning: Token not allowed in a PDF string (Unicode): removing `\endgroup' on input line 5.
Package hyperref Warning: Token not allowed in a PDF string (Unicode): removing `math shift' on input line 5.
Package hyperref Warning: Token not allowed in a PDF string (Unicode): removing `\over' on input line 5.
Package hyperref Warning: Token not allowed in a PDF string (Unicode): removing `\begingroup' on input line 5.
pdflatex. What build engine are you using? – AndréC Mar 31 '24 at 08:21\pdfcomment{y=u/v}– David Carlisle Mar 31 '24 at 08:50