[Tex/LaTex] Internal bibliography with biblatex

biblatexbibliographies

I would like to have a paper's bibliography entries inside its .tex file instead of outside in a .bib file. Is this possible with biblatex?

My reason for asking this is that I want to find the most convenient way to produce documents that uses biblatex from just one file to make collaboration on papers easier and to be able to handle submissions of papers to journals.

Best Answer

Not really. You can use the filecontents* environment. Put

\begin{filecontents*}{database.bib}
<the bibliography database>
\end{filecontents*}

in the preamble (before \documentclass) and the database.bib file will be created if not already existent. This is the most convenient way to pack everything needed in a unique .tex file.

The filecontents* environment differs from filecontents in that the former doesn't add any initial comments, which could confuse bibtex or biber.

As mentioned by Gonzalo Medina, the filecontents package lifts some restriction about these environments, allowing for example to put them anywhere in the file. Notice that, with this package, existent files will be overwritten.

Related Question