biblatex 中的错误
嗯,我有这个文件:
\documentclass[11pt]{scrreprt}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[style=authoryear-luh-ipw,natbib=true]{biblatex}
\usepackage[printonlyused]{acronym}
\bibliography{eva.bib}
\begin{document}
\citep{a}
\citep{b}
\citeyearpar{a}
\citeyearpar{b}
\end{document}
A 和 B 由同一作者于同一年出版。LaTeX 生成:
(标题 a,1980a)
(标题 b,1980b)
(1980)(1980)
我想在后两个年份引用上附加排序字符。这很简单,我遗漏了什么?
答案1
\citeyearpar
问题在于文件中的定义blx-natbib.def
。
定义是:
\DeclareCiteCommand{\citeyearpar}[\mkbibparens]
{\boolfalse{citetracker}%
\boolfalse{pagetracker}%
\usebibmacro{prenote}}
{\printfield{year}}
{\multicitedelim}
{\usebibmacro{postnote}}
这里你可以看到extrayear
缺少该字段。根据此信息,你可以修改完整定义,如下所示:
\DeclareCiteCommand{\citeyearpar}[\mkbibparens]
{\boolfalse{citetracker}%
\boolfalse{pagetracker}%
\usebibmacro{prenote}}
{\printfield{year}\printfield{extrayear}}
{\multicitedelim}
{\usebibmacro{postnote}}
与您的示例相关的下一条信息。该命令\bibliography
与 结合使用时已过时biblatex
。正确的命令是\addbibresource
。
对于下面的示例,我使用 biblatex 示例文件。
\documentclass[11pt,parskip=half]{scrreprt}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[style=authoryear-luh-ipw,natbib=true,backend=biber]{biblatex}
\DeclareCiteCommand{\citeyearpar}[\mkbibparens]
{\boolfalse{citetracker}%
\boolfalse{pagetracker}%
\usebibmacro{prenote}}
{\printfield{year}\printfield{extrayear}}
{\multicitedelim}
{\usebibmacro{postnote}}
%\bibliography{eva.bib}
\addbibresource{biblatex-examples.bib}
\begin{document}
\verb+\citep{knuth:ct:a}+\qquad\citep{knuth:ct:a}
\verb+\citep{knuth:ct:c}+\qquad\citep{knuth:ct:c}
\verb+\citep{knuth:ct:d}+\qquad\citep{knuth:ct:d}
\verb+\citeyearpar{knuth:ct:a}+\qquad\citeyearpar{knuth:ct:a}
\verb+\citeyearpar{knuth:ct:c}+\qquad\citeyearpar{knuth:ct:c}
\verb+\citeyearpar{knuth:ct:d}+\qquad\citeyearpar{knuth:ct:d}
\end{document}