更改 biblatex 中实际 URL 前的 URL 字样的字体

更改 biblatex 中实际 URL 前的 URL 字样的字体

我正在研究我的参考书目,想更改 URL 的字体样式。我可以使用 和 来做到这一点\usepackage{url}\urlstyle{same}编译后字体发生了变化,但单词“URL:”没有变化。您可以在下面看到这一点。

我尝试重新定义风格,如问题。但这没有用。我希望你能提出任何建议。提前致谢。

梅威瑟:

\documentclass{article}

\usepackage[style=alphabetic,
isbn=false,
doi=false,
url=false,
language = ngerman]{biblatex}

\usepackage[scaled]{helvet}
\renewcommand{\familydefault}{\sfdefault} 
\usepackage{url}
\urlstyle{same}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@online{Dantam.2018,
    author = {Dantam, Neil},
    title = {Quaternion Computation},
    url = {http://www.neil.dantam.name/note/dantam-quaternion.pdf},
    urldate = {2018-01-05},
    abstract = {},
    organization = {{Institute for Robotics and Intelligent Machines, Georgia Institute of Technology}},
    shorthand = {DANT18}
}
\end{filecontents*}
\bibliography{\jobname}


\begin{document}
\nocite{*}
\printbibliography
\end{document}

答案1

如果你只想更改 URL 字体,你可以使用:

\DeclareFieldFormat{url}{URL\addcolon\space\url{#1}}

以标准大写字母而不是小写字母的形式获取。

但是,更通用、更合适的方法是重新定义将“URL”设置为小写字母的宏,因为它也会影响其他首字母缩略词(例如“DOI”、“ISBN”、“ISSN”等)。因此,为了保持一致性,\mkbibacro最好对进行通用重新定义(正如 moewe 在评论中指出的那样):

\renewcommand*{\mkbibacro}[1]{#1}

任一方法的结果(尽管第二种方法更可取)将是:

在此处输入图片描述

完整的 MWE:

\documentclass{article}

\usepackage[style=alphabetic,
isbn=false,
doi=false,
url=false,
language = ngerman]{biblatex}

\usepackage[scaled]{helvet}
\renewcommand{\familydefault}{\sfdefault} 
\usepackage{url}
\urlstyle{same}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@online{Dantam.2018,
    author = {Dantam, Neil},
    title = {Quaternion Computation},
    url = {http://www.neil.dantam.name/note/dantam-quaternion.pdf},
    urldate = {2018-01-05},
    abstract = {},
    organization = {{Institute for Robotics and Intelligent Machines, Georgia Institute of Technology}},
    shorthand = {DANT18}
}
\end{filecontents*}
\bibliography{\jobname}

\renewcommand*{\mkbibacro}[1]{#1}

\begin{document}
\nocite{*}
\printbibliography
\end{document}

相关内容