3

I am new to Latex and I am trying to write in an Elsevier template, following the instructions though placed on the template does not give me the desired outcome.

I am using a .bib (name of file is george.bib) library with my references which was produced by mendeley (give a BiBtex file), and placed the file in the folder i have the latex components.

%% If you have bibdatabase file and want bibtex to generate the
%% bibitems, please use
%% \bibliographystyle{elsarticle-harv} 
%%  \bibliography{<your bibdatabase>}

\bibliographystyle{elsarticle-harv} 
\bibliography{george}

%% else use the following coding to input the bibitems directly in the
%% TeX file.

\begin{thebibliography}{00}
%% \bibitem[Author(year)]{label}
%% Text of bibliographic item

%\bibitem[ ()]{}
\bibitem[ ()]{}

\end{thebibliography}

I also did a small test with the \bibitem command and it was giving me the in text citation although I would like to use my .bib saved library instead of having to insert all citation manually. So far when i use \citet{} and the citation's name i get a ? when i compile the document.

How can i insert the .bib and then use the key words with \citet to create citation within text and a bibliography at the end?

thank you

  • Did you run (pdf)latex -> bibtex -> (pdf)latex -> (pdf)latex? Also, as the template states in its comments, since you are using a .bib database, use \bibliographystyle{<...>} \bibliography{<...>} and leave out the thebibliography environment; you should not be using both. – Paul Gessler Jul 5 '14 at 18:25
  • @PaulGessler i dont know what the first set of commands is, to be sincere, i want to use my .bib but i cannot understand how to import it and run so as to couple the library with latex I am using quickbuilt option to see the pdf – George Jul 5 '14 at 18:33
  • Which editor do you use? In any case, remove everything between and including \begin{thebibliography} and \end{thebibliography}. This is not needed if you are using a .bib database file. – Paul Gessler Jul 5 '14 at 18:36
  • @PaulGessler I am using Tex maker, i have commented everything %% , should i replace them with something else? – George Jul 5 '14 at 18:38
  • In TeXmaker, the default Quickbuild does not run bibtex, which is needed for citation data. Change the dropdown next to Quickbuild to 'BibTeX', run once, then back to 'Quickbuild' and run twice. All should be good then. :-) – Paul Gessler Jul 5 '14 at 18:49
-2

In the Elsevier template, you should use the file generated by TexMaker which ends in .bbl. This file will contain all your references that you added in your article.

Just copy the content of this .bbl file and paste it into the .tex article and delete the reference to your bib file. Copy everything including the\begin{thebibliography} and \end{thebibliography} in the text you copy. Recompile.

Presto! the bibliography will be there in the bibliography style required by Elsevier.

Of course, every time you change or add a citation in your article, you will have to make sure that the corresponding reference appears in your bibliography. So you should only use the above procedure when you are about to submit your article to the journal through the Elsevier platform.

  • Please streamline your write-up. For instance, it is not TeXMaker that creates the .bbl file: TeXmaker acts as a front-end to LaTeX and BibTeX. It is BibTeX that creates the .bbl file. – Mico Jun 15 '15 at 11:12
  • This seems to be a very bad advice. There is no need to copy and paste the contents of the bbl file in the tex file. Just run (pdf)latex -> bibtex -> (pdf)latex once until there is a new entry in the bib file. – pluton Jun 15 '15 at 11:41
  • This is very bad advice and doesn't really answer the question. – Johannes_B Jul 30 '17 at 12:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.