我是 Latex 的新手,我正在尝试使用“bibtex”来创建参考文献,我正在其中工作pdfLaTeX+MakeIndex+BibTex
。
这是我的示例代码:
\documentclass[12pt]{article}
\usepackage{cite}
\begin {document}
$$ x_i$$
\section{Introduction}
According to \cite{2006}
\bibliographystyle{IEEEtran}
\bibliography{my_bibtex}
\end{document}
编辑:
这是.bib
我正在使用的文件。
@article{2006,
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},
}
[1]
然而,我得到的并不是预期的参考[?]
,而是参考文献下没有列出任何内容,尽管确实出现了“参考”这个词。
在 YouTube 上教程我正在关注的这个案例中描述了这一点。教程确实说过,有时创建引用可能会出现问题。作者建议BibTeX
只在其中工作,然后移动到pdfLaTeX
然后单击运行几次,事情应该会正常工作。我做了上述操作,但对我来说没有任何效果。
关于如何使我的代码正常工作,您有什么想法吗?
编辑:
.bbl
以下是我的文件的内容:
% Generated by IEEEtran.bst, version: 1.13 (2008/09/30)
\begin{thebibliography}{}
\providecommand{\url}[1]{#1}
\csname url@samestyle\endcsname
\providecommand{\newblock}{\relax}
\providecommand{\bibinfo}[2]{#2}
\providecommand{\BIBentrySTDinterwordspacing}{\spaceskip=0pt\relax}
\providecommand{\BIBentryALTinterwordstretchfactor}{4}
\providecommand{\BIBentryALTinterwordspacing}{\spaceskip=\fontdimen2\font plus
\BIBentryALTinterwordstretchfactor\fontdimen3\font minus
\fontdimen4\font\relax}
\providecommand{\BIBforeignlanguage}[2]{{%
\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.}%
\else
\language=\csname l@#1\endcsname
\fi
#2}}
\providecommand{\BIBdecl}{\relax}
\BIBdecl
编辑:
这是我的.blg
文件的内容。
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.
完成。(有 2 条错误消息)
先感谢您
答案1
确保已在 中分配了键“2006” my_bibtex.bib
。假设您的TeX
文件名为test.tex
。那么您应该运行bibtex test
。检查它是否没有打印任何错误消息。
为了进一步查明您的问题,您应该将其添加\nocite{*}
到您的TeX
文件中。 (我总是把它放在前面\bibliography
。)这样可以bibtex
打印参考书目中的所有条目,即使是那些未在文档中明确引用的条目。
所以这仍然是关于https://tex.stackexchange.com/questions/61301/creating-a-reference-with-bibtex-beginner。另一个猜测可能是,bibtex
键不能以数字开头,但我刚刚尝试过,这不是问题。
使用bibtex
另一篇文章中的文件,我尝试构建它,但出现以下错误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
: }
即我没有该bibtex
样式。所以你也应该检查该样式是否是安装在你系统上的有效样式!
...
我真不敢相信你没有收到任何错误消息。下载文件后IEEEtran.bst
,一切正常。请注意,编译时你需要执行
pdflatex first_try.tex
bibtex first_try
pdflatex first_try.tex
pdflatex first_try.tex
在第一次运行中,pdflatex
创建first_try.aux
包含所用书目信息的文件。有了这些信息,就可以用组装的书目数据bibtex
构建文件。然后将其包含在文档中。但由于这主要发生在引用之后,因此需要再运行一次才能获得正确的引用。first_try.bbl
pdflatex
pdflatex
如果您仍然无法解决问题,请发布这些命令的输出。
答案2
你的 bib 文件可能看起来像这样
@BOOK{2006,
title = {Learning SQL on SQL Server 2005},
publisher = {O'Reilly},
year = {2006},
author = {Sikha Saha Bagui and Richard Earp},
isbn = {978-059-610-2159}
}