# I can't generate a bib document on texworks

I cannot generated a bib document and I am growing a bit desperate. I have my references in the bib format, for example:

@article{fosfuri2000patent,
title={Patent protection, imitation and the mode of technology transfer},
author={Fosfuri, Andrea},
journal={International Journal of Industrial Organization},
volume={18},
number={7},
pages={1129--1149},
year={2000},
publisher={Elsevier}
}


I copy them in a new document and I run latex in order to generate the aux file. But it doesn't run because \begin{document} is missing. I can save it as bib, but I can't generate the aux, so I can't run it in bibtex either. Thus even though I have it in my main tex, it doesn't read my references. I have it as:

\bibliography{biblio}
\bibliographystyle{plain

• You should have two files: your .tex file, and your .bib file. The .bib file will contain the bib items like the one you show, and given your example, it should be called biblio.bib. Delete your .aux files and then run latex, bibtex, latex, latex to compile the .tex document and generate the bibliography (you also need some \cite{} commands in your document. Does that work with a simple document? – Alan Munn Aug 24 '15 at 0:00
• \begin{document} is missing indicates a problem in your preamble. You should show the complete error message. – Ulrike Fischer Aug 24 '15 at 6:51

This is surely a duplicate but I can't find it.

Your .tex file should look like this:

\documentclass{article}
\begin{document}
Some text referencing \cite{fosfuri2000patent}.

\bibliographystyle{plain}
\bibliography{biblio}% if biblio.bib is the name of your .bib file
\end{document}


Then run pdflatex doc if your .tex file is doc.tex.

Then run bibtex doc.

Then run pdflatex doc.

Then run pdflatex doc.

You do not need to copy entries to your .tex document. Just use the bib keys (e.g. fosfuri2000patent) to refer to the entries you need.

Should you wish to add all entries, even if you don't cite them, you can write

\nocite{*}