![biblatex:结合作者年份和详细样式](https://linux22.com/image/479046/biblatex%EF%BC%9A%E7%BB%93%E5%90%88%E4%BD%9C%E8%80%85%E5%B9%B4%E4%BB%BD%E5%92%8C%E8%AF%A6%E7%BB%86%E6%A0%B7%E5%BC%8F.png)
我想修改作者年份citestyle 的方式第一次出现引用时,会在引用中添加一个脚注,提供完整的参考资料. 行为将类似于标准冗长citestyle,只是,它不是为每个引用创建脚注条目,而是在任何地方都使用 authoryear 样式,只在第一次出现引用时(最好是在章节中)添加脚注。
我想要如下内容:
[...] 正如 Sagan (1997)^1 所描述的那样。事实上,Sagan (1997) 和 Schulze-Makuch 和 Irwin (2004)^2 完美地描述了我们试图传达的感觉。
[1] Sagan, C., (1997). 暗淡蓝点:人类在太空的未来愿景。兰登书屋数字公司。
[2] Schulze-Makuch,D.,&Irwin,LN(2004 年)。宇宙中的生命。 Springer-Verlag.版本。
非常感谢您的帮助
答案1
您可能想尝试以下方法。宏定义改编自 中的原文authoryear.cbx
。不幸的是,需要一些技巧才能使 中的括号和脚注的顺序正确\textcite
。(这应该适用于authoryear
,对于更复杂的样式,authoryear-comp
它会复杂得多)。
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=authoryear, citetracker, backend=biber]{biblatex}
\newbibmacro*{first:fullcite}{%
\ifciteseen
{}
{\mkbibfootnote{%
\usedriver
{\DeclareNameAlias{sortname}{default}}
{\thefield{entrytype}}}}}
\renewbibmacro*{cite}{%
\iffieldundef{shorthand}
{\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
{\usebibmacro{cite:label}%
\setunit{\printdelim{nonameyeardelim}}}
{\printnames{labelname}%
\setunit{\printdelim{nameyeardelim}}}%
\usebibmacro{cite:labeldate+extradate}}
{\usebibmacro{cite:shorthand}}%
\usebibmacro{first:fullcite}}
\makeatletter
\newbibmacro*{textcite:first:fullcite:check}{%
\ifciteseen
{\global\undef\cbx@fullcitekey}
{\savefield{entrykey}{\cbx@fullcitekey}}}
\newbibmacro*{textcite:first:fullcite:print}{%
\ifundef\cbx@fullcitekey
{}
{\entrydata{\cbx@fullcitekey}{%
\mkbibfootnote{%
\usedriver
{\DeclareNameAlias{sortname}{default}}
{\thefield{entrytype}}}}}}
\makeatother
\renewbibmacro*{textcite}{%
\ifnameundef{labelname}
{\iffieldundef{shorthand}
{\usebibmacro{cite:label}%
\setunit{%
\global\booltrue{cbx:parens}%
\printdelim{nonameyeardelim}\bibopenparen}%
\ifnumequal{\value{citecount}}{1}
{\usebibmacro{prenote}}
{}%
\usebibmacro{cite:labeldate+extradate}}
{\usebibmacro{cite:shorthand}}}
{\printnames{labelname}%
\setunit{%
\global\booltrue{cbx:parens}%
\printdelim{nameyeardelim}\bibopenparen}%
\ifnumequal{\value{citecount}}{1}
{\usebibmacro{prenote}}
{}%
\usebibmacro{citeyear}}%
\usebibmacro{textcite:first:fullcite:check}}
\renewbibmacro*{textcite:postnote}{%
\iffieldundef{postnote}
{\ifbool{cbx:parens}
{\bibcloseparen}
{}%
\usebibmacro{textcite:first:fullcite:print}}
{\ifbool{cbx:parens}
{\setunit{\printdelim{postnotedelim}}}
{\setunit{\printdelim{extpostnotedelim}\bibopenparen}}%
\printfield{postnote}\bibcloseparen
\usebibmacro{textcite:first:fullcite:print}}}
\DeclareCiteCommand{\textcite}
{\boolfalse{cbx:parens}}
{\usebibmacro{citeindex}%
\iffirstcitekey
{\setcounter{textcitetotal}{1}}
{\stepcounter{textcitetotal}%
\textcitedelim}%
\usebibmacro{textcite}}
{\ifbool{cbx:parens}
{\bibcloseparen\global\boolfalse{cbx:parens}%
\usebibmacro{textcite:first:fullcite:print}}
{}}
{\usebibmacro{textcite:postnote}}
\addbibresource{biblatex-examples.bib}
\begin{document}
Lorem \textcite{sigfridsson}
ipsum \textcite{nussbaum}
dolor \textcite{sigfridsson}
sit \textcite{worman}
amet \textcite{geer,pines}
\printbibliography
\end{document}