Biblatex - 如何更改参考书目中的期刊、卷数和页码格式

Biblatex - 如何更改参考书目中的期刊、卷数和页码格式

我在尝试更改 biblatex 传记中期刊文章的格式时遇到了一些困难。

我目前拥有的:

Smith, A. and Smith, J. (2006). Article title. Journal title 29.2, pp. 1-43.

目标是什么:

Smith, A. and Smith, J. (2006). Article title. Journal title, 29(2): 1-43.

并且(如果没有定义问题):

Smith, A. and Smith, J. (2006). Article title. Journal title, 29: 1-43.

这是我的 MWE:

\documentclass{article}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[backend=biber,style=authoryear,maxcitenames=2,maxbibnames=50,firstinits=true,uniquelist=false,uniquename=init,isbn=false,doi=false,useprefix=true]{biblatex}
\DeclareNameAlias{sortname}{last-first}
\DeclareFieldFormat[article]{title}{#1} 
\DeclareFieldFormat[article]{journaltitle}{#1} 
\DeclareFieldFormat[book]{title}{#1} 
\renewbibmacro{in:}{%
  \ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@Article{initials,
  author = {Doe, J. P. and Jones, J.},
  title = {An article coauthored by John-Paul Doe},
  journal = {Journal title},
  volume = {29},
  pages = {825--833},
  year = {2008}}
@Article{smitha,
  author = {Smith, Anne and Smith, Joe},
  title = {Article title},
  journal = {Journal title},
  volume = {29},
  number = {2},
  pages = {1--43},
  year = {2006}}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
\cite{initials,smitha}
\printbibliography
\end{document}

有什么想法吗?提前致谢。

答案1

此代码应该可以完成您想要的操作(根据@Moewe 的建议):

\documentclass{article}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[backend=biber,style=authoryear,maxcitenames=2,maxbibnames=50,firstinits=true,uniquelist=false,uniquename=init,isbn=false,doi=false,useprefix=true]{biblatex}
\DeclareNameAlias{sortname}{last-first}
\DeclareFieldFormat[article]{title}{#1}
\DeclareFieldFormat[article]{journaltitle}{#1}
\DeclareFieldFormat[book]{title}{#1}
\DeclareFieldFormat[article]{pages}{#1}
\renewbibmacro{in:}{%
 \ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}}

\usepackage{xpatch}
\xpatchbibmacro{journal+issuetitle}{%
  \setunit*{\addspace}%
  \iffieldundef{series}}
  {%
  \setunit*{\addcomma\space}%
  \iffieldundef{series}}{}{}


\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@Article{initials,
  author = {Doe, J. P. and Jones, J.},
  title = {An article coauthored by John-Paul Doe},
  journal = {Journal title},
  volume = {29},
  pages = {825--833},
  year = {2008}}
@Article{smitha,
  author = {Smith, Anne and Smith, Joe},
  title = {Article title},
  journal = {Journal title},
  volume = {29},
  number = {2},
  pages = {1--43},
  year = {2006}}
\end{filecontents}

\addbibresource{\jobname.bib}
\renewcommand\bibpagespunct{\ifentrytype{article}{\addcolon}{\addcomma}\space}
\renewbibmacro*{volume+number+eid}{%
  \printfield{volume}
  \printfield[parens]{number}%
  \setunit{\addcomma\space}%
  \printfield{eid}}

\begin{document}
\cite{initials,smitha}
\printbibliography
\end{document} 

在此处输入图片描述

相关内容