0

I am struggling with this issue for one day. I cannot get my biblatex working. It gives me the following error:

! LaTeX Error: Command \bibhang already defined.

My document is as follows:

\documentclass[authoryear,review]{elsarticle}

\usepackage{biblatex}
\usepackage{lineno, hyperref}

%\modulolinenumbers[5]

\usepackage{wrapfig}

\usepackage{amssymb,amsmath}
\usepackage{times}
\usepackage{graphics}
\usepackage{amsfonts}
\usepackage{color}

\hoffset=-1.5cm
\addtolength{\textwidth}{3cm}
\voffset=-1.5cm
\addtolength{\textheight}{3cm}

\graphicspath{{Fig/}}

\renewcommand{\vec}[1]{{\rm\bf #1}}
\newcommand{\tocite}[1]{{\color{red} (#1)}} %to revert it to \cite later on
\newcommand\rd{{\rm{d}}}

\DeclareMathOperator{\sign}{sign}


\newcommand{\bluetext}[1]{{\color{blue} #1}}
\newcommand{\redtext}[1]{{\color{red} #1}}

\journal{journal?}


\begin{document}

The body of document 



\bibliographystyle{elsarticle-harv}


\bibliography{bibliography}

\end{document}

I would like to work in Harvard style. But I don't know how to make works.

Schweinebacke
  • 26,336
  • 5
    You should not use biblatex together with \bibliographystyle and bibliography. Use either the old bibtex system or biblatex. – Schweinebacke Jul 07 '17 at 16:21
  • 5
    elsarticle is importantly is focussed on journal publication so you should stick to what they mandate: here, it loads natbib which you should therefore be using. – Joseph Wright Jul 07 '17 at 16:22
  • 2
  • @ Schweinebacke thanks for your answer. What should I modify here if I am interested in \biblatex?. The link that you have provided strongly suggests that it is for personal use only, which is not my case. Thus, I couldn't use the solution provided in that link. – KratosMath Jul 07 '17 at 16:30
  • 3
    As Joseph (and the initial notes in the answers of the linked question) have explained: Do not use biblatex for a journal publication with elsearticle. Use the internally loaded natbib of the class as intended by the publisher. BTW: @<addressee> does only work without white space between @ and the use name of the addressee! – Schweinebacke Jul 07 '17 at 16:50
  • 2
    Do you want to submit this to Elsevier? Or are you just planning on creating a document with their style? The 'personal use' might be a bit misleading. What is important is the second line: You can't submit your papers like this. – moewe Jul 07 '17 at 16:58
  • Now I am just trying to add my biblography to it. Yes, I want to submit it but still, there are some minor issues. So I am just now focusing on how to adjust my biblography to the tex file. – KratosMath Jul 07 '17 at 19:42
  • If you want to submit to Elsevier you cannot use biblatex. It wont work and the editor (and their staff) won't like it. It will be incompatible with their workflow. You will have to work with the template/document class and styles they give you. If the bibliography output you get when using the journal template does not match the required output (and you can be sure that is not your fault) you should contact whoever is responsible for the journal template and complain. You should not try to use biblatex – moewe Jul 07 '17 at 20:16
  • 1
    Have a look at Joseph's explanations in Biblatex: submitting to a journal. Many journals simply cannot accept a manuscript that uses biblatex. Even more so if they actually provide official guidelines/document classes/templates that require the use of another package to use (that is also incompatible with biblatex). – moewe Jul 07 '17 at 20:18
  • 3
    Note finally that Elsevier's guidelines in https://www.elsevier.com/authors/author-schemas/latex-instructions explicitly ask to use BibTeX and not biblatex. The documentation of elsarticle.cls (https://www.elsevier.com/__data/assets/pdf_file/0008/56843/elsdoc-1.pdf) states clearly that natbib is used, so you can't use biblatex. – moewe Jul 07 '17 at 20:25
  • If you have an additional question about using natbib with elsarticle, please ask a new question with a new minimal but working example with bibliography (MWEB). – Schweinebacke Jul 08 '17 at 06:20

1 Answers1

6

You want to submit an article to a journal. Your publisher provides a LaTeX class, a manual to that class and an author guideline. You should use all of those with care.

The class already provides the bibliography package natbib. So you should not try to use biblatex instead. Because the publisher will not accept it. You have to use natbib. You must not use biblatex. This means also, that you have to remove \usepackage{biblatex} from your example. For your example the BibTeX style file elsarticle-harv.bst has to be available and the file with the bibliography database has to be named bibliography.bib (filename from the argument of the \bibliography{bibliography} command with appended mandatory extension .bib). And you have to run bibtex not biber!

The class already provides package graphicx. So you do not need nor should load package graphics.

Similar with your change of the fonts. Publishers almost ever use dedicated fonts for a journal. So font changes like loading (obsolete) package times will be removed. You should not load font packages without asking the editor. To use a Times-like font, use option times for class elsarticle.

Same with your changes of the layout. Journals always have a dedicated layout. You are either not allowed to change it or the changes will be removed in the workflow. So mostly is makes no sense to change \textwidth and \textheight nor \hoffset or \voffset. The final page layout depends on the journal type. Generally, for submissions with elsarticle you should use option preprint. There are other options that change the layout like 1p, 3p or 5p.

For a submissions I would also remove \graphicspath and put all files in one folder without subfolders. Because editors like is simple and flat. For the same reason use preamble definitions only, if you need them.

Schweinebacke
  • 26,336