3

I'm trying to use \pdfmarkupcomment from pdfcomment inside a dmath environment from breqn, but they appear to be incompatible.

Here is a simple example where it fails:

\documentclass{article}
\usepackage{geometry}
\usepackage{amsmath,amssymb,amsfonts,dsfont}
\usepackage{breqn}
\usepackage{pdfcomment}

\begin{document}
\pagestyle{empty}

% this works
\begin{equation}
\pdfmarkupcomment{ab}{F}
\end{equation}

% this fails:
\begin{dmath}
\pdfmarkupcomment{cd}{G}
\end{dmath}

\end{document}

The error I get from pdflatex is:

LaTeX Warning: Reference `pdfcomment:zref@2' on page 1 undefined on input line 
18.

! Undefined control sequence.
<argument> \kern -\parskip \leavevmode \vadjust 
                                                {\vbox to\z@ {\vss \@mn@marg...
l.18 \pdfmarkupcomment{cd}{G}

? 

LaTeX Warning: Reference `pdfcomment:zref@3' on page 1 undefined on input line 
18.

[1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./test.aux
* soulpos - computing points - it may take a few seconds * (./test.upa))

LaTeX Warning: There were undefined references.


LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.

I'm compiling in (k)ubuntu 15.04.

1
  • Welcome to TeX - LaTeX! I suggest you load breqn after pdfcomment to alleviate one warning message. But that doesn't solve your main problem. Sep 2, 2015 at 12:56

1 Answer 1

2

For some reason, breqn redefines in certain situations \vadjust to be \eq@vadjust without giving any meaning to this command, and this is the reason why you get the puzzling error message.

My suggestion would be to drop breqn altogether: I don't think it's useful to improve typography; it possibly can help in case where automatic breaking is desired because we can't control it (say mass compilation of documents whose output quality is not a concern).

If you add a default meaning to \eq@vadjust the document compiles, but I can't check if this has adverse effects.

\documentclass{article}
\usepackage{geometry}
\usepackage{amsmath,amssymb,amsfonts,dsfont}
\usepackage{pdfcomment}
\usepackage{breqn}

\makeatletter
\providecommand{\eq@vadjust}{\@@vadjust}
\makeatother

\begin{document}
\pagestyle{empty}

\begin{equation}
\pdfmarkupcomment[markup=Underline]{ab}{F}
\end{equation}

\begin{dmath}
\pdfmarkupcomment[markup=Underline]{cd}{G}
\end{dmath}

\end{document}

enter image description here

1
  • Unfortunately I cannot drop breqn. It is used to break some long equations which are automatically generated by another program. Your suggestion does appear to make it work. So far I have not spotted any visible issues. Thank you!
    – João Leal
    Sep 2, 2015 at 13:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .