0

I am trying to change doi font style to Times New Roman. By default, the font is not in Times New Roman but something else. I have tried:

\usepackage{lipsum}
\newcommand{\TNR}{\fontfamily{ptm}\selectfont}
\DeclareTextFontCommand{\textTNR}{\TNR}

\DeclareFieldFormat{doi}{ %
    \color{black}{doi}%
  \mkbibacro{}\addcolon \selectfont
  \textTNR{\underline{
  \ifhyperref
    {\href{https://doi.org/#1}{\nolinkurl{#1}}}
    {\nolinkurl{#1}}
    }
    }
    }

I have the above code by the following references link:
[1] Change font to comicneue only for one sentence [2] Formatting only the DOI using biblatex

Can anyone point out what's wrong with the above? I appreciate your time.

0

Assuming the rest of your document is already set up for Times (or with a Times clone), you only need \urlstyle{same} to have URLs, DOIs and the like in the main document font.

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage{times}

\usepackage[backend=biber, style=authoryear]{biblatex}

\urlstyle{same}

\addbibresource{biblatex-examples.bib}

\begin{document}
Lorem \autocite{sigfridsson}

\printbibliography
\end{document}

DOI in Times

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.