改變 biblatex 中實際 url 之前單字 URL 的字體

改變 biblatex 中實際 url 之前單字 URL 的字體

我正在處理我的參考書目,並且想要更改 URL 的字體樣式。我可以用\usepackage{url}and做到這一點\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}

相關內容