LaTeX forum ⇒ BibTeX, biblatex and biberBibliography Topic is solved

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Nadia_ZA
Posts: 11
Joined: Fri Dec 05, 2014 4:28 am

Bibliography

Postby Nadia_ZA » Thu Dec 11, 2014 11:24 pm

Hi! I'm writing a bibliography.

  1. \documentclass{report}
  2. \usepackage{setspace}
  3. \doublespacing
  4.  
  5. \begin{document}
  6.  
  7. \chapter{Introduction}
  8. A book on hamiltonian circuits is \cite{ref:tutte}.
  9.  
  10. \cleardoublepage
  11.  
  12. \chapter{Graphs}
  13. Owens \cite{ref:owens} constructed a non-hamiltonian graph.
  14.  
  15. \renewcommand{\bibname}{References}
  16. \def\bibindent{0.5in}
  17. \begin{thebibliography}{99\kern\bibindent}
  18. \makeatletter
  19. \def\@biblabel#1{}
  20. \let\old@bibitem\bibitem
  21. \def\bibitem#1{\old@bibitem{#1}\leavevmode\kern-\bibindent}
  22. \makeatother
  23.  
  24. \bibitem{ref:owens} Owens, P. J. (1981). Non-hamiltonian simple 3-polytopes whose faces are all 5-gons or 7-gons. {\em Discrete Mathematics, 36}, 227-230.
  25.  
  26. \bibitem{ref:tutte} Tutte, W. T. (1946). On hamiltonian circuits. {\em Journal of the London Mathematical Society, 21}, 98-101.
  27.  
  28. \end{thebibliography}
  29.  
  30. \end{document}


How can I have this style of citation (1981) or (Owens, 1981)? I also want each reference to be written in single spacing and a double space between references. What should I insert/type to achieve that? 

Tags:

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Fri Dec 12, 2014 10:24 am

Doing the bibliography this way (by hand) isn't the way to go, you can automate this and later change your mind and set the style of either the references in text or the bibliography.
There are commands in your example that are obsolete for 20 years.
I recommend to put your bibliographical data into a database (Read more about BibTeX-data bases).
Package biblatex will collect the information needed to run the helper program biber.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Nadia_ZA
Posts: 11
Joined: Fri Dec 05, 2014 4:28 am

Postby Nadia_ZA » Fri Dec 12, 2014 10:42 pm

Hi! I've put my bibliographical data into a bib file. As I have mentioned earlier, I want each entry to be single spaced and double spaced between entries. By the way, the body of the text is to be typed with double spacing. I've read several posts on this forum that are related to mine. But, I still can't figure out how to do. I've put \singlespacing command (as shown below in the code) but it makes the whole references to be single spaced. Please help.

  1. \begin{filecontents}{biblio.bib}
  2. @article{gz1974,
  3. title={The existence of certain planar maps},
  4. author={Gr{\"u}nbaum, Branko and Zaks, Joseph},
  5. journal={Discrete Mathematics},
  6. volume={10},
  7. number={1},
  8. pages={93--115},
  9. year={1974},
  10. publisher={North-Holland}
  11. }
  12.  
  13. @article{owens1984regular,
  14. title={Regular planar graphs with faces of only two types and shortness parameters},
  15. author={Owens, PJ},
  16. journal={Journal of graph theory},
  17. volume={8},
  18. number={2},
  19. pages={253--275},
  20. year={1984},
  21. publisher={Wiley Online Library}
  22. }
  23. \end{filecontents}
  24.  
  25. \documentclass{report}
  26.  
  27. \usepackage[UKenglish]{babel}
  28. \usepackage[latin1]{inputenc}
  29.  
  30. \usepackage{setspace}
  31. \doublespacing
  32.  
  33. \usepackage[round]{natbib}
  34.  
  35. \begin{document}
  36.  
  37. \chapter{Introduction}
  38. \citet{gz1974} have written a paper on planar maps.
  39.  
  40. \cleardoublepage
  41.  
  42. \chapter{Graphs}
  43. 3-, 4-, 5-regular non-hamiltonian graphs can be found in \citep{owens1984regular}.
  44.  
  45. \renewcommand{\bibname}{References}
  46. \setlength{\bibhang}{0.5in}
  47. \singlespacing
  48. \bibliographystyle{plainnat}
  49. \bibliography{biblio}
  50.  
  51. \end{document}

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sat Dec 13, 2014 1:11 pm

Putting \singlespace to the bibliography will set each bibitem single spaced. The distance between to item can be changed by the length bibsep. You can change it just like you did with bibhang
  1. \setlength{\bibsep}{0.5in}

Choose a value you like :-)

Now, for completeness the example with biblatex. Some things are similar, some are slightly different. It has some features that i don't want to miss. And you can alter the appearance relatively easy.

  1. \begin{filecontents}{\jobname.bib}
  2. @article{gz1974,
  3. title={The existence of certain planar maps},
  4. author={Gr{\"u}nbaum, Branko and Zaks, Joseph},
  5. journal={Discrete Mathematics},
  6. volume={10},
  7. number={1},
  8. pages={93--115},
  9. year={1974},
  10. publisher={North-Holland}
  11. }
  12.  
  13. @article{owens1984regular,
  14. title={Regular planar graphs with faces of only two types and shortness parameters},
  15. author={Owens, PJ},
  16. journal={Journal of graph theory},
  17. volume={8},
  18. number={2},
  19. pages={253--275},
  20. year={1984},
  21. publisher={Wiley Online Library}
  22. }
  23. \end{filecontents}
  24.  
  25. \documentclass{report}
  26.  
  27. \usepackage[UKenglish]{babel}
  28.  
  29. \usepackage{blindtext}
  30. \usepackage{setspace}
  31. \doublespacing
  32.  
  33. \usepackage[style=authoryear,natbib]{biblatex}
  34. \addbibresource{\jobname.bib}
  35. \addbibresource{biblatex-examples.bib}
  36. \setlength{\bibitemsep}{\baselineskip}
  37. \setlength{\bibhang}{1in}
  38. \begin{document}
  39.  
  40. \chapter{Introduction}
  41. \citet{gz1974} have written a paper on planar maps. On the other
  42. hand, \citeauthor{companion} have written \citetitle{companion}
  43. in \citeyear{companion}.
  44.  
  45. \blindtext
  46.  
  47. \chapter{Graphs}
  48. 3-, 4-, 5-regular non-hamiltonian graphs can be found in \citep{owens1984regular}.
  49.  
  50. \singlespacing
  51. \printbibliography[title=References]
  52. \end{document}

Hint, click on »open in writelatex« to check the output and play around. :-)
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Nadia_ZA
Posts: 11
Joined: Fri Dec 05, 2014 4:28 am

Postby Nadia_ZA » Sun Dec 14, 2014 9:37 am

Hi Johannes! The output pdf has gz1974, owens1984regular, companion printed in bold and no bibliography. I'm using MiKTeX 2.9 with TeXworks. I've compiled pdflatex, bibtex, pdflatex, pdflatex and repeated the combination many times. Here are some of the output written on the console output.

Package biblatex Warning: No "backend" specified, using Biber backend.
(biblatex) To use BibTeX, load biblatex with
(biblatex) the "backend=bibtex" option.
Package biblatex Warning: 'babel/polyglossia' detected but 'csquotes' missing.
(biblatex) Loading 'csquotes' recommended.
LaTeX Warning: Citation 'gz1974' on page 1 undefined on input line 41.
LaTeX Warning: Citation 'companion' on page 1 undefined on input line 42.
LaTeX Warning: Citation 'companion' on page 1 undefined on input line 42.
LaTeX Warning: Citation 'companion' on page 1 undefined on input line 43.
LaTeX Warning: Citation 'owens1984regular' on page 2 undefined on input line 48.
LaTeX Warning: Empty bibliography on input line 51.
LaTeX Warning: There were undefined references.
Package biblatex Warning: Please (re)run Biber on the file:
(biblatex) test3(3)
(biblatex) and rerun LaTeX afterwards.

User avatar
Stefan Kottwitz
Site Admin
Posts: 9416
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sun Dec 14, 2014 12:43 pm

Hi Nadia,

you need to run biber instead of bibtex with those settings,

Stefan
Site admin

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sun Dec 14, 2014 5:38 pm

I should have mentioned that.

You can find some pictures how to include biber in Texworks at TeXwelt.

Or have a look at TeX.SX for some english explanations. :-)
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.


Return to “BibTeX, biblatex and biber”

Who is online

Users browsing this forum: Majestic-12 [Bot] and 6 guests