You cannot put the BibTeX formatted code directly into your LaTeX file. But you put it into a BibTeX-file with extension .bib and include it in a certain way into your LaTeX document. Actually, you can put hundreds of such "@article"s (and there are other types "@book", "@techreport", and also "@inbook", "@inproceedings") into one BibTeX-file. Following file refs.bib is an example:
@ARTICLE{Smith1980,
author = {Peter Smith},
title = {A new analytic approach},
journal = {Artificial Intelligence},
volume = {14},
issue = {2},
pages = {329--334},
year = {1980}
}
@BOOK{AlwaysCitedRef1999,
author = {M. Miller},
title = {The Big Reference},
publisher = {Prentice-Hall, Inc.},
year = {1999}
}
Using biblatex (kind of replacement of bibtex), your document myarticle.tex will look like
\documentclass{article}
\usepackage[style=numeric]{biblatex} %default style
%\usepackage[style=draft]{biblatex} %maybe useful? difficult in bibtex!
\addbibresource{refs.bib} %\bibliography{refs} is deprecated
\begin{document}
Hello world! (\cite{Smith1980})
\nocite{AlwaysCitedRef1999}
\printbibliography
\end{document}
You need to compile the document by a sequence of commands.
pdflatex myarticle.tex will generate myarticle.aux that contains the bibtex-keys of all references you \cite'd (or \nocite'd), e.g. Smith1960 and AlwaysCitedRef1999.
bibtex myarticle.aux will process your refs.bib and sort out all the needed references into myarticle.bbl.
pdflatex myarticle.tex includes the bibliography myarticle.bbl into your pdf-output.
If you compile your document for the first time you might need to repeat step 2 and 3 until all page numbers are correct (actually, LaTeX will tell you to do so). This is because the 'insertion' of new text (the bibliography and the citations) into the pdf-output will change the page numbering.
Note: Only the \cite'd and \nocite'd papers will appear in your bibliography of your PDF file, not your entire collection!
My typical work flow using JabRef (and sometimes Zotero)
(1) Downloading/Naming/Saving of files.
After searching the web and finding a paper that has some useful information for me, I download the paper and also the biliographic data. For the latter, some webpages provide a bibtex-file for download as you have discovered. Others do not. In general, the bibliograpic data can be still found on the webpage. Hence, I have used the Addon Zotero for Firefox just to extract this information from the webpage and save it to a bibtex-file.
I create a bibtex-key BIBTEXKEY for this paper. This key should to be unique among all papers you have now and in future! So choose wisely! ;-) That depends on your subject. For example, how many authors does a typical paper have? 2 or 10? Here are two examples for patterns for the bibtex-keys,
<AuthorsEtAl><YEAR>-<InitTitle> where <AuthorsEtAl> stands for the first 2 or 3 author names and "etal" appended for more authors, and <InitTitle> for first 3 initials of title;
<YEAR>-<AuthorsShort>-<InitTitle> where <AuthorsShort> stands for the first 3 letters of each author name;
I save the PDF-paper as BIBTEXKEY.pdf and the bibliograpic data as BIBTEXKEY.bib in a folder for my not-yet-read papers. (Extending the filename is also possible, e.g. appending the title of the paper BIBTEXKEY_ShortendPaperTitleHere.pdf.)
(2) Integration into the BibTeX-file.
I have one folder that contains all my read papers and a BibTeX-file refs.bib as a database about them. The BibTeX-file is managed by the program JabRef. For the integration of the paper BIBTEXKEY.pdf, I move BIBTEXKEY.pdf into that folder for my read papers and import the file BIBTEXKEY.bib into refs.bib by JabRef (BIBTEXKEY.bib can be deleted afterwards).
(3) Writing an own article.
If "doc" is the folder with all the (LaTeX) files for my own article then I create a soft link to refs.bib in it. (You can also copy refs.bib to "doc" with the disadvantage that updates of the original file are missing in the copy.) In any case, after finalizing the article, I make sure that I have a permanent copy of refs.bib in folder "doc" for preservation purpose. Compilation of the LaTeX document works as shown above. (Actually, I am using LyX as editor to generate LaTeX.)
In sum, I have one folder with read papers and one BibTeX-file, which is managed by JabRef and used in all my works. The identification of papers is handled by BibTeX-keys.