[Tex/LaTex] Alphabetical order in natbib

bibtexnatbibsorting

I have read questions about this, and people say that it is just to include the natbib package and the plainnat style. For some reason my references will not sort alphabetically. Any help on this would be much appreciated! I am really new to LaTeX …

My commands:

\documentclass[a4paper,norsk]{article}
\usepackage{amstext}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage[comma,authoryear]{natbib}
\usepackage[norsk]{babel}
\usepackage[hmargin=3cm,vmargin=3.5cm]{geometry}
\pagestyle{plain}

\begin{document}

\begin{thebibliography}{56}

\end{thebibliography}

\printindex

\bibliographystyle{plainnat}

\end{document}

Best Answer

The command to print the bibliography in natbib is \bibliography{<your-bib-file>}. You don't use \begin{thebibliography} ... \end{thebibliography}.

So the following document should work:

\documentclass[a4paper,norsk]{article}
\usepackage{amstext}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage[comma,authoryear]{natbib}
\usepackage[norsk]{babel}
\usepackage[hmargin=3cm,vmargin=3.5cm]{geometry}
\pagestyle{plain}

\begin{document}
Insert some \cite{} commands here to your citations.

\printindex

\bibliographystyle{plainnat}
\bibliography{<your-bib-file>} % Insert the name of your bib file here

\end{document}
Related Question