0

I just downloaded the sample manuscript of elsevier on the dedicated Elsevier's Latex Instructions webpage and when I run of the following commands:

pdflatex elsarticle-template && biber elsarticle-template

or

pdflatex elsarticle-template && biber elsarticle-template && pdflatex elsarticle-template

or (three commands sequentially)

pdflatex elsarticle-template
biber elsarticle-template
pdflatex elsarticle-template

or (with .tex extension

pdflatex elsarticle-template.tex
biber elsarticle-template
pdflatex elsarticle-template.tex

I get the following error message:

ERROR MESSAGE N°1

INFO - This is Biber 2.16
INFO - Logfile is 'elsarticle-template.blg'
ERROR - Cannot find 'elsarticle-template.bcf'!
INFO - ERRORS: 1

There is no import of biblatex written in the template of elsevier. I tried to import manually by writing \usepackage[ backend=bibtex ]{biblatex} inside the preamble of the document elsarticle-template.tex but got the error message

ERROR MESSAGE N°2

! Package biblatex Error: Incompatible package 'natbib'.

See the biblatex package documentation for explanation. Type H <return> for immediate help. ...

l.202 \blx@packageincompatibility

Elsevier seems to use the 'natbib' package.

How can I compile the document from the command line?

ecjb
  • 883
  • First run pdflatex elsarticle-template, second run biber elsarticle-template, third run pdflatex elsarticle-template. – Simon Dispa Jan 31 '22 at 12:49
  • thanks for your comment @SimonDispa. I ran the following: pdflatex elsarticle-template && biber elsarticle-template && pdflatex elsarticle-template but get the same error – ecjb Jan 31 '22 at 12:51
  • 1
    What is the meaning of the && ? You run pdflatex elsarticle-template.tex and wait for the output? Then run biber elsarticle-template (no file extension) and after it finished run pdflatex elsarticle-template.tex again. – Simon Dispa Jan 31 '22 at 12:57
  • @SimonDispa, the && is a way to run the three commands in the command line in one line so that you don't have to type three different lines. I tried it again with the extension (pdflatex elsarticle-template.tex) but I still get the same error. – ecjb Jan 31 '22 at 13:09
  • 2
    I doubt very much that they use biblatex. So don't use biber but bibtex. – Ulrike Fischer Jan 31 '22 at 13:19
  • @UlrikeFischer Many thanks for your comment. Sorry for my ignorance, but I used biber command for all my projects so far and never used bibtex. I replaced biber by bibtex in the command above but it does not seem to work. Do you have a hint for an alternative command using bibtex? And more generally is bibtex more standard than biber? Is there an advantage of biber over bibtex? – ecjb Jan 31 '22 at 13:27
  • To use bibtex rather than biber, you must specify the option backend=bibtex as one of the options when loading biblatex. – Mico Jan 31 '22 at 13:55
  • thank you @Mico. However there is no import of biblatex written in the template of elsevier. I tried to import manually by writing \usepackage[ backend=biber ]{biblatex} inside the preamble of the document elsarticle-template.tex but got the error message `! Package biblatex Error: Incompatible package 'natbib'.

    See the biblatex package documentation for explanation. Type H for immediate help. ...

    l.202 \blx@packageincompatibility `. What shall I do next?

    – ecjb Jan 31 '22 at 14:12
  • 1
    But that package seems to use the natbib package which is incompatible with biblatex. – Herb Schulz Jan 31 '22 at 14:26
  • @HerbSchulz. Indeed you are right. Do you have any idea of how to proceed next? How can I compile the document from the command line? – ecjb Jan 31 '22 at 14:30
  • 1
    what does "it seems not to work" mean? Do you get an error and if yes which one? @Mico the template is not for biblatex and shouldn't use it. – Ulrike Fischer Jan 31 '22 at 14:35
  • Thank for your comment @UlrikeFischer. sorry for the messy question. I edited the question and highlighted the 2 error messages I got, the first one when using biber elsarticle-template as a command and the second when writing \usepackage[ backend=bibtex ]{biblatex} in the preamble. Is it clearer now? – ecjb Jan 31 '22 at 15:05
  • 2
    you should do none of them. Remove biblatex, and call bibtex elsarticle-template as a command instead of using biber. – Ulrike Fischer Jan 31 '22 at 15:08
  • @UlrikeFischer Many thanks! That worked!! – ecjb Jan 31 '22 at 15:20
  • @UlrikeFischer which other file now do I have to copy in order to be able to use the command bibtex elsarticle-template in another project? – ecjb Jan 31 '22 at 15:20

1 Answers1

1

The standard citation/bibliography method of the elsarticle class is based on natbib and the classical BibTeX approach. This approach is completely incompatible with biblatex and also with the biblatex-only Biber backend.

You cannot compile the normal elsarticle template with Biber. You need to run BibTeX on your file instead.

If you want to submit your paper to Elsevier, do not load biblatex in your document. Use the standard BibTeX-based approach of selecting a style with \bibliographystyle and indicating the .bib file with \bibliography as outlined in the template file. (In theory it is possible to have biblatex work with the elsarticle document class as demonstrated in biblatex instead of natbib in elsarticle, how?, but this is explicitly not what Elsevier recommend for publication. They explicitly say to use BibTeX.)

So as far as bibliography and citations are concerned, in your document you only need one of the style selections shown below, \citep and \citet as desired and \bibliography{<bib file name without extension>}

\documentclass[review]{elsarticle}

%%%%%%%%%%%%%%%%%%%%%%% %% Elsevier bibliography styles %%%%%%%%%%%%%%%%%%%%%%% %% To change the style, put a % in front of the second line of the current style and %% remove the % from the second line of the style you would like to use. %%%%%%%%%%%%%%%%%%%%%%%

%% Numbered %\bibliographystyle{model1-num-names}

%% Numbered without titles %\bibliographystyle{model1a-num-names}

%% Harvard %\bibliographystyle{model2-names.bst}\biboptions{authoryear}

%% Vancouver numbered %\usepackage{numcompress}\bibliographystyle{model3-num-names}

%% Vancouver name/year %\usepackage{numcompress}\bibliographystyle{model4-names}\biboptions{authoryear}

%% APA style %\bibliographystyle{model5-names}\biboptions{authoryear}

%% AMA style %\usepackage{numcompress}\bibliographystyle{model6-num-names}

%% `Elsevier LaTeX' style \bibliographystyle{elsarticle-num} %%%%%%%%%%%%%%%%%%%%%%%

\begin{document} Here are two sample references: \cite{Feynman1963118,Dirac1953888}.

\bibliography{mybibfile}

\end{document}

compile this file, if called elsarticle-template.tex, with

pdflatex elsarticle-template
bibtex elsarticle-template
pdflatex elsarticle-template

The difference between natbib and biblatex and Biber and BibTeX is nicely explained in bibtex vs. biber and biblatex vs. natbib.

moewe
  • 175,683
  • Many thanks @moewe. That worked!! However I try to implement it on an article I am preparing (with many packages loaded), but there, the bibliography does not appear (and many of the rendering I woked on the custom version are now broken). I'm going to try to debug it on my own now. – ecjb Jan 31 '22 at 18:55
  • @ecjb I would try to load as few packages as possible. Publishers may not have the same versions that you have and there workflow may not support the additional packages you use as well as you hope. In theory this approach should work as long as you do not load packages that get involved in citations and the bibliography. Do you get any warnings or errors (either from LaTeX or BibTeX) that could help you? – moewe Jan 31 '22 at 19:00
  • `{\vspace {-1.5cm} \begin {figure}[H]\ContinuedFloat \centering \caption \ETC. ! Paragraph ended before \title was complete.

    Package geometry Warning: Over-specification in -v'-direction. 'height' (731.23582pt) is ignored.

    Package natbib Warning: Citation 'XYZ_2006' on page 3 undefined on input line 4. ` are 3 errors I get for example @moewe

    – ecjb Jan 31 '22 at 19:12