eqref 和 pdfcomment 之间的冲突

eqref 和 pdfcomment 之间的冲突

我正在尝试使用 pdfcomment 注释一份数学报告,当要注释的文本中存在 \eqref 时,就会遇到问题。下面是一个最简单的非工作示例。如果我将 \eqref 推出 pdfmarkupcomment,这个错误就会消失。

\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}

答案1

\protect脆弱的\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}

在此处输入图片描述

相关内容