18

I have a References.bib file that contains all references I will cite. My Paper.tex looks like this:

\documentclass{article}
\usepackage{makeidx}  % allows for indexgeneration
\usepackage{ifpdf}
\usepackage{url}
\usepackage{graphicx} 

\begin{document}

\begin{figure}[h]
   \centering
   \includegraphics[scale=.89,bb=0 0 291 279]{f1.png}
   \caption{Some description about the picture}
   \label{picture-label}
\end{figure}
TEXT \cite{1}

\bibliographystyle{plain}
\bibliography{References.bib}
\end{document}

But I did not get the References at the end of the PDF file, and also I did not get the citation after the text. instead I get [?]. How can I make my references show up in the text?

5
  • The following answer might be of help: Unable to generate references using .bib in Texlipse. Even though it references Texlipse, it is probably independent and therefore should solve your problem. Please let us know.
    – Werner
    Feb 3, 2012 at 20:27
  • 2
    How often did you compile your LaTeX file? Did you run BibTeX? It is not enough in this case to compile just once.
    – Count Zero
    Feb 3, 2012 at 20:28
  • This may not be the reason but anyway, you should remove the extension from your reference file, i.e. \biliography{References}
    – vaettchen
    Feb 4, 2012 at 7:40
  • The only citation you have seems to have a bibkey of 1. Is that really the bibkey?
    – StrongBad
    Feb 4, 2012 at 9:52
  • to me the issue was I didn't actually use the citation I inserted, so it didn't put it in the bibliography in the pdf... Dec 11, 2020 at 22:21

2 Answers 2

14

First of all, you have to remove the extension .bib from your \bibliography command; i.e. \bibliography{References} and make sure it is in the same folder as your compiles .tex file, if it is in a sub-directory then use \bibliography{./References/References} as an example.

You also have to make sure the entry is correct in your bibliography .bib file, I can see you use cite{1}, so I presume you have an entry in your .bib file as:

@book{1,
title={Book},
author={Author}
}

... of course you have to fill in all obligatory fields depending on entry type. BibTeX Documentation.

For your compilation to work properly, you should compile in the following manner:

pdflatex file.tex && bibtex file.aux && pdflatex file.tex && pdflatex file.tex

This example being given for a pdflatex output, you could use latex ,xetex or whichever engine you use.

If you get a [?] in your citation instead of a proper reference number, check the log file for something like:

LaTeX Warning: Citation `1' on page 2 undefined on input line 51`
4
  • Thanks Ayman , It works now , but still not all citation appear properly.Some of them are still [?]
    – M.M
    Feb 5, 2012 at 18:25
  • @Mohammed It's probably a typo in either the \cite command or the BibTeX entry; you could have a @book{Mohammed, entry and a \cite{Mohammd}, it's common. If the problem persists, provide an MWE for your .tex file and .bib file. Feb 5, 2012 at 20:18
  • I am using TexMakerX , the problem is resolved now I have to choose the citation EXPLICITLY form the pop-up menu after typing \cite
    – M.M
    Feb 6, 2012 at 2:19
  • +1 for pointing that bibtex file.aux is not implicit in pdflatex file.tex. Jul 18, 2016 at 11:22
1

I had the same problem and just resolved it. Maybe you have the same mistake as mine. My .bib file was named ref.bib and I was thinking: its name is ref and its postfix is bib. However, the name.postfix was ref.bib.tex. It was so because based on my PC settings, the postfix of files are not shown. So I just changed it to ref.bib and resolved the problem.

You can check the postfix of your file in 'type' column of the folder your files are located if you change the view to "details".

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .