[Tex/LaTex] Why is the \url{} command not recognised here

biberhyperrefurlurls

The \url command in the bibliography file seems not to be recognised as a command to execute. At least, the source is not linked with the corresponding internet site and the command's characters were written (after some escaping).

The template was proposed (in this way or in a similar one) by the wikimedia citation tool.
It didn't matter wether loading hyperref additionally or not. I've compiled the document successfully through calling XeLaTeX — biber — XeLaTeX.

Important piece of the result: exportiert]. 2017. url: %5Curl%7Bhttps:

main.tex:

\documentclass[draft, german, hyperref = {hidelinks}, graphicx = {xelatex}]{beamer} % use larger type; default would be 10pt

% Reihenfolge: url -- hyperref -- biblatex  ???

\usepackage{url}  % Erleichtert das Setzen von URLs
%\usepackage[hidelinks]{hyperref}  % (Unscheinbar) verlinktes Inhaltsverzeichnis - sehr nützlich!
\usepackage{biblatex}  % für die ISBN-Nummer
\addbibresource{quellen.bib}

\begin{document}
\begin{frame}
\frametitle{Quellen}
\nocite{*}
\printbibliography
\end{frame}
\end{document}

quellen.bib:

@misc{wiki:cclasses,
   author = "Wikimedia Commons",
   title = "File:Complexity classes (de).svg --- Wikimedia Commons{,} the free media repository",
   year = "2017",
   url = {\url{https://commons.wikimedia.org/w/index.php?title=File:Complexity_classes_(de).svg&oldid=249414083}},
   note = "[Online; zuletzt aufgerufen am 15. November 2017; Mittels Inkscape als PNG exportiert]",
 }

Please write where I have made an error and why this behaviour occurs. Many thanks in advance!

Best Answer

The url field is already treated as such by biblatex, so you don't need url = {\url{... rather url = {https... should be enough. With this the url is correctly printed.

Furthermore, the draft option omits the actual link. So, if you want it, you should remove the option.

\documentclass[german, hyperref = {hidelinks}, graphicx = {xelatex}]{beamer} % use larger type; default would be 10pt

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
    @misc{wiki:cclasses,
        author = "Wikimedia Commons",
        title = "File:Complexity classes (de).svg --- Wikimedia Commons{,} the free media repository",
        year = "2017",
        url = {https://commons.wikimedia.org/w/index.php?title=File:Complexity_classes_(de).svg&oldid=249414083},
        note = "[Online; zuletzt aufgerufen am 15. November 2017; Mittels Inkscape als PNG exportiert]",
    }   
\end{filecontents}

% Reihenfolge: url -- hyperref -- biblatex  ???
% In most cases, hyperref should be loaded last. See https://tex.stackexchange.com/q/1863/105447

%\usepackage{url}  % Erleichtert das Setzen von URLs
% Not needed, as long as you load hyperref, for hyperref loads it by itself (and better not duplicate the call).

\usepackage{biblatex}  % für die ISBN-Nummer

%\usepackage[hidelinks]{hyperref}  % (Unscheinbar) verlinktes Inhaltsverzeichnis - sehr nützlich!
% Not needed, because beamer already calls hyperref.

\addbibresource{\jobname.bib}

\begin{document}
\begin{frame}
\frametitle{Quellen}
\nocite{*}
\printbibliography
\end{frame}
\end{document}

enter image description here

Related Question