TransWikia.com

Was given .bbl file from website and need to generate pdf

TeX - LaTeX Asked by Arun K on September 25, 2021

As the title says, I was given a reference list in the form of a .bbl file from a website, and I would like to generate a pdf from this. I’ve been googling for an hour but maybe I’m missing something. From what I understand, you create a .tex file, and use bibliography{*name_of_file*} but this doesn’t work. I’ve also tried just pasting the contents of the .bbl file into the bibliography which also doesn’t work.

Could someone give me a step by step guide on how to do this?

2 Answers

Welcome to TeX.SX!

Let's name your file "references.bib".

Create a document and name it "main.tex" with these contents:

documentclass{article}
usepackage{natbib}

begin{document}
nocite{*}
bibliographystyle{apalike}
%unsrt: Style with unsorted citations [1] [2]
%plain: [1] [2] etc but shorted 
%apalike: Author year style
%agsm: Harvard style
bibliography{references}
end{document}

Then run:

pdflatex main
bibtex main
pdflatex main

and pdflatex main

This will generate a document with your bibliography printed in your selected style.

Feel free to use geometry like:

usepackege[top=1in,bottom=1.2in,left=1in,right=1.5in]{geometry}

(add this command with your the margins you like to have in your preamble -for example just below documentclass command-)

or to remove page numbers buy using:

 pagestyle{empty}

somewhere after documentclass command.

EDIT:

Sorry... Just show you have a bbl file and not a bib... deleting my answer but leaving it for some minutes in order to see it and decide if you want to use your bib (if any) file instead and have access to the style at any time.... A bib file can give several styles of references... A bbl is just a specific output of a bib file and thus is less usable... So, if you have (or can get) a bib, try this method instead.

Answered by koleygr on September 25, 2021

You did not gave us your *.bbl file and you did not name the web site you got the file so I have to guess. Please next question add all relevant information to make it easier for us to help you!

Let us say the *.bbl you got is:

providecommand{latin}[1]{#1}
makeatletter
providecommand{doi}
  {begingroupletdo@makeotherdospecials
  catcode`{=1 catcode`}=2 doi@aux}
providecommand{doi@aux}[1]{endgrouptexttt{#1}}
makeatother
providecommand*mcitethebibliography{thebibliography}
csname @ifundefinedendcsname{endmcitethebibliography}
  {letendmcitethebibliographyendthebibliography}{}
begin{mcitethebibliography}{4}
providecommand*natexlab[1]{#1}
providecommand*mciteSetBstSublistMode[1]{}
providecommand*mciteSetBstMaxWidthForm[2]{}
providecommand*mciteBstWouldAddEndPuncttrue
  {defEndOfBibitem{unskip.}}
providecommand*mciteBstWouldAddEndPunctfalse
  {letEndOfBibitemrelax}
providecommand*mciteSetBstMidEndSepPunct[3]{}
providecommand*mciteSetBstSublistLabelBeginEnd[3]{}
providecommand*EndOfBibitem{}
mciteSetBstSublistMode{f}
mciteSetBstMaxWidthForm{subitem}{(alph{mcitesubitemcount})}
mciteSetBstSublistLabelBeginEnd
  {mcitemaxwidthsubitemformspace}
  {relax}
  {relax}

bibitem[Goossens latin{et~al.}(1994)Goossens, Mittelbach, and
  Samarin]{Goossens}
Goossens,~M.; Mittelbach,~F.; Samarin,~A. emph{The LaTeX Companion}, 1st ed.;
  Addison-Wesley, 1994relax
mciteBstWouldAddEndPuncttrue
mciteSetBstMidEndSepPunct{mcitedefaultmidpunct}
{mcitedefaultendpunct}{mcitedefaultseppunct}relax
EndOfBibitem
bibitem[Adams(1980)]{adams}
Adams,~D. emph{The Restaurant at the End of the Universe}; The Hitchhiker's
  Guide to the Galaxy; Pan Macmillan, 1980relax
mciteBstWouldAddEndPuncttrue
mciteSetBstMidEndSepPunct{mcitedefaultmidpunct}
{mcitedefaultendpunct}{mcitedefaultseppunct}relax
EndOfBibitem
bibitem[Editor latin{et~al.}(2015)Editor, Editor2, and Editor3]{test}
Editor,~F., Editor2,~S., Editor3,~T., Eds. emph{Test to show the effect};
  Publisher, 2015relax
mciteBstWouldAddEndPuncttrue
mciteSetBstMidEndSepPunct{mcitedefaultmidpunct}
{mcitedefaultendpunct}{mcitedefaultseppunct}relax
EndOfBibitem
bibitem[Feynman(1969)]{feynman}
Feynman,~R.~P. Very High-Energy Collisions of Hadrons. emph{Phys. Rev. Lett.}
  textbf{1969}, emph{23}, 1415--1417relax
mciteBstWouldAddEndPuncttrue
mciteSetBstMidEndSepPunct{mcitedefaultmidpunct}
{mcitedefaultendpunct}{mcitedefaultseppunct}relax
EndOfBibitem
end{mcitethebibliography}

To be able to use it in your tex code you need to know how it was produced. Therefore let us have a look to the following MWE (completed with a bib file and commands to produce the bibliography, resulting in the *.bbl shown above):

begin{filecontents*}{testbib.bib}
@Book{Goossens,
  author    = {Goossens, Michel and Mittelbach, Frank and 
               Samarin, Alexander},
  title     = {The LaTeX Companion},
  edition   = {1},
  publisher = {Addison-Wesley},
  location  = {Reading, Mass.},
  year      = {1994},
}
@Book{adams,
  title     = {The Restaurant at the End of the Universe},
  author    = {Douglas Adams},
  series    = {The Hitchhiker's Guide to the Galaxy},
  publisher = {Pan Macmillan},
  year      = {1980},
}
article{einstein,
  author  = {Albert Einstein},
  title   = {{Zur Elektrodynamik bewegter K{"o}rper}. ({German}) 
             [{On} the electrodynamics of moving bodies]},
  journal = {Annalen der Physik},
  volume  = {322},
  number  = {10},
  pages   = {891--921},
  year    = {1905},
  DOI     = {http://dx.doi.org/10.1002/andp.19053221004},
}
@article{Ross2006,
  title     = {Treating the right patient at the right time: 
               access to heart failure care},
  author    = {Ross, H and Howlett, J and Arnold, J Malcolm O and 
               Liu, P and O’Neill, BJ and Brophy, JM and Simpson, CS and 
               Sholdice, MM and Knudtson, M and Ross, DB and others},
  journal   = {Canadian journal of Cardiology},
  volume    = {22},
  number    = {9},
  pages     = {749--754},
  year      = {2006},
  publisher = {Elsevier},
}
@article{Heidenreich2013,
  title     = {Forecasting the impact of heart failure in the 
               United States a policy statement from the American Heart Association},
  author    = {Heidenreich, Paul A and Albert, Nancy M and 
               Allen, Larry A and Bluemke, David A and Butler, Javed and 
               Fonarow, Gregg C and Ikonomidis, John S and Khavjou, Olga 
               and Konstam, Marvin A and Maddox, Thomas M and others},
  journal   = {Circulation: Heart Failure},
  volume    = {6},
  number    = {3},
  pages     = {606--619},
  year      = {2013},
  publisher = {Am Heart Assoc},
}
@book{mschinLearning,
author    = {Tom M. Mitchell}, 
title     = {Machine learning},
publisher = {Mac Gew Hill},
year      = 1997,
volume    = 4,
series    = 10,
address   = {The address},
edition   = 3,
month     = 7,
note      = {An optional note},
isbn      = {0071154671},
}
@misc{mozart:KV183,
  author  = {Mozart, Wolfgang Amadeus},
  title   = {Sinfonie g-Moll},
  year    = {1773},
  address = {Salzburg},
  note    = {New K{"o}chelverzeichnis Nr. 183, old version Nr. 25; 
             Erster Satz: Allegro con brio, Zweiter Satz: Andante, 
             Dritter Satz: Menuetto, Vierter Satz: Allegro},
}
end{filecontents*}


documentclass[10pt,a4paper]{article}

usepackage{showframe}  % to visualise the typing area and margins
usepackage{hyperref}   % better urls


begin{document}

This is text with cite{Goossens} and cite{adams}.

nocite{*} % to test all bib entrys
bibliographystyle{unsrt} % <===========================================
bibliography{testbib}

end{document}

Package filecontents here is only used to have tex code and bib file together in a compilable MWE, you need not to use filecontents!

To be able to use the file testbib.bbl now you need the following tex code (please see that cite commands are needed and the bibliographystyle used to create the *.bbl file):

documentclass[10pt,a4paper]{article}

usepackage{showframe}  % to visualise the typing area and margins
usepackage{hyperref}   % better urls


begin{document}

This is text with cite{Goossens} and cite{adams}.

nocite{*} % to test all bib entrys
bibliographystyle{unsrt} % <===========================================
input{testbib.bbl} % <=================================================

end{document}

With input{testbib.bbl} the bibliography is included in the document at that place you have input{testbib.bbl}:

resulting bibliography

At last please compare the result above with the result of the code with *.bib file:

bibliography with bib file

Answered by Mensch on September 25, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP