2

I am new to latex and I have a problem in refrencing other papers in my work, I downloade the latex template from here:

get template

Also I want to for example cite this paper: a paper

so for example I copied the bibtex from this website and copy it in the bibography section so I have:enter image description here

But nothing happens I really do not know how to add it then can anyone help?

  • The site's paper_format.tex has a single bibliography entry in it. If you modify that bibliography entry and rebuild the document, does the PDF update accordingly? – Mike Renfro Jul 23 '15 at 22:06
  • 3
    I think the problem rather lies with OP inserting a BibTeX object inside LaTeX's thebibliography environment. OP, if you're going to use BibTeX (the @inproceedings/etc. stuff), I'm pretty sure you need to use it for every reference. Otherwise, you should format your citation manually. – Sean Allred Jul 23 '15 at 22:10
  • Yep. The @ alone would kill it. Should have noticed that. – Mike Renfro Jul 23 '15 at 22:44
  • My answer here may help a little. The question concerns a similar kind of 'mismatch' involving distinct ways to create a bibliography. – cfr Jul 23 '15 at 22:48
  • @MikeRenfro Well, it is much more difficult to read screen shots of code than to read code which has been pasted and properly formatted, as it should be. – cfr Jul 23 '15 at 22:49
1

The problem you're encountering arises because you are mixing-and-(mis)matching two different methods for creating a bibliography. First, the template you're using (from http://thesai.org/Home/Downloads/) provides the following, already-compiled thebibliography environment:

\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}

(The blank lines are essential, by the way, for LaTeX to be able to compile this part correctly.) Second, you've found the following, BibTeX-formatted entry online:

@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},
} 

As you've discovered, simply dumping this entry into the existing thebibliography environment does not work.

Assuming you don't need to reference the Kopka and Daly book, and assuming further that you don't want to format by hand the Kwak et al piece, here's what you need to do:

  • Replace the entire existing thebibliography environment with a single statement:

    \bibliography{myreferences}
    
  • Create a new file called myreferences.bib (the extension bib is essential), and place the BibTeX-formatted entry shown above in that file. All further bibtex-style entries should also be placed in this file. Save the bib file in the directory where your main tex file is located.

  • Back in your main tex file, be sure to have one or more \cite{Kwak:2010:TSN:1772690.1772751} instructions in the appropriate locations. Note the string "Kwak:2010:TSN:1772690.1772751" -- it's the very first string of the entry you placed in the file references.bib. The string is called the "key" to the corresponding entry.

  • Run LaTeX, BibTeX, and LaTeX twice more.

By the end of this, there should a citation call-out in the body of the document as well as a correctly formatted bibliography.


Here's the screenshot of the result of assembling these instructions. The example code uses the filecontents package to make the code self-contained and compilable. In practice, you should have separate .tex and .bib files.

enter image description here

\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}
  • Thanks a lot for your answer, I followed what u said and I created bib file the I added \bibliography{myreferences} in tex file and I used this line somewhere in the body of text: \cite{Kwak:2010:TSN:1772690.1772751} but I get ? which means unknown in the place of citation and also I get nothing in bibliography – Hamed Minaee Jul 24 '15 at 2:12
  • @HamedMinaee - Which error messages, if any, do you get? Incidentally, did you (a) place the bib file in the same directory as the main tex file, (b) provide a \bibliographystyle directive, and (c) run LaTeX, BibTeX, and LaTeX twice more to fully propagate all changes? – Mico Jul 24 '15 at 2:25
  • No I do no get any error, I just put the file in the same directory should I not do that? – Hamed Minaee Jul 24 '15 at 2:31
  • also what do u mean by providing bibliography ? do u mean this: \bibliography{myreferences} or the content of refrence file? – Hamed Minaee Jul 24 '15 at 2:32
  • Also I am using winedt and I just use compiled buttom 3 times is it enough for compilation or am I missing something? – Hamed Minaee Jul 24 '15 at 2:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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