TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I an new to Latex, and I am trying to use 'bibtex' to create a reference, I was working in pdfLaTeX+MakeIndex+BibTex.

Here is my sample code:



\begin {document}
$$ x_i$$


According to \cite{2006} 





Here is the .bib file that I am using.

     jstor_articletype = {research-article},
     title = {The Cross-Section of Volatility and Expected Returns},
     author = {Ang, Andrew and Hodrick, Robert J. and Xing, Yuhang and Zhang, Xiaoyan},
     journal = {The Journal of Finance},
     jstor_issuetitle = {},
     volume = {61},
     number = {1},
     jstor_formatteddate = {Feb., 2006},
     pages = {pp. 259-299},
     url = {http://www.jstor.org/stable/3699341},
     ISSN = {00221082},
     abstract = {We examine the pricing of aggregate volatility risk in the cross-section of stock returns. Consistent with theory, we find that stocks with high sensitivities to innovations in aggregate volatility have low average returns. Stocks with high idiosyncratic volatility relative to the Fama and French (1993, Journal of Financial Economics 25, 2349) model have abysmally low average returns. This phenomenon cannot be explained by exposure to aggregate volatility risk. Size, book-to-market, momentum, and liquidity effects cannot account for either the low average returns earned by stocks with high exposure to systematic volatility risk or for the low average returns of stocks with high idiosyncratic volatility.},
     language = {English},
     year = {2006},
     publisher = {Blackwell Publishing for the American Finance Association},
     copyright = {Copyright © 2006 American Finance Association},

However, instead of expected [1] for reference, I am getting [?], an nothing is listed under references, though the word "References" does show up.

In the youtube tutorial that I was following this case is described. The tutorial did say that sometimes there might this be an issue with creating a reference. To which the author suggest to work in BibTeX only, then move to pdfLaTeX and then click run a couple of times, and things should work. I did the above, but nothing works for me.

Any ideas how to get my code to work?


Here are the contents of my .bbl file:

% Generated by IEEEtran.bst, version: 1.13 (2008/09/30)
\csname url@samestyle\endcsname
\providecommand{\BIBentryALTinterwordspacing}{\spaceskip=\fontdimen2\font plus
\BIBentryALTinterwordstretchfactor\fontdimen3\font minus
\expandafter\ifx\csname l@#1\endcsname\relax
\typeout{** WARNING: IEEEtran.bst: No hyphenation pattern has been}%
\typeout{** loaded for the language `#1'. Using the pattern for}%
\typeout{** the default language instead.}%
\language=\csname l@#1\endcsname


Here are contents of my .blg file.

This is BibTeX, Version 0.99dThe top-level auxiliary file: newfile.aux
The style file: IEEEtran.bst
I couldn't open database file my_bibtex.bib
---line 4 of file newfile.aux
 : \bibdata{my_bibtex
 :                   }
I'm skipping whatever remains of this command
I found no database files---while reading file newfile.aux
Warning--I didn't find a database entry for "2006"
-- IEEEtran.bst version 1.13 (2008/09/30) by Michael Shell.
-- http://www.michaelshell.org/tex/ieeetran/bibtex/
-- See the "IEEEtran_bst_HOWTO.pdf" manual for usage information.

Done. (There were 2 error messages)

Thank You in Advance

share|improve this question

closed as too localized by egreg, Paulo Cereda, Joseph Wright Jun 27 '12 at 21:47

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

What does the contents of my_bibtex look like? – Werner Jun 26 '12 at 20:12
Just a little note not concerning the problem: never use $$..$$ to delimit math in display, but use \[..\] instead – Spike Jun 26 '12 at 20:15
If I run pdflatex on your file, then bibtex and then pdflatex twice I get the expected result. – egreg Jun 27 '12 at 11:29
@Akavall You should have a .blg file in the working directory. Please show its contents. – egreg Jun 27 '12 at 13:35
@Akavall No. Let's say that your main LaTeX file is myfile.tex. When you run bibtex myfile the program should produce a file called myfile.bbl (containing the bib data suitable for LaTeX) and a transcript of the session called myfile.blg. Are you perhaps doing bibtex my_bibtex? This would be wrong. – egreg Jun 27 '12 at 15:33
up vote 5 down vote accepted

Make sure that you have assigned the key “2006” in your my_bibtex.bib. Let's assume your TeX file is named test.tex. Then you should have ran bibtex test. Check that it did not print any error messages.

To further pin down your problem you should add \nocite{*} to your TeX file. (I always put it right before \bibliography.) This makes bibtex print all entries in your bibliography, even those which are not explicitly cited in the document.

So this is still about Creating a reference with bibtex beginner. Another guess could have been, that a bibtex key can not start with a digit, but I just tried that and it is not a problem.

With the bibtex file from the other post I tried to build it and I got this error from bibtex:

This is BibTeX, Version 0.99d (TeX Live 2011)
The top-level auxiliary file: test10.aux
I couldn't open style file IEEEtran.bst
---line 3 of file test10.aux
 : \bibstyle{IEEEtran
 :                   }

I.e. I don't have that bibtex style. So you should also check if that style is a valid one which is installed on your system!


I can not really believe that you don't get any error messages. After I have downloaded the IEEEtran.bst file, everything worked ok. Note that for compiling you need to do

pdflatex first_try.tex
bibtex first_try
pdflatex first_try.tex
pdflatex first_try.tex

In the first run, pdflatex creates the first_try.aux file which contains the information about used bibliographies. With that given, bibtex can construct the first_try.bbl file with the assembled bibliography data. Then pdflatex will include it in the document. But as that happens mostly after the point it is referenced, another run of pdflatex is required to get a correct reference.

If you still can't solve the problem, please post the output of those commands.

share|improve this answer
Thanks for your answer. Yes this question is the follow up of my previous post. How do I assign "2006" as key? Where should I put \nocite{*} in my test.tex file? I am not getting any errors. Given how new I am to LaTex, my gut feeling is that the problem is with me :). Sorry for having problems following. – Akavall Jun 26 '12 at 21:24

Your bib file could look like this

  title = {Learning SQL on SQL Server 2005},
  publisher = {O'Reilly},
  year = {2006},
  author = {Sikha Saha Bagui and Richard Earp},
  isbn = {978-059-610-2159}
share|improve this answer
Thanks. Are you saying that if my file has this format, it will not work? What format will work? – Akavall Jun 26 '12 at 21:25
@Akavall: No, he is just giving an example of a correct file with the key “2006”. But as noted above there does not seem to be an issue with yours anyway. You should only have included it in this post as well. – canaaerus Jun 27 '12 at 4:57
OK, I see. Thanks. – Akavall Jun 27 '12 at 13:34

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