1

As shown by the following MCE, if hyperref's links are asked to be colored, the ones of intopdf are not colored.

\documentclass{article}
\usepackage[colorlinks]{hyperref}%
\usepackage{intopdf}
\begin{document}
The source of the document is attached
\attachandlink{\jobname.tex}[application/x-tex]{The source of this
  document}{here}.

\url{www.test.org}
\end{document}

enter image description here

Even the usual \PassOptionsToPackage trick doesn't work:

\PassOptionsToPackage{colorlinks}{hyperref}%
\documentclass{article}
\usepackage{intopdf}
\begin{document}
The source of the document is attached
\attachandlink{\jobname.tex}[application/x-tex]{The source of this
  document}{here}.

\url{www.test.org}
\end{document}

Do you see what's going on and how to circumvent this problem?

1 Answer 1

2

The implementation in intopdf.sty shows that colorlinks is not yet supported. The following example is a try.

\documentclass{article}
\usepackage[colorlinks]{hyperref}
\usepackage{intopdf}

% patch \intopdf_attach_link:nnnnn
\usepackage{xpatch}
\ExplSyntaxOn
\makeatletter
\xpatchcmd \intopdf_attach_link:nnnnn
  {#5}
  {
    \group_begin:
    \cs_if_free:NF\@urlbordercolor{
      \Hy@colorlink\@urlcolor
    }
    #5
    \group_end:
  }
  {}{\fail}
\makeatother
\ExplSyntaxOff

\begin{document}
The source of the document is attached
\attachandlink{\jobname.tex}[application/x-tex]{The source of this
  document}{here}. 

\url{www.test.org}
\end{document}

enter image description here

You must log in to answer this question.

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