[Tex/LaTex] How to convert the bibliography items from BibTeX to an embedded format

bibliographiesbibtexconversion

There exist two major ways of defining a bibliography:

  1. Embedded

    Declare \begin{thebibliography} at the end of your file and use \bibitem . The entries look like

    \bibitem{amin1}
      S.~P. Beeby, M.~J. Tudor, and N.~White, ``Energy harvesting vibration sources
      for microsystems applications,'' {\em Measurement science and
      technology}~{\bf 17}(12), p.~R175, 2006.
    
  2. Using BibTeX- The entries are stored in a .bib file. The entries look like :-

     @article{amin1,
      title={Energy harvesting vibration sources for microsystems applications},
      author={Beeby, S Pꎬ and Tudor, M Jꎬ and White, NM},
      journal={Measurement science and technology},
      volume={17},
      number={12},
      pages={R175},
      year={2006},
      publisher={IOP Publishing}
    }
    

Is there an easy, automated way to convert entries from 2 to 1.

I have been using format 2, i.e using a bib file. But I want to switch to format 1 without manually changing all the entries. Is this possible?

Best Answer

The conversion from a BibTeX .bib file to an embedded thebibliography environment depends on the bibliography style you're after. The style defines the layout and formatting of specific @type references.

The suggestion would be to:

  1. Use BibTeX to compile your file under the specific style you're interested in. For example,

    \documentclass{article}
    
    \usepackage{filecontents}
    \begin{filecontents*}{references.bib}
    @article{greenwade93,
      author = {George D. Greenwade},
      title = {The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})},
      year = {1993},
      journal = {TUGBoat},
      volume = {14},
      number = {3},
      pages = {342--351}
    }
    \end{filecontents*}
    
    \begin{document}
    
    \nocite{*}
    
    \bibliographystyle{plain}
    \bibliography{references}
    
    \end{document}
    

    When compiled using LaTeX > BibTeX > LaTeX > LaTeX, the above minimal example (called filename.tex) creates filename.bbl:

    \begin{thebibliography}{1}
    
    \bibitem{greenwade93}
    George~D. Greenwade.
    \newblock The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN}).
    \newblock {\em TUGBoat}, 14(3):342--351, 1993.
    
    \end{thebibliography}
    

    BibTeX already took care of the formatting and layout, as well as the sort order (if that has been specified in some way, even using a different package).

  2. Exchange

    \bibliographystyle{plain}
    \bibliography{references}
    

    for

    \input{filename.bbl}
    

    in your code.

enter image description here