[Tex/LaTex] \href line break issue

hyperrefline-breaking

I'm running into trouble using \href with a long link diskription which is then broken over two lines. The issue is the link box, which obviously cannot be properly broken and then disappears, as can be seen on the following example:

\documentclass{scrartcl}

\usepackage[breaklinks=true]{hyperref}
\usepackage{breakurl}

\begin{document}

\begin{minipage}{0.3\linewidth}
  \href{url}{Very long link which should be broken}

  \url{Very/long/link/which/should/be/broken}
\end{minipage}

\end{document}

The output:

sdfsdenter image description here

As you can see, breakurl package creates two frames one for each line, whereas href command controlled by hyperref package creates only a small frame between the lines. In combination mit colores links without frames, it is almost impossible to find the link by mouse…

Update: This issue occures using latex + dvipdf chain only, pdflatex works fine. Ommiting brakurl package for latex + dvipdf results in url not broken:

 \documentclass{scrartcl}

\usepackage[breaklinks=true]{hyperref}
% \usepackage{breakurl}

\begin{document}

\framebox{
  \begin{minipage}{0.3\linewidth}
    \href{url}{Very long link which should be broken}

    \url{Very/long/link/which/should/be/broken}
  \end{minipage}
}

\end{document}

Output:

enter image description here

Best Answer

For me your code gives a correct broken url. Probably you are just using a compiler that conflicts with this setup. As @Cupora states latex+dvipdf seem to refuse making the right links.

I've compiled with pdflatex and lualatex and they both show the following output:

links

xelatex seems to fail using breakurl, but that may be an issue with my setup.

Related Question