How can I get a dotted URL underline with line breaking?
I found this solution: Having all links underlined with dotted line but this TIKZ one does not work with line breaking.
I also tried a simpler solution. This results in a dotted line, but also no line breaking.
\documentclass{article}
\usepackage[hidelinks]{hyperref}
\usepackage{ulem}
\makeatother
\AtBeginDocument{
\let\oldurl=\url
\renewcommand\url[1]{\dotuline{\oldurl{#1}}}
}
\begin{document}
Desired dotted line, but no linebreaking:\\
\url{http://www.very.very.very,very.very.very.very.very.very.very.long.url.com/a/b/c/d/e/df/sadasd/asdasda}
\par Line breaking but no dotted line\\
\oldurl{http://www.very.very.very,very.very.very.very.very.very.very.long.url.com/a/b/c/d/e/df/sadasd/asdasda}
\end{document}
This outputs this:
How to get linebreaking working in combination with dotted (or more in general: customized) underline?
\tikzul[dashed]{\url{http://www.very.very.very,very.very.very.very.very.very.very.long.url.com/a/b/c/d/e/df/sadasd/asdasda}}
. (If your url contains special chars, you will have to store the url first with\urldef
). You must compile twice. – Ulrike Fischer May 13 '15 at 15:40\url
. – Ulrike Fischer May 14 '15 at 12:00