3

I have a document in which two papers have the same first-author and the same year. With my current bitex-style file, papers are listed and numbered according to the year and then the authors, which is generally good, but in this specific case I'd like to have the both papers listed according to their appearance and not by their second authors:

example:

current listings:

hqkjshdqksd qhsdqh by Peterson et al. (**2013b**), hdqkjshdkqjsdhsqd (Peterson et al. **2013a**).

References:

Peterson, A. & **Meier**, B. **2013a** Second listed reference

Peterson, A. & **Umber**, B. **2013b** First listed reference

should be:

hqkjshdqksd qhsdqh by Peterson et al. (**2013a**), hdqkjshdkqjsdhsqd (Peterson et al. **2013b**).

References:

Peterson, A. & **Umber**, B. **2013a** First listed reference

Peterson, A. & **Meier**, B. **2013b** Second listed reference

Not sure how to achieve this. Was trying to hack the bibtex file since its the only problem but with no success. Think it's related to on of the sort.format.nales, author.sort, calc.label or presort functions (see below). Thx in advance!!

FUNCTION {sort.format.names}
{ 's :=
  #1 'nameptr :=
  ""
  s num.names$ 'numnames :=
  numnames 'namesleft :=
    { namesleft #0 > }
    { s nameptr
      "{vv{ } }{ll{ }}{  f{ }}{  jj{ }}"
      format.name$ 't :=
      nameptr #1 >
        {
          nameptr #7
          #1 + =
          numnames #7
          > and
            { "others" 't :=
              #1 'namesleft := }
            'skip$
          if$
          "   "  *
          namesleft #1 = t "others" = and
            { "zzzzz" * }
            { t sortify * }
          if$
        }
        { t sortify * }
      if$
      nameptr #1 + 'nameptr :=
      namesleft #1 - 'namesleft :=
    }
  while$
}

FUNCTION {author.sort}
{ author empty$
    { key empty$
        { "to sort, need author or key in " cite$ * warning$
          ""
        }
        { key sortify }
      if$
    }
    { author sort.format.names }
  if$
}
FUNCTION {calc.label}
{ calc.short.authors
  short.list
  "("
  *
  year duplicate$ empty$
  short.list key field.or.null = or
     { pop$ "" }
     'skip$
  if$
  *
  'label :=
}

FUNCTION {presort}
{ calc.label
  label sortify
  "    "
  *
  type$ "book" =
  type$ "inbook" =
  or
    'author.editor.sort
    { type$ "proceedings" =
        'editor.sort
        'author.sort
      if$
    }
  if$
  #1 entry.max$ substring$
  'sort.label :=
  sort.label
  *
  "    "
  *
  title field.or.null
  sort.format.title
  *
  #1 entry.max$ substring$
  'sort.key$ :=
}

MWE:

\documentclass[english]{article} 
\usepackage[authoryear]{natbib} 
\usepackage{babel} 
\begin{document} 
hqkjshdqksd qhsdqh by \citet{Peterson2013}, 
hdqkjshdkqjsdhsqd \citep{Peterson2013a}. 
\bibliographystyle{icesjms} 
\bibliography{order_citations} 
\end{document}

bib file:

@ARTICLE{Peterson2013a, 
  author = {Peterson, A and Meier, B. and Kensington, U}, 
  title = {Second listed reference}, 
  year = {2013}, 
  owner = {robert}, 
  timestamp = {2013.07.17} 
} 
@ARTICLE{Peterson2013, 
  author = {Peterson, A and Umber, B. and Kensington, U}, 
  title = {First listed reference}, 
  year = {2013}, 
  owner = {robert}, 
  timestamp = {2013.07.17} 
}
  • 2
    I suggest you take a look at the bibtex manual and, in particular, the provision and use of the \noopsort LaTeX macro to override the default sorting order for the two publications in question. – Mico Jul 17 '13 at 13:05
4

Many thx to Mico! \noopsort did the job!

made just the follwing changes in the .bib-file:

@PREAMBLE{ {\providecommand{\noopsort}[1]{}} 

@ARTICLE{Peterson2013b,
  author = {Peterson, A. and {\noopsort{b}}Meier, B. and Kensington, U},
  title = {Second listed reference},
  year = {2013},
  owner = {robert},
  timestamp = {2013.07.17}
}

@ARTICLE{Peterson2013a,
  author = {Peterson, A. and {\noopsort{a}}Umber, B. and Kensington, U},
  title = {First listed reference},
  year = {2013},
  owner = {robert},
  timestamp = {2013.07.17}
}

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.