1

but wanting to try and write my thesis using this. I am using TexMaker as the editing software. All my references thus far have been in Mendeley and i have exported this into LaTex. I am now trying to cite a specific reference which has been cited as Zumla2016 in mendeley but when i write \cite{Zumla2016}

The output is [?]

I don't know why but i guess it is not reading the citation. I am completely new to all this but the total preamble in exported bibliography for this reference is this:

@article{Zumla2016,
author = {Zumla, Alimuddin and Rao, Martin and Wallis, Robert S and Kaufmann, Stefan H E and Rustomjee, Roxana and Mwaba, Peter and Vilaplana, Cris and Yeboah-Manu, Dorothy and Chakaya, Jeremiah and Ippolito, Giuseppe and Azhar, Esam and Hoelscher, Michael and Maeurer, Markus},
doi = {10.1016/S1473-3099(16)00078-5},
issn = {14733099},
journal = {The Lancet Infectious Diseases},
month = {apr},
number = {4},
pages = {e47--e63},
title = {{Host-directed therapies for infectious diseases: current status, recent progress, and future prospects}},
url = {http://linkinghub.elsevier.com/retrieve/pii/S1473309916000785},
volume = {16},
year = {2016}
}

Must i write all this every time?

Thank you and sorry for being clueless!

Vani

  • Just to add - adding the above preamble just creates more question marks. So nothing seems to be able to recognise the reference. – Vani Dec 24 '16 at 19:20
  • 1
    Do you have a \bibliographystyle instruction in your tex file? Do you have a \bibliography instruction in your tex file? Did you run BibTeX after running LaTeX, followed by two more LaTeX runs? – Mico Dec 24 '16 at 19:21
  • Hi! I have typed \bibliographystyle{style} in my tex file. How do you mean by running Bibtex and latex again? I did try and press bibtex on the latex file but it's not doing much other then putting more info in the preamble box. It's probably not helping by the fact I am not able to save the document at the moment either. – Vani Dec 24 '16 at 19:36
  • Well, do you also have a \bibliography instruction, likely towards the end of your tex file? – Mico Dec 24 '16 at 19:38
  • No! I guess I should? There is a separate .bib file. but do I need to write something at the end of the edited tex file? Is this why I can't save it at the moment also? – Vani Dec 24 '16 at 19:42
0

Some comments and suggestions, in no particular order.

  • Mendeley is a tool to help assemble a .bib file. It's important to realize that Mendeley does not, and will not, create a formatted bibliography. All it does it to help create the bib file(s).

  • Creating the formatted bibliography for a LaTeX document is the job of BibTeX (or biblatex). BibTeX needs to be made aware of three key inputs:

    • The file that contains the raw bib inputs. This file must have filename extension .bib. The instruction \bibliography should contain, in its argument, a list of one or more bib filenames, without the .bib extension.

    • Information about which formatting guidelines should be applied to the bib entries as well as to the citation call-outs. This information should be in the argument of a single \bibliographystyle instruction. Bibliography style files must have exension .bst.

    • Which entries from the bib file(s) should actually be extracted and formatted? That's the job of the \cite commands.

  • Judging from your description, you have so far provided neither \bibliography nor \bibliographystyle instructions. You probably haven't run BibTeX either, right?

  • Assuming appropriate \bibliography and \bibliographystyle instructions have been provided and assuming that various \cite instructions are present in the tex file, and assuming the tex file is called myfile.tex, the compilation sequence should be

    latex myfile
    bibtex myfile
    latex myfile
    latex myfile
    

    Depending on your editing software, there may be a drop-down menu from which to choose latex and bibtex runs.


Here's the output of a full MWE (minimum working example). It uses the plainnat bibliography style and the natbib citation management package. The bib entry is contained in a file called mybib.bib. Incidentally, there is an error in your bib entry: the argument of the month field should be either apr or {April}, but not {apr}.

enter image description here

\RequirePackage{filecontents}
\begin{filecontents}{mybib.bib}
@article{Zumla2016,
author  = {Zumla, Alimuddin and Rao, Martin and Wallis, Robert S. and Kaufmann, Stefan H. E. and Rustomjee, Roxana and Mwaba, Peter and Vilaplana, Cris and Yeboah-Manu, Dorothy and Chakaya, Jeremiah and Ippolito, Giuseppe and Azhar, Esam and Hoelscher, Michael and Maeurer, Markus},
doi     = {10.1016/S1473-3099(16)00078-5},
issn    = {14733099},
journal = {The Lancet Infectious Diseases},
month   = apr,
number  = {4},
pages   = {E47--E63},
title   = {Host-directed therapies for infectious diseases: Current status, recent progress, and future prospects},
url     = {http://linkinghub.elsevier.com/retrieve/pii/S1473309916000785},
volume  = {16},
year    = {2016}
}
\end{filecontents}

\documentclass{article}
\usepackage[numbers]{natbib}
\bibliographystyle{plainnat}
\usepackage{url}
\usepackage[colorlinks,allcolors=blue]{hyperref}  % just for this example
\begin{document}
\cite{Zumla2016}
\bibliography{mybib} % place the formatted bibliography *here*
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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