1

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

  • Why do you even use breakurl? hyperref breaks the first link in a correct way too. – TeXnician Feb 9 '17 at 16:16
2

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.

  • This behaviour looks to depend on compiler one is using. pdflatex causes no problem, whereas latex + dvipdf does it. Evenmore, removeing breakurl leads to no change on href output, but url is not broken anymore. – Cupora Feb 10 '17 at 7:39
  • @Cupora Okay, I usually compile with XeLaTeX or LuaLaTeX. But as you can see, \url is broken here. – TeXnician Feb 10 '17 at 7:42
  • @Cupora The answer is now community wiki, so if you have further ideas just add them. – TeXnician Feb 10 '17 at 7:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.