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

来源:互联网 发布:数据接口自己能换吗 编辑:程序博客网 时间:2024/06/03 12:17
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@chapter1.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

activeoldestvotes
up vote6 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
up vote6 down vote

Load algorithm2e after natbib.

shareimprove this answer
原创粉丝点击