现在的位置: 首页 > 综合 > 正文

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

2013年12月13日 ⁄ 综合 ⁄ 共 1662字 ⁄ 字号 评论关闭

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.

shareimprove
this question
 
Was this post useful to you?     

2 Answers

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.

shareimprove
this answer
 
feedback

Load algorithm2e after natbib.

shareimprove
this answer

抱歉!评论已关闭.