## LaTeX forum ⇒ BibTeX, biblatex and biber ⇒ Natbib and apalike conflict

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
zaksotiris
Posts: 2
Joined: Sat Aug 17, 2013 12:17 pm

### Natbib and apalike conflict

hi to all

I am trying to write my thesis proposal and i have some major problems with natbib package. I am using the apalike bibliography style. When i am using the natbib package i am getting this message:

! LaTeX Error: Command \bibhang already defined.Or name \end... illegal, see p.192 of the manual.See the LaTeX manual or LaTeX Companion for explanation.Type H <return> for immediate help.... \newlength{\bibhang}

I do not know, what i am doing wrong.

\documentclass[12pt]{article}\usepackage{apalike}\usepackage{natbib}\usepackage{amsmath}\usepackage[margin=3cm]{geometry}\usepackage[bottom]{footmisc}\usepackage{multirow}\usepackage{environ}\pagestyle{plain}\usepackage{fullpage} \begin{document}\maketitle\begin{abstract}dddfdff\end{abstract}\pagebreak\begin{LARGE}\section{Introduction}\end{LARGE}dkhddh \end{document}

Thank you in advance for any solution.
Last edited by cgnieder on Sat Aug 17, 2013 7:37 pm, edited 1 time in total.
Reason: added code markup and changed title

Tags:

cgnieder
Site Moderator
Posts: 1988
Joined: Sat Apr 16, 2011 7:27 pm
Hi zaksotiris,

Welcome to the LaTeX community!

In this case there are two possibilities:
\usepackage{apalike}\usepackage{natbib}
2. „delete“ the first \bibhang before loading the second package:
\usepackage{apalike}\let\bibhang\relax\usepackage{natbib}
If you want apalike's formatting you should choose the first variant, if you want that of natbib choose the second.

I've also made some minor comments on your minimal working example (which is rather good, actually, compared to many others!)

\documentclass[12pt]{article} \usepackage{natbib}\usepackage{apalike} % not necessary for the example:% \usepackage{amsmath}% \usepackage[margin=3cm]{geometry}% \usepackage[bottom]{footmisc}% \usepackage{multirow}% \usepackage{environ}% \pagestyle{plain}% \usepackage{fullpage} \begin{document}% the \maketitle macro throws errors if no \title and no \author are given!% \maketitle \begin{abstract}   dddfdff\end{abstract} \pagebreak % changing the layout of section titles should be done using a package like% titlesec' and _not_ by placing \Large manually.  It does't have an effect% here, anyway% \begin{LARGE}\section{Introduction}% \end{LARGE} dkhddh\end{document}`
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

zaksotiris
Posts: 2
Joined: Sat Aug 17, 2013 12:17 pm