BibTeX, biblatex and biberBibliography as a section from different files

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
philalou
Posts: 6
Joined: Sat Nov 29, 2014 10:04 pm

Bibliography as a section from different files

Post by philalou »

Hi all,

I'm currently struggling at using each of my bibliography files for the thesis I'm compiling as being separate sections in each of my chapters and having showed in my table of contents. In addition the bibliography as soon as it is compiled, shows on a separate page.

I tried to build a minimal example out of this and hopes that shows everything I need to.

Code: Select all

\documentclass[12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{achemso}
\usepackage[super,sort&compress,comma,sectionbib]{natbib}
\usepackage[sectionbib]{chapterbib}

\begin{document}

\tableofcontents

\chapter{}
\section{Introduction}
blablalbalablalbal \cite{alvarez}
\section{References}
\bibliography{Bibliography/chapter1-refs}

\chapter{}
\section{Introduction}
blablalbalablalbal \cite{ambat}
\section{References}
\bibliography{Bibliography/chapter2-refs}



\end{document}
and finally my refs in each file:
chapter1-refs.bib

Code: Select all

@article{alvarez,
   author = "Alvarez-Pampliega, A. and Lamaka, S. V. and Taryba, M. G. and Madani, M. and De Strycker, J. and Tourwé, E. and Ferreira, M. G. S. and Terryn, H.",
   title = "Cut-edge corrosion study on painted aluminum rich metallic coated steel by scanning vibrating electrode and micro-potentiometric techniques",
   journal = "Electrochimica Acta",
   volume = "61",
   number = "0",
   pages = "107-117",
   year = "2012",
}
and for:
chapter2-refs.bib

Code: Select all

@article{ambat,
   author = "Ambat, Rajan and Aung, Naing Naing and Zhou, W.",
   title = "Evaluation of microstructural effects on corrosion behaviour of {AZ}91D magnesium alloy",
   journal = "Corrosion Science",
   volume = "42",
   number = "8",
   pages = "1433-1455",
   year = "2000"
}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Bibliography as a section from different files

Post by Johannes_B »

Sorry for the late reply, do you require to use package achemso? Achemso loads package natbib itself, this constricts you to use biblatex, which would be very useful here.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
philalou
Posts: 6
Joined: Sat Nov 29, 2014 10:04 pm

Re: Bibliography as a section from different files

Post by philalou »

Yes the achemso style is required. Unless it is possible to obtain a similar format using biblatex.

Authors, Title, Journal name in italic, Year in bold, Volume in italic, pages.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Bibliography as a section from different files

Post by Johannes_B »

The author of achemso is also the maintainer of biblatex-chem, providing a style chem-acs, which covers most of American Chemistry Society Journals.

Code: Select all

\begin{filecontents}{\jobname.bib}
    @article{alvarez,
       author = "Alvarez-Pampliega, A. and Lamaka, S. V. and Taryba, M. G. and Madani, M. and De Strycker, J. and Tourwé, E. and Ferreira, M. G. S. and Terryn, H.",
       title = "Cut-edge corrosion study on painted aluminum rich metallic coated steel by scanning vibrating electrode and micro-potentiometric techniques",
       journal = "Electrochimica Acta",
       volume = "61",
       number = "0",
       pages = "107-117",
       year = "2012",
    }
    @article{ambat,
       author = "Ambat, Rajan and Aung, Naing Naing and Zhou, W.",
       title = "Evaluation of microstructural effects on corrosion behaviour of {AZ}91D magnesium alloy",
       journal = "Corrosion Science",
       volume = "42",
       number = "8",
       pages = "1433-1455",
       year = "2000"
    }
\end{filecontents}
\documentclass[12pt]{report}
\usepackage[utf8]{inputenc}
%\usepackage{achemso}
%\usepackage[super,sort&compress,comma,sectionbib]{natbib}
%\usepackage[sectionbib]{chapterbib}
\usepackage[natbib=true,
refsection=chapter,
autocite=superscript,
style=chem-acs
]{biblatex}
\defbibheading{bibliography}{\section*{The Cites of this chapter}}
\addbibresource{\jobname.bib}
\let\cite\autocite
\begin{document}
\tableofcontents
\chapter{}
\section{Introduction}
blablalbalablalbal
\cite{alvarez}
\printbibliography
\chapter{}
\section{Introduction}
blablalbalablalbal
\cite{ambat}
\printbibliography
\end{document}

By the way, please add \bibliographystyle{achemso} to your classical set. You will note a difference to the style you described above. ;-)
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
philalou
Posts: 6
Joined: Sat Nov 29, 2014 10:04 pm

Re: Bibliography as a section from different files

Post by philalou »

Thank you Johannes.

This is a very helpful tip. I was not aware of this package and its availability with bib latex.

Is the bibliography needs to be loaded as you have? Or can I add a file in my tree that can be loaded? How can I do this?

Another thing I'm wondering is related to my initial query and has to do with the table of contents.

In your example, the table of content as each chapter listed as separate entities with one section each. My question is the following.
How is it possible to make each references list at the end of each chapter appear as a section which would show up in the table of contents?

This may be very simple but I have still not figured it out.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Bibliography as a section from different files

Post by Johannes_B »

The table of contents business is very simple indeed. I defined a bib-heading using starred sections. They are unnumbered and don't go to the toc by default. If you want it numbered, just remove the star. If you want an unnumbered section to go to the toc, use package unnumberedtotoc. It provides addchap and addsec for unnumbered chapters and sections.

Your first question, i am sorry. I don't understand what you are asking for. Please try to be a bit more verbose.
Ah, i think i know what you mean. The filecontents environment is very handy for testing stuff, it gives a helper a bit of comfort.
The bib-database is loaded with \addbibresource. You can savely remove the whole filecontents stuff.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply