如何按年份排列引用顺序(但引用参考文献是按照字母顺序排列的?)

如何按年份排列引用顺序(但引用参考文献是按照字母顺序排列的?)

这是另一个问题引用时使用 ; 而不是 &

如何按年份排列引用顺序(但引用参考文献是按照字母顺序排列的?)

我希望拥有:

(Hands et al.,2014; 2016; Mudariki et al., 2014)

而不是(2014 年在前)

(Hands et al.,2016; 2014; Mudariki et al., 2014)

在此处输入图片描述

我的 MWE:

\documentclass{article}
\usepackage{xpatch}
% \usepackage[style = authoryear-comp, maxnames = 99]{biblatex}

\usepackage[backend=biber, 
% style=authoryear, 
 style=authoryear-comp,
% citestyle=authoryear, 
dashed=false,
maxcitenames=2,
maxbibnames=99,
uniquelist=false, 
giveninits,
alldates=comp, 
dateabbrev=false,
uniquename=false,backref=true,backrefstyle=none]{biblatex}

% \renewcommand*{\compcitedelim}{\addspace\&\space}

% to make volume (number), eg. 4(2)
\newcommand*{\volnumdelim}{}
\DeclareFieldFormat[article,periodical]{number}{\mkbibparens{#1}}

\renewbibmacro*{volume+number+eid}{%
  \printfield{volume}%
  \setunit*{\volnumdelim}%
  \printfield{number}%
  \setunit{\addcomma\space}%
  \printfield{eid}}

\newcommand*{\jourvoldelim}{\addcomma\space}
\newcommand*{\jourserdelim}{\newunitpunct}
\newcommand*{\servoldelim}{\jourvoldelim}
\newcommand*{\volnumdatedelim}{\addspace}

\renewbibmacro*{journal+issuetitle}{%
  \usebibmacro{journal}%
  \setunit*{\jourvoldelim}%
  \iffieldundef{series}
    {}
    {\setunit*{\jourserdelim}%
     \printfield{series}%
     \setunit{\servoldelim}}%
  \usebibmacro{volume+number+eid}%
  \setunit{\volnumdatedelim}%
  \usebibmacro{issue+date}%
  \setunit{\addcolon\space}%
  \usebibmacro{issue}%
  \newunit}  
% to make volume (number), eg. 4(2)
\DeclareNameAlias{sortname}{family-given} %for second and third author name
\DeclareFieldFormat{postnote}{\printtext[bibhyperref]{#1}}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage[english]{babel}
\usepackage{csquotes}



\addto\captionsenglish{
\renewcommand{\listfigurename}{\textsf{List of Figures}}
\renewcommand{\listtablename}{\textsf{List of Tables}}
}

% Flag for whether to add front matter to TOC
\newtoggle{fulltoc}
\toggletrue{fulltoc}  % Change to \togglefalse{fulltoc} to remove front matter
\renewcommand{\contentsname}{Table of Contents}


\usepackage[unicode,colorlinks,citecolor=blue]{hyperref}


% for a chapter edited by a book
\usepackage{xpatch}
% \renewcommand*{\finalnamedelim}{\addspace\&\space} 
% \renewcommand*{\intitlepunct}{\space} (to become In:)
\renewcommand{\labelnamepunct}{\space} %to delete . after (1997)
% \DeclareFieldFormat[article, incollection, unpublished]{pages}{#1} % to add in PP. (page)
\DeclareFieldFormat[article, incollection, unpublished]{title}{#1}
% \renewcommand{\bibpagespunct}{\ifentrytype{article}{\addcolon}{\addperiod\addspace}} %cancel out this in order to add in PP. (page)


% for title italic
% \DeclareFieldFormat*{title}{\mkbibemph{#1}} %for title italic in all format (conference, paper..)
\DeclareFieldFormat*{title}{#1} %for conference title delete ".."
\DeclareFieldFormat[incollection]{title}{\mkbibemph{#1}} %for incollecion title italic ONLY
\DeclareFieldFormat[thesis]{title}{\mkbibemph{#1}} %for phdthesis title italic ONLY
% for title italic

% to delete "In:" for article
\renewbibmacro{in:}{%
  \ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}}
% to delete "In:" for article


% for delete comma after Author A and Aurhor b
\DefineBibliographyExtras{english}{%
   \let\finalandcomma\empty
   \let\finalandsemicolon\empty
 }
\renewcommand{\compcitedelim}{\space\&\space}
\DeclareNameAlias{editorin}{given-family}

\newbibmacro*{byeditor:in}{%
  \ifnameundef{editor}
    {}
    {\printnames[editorin]{editor}%
     \setunit{\addcomma\space}%
     \usebibmacro{editorstrg}%
     \clearname{editor}}}     


\DeclareDelimFormat[textcite]{postnotedelim}{\addcolon\space}
\DeclareDelimFormat[parencite]{postnotedelim}{\addcolon\space}

% \DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{postnote}{\printtext[bibhyperref]{#1}}
\DeclareFieldFormat{multipostnote}{#1}


% for references 's studies (year)
\renewcommand*{\nameyeardelim}{\addcomma\space}
\newcommand{\mycite}[1]{\citeauthor{#1}'s \citeyear{#1}}

\DeclareCiteCommand{\citeauthor}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\ifciteindex
     {\indexnames{labelname}}
     {}%
   \printtext[bibhyperref]{\printnames{labelname}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\citeyear} % <======================================
    {}
    {(\bibhyperref{\printdate})}
    {\multicitedelim}
    {}

\DeclareCiteCommand{\parencite}[\mkbibparens]
  {\renewcommand*{\postnotedelim}{\addcolon\space}%
   \usebibmacro{cite:init}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \printtext[bibhyperref]{\usebibmacro{cite}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\cbx@textcite}
  {\renewcommand*{\postnotedelim}{\addsemicolon\space}%
   \usebibmacro{cite:init}}
  {\usebibmacro{citeindex}%
   \usebibmacro{textcite}}
  {}
  {\usebibmacro{textcite:postnote}}  



\makeatletter
\let\abx@macro@textciteOrig\abx@macro@textcite
\renewbibmacro{textcite}{% <============================================
   \bibhyperref{%
   \let\bibhyperref\relax\relax%
   \abx@macro@textciteOrig%
   }%
}%
\makeatother
% for references 's studies (year)





\DeclareFieldFormat{url}{Available at\addcolon\space\url{#1}}
\DeclareFieldFormat{urldate}{\mkbibbrackets{\bibstring{urlseen}\space#1}}
\DeclareFieldFormat[online]{title}{\mkbibemph{#1}}
\DefineBibliographyStrings{english}{%
  urlseen = {Accessed},
}

\DefineBibliographyExtras{english}{%
  \protected\def\mkdaterangecomp{%
    \mkdaterangetrunc{long}}%
  \protected\def\mkdaterangeterse{%
    \mkdaterangetrunc{short}}%
  \protected\def\mkdaterangecompextra{%
    \mkdaterangetruncextra{long}}%
  \protected\def\mkdaterangeterseextra{%
    \mkdaterangetruncextra{short}}%
  \protected\def\mkbibdatelong#1#2#3{%
    \iffieldundef{#3}
      {}
      {\thefield{#3}%
       \iffieldundef{#2}{}{\nobreakspace}}%
    \iffieldundef{#2}
      {}
      {\mkbibmonth{\thefield{#2}}%
       \iffieldundef{#1}{}{\space}}%
    \iffieldbibstring{#1}
      {\bibstring{\thefield{#1}}}
      {\dateeraprintpre{#1}\stripzeros{\thefield{#1}}}}%
}





\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}



@article{hands2014attenuated,
  title={Title 1},
  author={Hands, James R and Dorling, Konrad M and Abel, Peter and Ashton, Katherine M and Brodbelt, Andrew and Davis, Charles and Dawson, Timothy and Jenkinson, Michael D and Lea, Robert W and Walker, Carol and others},
  journal={Journal of biophotonics},
  volume={7},
  number={3-4},
  pages={189--199},
  year={2014},
  publisher={Wiley Online Library}
}

@article{hands2016brain,
  title={Title 2},
  author={Hands, James R and Clemens, Graeme and Stables, Ryan and Ashton, Katherine and Brodbelt, Andrew and Davis, Charles and Dawson, Timothy P and Jenkinson, Michael D and Lea, Robert W and Walker, Carol and others},
  journal={Journal of neuro-oncology},
  volume={127},
  number={3},
  pages={463--472},
  year={2016},
  publisher={Springer}
}

@article{mudariki2014p59diagnostic,
  title={Title 3},
  author={Mudariki, T and Lea, RW and Clemens, G and Baker, MJ},
  journal={Neuro-oncology},
  volume={16},
  number={Suppl 6},
  pages={vi10},
  year={2014},
  publisher={Oxford University Press}
}




\end{filecontents*}

\addbibresource{\jobname.bib}

\begin{document}
\nocite{WinNT}

The sample ABC is done by \parencite{hands2014attenuated, mudariki2014p59diagnostic, hands2016brain} in a way.



\printbibliography
\end{document}

答案1

以下 MWE 重现了您所看到的内容

\documentclass{article}

\usepackage[backend=biber, 
  style=authoryear-comp,
  maxcitenames=2,
  maxbibnames=99,
  uniquelist=false, 
  giveninits,
]{biblatex}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{hands2014attenuated,
  title    ={Title 1},
  author   ={Hands, James R. and Dorling, Konrad M. and Abel, Peter
             and Ashton, Katherine M. and Brodbelt, Andrew and Davis, Charles
             and Dawson, Timothy and Jenkinson, Michael D. and Lea, Robert W.
             and Walker, Carol and others},
  journal  ={Journal of biophotonics},
  volume   ={7},
  number   ={3-4},
  pages    ={189--199},
  year     ={2014},
}
@article{hands2016brain,
  title   = {Title 2},
  author  = {Hands, James R. and Clemens, Graeme and Stables, Ryan
             and Ashton, Katherine and Brodbelt, Andrew and Davis, Charles
             and Dawson, Timothy P. and Jenkinson, Michael D.
             and Lea, Robert W. and Walker, Carol and others},
  journal = {Journal of neuro-oncology},
  volume  = {127},
  number  = {3},
  pages   = {463--472},
  year    = {2016},
}
@article{mudariki2014p59diagnostic,
  title   = {Title 3},
  author  = {Mudariki, T. and Lea, R. W.  and Clemens, G. and Baker, M. J.},
  journal = {Neuro-oncology},
  volume  = {16},
  number  = {Suppl 6},
  pages   = {vi10},
  year    = {2014},
}
\end{filecontents*}

\addbibresource{\jobname.bib}

\begin{document}
Lorem
\parencite{hands2014attenuated, mudariki2014p59diagnostic, hands2016brain}

\printbibliography
\end{document}

问题出现的原因是引用的排序与参考书目完全一样。如果你仔细查看参考书目,你会发现引用hands2016brain排在前面,hands2014attenuated因为排序考虑了所有显示的合著者(2016 年论文中的 Clemens 排在 2014 年论文中的 Dorling 之前)。

我认为这里没有一个好的解决方案,但你可以添加maxsortnames=2,到你的参考书目选项中(请注意,选项必须被设定 maxbibnames/maxnames如果存在maxbibnames/ maxnames;另请参阅biblatex 排序问题如何在 biblatex 中建立复杂的参考文献排序方案?)。这样,排序将只考虑引用中显示的相同数量的名称,因此您的引用将按正确顺序显示。不过,参考书目会有点乱序。

\documentclass{article}

\usepackage[backend=biber, 
  style=authoryear-comp,
  maxcitenames=2,
  maxbibnames=99,
  maxsortnames=2,
  uniquelist=false, 
  giveninits,
]{biblatex}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{hands2014attenuated,
  title    ={Title 1},
  author   ={Hands, James R. and Dorling, Konrad M. and Abel, Peter
             and Ashton, Katherine M. and Brodbelt, Andrew and Davis, Charles
             and Dawson, Timothy and Jenkinson, Michael D. and Lea, Robert W.
             and Walker, Carol and others},
  journal  ={Journal of biophotonics},
  volume   ={7},
  number   ={3-4},
  pages    ={189--199},
  year     ={2014},
}
@article{hands2016brain,
  title   = {Title 2},
  author  = {Hands, James R. and Clemens, Graeme and Stables, Ryan
             and Ashton, Katherine and Brodbelt, Andrew and Davis, Charles
             and Dawson, Timothy P. and Jenkinson, Michael D.
             and Lea, Robert W. and Walker, Carol and others},
  journal = {Journal of neuro-oncology},
  volume  = {127},
  number  = {3},
  pages   = {463--472},
  year    = {2016},
}
@article{mudariki2014p59diagnostic,
  title   = {Title 3},
  author  = {Mudariki, T. and Lea, R. W.  and Clemens, G. and Baker, M. J.},
  journal = {Neuro-oncology},
  volume  = {16},
  number  = {Suppl 6},
  pages   = {vi10},
  year    = {2014},
}
\end{filecontents*}

\addbibresource{\jobname.bib}

\begin{document}
Lorem
\parencite{hands2014attenuated, mudariki2014p59diagnostic, hands2016brain}

\printbibliography
\end{document}

2014 年手记 > 2016 年手记

相关内容