[Tex/LaTex] Linebreak before URL with biblatex/alphabetic

biblatexline-breaking

Using biblatex with alphabetic style, how could I insert a line break (\\ or \linebreak) before the URL output (with the aim to have less linebreaks within URL)?
(I use url and hyperref)

Best Answer

\documentclass{scrartcl}
\usepackage{xcolor}
\usepackage[style=authoryear,backend=biber,]{biblatex}
\usepackage[colorlinks=true,urlcolor=red!50!black]{hyperref}
\addbibresource{biblatex-examples.bib}
\DeclareFieldFormat{formaturl}{\newline #1}
\newbibmacro*{url+urldate}{%
\printtext[formaturl]{%
  \printfield{url}}%
  \iffieldundef{urlyear}
    {}
    {\setunit*{\addspace}%
     \printtext[urldate]{\printurldate}}}

\begin{document}
\cite{ctan}
\printbibliography
\end{document}

With DeclaredFieldFormat you can format the whole string of url and urldate. In this case I insert a \newline in front of the ouput.

EDIT:

added printtext

enter image description here

Related Question