cross-referencing breaks when \pdfmarkupcomment[]{}{} is inserted into float captions

Issue #3 resolved
aghsmith created an issue

A piece of code such as: {{{ \begin{figure} \caption{This is \pdfmarkupcomment{my}{} figure} \label{fig:myFig} \end{figure}

\cref{fig:MyFig} }}}

will break the cross cross-referencing.

I started a question on stackexchange regarding this matter: http://tex.stackexchange.com/q/42960/1269

there is also this related problem with the amsmath environment: http://tex.stackexchange.com/q/28313/1269

Some commentary and solutions have been suggested which involve redefining macros within the cleveref and hyperref packages but it seems like a solution implemented within pdfcomment would be better.

Comments (1)

  1. Josef Kleber repo owner

    Works with the latest developer version.

    Josef

    \documentclass{article}
    \usepackage{graphicx}
    \usepackage{pdfcomment}
    \usepackage{cleveref}
    \begin{document}
    \section{test}
    
    see: \cref{fig:MyFig}
    
    \begin{figure}[htpb]
       \includegraphics{minimal.jpg}
       \caption{This is \pdfmarkupcomment{my}{comment} figure}
       \label{fig:MyFig}
    \end{figure}
    
    \end{document}
    
  2. Log in to comment