# Import .bib file into .tex file [duplicate]

This question already has an answer here:

How can I import a .bib (Latex Bibliography) file into a .tex (Latex)? There must be separate files but there must be a bibliography into the .tex file.

## migrated from stackoverflow.comDec 7 '15 at 1:05

This question came from our site for professional and enthusiast programmers.

Your question is pretty unclear to me, feel free to add any further detail to it.

You may create one text file mybib.bib with contents formatted as follows:

@Book{JS2015,
Title                    = {Once Upon a Time on Stack Overflow},
Author                   = {{Smith, J.}},
Year                     = {2015},
Edition                  = {1th},
Address                  = {Houston, TX},
Publisher                = {United Publishers}
}


and, in the same folder, one file main.tex, with at least one citation:

\documentclass{article}

\begin{document}

Text ... citation: \cite{JS2015}.

\bibliographystyle{plain}
\bibliography{mybib}

\end{document}


You save and compile this latter, then compile the bibliography, then compile again one last time.

This is, very briefly, How can I import a .bib (Latex Bibliography) file into a .tex (Latex), standard way. Please post a comment if something is not yet clear to you.

• The double braces in author = {{Smith, J.}}, stop BibTeX from parsing the name properly and from splitting it into family and given name. For people's names there should be no second pair of braces, it should be author = {Smith, J.}, the extra set of braces is only necessary for corporate authors (tex.stackexchange.com/q/10808/35864). – moewe Feb 11 at 8:52