# Trying to use pdfcomment’s \pdfmarkupcomment with acro

I’ve been trying to use \pdfmarkupcomment from the pdfcomment package as the tooltip-cmd for the acro package. However, I’m getting an error and don’t quite understand where it’s coming from. The following minimal example:

\documentclass[american]{scrartcl}
\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage{pdfcomment}
% This doesn’t work:
%\usepackage[tooltip-cmd=\pdftooltip]{acro}
\usepackage{acro}

\newcommand{\mytooltip}[2]{\pdfmarkupcomment[opacity=0]{#1}{#2}}
\acsetup{tooltip-cmd=\mytooltip}
\DeclareAcronym{test}{short=test-short, long=test-long}

\begin{document}
\ac{test}
\end{document}


produces the following error:

! Argument of \use:c has an extra }.
<inserted text>
\par
l.16  \ac{test}


With \acsetup{tooltip-cmd=\pdftooltip} instead, everything works OK. (As you can see, I’m using \acsetup instead of package options such as \usepackage[tooltip-cmd=\...]{acro} because that doesn’t work at all, even with \pdftooltip. Shouldn’t both ways work?)

Since \pdftooltip works, I’m assuming \pdfmarkupcomment is different somehow. Is there a way to fix this?

I’m using TeX Live 2016/Linux and the problem is with either pdfLaTeX/LuaLaTeX.

• The first mandatory argument of \pdfmarkupcomment seems to be passed on to a command from the soul package which seems to be the problem here… acro does not pass the pure string to the tooltip command but something like \use:c {acro_write_short:nv}{test}{l__acro_short_tl}\acro_endings:nn {test}{short}. The soul command doesn't seem to be able to handle this input… – clemens Nov 26 '16 at 14:18