Is it possible to change the URL entries to normal text mode by using biblatex? (Hope MWE is not required for this, if requires, will provide)
1 Answers
biblatex delegates its URL typesetting to the url package. So you can use
\urlstyle{same}
to have all URLs typeset by url in the document font.
Note that this also changes "URL-like" things such as DOIs and many eprint formats.
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=authoryear, backend=biber]{biblatex}
\addbibresource{biblatex-examples.bib}
\urlstyle{same}
\begin{document}
\cite{sigfridsson,ctan}
\printbibliography
\end{document}
Here is a solution that treats the URL as normal text. That is complicated for two reasons
Biber applies percent/URL encoding to the
urlfield, see How to disable percent-encoding in URLs? and Scandinavian letters in Biblatex URL. That means that if you want a backslash to survive, you must print the special fieldurlrawinstead ofurl.URLs are interpreted verbatim, that means that none of the special characters have their usual special meaning.
~is just~and not a space, similarly_is just an underscore and not the subscript marker that lands you in math mode. But then\is just a backslash and not the special character that starts control sequence names. So we need to 'reactivate'\, in the MWE I did that with\scantokens, but that means that all other special characters get back their special meaning as well. Effectively that means you can't have#,_and~in your URL any more.
All that suggests that, while theoretically possible, this approach is really not something you should use.
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=authoryear, backend=biber]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{appleby,
author = {Humphrey Appleby},
title = {On the Importance of the Civil Service},
date = {1980},
url = {http://example.com/\break sir-humphrey/imp.html},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
\DeclareFieldFormat{url}{%
\mkbibacro{URL}\addcolon\space
\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
\expandafter\expandafter\expandafter
\scantokens
\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
\expandafter\expandafter\expandafter
{\thefield{urlraw}}}
\begin{document}
\cite{sigfridsson,appleby}
\printbibliography
\end{document}
If you are having trouble with the way URLs are broken in the bibliography have a look at Line breaks of long URLs in biblatex bibliography? and Forcing linebreaks in \url for canonical solutions to URL breaking in TeX. You might also be interested in How to adjust the breaking in the bibliography?.
- 175,683

~,_and#don't cause errors, but it also means that commands can not be executed any more. – moewe Oct 25 '18 at 05:51\break. Instead have a look at https://tex.stackexchange.com/q/134191/35864 and https://tex.stackexchange.com/q/3033/35864 – moewe Oct 25 '18 at 05:53