[Tex/LaTex] Sorting references alphabetically

bibtexnatbibsorting

I am trying to use a modified (German) bibstyle from the American Economic Review (The original version can be downloaded from http://mirrors.ctan.org/biblio/bibtex/contrib/economic/aer.bst. I have simply replaced "and" by "und", "Vol." by "Bd.", "eds."/"ed." by "Hrsg." and normal quotes with German ones. ). The references appear in the format:
"Lastname, Firstname" for the first author and "Firstname Lastname" for all others.

The ordering of the references should be by the authors' last names; however if I have two papers written by three authors with the same first author Bibtex arranges them in an incorrect order:

E.g. using Bibtex I get
Felbermayr, Gabriel J., Julien Prat und Hans-Jörg Schmerer ….

Felbermayr, Gabriel J., Mario Larch und Wolfgang Lechthaler ….

That is given that the first author is identical, Bibtex sorts the papers by the second author's first name. However, I would like it to show up as

Felbermayr, Gabriel J., Mario Larch und Wolfgang Lechthaler ….
Felbermayr, Gabriel J., Julien Prat und Hans-Jörg Schmerer ….

Moreover, I get a similar problem if there is one paper written by two authors and those very same authors have written another paper together with a third author. For instance, I get:

Helpman, Elhanan, Oleg Itskhoki und Stephen J. Redding… in front of

Helpman, Elhanan, und Oleg Itskhoki…, which is the wrong order.

Can anyone help me with this?

MWE

Test.tex:

\documentclass[%
fontsize=12pt,                              % Schriftgr??e (12pt, 11pt (Standard))
titlepage,                      % Titelei auf eigener Seite
headings=small,         % Überschriften etwas kleiner (smallheadings)
]{scrartcl}


\usepackage{setspace}
\usepackage{amsmath}
\usepackage{pdfpages}

%% Deutsche Anpassungen %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[T1]{fontenc}
\usepackage[ansinew]{inputenc}
\usepackage[ngerman]{babel}

\usepackage{geometry} 
\geometry{a4paper, top=25mm, left=40mm, right=20mm, bottom=20mm} 

\usepackage{mathptmx}
\usepackage{mathspec}
\setromanfont{Times New Roman}
\addtokomafont{disposition}{\rmfamily}
\usepackage{graphicx} %%Zum Laden von Grafiken
\usepackage{color}
\makeatletter 


\usepackage{titlesec}
\usepackage{hyperref}

%% Bibliographiestil %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{natbib}
\bibliographystyle{aer_german3}
\renewcommand*{\bibfont}{\footnotesize}
\setlength{\bibsep}{0.0pt}

\setlength{\footskip}{1cm}
\setmainfont[Mapping=tex-text]{Times New Roman}
\usepackage{unicode-math} \setmathfont{XITS Math}


\makeatother

\makeatletter
\renewcommand{\@makefntext}[1]{\setlength{\parindent}{0pt}%
\begin{list}{}{%
\setlength{\topsep}{0pt}%
\setlength{\partopsep}{0pt}%
\settowidth{\labelwidth}{00\@thefnmark}%
% ^^ Anzahl_Nullen =df. Abstand
\setlength{\labelsep}{0.7pt}%
\setlength{\leftmargin}{\labelwidth}%
\addtolength{\leftmargin}{\labelsep}%
\footnotesize}\item[\@makefnmark\hfill]#1%
\end{list}}
\makeatother


\begin{document}
TEXT \citep{Felbermayr.2011} \citep{Felbermayr.2013} \citep{HELPMAN.2010} \citep{Helpman.2010c}
\bibliography{BA2-MWE}
\end{document}

The files aer-german3.bst and BA2-MWE.bib can be found here.

ADDITIONAL COMMENT: Using the original English bibstyle resolves the latter problem, but not the first one.

By the way, I am using Texmaker together with MikTex

Best Answer

I had a look to your given files and found several errors there.

I will only list some of the errors here:

  • In your bib file you wrote several times year = {2011a}, or simular. There is only a number allowed, the year. The a should you better write in the key, for example @article{Felbermayr.2011a,
  • And so I changed in your tex code the \cite commands to use the corresponding cite keys.
  • You mixed environments for pdflatex (inputenc) and xelatex (\setmainfont). I commented the first one.
  • Because in your german bst file version are so much errors I changed the style to the english style. My answer here is late so I do not correct the german bst file if there is no need for that work. One remark: not all "and" can be changed to "und". Only the one enclosed with " " ... Most of the errors you got are caused in the faulty german version of the bst file ...
  • I made your code shorter (deleted unused code for the preblem here) and used package filecontents to add the corrrected bib file into the mwe.
  • I fixed some warnings because the bst file uses old commands \bf etc.
  • I moved package hyperref to be the last called package. You should rework the order of package calls ...

The following MWE compiles without error and only one warning (comming from filecontents, that's okay!):

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@misc{Felbermayr.2013b,
 author  = {Felbermayr, Gabriel J. and Larch, Mario and Flach, Lisandra and 
           Yalcin, Erdal and Benz, Sebastian},
 year    = {2013},
 title   = {Dimensionen und Auswirkungen eines Freihandelsabkommens zwischen der EU und den USA},
 url     = {http://www.cesifo-group.de/DocDL/ifo\_AH\_2013\_TAFTA\_Endbericht.pdf},
 address = {M{\"u}nchen},
 urldate = {29/08/2014},
 series  = {Studie im Auftrag des Bundesministeriums f{\"u}r Wirtschaft 
            und Technologie --Endbericht},
 institution = {{ifo Institut}},
}

@article{Felbermayr.2013a,
 author = {Felbermayr, Gabriel J. and Larch, Mario and Lechthaler, Wolfgang},
 year   = {2013},
 title  = {Unemployment in an Interdependent World},
 pages  = {262--301},
 volume = {5},
 number = {1},
 issn   = {1945-7731},
 journal = {American Economic Journal: Economic Policy},
 doi    = {10.1257/pol.5.1.262},
}


@article{Felbermayr.2011a,
 author = {Felbermayr, Gabriel J. and Prat, Julien and 
           Schmerer, Hans-J{\"o}rg},
 year   = {2011},
 title  = {Globalization and Labor Market Outcomes: Wage Bargaining, 
           Search Frictions, and Firm Heterogeneity},
 pages  = {39--73},
 volume = {146},
 number = {1},
 issn   = {00220531},
 journal = {Journal of Economic Theory},
 doi    = {10.1016/j.jet.2010.07.004},
}


@article{Felbermayr.2011b,
 author = {Felbermayr, Gabriel J. and Prat, Julien and Schmerer, Hans-J{\"o}rg},
 year   = {2011},
 title  = {Trade and Unemployment: What Do the Data Say?},
 pages  = {741--758},
 volume = {55},
 number = {6},
 issn   = {00142921},
 journal = {European Economic Review},
 doi    = {10.1016/j.euroecorev.2011.02.003},
}


@article{HELPMAN.2010a,
 author = {Helpman, Elhanan and Itskhoki, Oleg},
 year   = {2010},
 title  = {Labour Market Rigidities, Trade and Unemployment},
 pages  = {1100--1137},
 volume = {77},
 number = {3},
 issn   = {00346527},
 journal = {Review of Economic Studies},
 doi    = {10.1111/j.1467-937X.2010.00600.x},
}

@article{Helpman.2010c,
 author = {Helpman, Elhanan and Itskhoki, Oleg and Redding, Stephen J.},
 year   = {2010},
 title  = {Inequality and Unemployment in a Global Economy},
 pages  = {1239--1283},
 volume = {78},
 number = {4},
 issn   = {0012-9682},
 journal = {Econometrica},
 doi    = {10.3982/ECTA8640},
}
\end{filecontents*}


\documentclass[%
  fontsize=12pt,         % Schriftgr??e (12pt, 11pt (Standard))
  titlepage,             % Titelei auf eigener Seite
  headings=small,        % Überschriften etwas kleiner (smallheadings)
]{scrartcl}


%% Deutsche Anpassungen %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\usepackage[T1]{fontenc}
%\usepackage[ansinew]{inputenc}
\usepackage[ngerman]{babel}

\usepackage{geometry} 
\geometry{a4paper, top=25mm, left=40mm, right=20mm, bottom=20mm} 

\usepackage{mathptmx}
\usepackage{mathspec}
\setromanfont{Times New Roman}
\addtokomafont{disposition}{\rmfamily}
\usepackage{color}


%\usepackage{titlesec} % Warning with KOMA-Script


%% Bibliographiestil %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{natbib}
\bibliographystyle{aer}% aer_german3 aer
\renewcommand*{\bibfont}{\footnotesize}
\setlength{\bibsep}{0.0pt}

\setlength{\footskip}{1cm}
\setmainfont[Mapping=tex-text]{Times New Roman}
\usepackage{unicode-math} \setmathfont{XITS Math}

\usepackage{hyperref}


\begin{document}
TEXT 
\citep{Felbermayr.2011a} 
\citep{Felbermayr.2013a} 
\citep{HELPMAN.2010a} 
\citep{Helpman.2010c}
{
\let\it\itshape
\let\bf\bfseries
\bibliography{\jobname}
}
\end{document}
Related Question