hyperref icon indicating copy to clipboard operation
hyperref copied to clipboard

add configuration point in \Hy@raisedlink

Open u-fischer opened this issue 4 years ago • 0 comments

From https://tex.stackexchange.com/a/612327/2388

varwidth needs a configuration point around the argument of \Hy@raisedlink in vmode so that it can add its wrapper:

\documentclass{article}

\usepackage{varwidth,etoolbox}
\usepackage{hyperref,color}

\makeatletter

\newcommand\hyper@configure@raisedlink@vmode[1]{#1}
\patchcmd\Hy@raisedlink{\ifvmode #1}{\ifvmode \hyper@configure@raisedlink@vmode{#1}}{}{\fail}
\appto\@vwid@setup{\let\hyper@configure@raisedlink@vmode\@vwid@wrap}
\makeatletter

\begin{document}
abc

\fbox{\begin{varwidth}{\textwidth}
  \begin{enumerate}
    \item One
    \item Two
  \end{enumerate}
\end{varwidth}}

\end{document}

u-fischer avatar Aug 28 '21 14:08 u-fischer