答案1
您遇到的问题是由于您混合(错误)匹配了两种不同的参考书目创建方法。首先,您使用的模板(来自http://thesai.org/Home/Downloads/
)提供了以下已编译的thebibliography
环境:
\begin{thebibliography}{1}
\bibitem{IEEEhowto:kopka}
H.~Kopka and P.~W. Daly, \emph{A Guide to \LaTeX}, 3rd~ed.\hskip 1em plus
0.5em minus 0.4em\relax Harlow, England: Addison-Wesley, 1999.
\end{thebibliography}
(顺便说一下,空行对于 LaTeX 能够正确编译此部分至关重要。)其次,您在网上找到了以下 BibTeX 格式的条目:
@inproceedings{Kwak:2010:TSN:1772690.1772751,
author = {Kwak, Haewoon and Lee, Changhyun and Park, Hosung and Moon, Sue},
title = {What is Twitter, a Social Network or a News Media?},
booktitle = {Proceedings of the 19th International Conference on World Wide Web},
series = {WWW '10},
year = {2010},
isbn = {978-1-60558-799-8},
location = {Raleigh, North Carolina, USA},
pages = {591--600},
numpages = {10},
url = {http://doi.acm.org/10.1145/1772690.1772751},
doi = {10.1145/1772690.1772751},
acmid = {1772751},
publisher = {ACM},
address = {New York, NY, USA},
keywords = {Twitter, degree of separation, homophily, influential, information diffusion, online social network, pagerank, reciprocity, retweet},
}
正如您所发现的,简单地将该条目转储到现有thebibliography
环境中是行不通的。
假设您不需要参考 Kopka 和 Daly 的书,并且进一步假设您不想手动格式化 Kwak 等人的作品,那么您需要执行以下操作:
thebibliography
用一条语句替换整个现有环境:\bibliography{myreferences}
myreferences.bib
创建一个名为(扩展名必不可少)的新文件bib
,并将上面显示的 BibTeX 格式的条目放入该文件中。所有其他 bibtex 样式的条目也应放在此文件中。将 bib 文件保存在主 tex 文件所在的目录中。返回主 tex 文件,确保
\cite{Kwak:2010:TSN:1772690.1772751}
在适当的位置有一个或多个指令。注意字符串“Kwak:2010:TSN:1772690.1772751
”——它是您放置在文件中的条目的第一个字符串references.bib
。该字符串称为相应条目的“键”。再运行 LaTeX、BibTeX 和 LaTeX 两次。
最后,文档正文中应该有一个引用标注以及一个格式正确的参考书目。
这是汇编这些指令的结果截图。示例代码使用filecontents
包使代码自成体系且可编译。实际上,您应该有单独的.tex
和.bib
文件。
\RequirePackage{filecontents}
\begin{filecontents}{myreferences.bib}
@inproceedings{Kwak:2010:TSN:1772690.1772751,
author = {Kwak, Haewoon and Lee, Changhyun and Park, Hosung and Moon, Sue},
title = {What is Twitter, a Social Network or a News Media?},
booktitle = {Proceedings of the 19th International Conference on World Wide Web},
series = {WWW '10},
year = {2010},
isbn = {978-1-60558-799-8},
location = {Raleigh, North Carolina, USA},
pages = {591--600},
numpages = {10},
url = {http://doi.acm.org/10.1145/1772690.1772751},
doi = {10.1145/1772690.1772751},
acmid = {1772751},
publisher = {ACM},
address = {New York, NY, USA},
keywords = {Twitter, degree of separation, homophily, influential, information diffusion, online social network, pagerank, reciprocity, retweet},
}
\end{filecontents}
\documentclass[conference, letterpaper]{IEEEtran}
%% the following preamble is a compressed version of the template's material
\hyphenation{op-tical net-works semi-conduc-tor}
\usepackage{subcaption}
\ifCLASSINFOpdf
\usepackage[pdftex]{graphicx}
\else
\fi
\usepackage[cmex10]{amsmath}
\usepackage{color}
\usepackage{fancyhdr}
\renewcommand{\thispagestyle}[2]{}
\fancypagestyle{plain}{
\fancyhead{}
\fancyhead[C]{first page center header}
\fancyfoot{}
\fancyfoot[C]{first page center footer}
}
\pagestyle{fancy}
\headheight 20pt
\footskip 20pt
\rhead{}
\setcounter{page}{1}
\fancyhead[R]{\textit{(IJACSA) International Journal of Advanced Computer Science and Applications, \\ Vol. XXX, No. XXX, 3001}}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[C]{www.ijacsa.thesai.org}
\renewcommand{\footrulewidth}{0.5pt}
\fancyfoot[R]{\thepage \ $|$ P a g e }
\bibliographystyle{IEEEtran}
\begin{document}
\cite{Kwak:2010:TSN:1772690.1772751}
\bibliography{myreferences}
\end{document}