References after each chapter - CUED PhD Thesis Template












0














I know it is unorthodox but there's really no way to show what I have done other than the link.



I am writing my thesis using the PhD Thesis Template for Cambridge University Engineering Department (CUED) (v2.3.1) found on Overleaf at my tutor's request and I can't seem to be able to separate the references so that they are after each chapter.



I have tried using natbib with chapterbib as one question here suggested, I have tried using biblatex with refsection=chapter and nothing.



I don't know enough to understand the .cls or other documents that define the kind of document class I am using.



I am calling each reference in the chapter like



bibliographystyle{aipnum4-1.bst}
setstretch{0.9}
bibliography{ch1/biblio1.bib}


I don't know what to do, I have read every question on here and cant seem to make it work.



Thanks!



Edit: Forgot to mention, even though I've tried different ways to get multiple references sections, at the moment I am using biblatex. The references for the first chapter are shown for all the rest of the chapters too, and the references that are not in the .bib of the first chapter are displayed like ?? in the rest of the thesis.



Edit2: A link to a minimal working example in overleaf is here. I know it's not ideal but I cant think of any other way.










share|improve this question
























  • bibliographystyle is incompatible with biblatex. If you get ?? for unprocessed references you are not even using biblatex (in which case you would get bold entry keys). Unfortunately the link to the template on Overleaf is not enough. The template offers a great many options and we don't know which you use. Please show us an example document that explains what you are doing (tex.meta.stackexchange.com/q/228/35864 and tex.meta.stackexchange.com/q/4407/35864).
    – moewe
    1 hour ago










  • But really, do yourself a favour and avoid that template and all other templates for that matter. At best they needlessly complicate things when you want to change stuff, at worst they contain outdated or outright wrong code that breaks in unexpected places and when you can least afford it. See tex.stackexchange.com/q/390683/35864. PhDThesisPSnPDF.cls alone in its current form is 1200 lines long and thesis.tex inputs another few hundred lines from Preamble/preamble.tex.
    – moewe
    1 hour ago












  • Honestly, I wish I could change templates but I cant, it was my at tutor's request and we are already not in the best of terms. I have sadly made a lot of changes and added things to the preamble. I have edited the post to add the link to a minimal example of what I am working on, only two chapters with enough text to exemplify what is happening.
    – M.O.
    1 hour ago












  • Please have a look to possible duplicate question tex.stackexchange.com/questions/87414/…
    – Kurt
    34 mins ago










  • The situation with biblatex was more complicated: While you were not actually using the package, that was only due to a weird coincidence. I have added the tag back in and tried to address the issues in my answer.
    – moewe
    22 mins ago


















0














I know it is unorthodox but there's really no way to show what I have done other than the link.



I am writing my thesis using the PhD Thesis Template for Cambridge University Engineering Department (CUED) (v2.3.1) found on Overleaf at my tutor's request and I can't seem to be able to separate the references so that they are after each chapter.



I have tried using natbib with chapterbib as one question here suggested, I have tried using biblatex with refsection=chapter and nothing.



I don't know enough to understand the .cls or other documents that define the kind of document class I am using.



I am calling each reference in the chapter like



bibliographystyle{aipnum4-1.bst}
setstretch{0.9}
bibliography{ch1/biblio1.bib}


I don't know what to do, I have read every question on here and cant seem to make it work.



Thanks!



Edit: Forgot to mention, even though I've tried different ways to get multiple references sections, at the moment I am using biblatex. The references for the first chapter are shown for all the rest of the chapters too, and the references that are not in the .bib of the first chapter are displayed like ?? in the rest of the thesis.



Edit2: A link to a minimal working example in overleaf is here. I know it's not ideal but I cant think of any other way.










share|improve this question
























  • bibliographystyle is incompatible with biblatex. If you get ?? for unprocessed references you are not even using biblatex (in which case you would get bold entry keys). Unfortunately the link to the template on Overleaf is not enough. The template offers a great many options and we don't know which you use. Please show us an example document that explains what you are doing (tex.meta.stackexchange.com/q/228/35864 and tex.meta.stackexchange.com/q/4407/35864).
    – moewe
    1 hour ago










  • But really, do yourself a favour and avoid that template and all other templates for that matter. At best they needlessly complicate things when you want to change stuff, at worst they contain outdated or outright wrong code that breaks in unexpected places and when you can least afford it. See tex.stackexchange.com/q/390683/35864. PhDThesisPSnPDF.cls alone in its current form is 1200 lines long and thesis.tex inputs another few hundred lines from Preamble/preamble.tex.
    – moewe
    1 hour ago












  • Honestly, I wish I could change templates but I cant, it was my at tutor's request and we are already not in the best of terms. I have sadly made a lot of changes and added things to the preamble. I have edited the post to add the link to a minimal example of what I am working on, only two chapters with enough text to exemplify what is happening.
    – M.O.
    1 hour ago












  • Please have a look to possible duplicate question tex.stackexchange.com/questions/87414/…
    – Kurt
    34 mins ago










  • The situation with biblatex was more complicated: While you were not actually using the package, that was only due to a weird coincidence. I have added the tag back in and tried to address the issues in my answer.
    – moewe
    22 mins ago
















0












0








0


1





I know it is unorthodox but there's really no way to show what I have done other than the link.



I am writing my thesis using the PhD Thesis Template for Cambridge University Engineering Department (CUED) (v2.3.1) found on Overleaf at my tutor's request and I can't seem to be able to separate the references so that they are after each chapter.



I have tried using natbib with chapterbib as one question here suggested, I have tried using biblatex with refsection=chapter and nothing.



I don't know enough to understand the .cls or other documents that define the kind of document class I am using.



I am calling each reference in the chapter like



bibliographystyle{aipnum4-1.bst}
setstretch{0.9}
bibliography{ch1/biblio1.bib}


I don't know what to do, I have read every question on here and cant seem to make it work.



Thanks!



Edit: Forgot to mention, even though I've tried different ways to get multiple references sections, at the moment I am using biblatex. The references for the first chapter are shown for all the rest of the chapters too, and the references that are not in the .bib of the first chapter are displayed like ?? in the rest of the thesis.



Edit2: A link to a minimal working example in overleaf is here. I know it's not ideal but I cant think of any other way.










share|improve this question















I know it is unorthodox but there's really no way to show what I have done other than the link.



I am writing my thesis using the PhD Thesis Template for Cambridge University Engineering Department (CUED) (v2.3.1) found on Overleaf at my tutor's request and I can't seem to be able to separate the references so that they are after each chapter.



I have tried using natbib with chapterbib as one question here suggested, I have tried using biblatex with refsection=chapter and nothing.



I don't know enough to understand the .cls or other documents that define the kind of document class I am using.



I am calling each reference in the chapter like



bibliographystyle{aipnum4-1.bst}
setstretch{0.9}
bibliography{ch1/biblio1.bib}


I don't know what to do, I have read every question on here and cant seem to make it work.



Thanks!



Edit: Forgot to mention, even though I've tried different ways to get multiple references sections, at the moment I am using biblatex. The references for the first chapter are shown for all the rest of the chapters too, and the references that are not in the .bib of the first chapter are displayed like ?? in the rest of the thesis.



Edit2: A link to a minimal working example in overleaf is here. I know it's not ideal but I cant think of any other way.







biblatex bibliographies templates






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 24 mins ago









moewe

87.5k9110335




87.5k9110335










asked 2 hours ago









M.O.M.O.

116




116












  • bibliographystyle is incompatible with biblatex. If you get ?? for unprocessed references you are not even using biblatex (in which case you would get bold entry keys). Unfortunately the link to the template on Overleaf is not enough. The template offers a great many options and we don't know which you use. Please show us an example document that explains what you are doing (tex.meta.stackexchange.com/q/228/35864 and tex.meta.stackexchange.com/q/4407/35864).
    – moewe
    1 hour ago










  • But really, do yourself a favour and avoid that template and all other templates for that matter. At best they needlessly complicate things when you want to change stuff, at worst they contain outdated or outright wrong code that breaks in unexpected places and when you can least afford it. See tex.stackexchange.com/q/390683/35864. PhDThesisPSnPDF.cls alone in its current form is 1200 lines long and thesis.tex inputs another few hundred lines from Preamble/preamble.tex.
    – moewe
    1 hour ago












  • Honestly, I wish I could change templates but I cant, it was my at tutor's request and we are already not in the best of terms. I have sadly made a lot of changes and added things to the preamble. I have edited the post to add the link to a minimal example of what I am working on, only two chapters with enough text to exemplify what is happening.
    – M.O.
    1 hour ago












  • Please have a look to possible duplicate question tex.stackexchange.com/questions/87414/…
    – Kurt
    34 mins ago










  • The situation with biblatex was more complicated: While you were not actually using the package, that was only due to a weird coincidence. I have added the tag back in and tried to address the issues in my answer.
    – moewe
    22 mins ago




















  • bibliographystyle is incompatible with biblatex. If you get ?? for unprocessed references you are not even using biblatex (in which case you would get bold entry keys). Unfortunately the link to the template on Overleaf is not enough. The template offers a great many options and we don't know which you use. Please show us an example document that explains what you are doing (tex.meta.stackexchange.com/q/228/35864 and tex.meta.stackexchange.com/q/4407/35864).
    – moewe
    1 hour ago










  • But really, do yourself a favour and avoid that template and all other templates for that matter. At best they needlessly complicate things when you want to change stuff, at worst they contain outdated or outright wrong code that breaks in unexpected places and when you can least afford it. See tex.stackexchange.com/q/390683/35864. PhDThesisPSnPDF.cls alone in its current form is 1200 lines long and thesis.tex inputs another few hundred lines from Preamble/preamble.tex.
    – moewe
    1 hour ago












  • Honestly, I wish I could change templates but I cant, it was my at tutor's request and we are already not in the best of terms. I have sadly made a lot of changes and added things to the preamble. I have edited the post to add the link to a minimal example of what I am working on, only two chapters with enough text to exemplify what is happening.
    – M.O.
    1 hour ago












  • Please have a look to possible duplicate question tex.stackexchange.com/questions/87414/…
    – Kurt
    34 mins ago










  • The situation with biblatex was more complicated: While you were not actually using the package, that was only due to a weird coincidence. I have added the tag back in and tried to address the issues in my answer.
    – moewe
    22 mins ago


















bibliographystyle is incompatible with biblatex. If you get ?? for unprocessed references you are not even using biblatex (in which case you would get bold entry keys). Unfortunately the link to the template on Overleaf is not enough. The template offers a great many options and we don't know which you use. Please show us an example document that explains what you are doing (tex.meta.stackexchange.com/q/228/35864 and tex.meta.stackexchange.com/q/4407/35864).
– moewe
1 hour ago




bibliographystyle is incompatible with biblatex. If you get ?? for unprocessed references you are not even using biblatex (in which case you would get bold entry keys). Unfortunately the link to the template on Overleaf is not enough. The template offers a great many options and we don't know which you use. Please show us an example document that explains what you are doing (tex.meta.stackexchange.com/q/228/35864 and tex.meta.stackexchange.com/q/4407/35864).
– moewe
1 hour ago












But really, do yourself a favour and avoid that template and all other templates for that matter. At best they needlessly complicate things when you want to change stuff, at worst they contain outdated or outright wrong code that breaks in unexpected places and when you can least afford it. See tex.stackexchange.com/q/390683/35864. PhDThesisPSnPDF.cls alone in its current form is 1200 lines long and thesis.tex inputs another few hundred lines from Preamble/preamble.tex.
– moewe
1 hour ago






But really, do yourself a favour and avoid that template and all other templates for that matter. At best they needlessly complicate things when you want to change stuff, at worst they contain outdated or outright wrong code that breaks in unexpected places and when you can least afford it. See tex.stackexchange.com/q/390683/35864. PhDThesisPSnPDF.cls alone in its current form is 1200 lines long and thesis.tex inputs another few hundred lines from Preamble/preamble.tex.
– moewe
1 hour ago














Honestly, I wish I could change templates but I cant, it was my at tutor's request and we are already not in the best of terms. I have sadly made a lot of changes and added things to the preamble. I have edited the post to add the link to a minimal example of what I am working on, only two chapters with enough text to exemplify what is happening.
– M.O.
1 hour ago






Honestly, I wish I could change templates but I cant, it was my at tutor's request and we are already not in the best of terms. I have sadly made a lot of changes and added things to the preamble. I have edited the post to add the link to a minimal example of what I am working on, only two chapters with enough text to exemplify what is happening.
– M.O.
1 hour ago














Please have a look to possible duplicate question tex.stackexchange.com/questions/87414/…
– Kurt
34 mins ago




Please have a look to possible duplicate question tex.stackexchange.com/questions/87414/…
– Kurt
34 mins ago












The situation with biblatex was more complicated: While you were not actually using the package, that was only due to a weird coincidence. I have added the tag back in and tried to address the issues in my answer.
– moewe
22 mins ago






The situation with biblatex was more complicated: While you were not actually using the package, that was only due to a weird coincidence. I have added the tag back in and tried to address the issues in my answer.
– moewe
22 mins ago












1 Answer
1






active

oldest

votes


















1














If at all possible you should try to avoid templates in general and this template in particular. See Why should you avoid using (complex) templates?. Templates are fine while they are working and giving you exactly the output you want, but it can become increasingly complicated to modify them. Bad templates may contain outdated or outright wrong code and may explode into your face at any moment.



This particular template (Link to the Overleaf version) is also available on https://github.com/kks32/phd-thesis-template and is intended to be a PhD thesis template for Cambridge University Engineering Department (CUED). If that's not where you will be submitting your thesis, it is probably better not to use that template.





The class has several bibliography-related options and custombib would hand all control over the bibliography back to you if you had not also used the option numbered. The way these options are handled means that (counter-intuitively) the eralier option numbered just overrides the custombib and loads natbib instead. (Note that the class does not care about the order of these bibliography options, the outcome is determined by the particular nesting of tests in the implementation of the class. And the outcome of using conflicting options is not at all clear from the outside.)



In Preamble/preamble.tex, specifically with



ifuseCustomBib
%usepackage[backend=biber,refsection=section, style=numeric-comp, citestyle=numeric, sorting=nty]{biblatex}

usepackage[firstinits=true,
bibencoding=inputenc,
hyperref=auto,
pagination=none,
%style=standard,
refsection=chapter]
{biblatex}


bibliographystyle{aipnum4-1.bst}
fi


you try to explicitly load the biblatex package, yet in the next line of code you write



bibliographystyle{aipnum4-1.bst}


which is a command of traditional BibTeX bibliographies that is incompatible with biblatex (and also slightly incorrect: the style in bibliographystyle should be given without file extension, bibliographystyle{aipnum4-1} would be correct).



Be that as it may, the numbered option quashes your attempt to define the bibliography anyway. It just causes natbib to be loaded and ignores your definitions because they are guarded by ifuseCustomBib (which is false).





In the chapters (e.g. Chapter5/chapter5.tex) you then produce a bibliography with



I know this seems kind of extra, it's so that no extra white page is added in between the text and the references.
begingroup
makeatletter
renewcommand{chapter}{
if@openrightclearpageelseclearpagefi
thispagestyle{empty}%
global@topnumz@
@afterindentfalse
secdef@chapter@schapter
}
makeatother

bibliographystyle{aipnum4-1.bst}
setstretch{0.9}
bibliography{Chapter5/biblio5.bib}
endgroup
thispagestyle{empty}
clearpage
%if@openrightcleardoublepageelseclearpagefi
mbox{}
thispagestyle{empty}


which looks wrong on quite a few levels. But again we can take away from this bit of code that you are using traditional BibTeX methods and not biblatex – this time explicitly.





There are several methods to obtain split bibliographies (see Sectioning bibliography by type of referred item) and there are BibTeX-compatible way to obtain per-chapter bibliographies as well (see References at the end of each chapter and for example How to use chapterbib package: syntax and Bibliography in each chapter). Yet I believe that biblatex offers the easiest and most convenient way to per-chapter bibliographies.



Have a look at What to do to switch to biblatex? to see what you have to do to switch to biblatex.



Remove all the bibliographystyle and the bibliography instructions in the document body.



The following is a "minimal" example using PhDThesisPSnPDF that shows how you could use biblatex in your document. Please read the comments carefully, they should explain how this works.



% no option numbered
documentclass[a4paper,12pt,times,preprint,index, custombib]{Classes/PhDThesisPSnPDF}

% in Preamble/preamble.tex you need
ifuseCustomBib
usepackage[
backend=biber,
style=numeric,
refsection=chapter]
{biblatex}

% you also need to declare your bib file
addbibresource{biblatex-examples.bib}
% biblatex-examples.bib is an example file
% that is available everywhere where biblatex is installed
% you'll need something like
% addbibresource{biblio.bib}
% and maybe
% addbibresource{Chapter5/biblio5.bib}
% etc. you can several of these lines
fi

begin{document}
% in your chapters you'll have
chapter{Lorem}
Lorem ipsum~cite{sigfridsson} dolor~cite{worman}.
% just use cite as normal

printbibliography[heading=subbibliography] % this prints the bibliography

% next chapter
chapter{Dolor}
Dolor~cite{nussbaum} sit~cite{sigfridsson}

printbibliography[heading=subbibliography]
end{document}


Screenshot of chapter 2 with two citations and a subbibliography with those two entries






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f469649%2freferences-after-each-chapter-cued-phd-thesis-template%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    If at all possible you should try to avoid templates in general and this template in particular. See Why should you avoid using (complex) templates?. Templates are fine while they are working and giving you exactly the output you want, but it can become increasingly complicated to modify them. Bad templates may contain outdated or outright wrong code and may explode into your face at any moment.



    This particular template (Link to the Overleaf version) is also available on https://github.com/kks32/phd-thesis-template and is intended to be a PhD thesis template for Cambridge University Engineering Department (CUED). If that's not where you will be submitting your thesis, it is probably better not to use that template.





    The class has several bibliography-related options and custombib would hand all control over the bibliography back to you if you had not also used the option numbered. The way these options are handled means that (counter-intuitively) the eralier option numbered just overrides the custombib and loads natbib instead. (Note that the class does not care about the order of these bibliography options, the outcome is determined by the particular nesting of tests in the implementation of the class. And the outcome of using conflicting options is not at all clear from the outside.)



    In Preamble/preamble.tex, specifically with



    ifuseCustomBib
    %usepackage[backend=biber,refsection=section, style=numeric-comp, citestyle=numeric, sorting=nty]{biblatex}

    usepackage[firstinits=true,
    bibencoding=inputenc,
    hyperref=auto,
    pagination=none,
    %style=standard,
    refsection=chapter]
    {biblatex}


    bibliographystyle{aipnum4-1.bst}
    fi


    you try to explicitly load the biblatex package, yet in the next line of code you write



    bibliographystyle{aipnum4-1.bst}


    which is a command of traditional BibTeX bibliographies that is incompatible with biblatex (and also slightly incorrect: the style in bibliographystyle should be given without file extension, bibliographystyle{aipnum4-1} would be correct).



    Be that as it may, the numbered option quashes your attempt to define the bibliography anyway. It just causes natbib to be loaded and ignores your definitions because they are guarded by ifuseCustomBib (which is false).





    In the chapters (e.g. Chapter5/chapter5.tex) you then produce a bibliography with



    I know this seems kind of extra, it's so that no extra white page is added in between the text and the references.
    begingroup
    makeatletter
    renewcommand{chapter}{
    if@openrightclearpageelseclearpagefi
    thispagestyle{empty}%
    global@topnumz@
    @afterindentfalse
    secdef@chapter@schapter
    }
    makeatother

    bibliographystyle{aipnum4-1.bst}
    setstretch{0.9}
    bibliography{Chapter5/biblio5.bib}
    endgroup
    thispagestyle{empty}
    clearpage
    %if@openrightcleardoublepageelseclearpagefi
    mbox{}
    thispagestyle{empty}


    which looks wrong on quite a few levels. But again we can take away from this bit of code that you are using traditional BibTeX methods and not biblatex – this time explicitly.





    There are several methods to obtain split bibliographies (see Sectioning bibliography by type of referred item) and there are BibTeX-compatible way to obtain per-chapter bibliographies as well (see References at the end of each chapter and for example How to use chapterbib package: syntax and Bibliography in each chapter). Yet I believe that biblatex offers the easiest and most convenient way to per-chapter bibliographies.



    Have a look at What to do to switch to biblatex? to see what you have to do to switch to biblatex.



    Remove all the bibliographystyle and the bibliography instructions in the document body.



    The following is a "minimal" example using PhDThesisPSnPDF that shows how you could use biblatex in your document. Please read the comments carefully, they should explain how this works.



    % no option numbered
    documentclass[a4paper,12pt,times,preprint,index, custombib]{Classes/PhDThesisPSnPDF}

    % in Preamble/preamble.tex you need
    ifuseCustomBib
    usepackage[
    backend=biber,
    style=numeric,
    refsection=chapter]
    {biblatex}

    % you also need to declare your bib file
    addbibresource{biblatex-examples.bib}
    % biblatex-examples.bib is an example file
    % that is available everywhere where biblatex is installed
    % you'll need something like
    % addbibresource{biblio.bib}
    % and maybe
    % addbibresource{Chapter5/biblio5.bib}
    % etc. you can several of these lines
    fi

    begin{document}
    % in your chapters you'll have
    chapter{Lorem}
    Lorem ipsum~cite{sigfridsson} dolor~cite{worman}.
    % just use cite as normal

    printbibliography[heading=subbibliography] % this prints the bibliography

    % next chapter
    chapter{Dolor}
    Dolor~cite{nussbaum} sit~cite{sigfridsson}

    printbibliography[heading=subbibliography]
    end{document}


    Screenshot of chapter 2 with two citations and a subbibliography with those two entries






    share|improve this answer




























      1














      If at all possible you should try to avoid templates in general and this template in particular. See Why should you avoid using (complex) templates?. Templates are fine while they are working and giving you exactly the output you want, but it can become increasingly complicated to modify them. Bad templates may contain outdated or outright wrong code and may explode into your face at any moment.



      This particular template (Link to the Overleaf version) is also available on https://github.com/kks32/phd-thesis-template and is intended to be a PhD thesis template for Cambridge University Engineering Department (CUED). If that's not where you will be submitting your thesis, it is probably better not to use that template.





      The class has several bibliography-related options and custombib would hand all control over the bibliography back to you if you had not also used the option numbered. The way these options are handled means that (counter-intuitively) the eralier option numbered just overrides the custombib and loads natbib instead. (Note that the class does not care about the order of these bibliography options, the outcome is determined by the particular nesting of tests in the implementation of the class. And the outcome of using conflicting options is not at all clear from the outside.)



      In Preamble/preamble.tex, specifically with



      ifuseCustomBib
      %usepackage[backend=biber,refsection=section, style=numeric-comp, citestyle=numeric, sorting=nty]{biblatex}

      usepackage[firstinits=true,
      bibencoding=inputenc,
      hyperref=auto,
      pagination=none,
      %style=standard,
      refsection=chapter]
      {biblatex}


      bibliographystyle{aipnum4-1.bst}
      fi


      you try to explicitly load the biblatex package, yet in the next line of code you write



      bibliographystyle{aipnum4-1.bst}


      which is a command of traditional BibTeX bibliographies that is incompatible with biblatex (and also slightly incorrect: the style in bibliographystyle should be given without file extension, bibliographystyle{aipnum4-1} would be correct).



      Be that as it may, the numbered option quashes your attempt to define the bibliography anyway. It just causes natbib to be loaded and ignores your definitions because they are guarded by ifuseCustomBib (which is false).





      In the chapters (e.g. Chapter5/chapter5.tex) you then produce a bibliography with



      I know this seems kind of extra, it's so that no extra white page is added in between the text and the references.
      begingroup
      makeatletter
      renewcommand{chapter}{
      if@openrightclearpageelseclearpagefi
      thispagestyle{empty}%
      global@topnumz@
      @afterindentfalse
      secdef@chapter@schapter
      }
      makeatother

      bibliographystyle{aipnum4-1.bst}
      setstretch{0.9}
      bibliography{Chapter5/biblio5.bib}
      endgroup
      thispagestyle{empty}
      clearpage
      %if@openrightcleardoublepageelseclearpagefi
      mbox{}
      thispagestyle{empty}


      which looks wrong on quite a few levels. But again we can take away from this bit of code that you are using traditional BibTeX methods and not biblatex – this time explicitly.





      There are several methods to obtain split bibliographies (see Sectioning bibliography by type of referred item) and there are BibTeX-compatible way to obtain per-chapter bibliographies as well (see References at the end of each chapter and for example How to use chapterbib package: syntax and Bibliography in each chapter). Yet I believe that biblatex offers the easiest and most convenient way to per-chapter bibliographies.



      Have a look at What to do to switch to biblatex? to see what you have to do to switch to biblatex.



      Remove all the bibliographystyle and the bibliography instructions in the document body.



      The following is a "minimal" example using PhDThesisPSnPDF that shows how you could use biblatex in your document. Please read the comments carefully, they should explain how this works.



      % no option numbered
      documentclass[a4paper,12pt,times,preprint,index, custombib]{Classes/PhDThesisPSnPDF}

      % in Preamble/preamble.tex you need
      ifuseCustomBib
      usepackage[
      backend=biber,
      style=numeric,
      refsection=chapter]
      {biblatex}

      % you also need to declare your bib file
      addbibresource{biblatex-examples.bib}
      % biblatex-examples.bib is an example file
      % that is available everywhere where biblatex is installed
      % you'll need something like
      % addbibresource{biblio.bib}
      % and maybe
      % addbibresource{Chapter5/biblio5.bib}
      % etc. you can several of these lines
      fi

      begin{document}
      % in your chapters you'll have
      chapter{Lorem}
      Lorem ipsum~cite{sigfridsson} dolor~cite{worman}.
      % just use cite as normal

      printbibliography[heading=subbibliography] % this prints the bibliography

      % next chapter
      chapter{Dolor}
      Dolor~cite{nussbaum} sit~cite{sigfridsson}

      printbibliography[heading=subbibliography]
      end{document}


      Screenshot of chapter 2 with two citations and a subbibliography with those two entries






      share|improve this answer


























        1












        1








        1






        If at all possible you should try to avoid templates in general and this template in particular. See Why should you avoid using (complex) templates?. Templates are fine while they are working and giving you exactly the output you want, but it can become increasingly complicated to modify them. Bad templates may contain outdated or outright wrong code and may explode into your face at any moment.



        This particular template (Link to the Overleaf version) is also available on https://github.com/kks32/phd-thesis-template and is intended to be a PhD thesis template for Cambridge University Engineering Department (CUED). If that's not where you will be submitting your thesis, it is probably better not to use that template.





        The class has several bibliography-related options and custombib would hand all control over the bibliography back to you if you had not also used the option numbered. The way these options are handled means that (counter-intuitively) the eralier option numbered just overrides the custombib and loads natbib instead. (Note that the class does not care about the order of these bibliography options, the outcome is determined by the particular nesting of tests in the implementation of the class. And the outcome of using conflicting options is not at all clear from the outside.)



        In Preamble/preamble.tex, specifically with



        ifuseCustomBib
        %usepackage[backend=biber,refsection=section, style=numeric-comp, citestyle=numeric, sorting=nty]{biblatex}

        usepackage[firstinits=true,
        bibencoding=inputenc,
        hyperref=auto,
        pagination=none,
        %style=standard,
        refsection=chapter]
        {biblatex}


        bibliographystyle{aipnum4-1.bst}
        fi


        you try to explicitly load the biblatex package, yet in the next line of code you write



        bibliographystyle{aipnum4-1.bst}


        which is a command of traditional BibTeX bibliographies that is incompatible with biblatex (and also slightly incorrect: the style in bibliographystyle should be given without file extension, bibliographystyle{aipnum4-1} would be correct).



        Be that as it may, the numbered option quashes your attempt to define the bibliography anyway. It just causes natbib to be loaded and ignores your definitions because they are guarded by ifuseCustomBib (which is false).





        In the chapters (e.g. Chapter5/chapter5.tex) you then produce a bibliography with



        I know this seems kind of extra, it's so that no extra white page is added in between the text and the references.
        begingroup
        makeatletter
        renewcommand{chapter}{
        if@openrightclearpageelseclearpagefi
        thispagestyle{empty}%
        global@topnumz@
        @afterindentfalse
        secdef@chapter@schapter
        }
        makeatother

        bibliographystyle{aipnum4-1.bst}
        setstretch{0.9}
        bibliography{Chapter5/biblio5.bib}
        endgroup
        thispagestyle{empty}
        clearpage
        %if@openrightcleardoublepageelseclearpagefi
        mbox{}
        thispagestyle{empty}


        which looks wrong on quite a few levels. But again we can take away from this bit of code that you are using traditional BibTeX methods and not biblatex – this time explicitly.





        There are several methods to obtain split bibliographies (see Sectioning bibliography by type of referred item) and there are BibTeX-compatible way to obtain per-chapter bibliographies as well (see References at the end of each chapter and for example How to use chapterbib package: syntax and Bibliography in each chapter). Yet I believe that biblatex offers the easiest and most convenient way to per-chapter bibliographies.



        Have a look at What to do to switch to biblatex? to see what you have to do to switch to biblatex.



        Remove all the bibliographystyle and the bibliography instructions in the document body.



        The following is a "minimal" example using PhDThesisPSnPDF that shows how you could use biblatex in your document. Please read the comments carefully, they should explain how this works.



        % no option numbered
        documentclass[a4paper,12pt,times,preprint,index, custombib]{Classes/PhDThesisPSnPDF}

        % in Preamble/preamble.tex you need
        ifuseCustomBib
        usepackage[
        backend=biber,
        style=numeric,
        refsection=chapter]
        {biblatex}

        % you also need to declare your bib file
        addbibresource{biblatex-examples.bib}
        % biblatex-examples.bib is an example file
        % that is available everywhere where biblatex is installed
        % you'll need something like
        % addbibresource{biblio.bib}
        % and maybe
        % addbibresource{Chapter5/biblio5.bib}
        % etc. you can several of these lines
        fi

        begin{document}
        % in your chapters you'll have
        chapter{Lorem}
        Lorem ipsum~cite{sigfridsson} dolor~cite{worman}.
        % just use cite as normal

        printbibliography[heading=subbibliography] % this prints the bibliography

        % next chapter
        chapter{Dolor}
        Dolor~cite{nussbaum} sit~cite{sigfridsson}

        printbibliography[heading=subbibliography]
        end{document}


        Screenshot of chapter 2 with two citations and a subbibliography with those two entries






        share|improve this answer














        If at all possible you should try to avoid templates in general and this template in particular. See Why should you avoid using (complex) templates?. Templates are fine while they are working and giving you exactly the output you want, but it can become increasingly complicated to modify them. Bad templates may contain outdated or outright wrong code and may explode into your face at any moment.



        This particular template (Link to the Overleaf version) is also available on https://github.com/kks32/phd-thesis-template and is intended to be a PhD thesis template for Cambridge University Engineering Department (CUED). If that's not where you will be submitting your thesis, it is probably better not to use that template.





        The class has several bibliography-related options and custombib would hand all control over the bibliography back to you if you had not also used the option numbered. The way these options are handled means that (counter-intuitively) the eralier option numbered just overrides the custombib and loads natbib instead. (Note that the class does not care about the order of these bibliography options, the outcome is determined by the particular nesting of tests in the implementation of the class. And the outcome of using conflicting options is not at all clear from the outside.)



        In Preamble/preamble.tex, specifically with



        ifuseCustomBib
        %usepackage[backend=biber,refsection=section, style=numeric-comp, citestyle=numeric, sorting=nty]{biblatex}

        usepackage[firstinits=true,
        bibencoding=inputenc,
        hyperref=auto,
        pagination=none,
        %style=standard,
        refsection=chapter]
        {biblatex}


        bibliographystyle{aipnum4-1.bst}
        fi


        you try to explicitly load the biblatex package, yet in the next line of code you write



        bibliographystyle{aipnum4-1.bst}


        which is a command of traditional BibTeX bibliographies that is incompatible with biblatex (and also slightly incorrect: the style in bibliographystyle should be given without file extension, bibliographystyle{aipnum4-1} would be correct).



        Be that as it may, the numbered option quashes your attempt to define the bibliography anyway. It just causes natbib to be loaded and ignores your definitions because they are guarded by ifuseCustomBib (which is false).





        In the chapters (e.g. Chapter5/chapter5.tex) you then produce a bibliography with



        I know this seems kind of extra, it's so that no extra white page is added in between the text and the references.
        begingroup
        makeatletter
        renewcommand{chapter}{
        if@openrightclearpageelseclearpagefi
        thispagestyle{empty}%
        global@topnumz@
        @afterindentfalse
        secdef@chapter@schapter
        }
        makeatother

        bibliographystyle{aipnum4-1.bst}
        setstretch{0.9}
        bibliography{Chapter5/biblio5.bib}
        endgroup
        thispagestyle{empty}
        clearpage
        %if@openrightcleardoublepageelseclearpagefi
        mbox{}
        thispagestyle{empty}


        which looks wrong on quite a few levels. But again we can take away from this bit of code that you are using traditional BibTeX methods and not biblatex – this time explicitly.





        There are several methods to obtain split bibliographies (see Sectioning bibliography by type of referred item) and there are BibTeX-compatible way to obtain per-chapter bibliographies as well (see References at the end of each chapter and for example How to use chapterbib package: syntax and Bibliography in each chapter). Yet I believe that biblatex offers the easiest and most convenient way to per-chapter bibliographies.



        Have a look at What to do to switch to biblatex? to see what you have to do to switch to biblatex.



        Remove all the bibliographystyle and the bibliography instructions in the document body.



        The following is a "minimal" example using PhDThesisPSnPDF that shows how you could use biblatex in your document. Please read the comments carefully, they should explain how this works.



        % no option numbered
        documentclass[a4paper,12pt,times,preprint,index, custombib]{Classes/PhDThesisPSnPDF}

        % in Preamble/preamble.tex you need
        ifuseCustomBib
        usepackage[
        backend=biber,
        style=numeric,
        refsection=chapter]
        {biblatex}

        % you also need to declare your bib file
        addbibresource{biblatex-examples.bib}
        % biblatex-examples.bib is an example file
        % that is available everywhere where biblatex is installed
        % you'll need something like
        % addbibresource{biblio.bib}
        % and maybe
        % addbibresource{Chapter5/biblio5.bib}
        % etc. you can several of these lines
        fi

        begin{document}
        % in your chapters you'll have
        chapter{Lorem}
        Lorem ipsum~cite{sigfridsson} dolor~cite{worman}.
        % just use cite as normal

        printbibliography[heading=subbibliography] % this prints the bibliography

        % next chapter
        chapter{Dolor}
        Dolor~cite{nussbaum} sit~cite{sigfridsson}

        printbibliography[heading=subbibliography]
        end{document}


        Screenshot of chapter 2 with two citations and a subbibliography with those two entries







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 5 mins ago

























        answered 26 mins ago









        moewemoewe

        87.5k9110335




        87.5k9110335






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f469649%2freferences-after-each-chapter-cued-phd-thesis-template%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Contact image not getting when fetch all contact list from iPhone by CNContact

            count number of partitions of a set with n elements into k subsets

            A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks