1

Sometimes I cite papers or books that were published in the same year by the same author. The default option is to sort them alphabetically by title. So if item 1's title begins with an 'A' and item 2's title begins with a 'Z', and both were published in 2012 by Kagan, then item 1 will be (Kagan 2012a) and item 2 will be (Kagan 2012b). But that looks weird if I cite item 2 first. How can these items be sorted according to the order in which I cite them as opposed to alphabetically by title? I'd still like the order of all other items to be done alphabetically by the author's last name, and then the year of publication. Thanks!

Here's a MWE:

\documentclass[12pt]{article}

\usepackage{enumitem} %adjusts lists
\usepackage{baskervillef} %font
\usepackage[T1]{fontenc} %font
\usepackage[margin=25mm]{geometry} %changes margins
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@book{Kagan2012a,
    address = {New Haven, CT},
    author = {Kagan, Shelly},
    file = {:Users/James/Library/Application Support/Mendeley Desktop/Downloaded/Kagan - 2012 - Death.pdf:pdf},
    publisher = {Yale University Press},
    title = {{Death}},
    year = {2012}
}

@book{Kagan2012,
    address = {Oxford},
    author = {Kagan, Shelly},
    file = {:Users/James/Library/Application Support/Mendeley Desktop/Downloaded/Kagan - 2012 - The Geometry of Desert.pdf:pdf},
    publisher = {Oxford University Press},
    title = {{The Geometry of Desert}},
    year = {2012}
}
\end{filecontents}




%%%%%%%%%%BIBLIOGRAPHY

\usepackage[style=apa6, doi=false, url=false, isbn=false, date=year, natbib=true]{biblatex}
\setlength\bibitemsep{1.5\itemsep}
\AtEveryBibitem{\clearfield{chapter}} %gets rid of chapters
\DeclareFieldFormat{apacase}{#1} %stops capitalisation
\AtEveryBibitem{\clearfield{number}} %clears issue numbers
\DeclareFieldFormat[article]{volume}{\apanum{#1}} %de-italicises volume numbers
\renewcommand*{\finalnamedelim}{%
    \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}%
    \addspace\&\space} %replaces 'and' with '&' in in-text citations.

\addbibresource{\jobname.bib}

%%%%%%%%%%%%%%%%%%%%


%%%commands to stop hyphenation in bibliography
\renewcommand*{\bibsetup}{%
    \interlinepenalty=5000\relax
    \widowpenalty=10000\relax
    \clubpenalty=10000\relax
    % no hyphenation in the bibliography
    \hyphenpenalty=10000\exhyphenpenalty=10000\relax
    % increase allowed stretch to avoid overfull boxes
    \setlength{\emergencystretch}{1em}%
    \raggedbottom
    \frenchspacing
    \biburlsetup}
%%%



\title{Change the Ordering of Same-Author Same-Year Citations}


\begin{document}

\maketitle

In 2012, Shelly Kagan wrote two books. Suppose that I cite his book on what people deserve first, \citet{Kagan2012}, and then his book on death, \citet{Kagan2012a}. Since I've cited his book on desert first I would like that one to be (2012a) rather than (2012b). That is, I would like the `a' and `b' to be ordered according to the order in which they are cited as opposed to by the alphabetical order of the titles.

\printbibliography


\end{document}

Which outputs:

enter image description here

1 Answer 1

1

This change of course means that the document is no longer APA style compliant. If you do not want APA style it is usually easier to use one of the generic author-year standard styles (style=authoryear,) as basis than to base your custom style on biblatex-apa or biblatex-apa6.

Just add \sort{\citeorder} in the right place to your current sorting template to give the cite order precedence over the title. (You can find the original definition of the apa sorting template in apa6.bbx, ll. 189-224, in v8.5 2020/08/28)

\DeclareSortingTemplate{apa}{
  \sort{
    \field{presort}
  }
  \sort[final]{
    \field{sortkey}
  }
  \sort{
    \field{sortname}
    \field{author}
    \field{editor}
    \field{translator}
    \field{writer}
    \field{director}
    \field{producer}
    \field{execproducer}
    \field{sorttitle}
    \field{title}
  }
  \sort{
    \field{pubstate}
  }
  \sort{
    \field{sortyear}
    \field{year}
    \literal{-2000000000}% APA has "nodates" coming first
  }
  \sort{\citeorder}
  \sort{
    \field{sorttitle}
    \field{title}
  }
  \sort{
    \field{volume}
    \literal{0}
  }
}

Then

\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{baskervillef}

\usepackage[style=apa6, doi=false, url=false, isbn=false, date=year, natbib=true]{biblatex}

\setlength\bibitemsep{1.5\itemsep}

\DeclareFieldFormat{apacase}{#1}

\AtEveryBibitem{%
  \clearfield{chapter}
  \clearfield{number}}

\DeclareFieldFormat[article]{volume}{\apanum{#1}}

\DeclareDelimFormat{finalnamedelim}{%
  \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}%
  \addspace\&\space}

\renewcommand*{\bibsetup}{%
  \interlinepenalty=5000\relax
  \widowpenalty=10000\relax
  \clubpenalty=10000\relax
  \hyphenpenalty=10000\exhyphenpenalty=10000\relax
  \setlength{\emergencystretch}{1em}%
  \raggedbottom
  \frenchspacing
  \biburlsetup}

\DeclareSortingTemplate{apa}{
  \sort{
    \field{presort}
  }
  \sort[final]{
    \field{sortkey}
  }
  \sort{
    \field{sortname}
    \field{author}
    \field{editor}
    \field{translator}
    \field{writer}
    \field{director}
    \field{producer}
    \field{execproducer}
    \field{sorttitle}
    \field{title}
  }
  \sort{
    \field{pubstate}
  }
  \sort{
    \field{sortyear}
    \field{year}
    \literal{-2000000000}% APA has "nodates" coming first
  }
  \sort{\citeorder}
  \sort{
    \field{sorttitle}
    \field{title}
  }
  \sort{
    \field{volume}
    \literal{0}
  }
}

\begin{filecontents}{\jobname.bib}
@book{Kagan2012a,
  address   = {New Haven, CT},
  author    = {Kagan, Shelly},
  publisher = {Yale University Press},
  title     = {Death},
  year      = {2012},
}
@book{Kagan2012,
  address   = {Oxford},
  author    = {Kagan, Shelly},
  publisher = {Oxford University Press},
  title     = {The Geometry of Desert},
  year      = {2012},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
In 2012, Shelly Kagan wrote two books.
Suppose that I cite his book on what people deserve first, \citet{Kagan2012},
and then his book on death, \citet{Kagan2012a}.
Since I've cited his book on desert first
I would like that one to be (2012a) rather than (2012b).
That is, I would like the `a' and `b' to be ordered
according to the order in which they are cited
as opposed to by the alphabetical order of the titles.

\printbibliography
\end{document}

produces

Suppose that I cite his book on what people deserve frst, Kagan (2012a), and then his book on death, Kagan (2012b).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .