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}
Best Answer
Update the
l3kernel
andl3experimental
packages. Here is some code that defines asortbibliography
environment, which (1) captures everything until\end{sortbibliography}
(using theenviron
package, which you probably already have), (2) splits what it found (\BODY
) into individual items (at every\bibitem
), (3) removes whatever was before the first\bibitem
(and makes sure that was empty), (4) sorts the items in lexicographic order, (5) typesets everything within the environment of your choice (here I usedthebibliography
, but you seem to have athe bibliography
environment in your setup. This should be fast for up to a few thousand items, although I have not tested it extensively.