更改 biblatex 中同一年份的字母排序

更改 biblatex 中同一年份的字母排序

我从这里开始按同一作者和同一年份对书目进行排序(biblatex)

\documentclass{article}
\usepackage{filecontents}
\usepackage[style=authoryear,sorting=nyt]{biblatex}
\begin{filecontents}{\jobname.bib}
@BOOK{lennon1972a,
AUTHOR = "John Lennon",
TITLE = "My music",
YEAR = "1972"}
@BOOK{lennon1972b,
AUTHOR = "John Lennon",
TITLE = "More of my music",
YEAR = "1972"}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\cites{lennon1972a}{lennon1972b}
\printbibliography
\end{document}

对于给定的语言字母表,是否可以将“a”...“b”更改为另一个字母表?假设是罗马数字

編輯:

根据下面的答案我更改了代码如下:

\documentclass{article}
\usepackage{filecontents}
\usepackage{fontspec}
 \defaultfontfeatures{Ligatures=TeX}
\usepackage[russian]{babel}
\usepackage[style=authoryear,sorting=nyt]{biblatex}
\setmainfont{Dejavu Serif}
\begin{filecontents}{\jobname.bib}
@BOOK{lennon1972a,
AUTHOR = "John Lennon",
TITLE = "My music",
YEAR = "1972"}
@BOOK{lennon1972b,
AUTHOR = "John Lennon",
TITLE = "More of my music",
YEAR = "1972"}
\end{filecontents}
\addbibresource{\jobname.bib}
\DeclareFieldFormat{extrayear}{% = the 'a' in 'Jones 1995a'
  \iffieldnums{labelyear}
 {\Asbuk{#1}}
{\mkbibparens{\Asbuk{#1}}}}
\usepackage{enumitem}
% Some other packages, not needed for MWE
 \AddEnumerateCounter{\Asbuk}{\@Asbuk}{Ы}
 \AddEnumerateCounter{\asbuk}{\@asbuk}{ы}
\renewcommand{\theenumi}{(\Asbuk{enumi})}
\renewcommand{\labelenumi}{\Asbuk{enumi})}
\begin{document}
\begin{enumerate}
\item Item A
\item Item B
\end{enumerate}
\cites{lennon1972a}{lennon1972b}
\printbibliography
\end{document}

如您所见,enumitems 输出了俄文字母,但 biblatex 部分出现错误

答案1

extrayear字段只是一个数字,您可以根据需要格式化它。

默认定义 ( biblatex.def) 为

\DeclareFieldFormat{extrayear}{% = the 'a' in 'Jones 1995a'
  \iffieldnums{labelyear}
    {\mknumalph{#1}}
    {\mkbibparens{\mknumalph{#1}}}}

对于罗马数字,你可以将其读作

\DeclareFieldFormat{extrayear}{% = the 'a' in 'Jones 1995a'
  \iffieldnums{labelyear}
    {\Rn{#1}}
    {\mkbibparens{\Rn{#1}}}}

\RN用大写罗马数字代替\Rn

对于由\asbuk我们印刷的俄罗斯标签,\russian@alph

\makeatletter
\DeclareFieldFormat{extrayear}{% = the 'a' in 'Jones 1995a'
  \iffieldnums{labelyear}
    {\russian@alph{#1}}
    {\mkbibparens{\russian@alph{#1}}}}
\makeatother

(请注意\makeatletter/\makeatother对)。

平均能量损失

\documentclass{article}
\usepackage{filecontents}
\usepackage[style=authoryear,sorting=nyt]{biblatex}
\begin{filecontents}{\jobname.bib}
@BOOK{lennon1972a,
AUTHOR = "John Lennon",
TITLE = "My music",
YEAR = "1972"}
@BOOK{lennon1972b,
AUTHOR = "John Lennon",
TITLE = "More of my music",
YEAR = "1972"}
\end{filecontents}
\addbibresource{\jobname.bib}


\DeclareFieldFormat{extrayear}{% = the 'a' in 'Jones 1995a'
  \iffieldnums{labelyear}
    {\Rn{#1}}
    {\mkbibparens{\Rn{#1}}}}

\begin{document}
\cites{lennon1972a}{lennon1972b}
\printbibliography
\end{document}

相关内容