“\Ualgocf@original@chapter” undefined when using algorithm2e with natbib

4 down vote favorite
1

Is it possible to just use plainnat without using the package natbib? When I do so, multiple author references don't work too well. I get

[author et al (year)auhtor1, author2 and author3]

when what I want is just

[author et al (year)]

Anyway to fix this?

If I add \usepackage{natbib} I just get an error:

Undefined control  sequence.

\chtapter ...ace {10\p@ }}\algocf@original@chapter

1.1 \begin{thebibliography}{28}

So using plainnat without natbib is the closest I got to get this working.

Example:

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{rotating}
\usepackage{listings}
\usepackage[ruled,vlined]{algorithm2e}
\usepackage[ngerman,english]{babel}
\usepackage{babelbib,url} 
\usepackage{breakcites}
%\usepackage{natbib}
%\usepackage[square, comma, sort&compress]{natbib}
\usepackage[latin1]{inputenc}
\usepackage{pslatex}
\usepackage{setspace}
\setstretch{2} 
\begin{document}
    \cite{DPS2000}
\newpage\pagebreak
\nocite{*}
\bibliographystyle{plainnat}
\bibliography{references}
\end{document}

It compiles fine but I get

[author et al (year)auhtor1, author2 and author3]

style referencing and if I uncomment natbib it won't compile.

share improve this question
 
Was this post useful to you?     

2 Answers

active oldest votes
up vote 6 down vote accepted

The problem is that the algorithm2e expects \chapter to be defined. It makes some changes to how the bibliography is printed which do not make sense. One fix is to do

\let\chapter\section

before loading algorithm2e: the problem should be go away.

share improve this answer
 
feedback
up vote 6 down vote

Load algorithm2e after natbib.

share improve this answer

你可能感兴趣的:(“\Ualgocf@original@chapter” undefined when using algorithm2e with natbib)