LaTeX forum ⇒ BibTeX, biblatex and biberNatbib 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

Postby zaksotiris » Sat Aug 17, 2013 12:26 pm

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:

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

  1. \documentclass[12pt]{article}
  2. \usepackage{apalike}
  3. \usepackage{natbib}
  4. \usepackage{amsmath}
  5. \usepackage[margin=3cm]{geometry}
  6. \usepackage[bottom]{footmisc}
  7. \usepackage{multirow}
  8. \usepackage{environ}
  9. \pagestyle{plain}
  10. \usepackage{fullpage}
  11.  
  12. \begin{document}
  13. \maketitle
  14. \begin{abstract}
  15. dddfdff\end{abstract}
  16. \pagebreak
  17. \begin{LARGE}
  18. \section{Introduction}
  19. \end{LARGE}
  20. 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:

User avatar
cgnieder
Site Moderator
Posts: 1988
Joined: Sat Apr 16, 2011 7:27 pm

Postby cgnieder » Sat Aug 17, 2013 7:53 pm

Hi zaksotiris,

Welcome to the LaTeX community!

In this case there are two possibilities:
  1. change the loading order:
    1. \usepackage{apalike}
    2. \usepackage{natbib}
  2. „delete“ the first \bibhang before loading the second package:
    1. \usepackage{apalike}
    2. \let\bibhang\relax
    3. \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!)

  1. \documentclass[12pt]{article}
  2.  
  3. \usepackage{natbib}
  4. \usepackage{apalike}
  5.  
  6. % not necessary for the example:
  7. % \usepackage{amsmath}
  8. % \usepackage[margin=3cm]{geometry}
  9. % \usepackage[bottom]{footmisc}
  10. % \usepackage{multirow}
  11. % \usepackage{environ}
  12. % \pagestyle{plain}
  13. % \usepackage{fullpage}
  14.  
  15. \begin{document}
  16. % the \maketitle macro throws errors if no \title and no \author are given!
  17. % \maketitle
  18.  
  19. \begin{abstract}
  20. dddfdff
  21. \end{abstract}
  22.  
  23. \pagebreak
  24.  
  25. % changing the layout of section titles should be done using a package like
  26. % `titlesec' and _not_ by placing \Large manually. It does't have an effect
  27. % here, anyway
  28. % \begin{LARGE}
  29. \section{Introduction}
  30. % \end{LARGE}
  31.  
  32. dkhddh
  33. \end{document}
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

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

Postby zaksotiris » Tue Aug 20, 2013 3:49 pm

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


Return to “BibTeX, biblatex and biber”

Who is online

Users browsing this forum: No registered users and 6 guests