# Create per chapter bibliography

My university has provided a template for writing the thesis. However, it only prints the bibliography in the end of the thesis.

Thanks a lot. Regards

• You might be interested in § 3.7.4 Bibliography sections, pp. 85-86 in the documentation of biblatex. Sep 28 '18 at 14:32
• gist.github.com/moewew/13a85c603df482d03a456827b247aaa9 shows how one could turn the four-step instruction which included downloading files from elsewhere and unpacking them into a short MWE. Please try to show minimal example documents like this in the future. It is more time consuming to come up with short examples than just dumping all your code on people, but you will get better help much quicker if you don't smother people with walls of code. Sep 28 '18 at 16:12
• @Rouge No one is being unfriendly of bullying anyone. Then thing is that when it comes to LaTeX, it's really hard to give a useful answer without seeing the preamble of your document. People are here to help you, otherwise they would be doing other things in their spare time. moewe is an expert in bibliographies, his answer will most certainly point you in the right way. I'll roll back your edit so people who see this question in the future might benefit from it. Sep 28 '18 at 16:52
• I'm sorry that I upset you. I didn't expect that those two phrases would offend you (or indeed anyone else), but I'm not a native English speaker, so I do not necessarily know all the connotations that they entail. I hoped that the comment could help you improve your questions in the future: It is a simple matter of fact that people are more inclined (and able) to help you if your code example are compact. If they don't feel like unloading a lot of code. If they don't require visiting other webpages and downloading and unpacking .zip files. ... Sep 28 '18 at 20:58
• ... For the people trying to help you, questions with just a link to "the code" and a huge number of lines of code can act as a deterrent. Sep 28 '18 at 21:04

Your document class is based on report, so I assume your highest level of sectioning is \chapter. If you use the option refsection=chapter and add a \printbibliography at the end of each chapter you get a bibliography for each chapter separately.

\documentclass[british]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[style=authoryear, backend=biber, refsection=chapter]{biblatex}

\begin{document}
\chapter{Lorem}
Lorem ipsum \autocite{sigfridsson} dolor \autocite{geer,worman}

\chapter{Dolor}
Lorem ipsum \autocite{sigfridsson} dolor \autocite{knuth:ct:a,pines}

\chapter{Sit}
Lorem ipsum \autocite{sigfridsson} dolor \autocite{geer,cicero,companion}

The MWE uses heading=subbibliography so that the heading is typeset as a \section subordinate to the current \chapter.
Edit your MWE shows at least one problem: You have refsegment=chapter. But you should be using refsection=chapter.
refsections keep their contents completely local and completely independent of other refsections, which means that the numbers in the bibliography restart for each chapter. refsegments basically only add an attribute to entries and are usually only used to filter bibliographies: If you use refsegments, all entries still belong to one global list.
You can find a bit about the differences between refsection and refsegment in the biblatex documentation (§3.7.4 and §3.7.5), in Reset the counter of references in each chapter and Multiple bibliographies, multiple styles, discontiguous regions.