Saturday, December 5, 2009

Convert bibtex entries to \bibitem in Latex

Some journals such as the Royal Society refuse to process .bib files for latex submissions. Seriously guys...get in the game! Instead they require the use of a bibliography command like

\begin{thebibliography}{3}
\providecommand{\natexlab}[1]{#1}
\expandafter\ifx\csname urlstyle\endcsname\relax
\providecommand{\doi}[1]{doi:\discretionary{}{}{}#1}\else
\providecommand{\doi}{doi:\discretionary{}{}{}\begingroup
\urlstyle{rm}\Url}\fi

\bibitem[{Anderson(2001)}]{Anderson2001}
Anderson, J. 2001 History of high-speed flight and its technical development.
\newblock \emph{AIAA J.}, \textbf{39}(5), 761--771.

\bibitem[{Anderson(2003)}]{Anderson2003a}
Anderson, J. 2003 \emph{Modern compressible flow: with historical perspective}.
\newblock McGraw-Hill.

\bibitem[{Stodola(1905)}]{Stodola1905}
Stodola, A. 1905 \emph{Steam turbines}.
\newblock D. Van Nostrand.

\end{thebibliography}

where all the bibliography entries are listed as \bibitems. Fortunately I found a way to convert all your entries in the .bib file to \bibitems from here.

It says
1) Generate your bibliography with regular bibtex commands first (run latex, bibtex, latex)
2) Open up the new .bbl file
3) Ctrl-A to select all, Ctrl-C to copy
4) Paste over the \bibliography{} command
5) rerun Latex!

Bibtex makes all the \bibitems automatically, but behind the scenes.

21 comments:

Kevin said...

you are a GOD! Thank you so much!

jbatters said...

Haha! I'm happy to help. I didn't expect that post to be all that useful for anyone but me. I'm glad I posted it now!

Amit Saha said...

hello josh! saved my night :) Thanks!

Unknown said...

This was very very helpful! Thanks!

Unknown said...

hi josh, thank you very much. You save my holliday.

SD said...

and How we can go backward ? I mean how to generate .bib file from the list of \bibitem

SD said...

How to conver \bibitem refernces to .bib file ?

Anonymous said...

You are, in fact, a god. Thanks very much!

Mahmoud Lababidi said...

no really, this is very helpful.
thank you.

Unknown said...

I love you, you saved me a looooot of time :)

Alex said...

Perfect tip ! I was so pissed to think I had used a .bib manual-entry editor for nothing ...

Alex said...

Perfect tip ! I was so pissed to think I had used a .bib manual-entry editor for nothing ...

Rahgozar said...

You saved me a whole day... Thanks :)

Musoro said...

Ok, this was very helpful. Thank you!

Anonymous said...

Awesome!!! But you are indeed right! Those journals should accept bibtex right away.

Unknown said...

Just wanted to thank you for this. It saved me A LOT of time.

Cheers!

Sanar said...

Thank you, helped a lot!

Sanar said...

Thank you, this helped a lot!

Unknown said...

Thanks a million.

Unknown said...

One reason why you might paste the .bbl file (the thing BibTeX generated with all the bibitems in it) instead of sending a .bib file is so that the people processing your article don't see all your entire private library (you might store on a general purpose .bib file and some of it might be personal or private or not yet published), only the references you actually cite.

jbatters said...

Alison: That's a good point. I always use a reference manager to collect the references in a paper, then export only those to the .bib. I acknowledge that other's may not do it that way. It is useful, though, for organizational purposes in large libraries.