Biblatex Harvard 风格:修改文内引用

Biblatex Harvard 风格:修改文内引用

一个非常相似的问题到这个帖子,但它从未得到解决;我也没有找到任何快速的解决方案,可能是因为这是一个菜鸟问题...希望有人可以为困惑的菜鸟提供答案。

当前biblatex生成的作者年份样式的文内引用如下所示:

(史密斯 2006,第 50 页)

我希望在文内引用的每个元素之间添加逗号,如下所示:

(Smith,2006,第 50 页)

我当前的代码biblatex(我相信大多数用于修改参考书目中的完整引用,因此指出我可以编辑的地方会很有帮助):

\usepackage[backend=biber,style=ext-authoryear,maxbibnames=99,giveninits=true,innamebeforetitle=true,dashed=false,uniquename=init]{biblatex}
\addbibresource{1.bib}
%force forcing the bib entries not to be split across pages, which is done by setting \interlinepenalty to 10000.
\renewcommand*{\bibsetup}{%
  \interlinepenalty=10000\relax % default is 5000
  \widowpenalty=10000\relax
  \clubpenalty=10000\relax
  \raggedbottom
  \frenchspacing
  \biburlsetup}
% space between biblio items
\setlength\bibitemsep{1.7\itemsep}
%Last-First name order
\DeclareNameAlias{sortname}{family-given}
\DeclareNameAlias{default}{family-given}
% Put editor string in parentheses
\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\DeclareDelimFormat{editortypedelim}{\addspace}

\DeclareFieldAlias{translatortype}{editortype}
\DeclareDelimAlias{translatortypedelim}{editortypedelim}

% Print editors before "in" title
\renewbibmacro*{in:}{%
  \setunit{\addcomma\space}%
  \bibstring{in}%
  \printunit{\intitlepunct}}

\DeclareDelimFormat[bib]{innametitledelim}{\addspace}
 
%remove pp in-text citations
\DefineBibliographyStrings{english}{
  page             = {},
  pages            = {},
} 
\renewcommand{\postnotedelim}{\addcolon}

\NewBibliographyString{available}
\DefineBibliographyStrings{english}{
    available = {Available at},
    urlseen = {accessed on}
    andothers = {\em et\addabbrvspace al\adddot}
}
\DeclareFieldFormat{url}{\bibstring{available}\addcolon\space\url{#1}}
\DeclareFieldFormat{urldate}{\addcomma\space\bibstring{urlseen}\space#1}

\renewbibmacro*{name:andothers}{% Based on name:andothers from biblatex.def
  \ifboolexpr{
    test {\ifnumequal{\value{listcount}}{\value{liststop}}}
    and
    test \ifmorenames
  }
    {\ifnumgreater{\value{liststop}}{1}
       {\finalandcomma}
       {}%
     \andothersdelim\bibstring[\emph]{andothers}}
    {}}

我的1.bib文件:

@book{Smith2006,
publisher = {Routledge},
title = {Uses of heritage},
year = 2006,
author = {Smith, Laurajane},
address = {London},
}

答案1

引文中姓名和年份之间的标点符号由上下文相关分隔符 控制nameyeardelim。年份和后注/页码范围之间的标点符号由控制postnotedelim

所以你可能想要类似的东西

\DeclareDelimFormat{nameyeardelim}{\addcomma\space}
\DeclareDelimFormat{postnotedelim}{\addcomma\space}

总的来说(做了一些小改动,让一些内容更加符合地道,如果您需要提示,请发表评论)

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[
  backend=biber,
  style=ext-authoryear,
  maxbibnames=99,giveninits=true,uniquename=init,
  innamebeforetitle=true,
  dashed=false,
]{biblatex}

\renewcommand*{\bibsetup}{%
  \interlinepenalty=10000\relax % default is 5000
  \widowpenalty=10000\relax
  \clubpenalty=10000\relax
  \raggedbottom
  \frenchspacing
  \biburlsetup}

\setlength\bibitemsep{1.7\itemsep}

\DeclareNameAlias{sortname}{family-given}
\DeclareNameAlias{default}{family-given}

\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\DeclareDelimFormat{editortypedelim}{\addspace}

\DeclareFieldAlias{translatortype}{editortype}
\DeclareDelimAlias{translatortypedelim}{editortypedelim}


\renewbibmacro*{in:}{%
  \setunit{\addcomma\space}%
  \bibstring{in}%
  \printunit{\intitlepunct}}

\DeclareDelimFormat[bib]{innametitledelim}{\addspace}
 
\DeclareDelimFormat{nameyeardelim}{\addcomma\space}

%remove pp in-text citations
\DeclareFieldFormat{postnote}{\mknormrange{#1}}
\DeclareDelimFormat{postnotedelim}{\addcomma\space}

\NewBibliographyString{available}
\DefineBibliographyStrings{english}{
  available = {Available at},
  urlseen   = {accessed on}
}

\DefineBibliographyExtras{british}{%
  \DeclareBibstringSet{latin}{andothers,ibidem}%
  \DeclareBibstringSetFormat{latin}{\mkbibemph{#1}}%
}
\UndefineBibliographyExtras{british}{%
  \UndeclareBibstringSet{latin}%
}

\DeclareFieldFormat{url}{\bibstring{available}\addcolon\space\url{#1}}
\DeclareFieldFormat{urldate}{\bibstring{urlseen}\space#1}
\renewbibmacro*{url+urldate}{%
  \usebibmacro{url}%
  \iffieldundef{urlyear}
    {}
    {\setunit*{\addcomma\space}%
     \usebibmacro{urldate}}}

\addbibresource{biblatex-examples.bib}

\begin{document}
Lorem \autocite{sigfridsson}
ipsum \autocite[12]{worman}
dolor \autocite{aksin}

\printbibliography
\end{document}

Lorem(Sigfridsson 和 Ryde,1998) ipsum(Worman,2002,12) dolor(Aksın 等,2006)

相关内容