2

I'm using biom.bst to reference papers in LaTeX. If I have two references to two different papers with exactly the same authors on the same year, the reference is correctly formatted in the citation and in the bibliography to disambiguate using an 'a' and 'b' appended to the year:

For example, if the .bib file contains:

@article{sumner2012a,
    author={Sumner, Jeremy G. and Fern{\'a}ndez-S{\'a}nchez, J. and Jarvis, P.D.},
    title={Lie Markov Models},
    year = {2012}
}

@article{sumner2012b,
    author={Sumner, Jeremy G. and Fern{\'a}ndez-S{\'a}nchez, J. and Jarvis, P.D.},
    title={Some other paper with exact same authors in same year},
    year = {2012}
}

And I cite both papers like this:

\citep{sumner2012a} \citep{sumner2012b}

The citation appears correctly with 'a' and 'b' like this:

(Sumner et al., 2012a) (Sumner et al., 2012b)

And the bibliography is also formatted correctly with 'a' and 'b':

Sumner, J. G., Fernández-Sánchez, J., and Jarvis, P. (2012a).
    Lie markov models.
Sumner, J. G., Fernández-Sánchez, J., and Jarvis, P. (2012b).
    Some other paper with exact same authors in same year.

The problem is when the lead author is the same, the year is the same, but secondary authors are different. For example, if the .bib file contains (same lead author Sumner but different secondary authors):

@article{sumner2012a,
    author = {Sumner, Jeremy G. and Jarvis, Peter D. and Fern{\'a}ndez-S{\'a}nchez, Jes{\'u}s and Kaine, Bodie T. and Woodhams, Michael D. and Holland, Barbara R.},
    title = {Is the General Time-Reversible Model Bad for Molecular Phylogenetics?},
    year = {2012}
}

@article{sumner2012b,
    author={Sumner, Jeremy G. and Fern{\'a}ndez-S{\'a}nchez, J. and Jarvis, P.D.},
    title={Lie Markov Models},
    year = {2012}
}

The 'a' and 'b' letters do not appear, so the citations are ambiguous:

(Sumner et al., 2012) (Sumner et al., 2012)

Sumner, J. G., Fernández-Sánchez, J., and Jarvis, P. (2012).
    Lie Markov Models
Sumner, J. G., Jarvis, P. D., Fernández-Sánchez, J., Kaine, B. T., Woodhams, M. D., and Holland, B. R. (2012).
    Is the general time-reversible model bad for molecular phylogenetics?

I think I've narrowed down the part of the BST file which prints the year and disambiguating letter (called extra.label):

FUNCTION {output.year.check}
{ year empty$
    { "empty year in " cite$ * warning$ }
    { write$
      " (" year * extra.label * ")" *
      mid.sentence 'output.state :=
    }
  if$
}

And possibly these functions:

FUNCTION {initialize.extra.label.stuff} 
{ #0 int.to.chr$ 'last.label :=
     "" 'next.extra :=
     #0 'last.extra.num :=
}

FUNCTION {forward.pass}
{ last.label label =
    { last.extra.num #1 + 'last.extra.num :=
      last.extra.num int.to.chr$ 'extra.label :=
    }
    { "a" chr.to.int$ 'last.extra.num :=
      "" 'extra.label :=
      label 'last.label :=
    }
  if$
}

FUNCTION {reverse.pass}       
{ next.extra "b" =
    { "a" 'extra.label := }
    'skip$
  if$
  label extra.label * "}" * 'label :=
  extra.label 'next.extra :=
}

EXECUTE {initialize.extra.label.stuff}

ITERATE {forward.pass}

REVERSE {reverse.pass}

But I have absolutely no idea how this code works or how to fix this bug. I essentially need it to check if just the first author is the same when determining if it needs to print the extra.label, instead of checking if ALL the authors are the same. Any suggestions?

Minimal working example, demonstrating what works (Tumner) and what doesn't (Sumner). The class file obtained from http://www.biometrics.tibs.org/biom.cls.txt.

\documentclass[useAMS,usenatbib]{biom}

\usepackage{filecontents}
\begin{filecontents}{biblio.bib}
@article{sumner2012a,
author = {Sumner, Jeremy G. and Jarvis, Peter D. and Fern{\'a}ndez-S{\'a}nchez, Jes{\'u}s and Kaine, Bodie T. and Woodhams, Michael D. and Holland, Barbara R.},
title = {Is the General Time-Reversible Model Bad for Molecular Phylogenetics?},
year = {2012}
}
@article{sumner2012b,
    author={Sumner, Jeremy G. and Fern{\'a}ndez-S{\'a}nchez, J. and Jarvis, P.D.},
    title={Some other paper with exact same authors in same year},
    year = {2012}
}
@article{tumner2013c,
author = {Tumner, Jeremy G. and Jarvis, Peter D.},
title = {Is the General Time-Reversible Model Bad for Molecular Phylogenetics?},
year = {2013}
}
@article{tumner2013d,
    author={Tumner, Jeremy G. and Jarvis, Peter D.},
    title={Some other paper with exact same authors in same year},
    year = {2013}
}
\end{filecontents}

\title[Title]{Title}
\author{Jane Author$^*$\email{ja@noreply.com}}
\begin{document}
\date{{\it Received June} 2018. {\it Revised October} 2018.  {\it
Accepted December} 2018.}
\pagerange{\pageref{firstpage}--\pageref{lastpage}} 
\volume{100}
\pubyear{2018}
\artmonth{December}
\doi{10.1111/j.1541-0420.2005.00454.x}

\begin{abstract}
Abstract
\end{abstract}

\maketitle
\label{firstpage}
\section{Introduction}

\citep{sumner2012a} \citep{sumner2012b}
\citep{tumner2013c} \citep{tumner2013d}

\backmatter

\bibliographystyle{biom}
\bibliography{biblio}

\label{lastpage}

\end{document}

enter image description here

  • A short MWE would be helpful, indeed. Is this a biblatex usage or bibtex for example? – Steven B. Segletes Apr 11 '18 at 11:39
  • I'm not sure, I'm really not an expert in these things. MWE example appended, which compiles in Overleaf. Thanks – James Allen Apr 11 '18 at 12:26
  • I expanded your MWE to show what works and what doesn't – Steven B. Segletes Apr 11 '18 at 12:40
1

It might be as simple as commenting the line in biom.bst

  "\protect\citeauthoryear{" author my.full.label * "}{" * swap$ * "}{" 

and uncommenting the following line:

  "\protect\citeauthoryear{" author format.lab.names * "}{" * swap$ * "}{" 

These two lines appear as part of the function calc.label in biom.bst:

FUNCTION {calc.label}      
{ type$ "book" =
  type$ "inbook" =
  or
    'author.editor.key.label
    { type$ "proceedings" =
        'editor.key.label                       
        'author.key.label                       
      if$
    }
  if$
%  "\protect\citeauthoryear{" author my.full.label * "}{" * swap$ * "}{"                    
  "\protect\citeauthoryear{" author format.lab.names * "}{" * swap$ * "}{"                    
%  "\protect\citeauthoryear{" format.authors * "}{" * swap$ * "}{"                    
%  "\protect\citeauthoryear{" swap$ * "}{"                   
  *                                                     
  year field.or.null purify$ #-1 #4 substring$          
  *                       
  'label :=
} 

With that, the MWE, repeated from above as

\documentclass[useAMS,usenatbib]{biom}

\usepackage{filecontents}
\begin{filecontents}{biblio.bib}
@article{sumner2012a,
author = {Sumner, Jeremy G. and Jarvis, Peter D. and Fern{\'a}ndez-S{\'a}nchez, Jes{\'u}s and Kaine, Bodie T. and Woodhams, Michael D. and Holland, Barbara R.},
title = {Is the General Time-Reversible Model Bad for Molecular Phylogenetics?},
year = {2012}
}
@article{sumner2012b,
    author={Sumner, Jeremy G. and Fern{\'a}ndez-S{\'a}nchez, J. and Jarvis, P.D.},
    title={Some other paper with exact same authors in same year},
    year = {2012}
}
@article{tumner2013c,
author = {Tumner, Jeremy G. and Jarvis, Peter D.},
title = {Is the General Time-Reversible Model Bad for Molecular Phylogenetics?},
year = {2013}
}
@article{tumner2013d,
    author={Tumner, Jeremy G. and Jarvis, Peter D.},
    title={Some other paper with exact same authors in same year},
    year = {2013}
}
\end{filecontents}

\title[Title]{Title}
\author{Jane Author$^*$\email{ja@noreply.com}}
\begin{document}
\date{{\it Received June} 2018. {\it Revised October} 2018.  {\it
Accepted December} 2018.}
\pagerange{\pageref{firstpage}--\pageref{lastpage}} 
\volume{100}
\pubyear{2018}
\artmonth{December}
\doi{10.1111/j.1541-0420.2005.00454.x}

\begin{abstract}
Abstract
\end{abstract}

\maketitle
\label{firstpage}
\section{Introduction}

\citep{sumner2012a} \citep{sumner2012b}
\citep{tumner2013c} \citep{tumner2013d}

\backmatter

\bibliographystyle{biom}
\bibliography{biblio}

\label{lastpage}

\end{document}

yields what would seem to be the right output, though I don't know if it breaks other things:

enter image description here

  • Great, thanks that appears to work well and as far as I can tell hasn't broken anything else. Thank you! – James Allen Apr 11 '18 at 13:33
  • @JamesAllen Great! By the way, the bst file also has an alternate function format.lab.names2. If you run into a problem with my solution (using format.lab.names), I would certainly try the alternate version to see if that fixes it. – Steven B. Segletes Apr 11 '18 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.