5

I am trying to use pdfcomment to annotate a mathematical report and runs into issues when \eqref is present inside the text to be annotated. Below is a minimal non-working example. If I push the \eqref out of the pdfmarkupcomment, this error goes away.

\documentclass[a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[rgb]{xcolor}
\usepackage[author={Max Schlepzig}]{pdfcomment}
\usepackage{amsmath}
\begin{document}
Following is energy equation 
\begin{align}
\label{eq:energy}
    E=mc^2
\end{align}
\pdfmarkupcomment[markup=Highlight,color=yellow]{Of course, you can highlight complete sentences. However equation numbers like \eqref{eq:energy} are tricky }{Highlight}
\end{document}
5

\protect the fragile \eqref

\documentclass[a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[rgb]{xcolor}
\usepackage[author={Max Schlepzig}]{pdfcomment}
\usepackage{amsmath}
\begin{document}
Following is energy equation
\begin{align}
\label{eq:energy}
    E=mc^2
\end{align}
\pdfmarkupcomment[markup=Highlight,color=yellow]{Of course, you can highlight complete sentences. However equation numbers like \protect\eqref{eq:energy} are tricky }{Highlight}
\end{document}

enter image description here

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.