例如,我需要打印,15 October 2022
而不是15th October 2022
。我发现了一个类似的问题旧解决方案据报道,它使用澳大利亚语言,因为它根据我的意愿格式化日期。我想避免使用其他语言。这是我的语言设置biblatex
:
\usepackage[utf8]{inputenc}
\usepackage[british]{babel}
\usepackage[%
backend=biber,
citestyle=numeric-comp, % authoryear
bibstyle=numeric-comp, % authoryear,
doi=false,url=true,isbn=false,
% sorting=nyt,% none
hyperref=true,
% %style=apa,
block=ragged,
urldate=long,
dateabbrev=false,
natbib=true]{biblatex}
我该如何解决这个问题?
答案1
相关的语言相关宏是\mkbibdatelong
其定义british.lbx
见第 20-31 行。我们想去掉序数天数,所以我们选择
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[%
backend=biber,
style=numeric-comp,
doi=false,url=true,isbn=false,
block=ragged,
urldate=long,
dateabbrev=false,
]{biblatex}
\DefineBibliographyExtras{british}{%
\protected\def\mkbibdatelong#1#2#3{%
\iffieldundef{#3}
{}
{\stripzeros{\thefield{#3}}%
\iffieldundef{#2}{}{\nobreakspace}}%
\iffieldundef{#2}
{}
{\mkbibmonth{\thefield{#2}}%
\iffieldundef{#1}{}{\space}}%
\iffieldbibstring{#1}
{\bibstring{\thefield{#1}}}
{\dateeraprintpre{#1}\stripzeros{\thefield{#1}}}}%
}
\addbibresource{biblatex-examples.bib}
\begin{document}
Lorem \autocite{sigfridsson,ctan}
\printbibliography
\end{document}