Citation 'xxx' on page 1 undefined [duplicate]

I have a really weird error when trying to \cite. I watched several video tutorials on how to create a bibliography and after doing so created a .bib file (named "sqwg2)" with the following content:

% Encoding: ISO-8859-1

@ARTICLE{Keldysh,
author = {L. V. Keldysh},
title = {Ionization in the field of a strong electromagnetic wave},
journal = {Soviet Physics Jetp},
year = {1965},
volume = {20},
pages = {1307-1314},
owner = {Chris Ferris},
timestamp = {2014.02.18}
}


After doing so, I went to my .tex file and created the bibliography as normal:

\bibliography{sqwg2}
\bibliographystyle{eeh}


To make sure the citation would appear, I used

\citep{Keldysh}


at some random text passage. However, the citation shows only "(?)" and I get an error message saying "Citation Keldysh on page 1 undefined".

What makes this error even more weird is that when I type in "\citep{" I can see "Keldysh" in the drop-down list. Since it clearly recognizes the .bib file, I do not understand why it tells me that it is undefined...

Can anyone help me please? A google-search regarding this problem didn't help me.

marked as duplicate by egreg, Zarko, user13907, Andrew, Stefan PinnowSep 13 '16 at 5:13

• Did you run bibtex your_file? – Przemysław Scherwentke Sep 12 '16 at 20:44
• Have you compiled your document twice (or more)? TeX uses several passes through the document to track all the citations and references. The first time through, you'll get many "(?)" and "undefined"s. – Teepeemm Sep 12 '16 at 20:45
• @PrzemysławScherwentke: What do you mean with this? I did press F1 to run it (?) – Malganas Sep 12 '16 at 21:53
• @Daniel you need to press not just F1 to do the quick build but also to run bibtex which is done by pressing F11. Do the following sequence F1, F11, F1, F1 does this work? You might be advised to read Question mark or bold citation key instead of citation number I'm sure this is a duplicate of that. From screenshot the OP has posted in a comment to the answer he is using texmaker. – Dai Bowen Sep 12 '16 at 21:59
• I should also ask, where is the eeh bibliographystyle coming from? It seems unfamiliar to both myself and Google. – Dai Bowen Sep 12 '16 at 22:06

Let us assume you have added the necessary package netbib as \usepackage{natbib} already. So the only reason that can cause such problem might be in \bibliographystyle{eeh}. I have checked your code with another \bibliographystyle and it works fine. My main file is:

\documentclass{article}
\usepackage{natbib}

\begin{document}
Some sample text \citep{Keldysh}.

\bibliography{sqwg2}
%\bibliographystyle{eeh}
\bibliographystyle{plainnat}
\end{document}


The sqwg2.bib:

@article{Keldysh,
author = {L. V. Keldysh},
title = {Ionization in the field of a strong electromagnetic wave},
journal = {Soviet Physics Jetp},
year = {1965},
volume = {20},
pages = {1307-1314},
owner = {Chris Ferris},
timestamp = {2014.02.18}


The output: Hope it helps.

• Thank you for the quick response. I opened a completely new file to try your code our, but I still get the same error: directupload.net/file/d/4476/c3nyskjj_jpg.htm – Malganas Sep 12 '16 at 21:47
• New files with the above posted codes in the answer ? – Majid Abdolshah Sep 12 '16 at 21:49
• I saw the image right now. – Majid Abdolshah Sep 12 '16 at 21:51
• Try to compile it more than once and check the output. – Majid Abdolshah Sep 12 '16 at 21:57
• Sorry, I pressed enter to start a new paragraph, but this suddenly sent the comment without me finishing. It is correct to press F1 when I want to see the output, right? Because maybe that's what I'm doing wrong. – Malganas Sep 12 '16 at 21:57