BibTeX, biblatex and biberNatbib and apalike conflict

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

Natbib and apalike conflict

Post by zaksotiris »

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:

Code: Select all

! 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.

Code: Select all

\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.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Natbib and apalike conflict

Post by cgnieder »

Hi zaksotiris,

Welcome to the LaTeX community!

In this case there are two possibilities:
  1. change the loading order:

    Code: Select all

    \usepackage{apalike}
    \usepackage{natbib}
  2. „delete“ the first \bibhang before loading the second package:

    Code: Select all

    \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 Infominimal working example (which is rather good, actually, compared to many others!)

Code: Select all

\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}
site moderator & package author
zaksotiris
Posts: 2
Joined: Sat Aug 17, 2013 12:17 pm

Re: Natbib and apalike conflict

Post by zaksotiris »

thank you very much..Your comments were very helpful.
Post Reply