Bibliography as chapter (in ToC, fancyhdr) in book document class












3















I want my bibliography to be treated as a chapter with class book, but right now it's being treated as a section of the previous chapter (the LE header is of the previous chapter, and it's not bolded / doesn't have the correct spacing in the ToC). None of the fixes I've found online work, perhaps because I have some other conflicting command? Here's a minimal working example:



in main.tex:



documentclass[12pt,letterpaper,openany]{book}
usepackage[utf8]{inputenc}
usepackage{amsmath}
usepackage{titling}
usepackage{url}
usepackage{graphicx}
usepackage[margin=1in]{geometry}
usepackage{caption}
usepackage{sidecap}
usepackage{fancyhdr}
usepackage{setspace}
usepackage{float}
usepackage{indentfirst}
setlengthparindent{0.5in}
usepackage[nottoc]{tocbibind}
usepackage[titletoc,toc,title,page]{appendix}
usepackage{longtable, booktabs}
usepackage{subfiles}
usepackage{apacite}
usepackage{etoolbox}
usepackage{textgreek}
makeatletter
patchcmd{nocite}{ifx@onlypreambledocument}{iftrue}{}{}
makeatother


fancypagestyle{plain}{%
fancyhf{}% clears all header and footer fields
fancyhead[LE,RO]{thepage}}
setlength{headheight}{14.5pt}

begin{document}

tableofcontents
listoffigures
listoftables


chapter{Chapter1}
subfile{Chapter1.tex}

bibliographystyle{apacite}
bibliography{main.bib}

end{document}


in Chapter1.tex:



documentclass[main.tex]{subfiles}

begin{document}

Example cite{CentralDogma}.

end{document}


in main.bib:



@article{CentralDogma,
doi = {10.1038/227561a0},
year = {1970},
publisher = {Springer Nature},
volume = {227},
number = {5258},
pages = {561--563},
author = {Francis Crick},
title = {Central Dogma of Molecular Biology},
journal = {Nature}
}









share|improve this question





























    3















    I want my bibliography to be treated as a chapter with class book, but right now it's being treated as a section of the previous chapter (the LE header is of the previous chapter, and it's not bolded / doesn't have the correct spacing in the ToC). None of the fixes I've found online work, perhaps because I have some other conflicting command? Here's a minimal working example:



    in main.tex:



    documentclass[12pt,letterpaper,openany]{book}
    usepackage[utf8]{inputenc}
    usepackage{amsmath}
    usepackage{titling}
    usepackage{url}
    usepackage{graphicx}
    usepackage[margin=1in]{geometry}
    usepackage{caption}
    usepackage{sidecap}
    usepackage{fancyhdr}
    usepackage{setspace}
    usepackage{float}
    usepackage{indentfirst}
    setlengthparindent{0.5in}
    usepackage[nottoc]{tocbibind}
    usepackage[titletoc,toc,title,page]{appendix}
    usepackage{longtable, booktabs}
    usepackage{subfiles}
    usepackage{apacite}
    usepackage{etoolbox}
    usepackage{textgreek}
    makeatletter
    patchcmd{nocite}{ifx@onlypreambledocument}{iftrue}{}{}
    makeatother


    fancypagestyle{plain}{%
    fancyhf{}% clears all header and footer fields
    fancyhead[LE,RO]{thepage}}
    setlength{headheight}{14.5pt}

    begin{document}

    tableofcontents
    listoffigures
    listoftables


    chapter{Chapter1}
    subfile{Chapter1.tex}

    bibliographystyle{apacite}
    bibliography{main.bib}

    end{document}


    in Chapter1.tex:



    documentclass[main.tex]{subfiles}

    begin{document}

    Example cite{CentralDogma}.

    end{document}


    in main.bib:



    @article{CentralDogma,
    doi = {10.1038/227561a0},
    year = {1970},
    publisher = {Springer Nature},
    volume = {227},
    number = {5258},
    pages = {561--563},
    author = {Francis Crick},
    title = {Central Dogma of Molecular Biology},
    journal = {Nature}
    }









    share|improve this question



























      3












      3








      3








      I want my bibliography to be treated as a chapter with class book, but right now it's being treated as a section of the previous chapter (the LE header is of the previous chapter, and it's not bolded / doesn't have the correct spacing in the ToC). None of the fixes I've found online work, perhaps because I have some other conflicting command? Here's a minimal working example:



      in main.tex:



      documentclass[12pt,letterpaper,openany]{book}
      usepackage[utf8]{inputenc}
      usepackage{amsmath}
      usepackage{titling}
      usepackage{url}
      usepackage{graphicx}
      usepackage[margin=1in]{geometry}
      usepackage{caption}
      usepackage{sidecap}
      usepackage{fancyhdr}
      usepackage{setspace}
      usepackage{float}
      usepackage{indentfirst}
      setlengthparindent{0.5in}
      usepackage[nottoc]{tocbibind}
      usepackage[titletoc,toc,title,page]{appendix}
      usepackage{longtable, booktabs}
      usepackage{subfiles}
      usepackage{apacite}
      usepackage{etoolbox}
      usepackage{textgreek}
      makeatletter
      patchcmd{nocite}{ifx@onlypreambledocument}{iftrue}{}{}
      makeatother


      fancypagestyle{plain}{%
      fancyhf{}% clears all header and footer fields
      fancyhead[LE,RO]{thepage}}
      setlength{headheight}{14.5pt}

      begin{document}

      tableofcontents
      listoffigures
      listoftables


      chapter{Chapter1}
      subfile{Chapter1.tex}

      bibliographystyle{apacite}
      bibliography{main.bib}

      end{document}


      in Chapter1.tex:



      documentclass[main.tex]{subfiles}

      begin{document}

      Example cite{CentralDogma}.

      end{document}


      in main.bib:



      @article{CentralDogma,
      doi = {10.1038/227561a0},
      year = {1970},
      publisher = {Springer Nature},
      volume = {227},
      number = {5258},
      pages = {561--563},
      author = {Francis Crick},
      title = {Central Dogma of Molecular Biology},
      journal = {Nature}
      }









      share|improve this question
















      I want my bibliography to be treated as a chapter with class book, but right now it's being treated as a section of the previous chapter (the LE header is of the previous chapter, and it's not bolded / doesn't have the correct spacing in the ToC). None of the fixes I've found online work, perhaps because I have some other conflicting command? Here's a minimal working example:



      in main.tex:



      documentclass[12pt,letterpaper,openany]{book}
      usepackage[utf8]{inputenc}
      usepackage{amsmath}
      usepackage{titling}
      usepackage{url}
      usepackage{graphicx}
      usepackage[margin=1in]{geometry}
      usepackage{caption}
      usepackage{sidecap}
      usepackage{fancyhdr}
      usepackage{setspace}
      usepackage{float}
      usepackage{indentfirst}
      setlengthparindent{0.5in}
      usepackage[nottoc]{tocbibind}
      usepackage[titletoc,toc,title,page]{appendix}
      usepackage{longtable, booktabs}
      usepackage{subfiles}
      usepackage{apacite}
      usepackage{etoolbox}
      usepackage{textgreek}
      makeatletter
      patchcmd{nocite}{ifx@onlypreambledocument}{iftrue}{}{}
      makeatother


      fancypagestyle{plain}{%
      fancyhf{}% clears all header and footer fields
      fancyhead[LE,RO]{thepage}}
      setlength{headheight}{14.5pt}

      begin{document}

      tableofcontents
      listoffigures
      listoftables


      chapter{Chapter1}
      subfile{Chapter1.tex}

      bibliographystyle{apacite}
      bibliography{main.bib}

      end{document}


      in Chapter1.tex:



      documentclass[main.tex]{subfiles}

      begin{document}

      Example cite{CentralDogma}.

      end{document}


      in main.bib:



      @article{CentralDogma,
      doi = {10.1038/227561a0},
      year = {1970},
      publisher = {Springer Nature},
      volume = {227},
      number = {5258},
      pages = {561--563},
      author = {Francis Crick},
      title = {Central Dogma of Molecular Biology},
      journal = {Nature}
      }






      table-of-contents bibliographies fancyhdr subfiles






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 21 at 3:41









      Kurt

      40.2k850164




      40.2k850164










      asked Mar 21 at 2:40









      casimirlulucasimirlulu

      183




      183






















          2 Answers
          2






          active

          oldest

          votes


















          1














          Either load package apacite with option nosectionbib:



          documentclass[12pt,letterpaper,openany]{book}
          usepackage[nosectionbib]{apacite}% <- option nosectionbib
          begin{document}
          tableofcontents
          chapter{Chapter1}
          section{Section 1}
          cite{CentralDogma}
          bibliographystyle{apacite}
          bibliography{main}
          end{document}


          or put the bibliography in back matter:



          documentclass[12pt,letterpaper,openany]{book}
          usepackage{apacite}
          begin{document}
          tableofcontents
          chapter{Chapter1}
          section{Section 1}
          cite{CentralDogma}
          backmatter% <- added
          bibliographystyle{apacite}
          bibliography{main}
          end{document}


          Result:



          enter image description here






          share|improve this answer
























          • Thank you so much! Loading apacite with [nosectionbib] did the trick and is so simple and elegant.

            – casimirlulu
            Mar 21 at 12:42



















          1














          I reduced your given code to be more minimal:



          documentclass[12pt,letterpaper,openany]{book}

          usepackage[utf8]{inputenc}
          usepackage{url}
          usepackage[margin=1in]{geometry}

          usepackage{apacite}
          usepackage{etoolbox}

          makeatletter
          patchcmd{nocite}{ifx@onlypreambledocument}{iftrue}{}{}
          makeatother


          begin{document}

          tableofcontents

          chapter{Chapter1}
          section{Section 1}

          cite{CentralDogma}

          bibliographystyle{apacite}
          bibliography{main} % bibliography file without extention .bib!

          end{document}


          which results in:



          resulting pdf



          In class boob.cls the environment is defined. We can now redefine it with the code (see line two, where we use chapter* as you wish):



          renewenvironment{thebibliography}[1]
          {chapter*{bibname}% <============================================
          @mkboth{MakeUppercasebibname}{MakeUppercasebibname}%
          list{@biblabel{@arabicc@enumiv}}%
          {settowidthlabelwidth{@biblabel{#1}}%
          leftmarginlabelwidth
          advanceleftmarginlabelsep
          @openbib@code
          usecounter{enumiv}%
          letp@enumiv@empty
          renewcommandtheenumiv{@arabicc@enumiv}}%
          sloppy
          clubpenalty4000
          @clubpenalty clubpenalty
          widowpenalty4000%
          sfcode`.@m}
          {def@noitemerr
          {@latex@warning{Empty `thebibliography' environment}}%
          endlist}


          With the complete code



          documentclass[12pt,letterpaper,openany]{book}

          usepackage[utf8]{inputenc}
          usepackage{url}
          usepackage[margin=1in]{geometry}

          usepackage{apacite}
          usepackage{etoolbox}

          makeatletter
          patchcmd{nocite}{ifx@onlypreambledocument}{iftrue}{}{}
          renewenvironment{thebibliography}[1]
          {chapter*{bibname}% <==============================================
          @mkboth{MakeUppercasebibname}{MakeUppercasebibname}%
          list{@biblabel{@arabicc@enumiv}}%
          {settowidthlabelwidth{@biblabel{#1}}%
          leftmarginlabelwidth
          advanceleftmarginlabelsep
          @openbib@code
          usecounter{enumiv}%
          letp@enumiv@empty
          renewcommandtheenumiv{@arabicc@enumiv}}%
          sloppy
          clubpenalty4000
          @clubpenalty clubpenalty
          widowpenalty4000%
          sfcode`.@m}
          {def@noitemerr
          {@latex@warning{Empty `thebibliography' environment}}%
          endlist}
          makeatother


          begin{document}

          tableofcontents

          chapter{Chapter1}
          section{Section 1}

          cite{CentralDogma}

          bibliographystyle{apacite}
          bibliography{main} % bibliography file without extention .bib! <===========

          end{document}


          you get the result:



          new pdf






          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%2f480609%2fbibliography-as-chapter-in-toc-fancyhdr-in-book-document-class%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            Either load package apacite with option nosectionbib:



            documentclass[12pt,letterpaper,openany]{book}
            usepackage[nosectionbib]{apacite}% <- option nosectionbib
            begin{document}
            tableofcontents
            chapter{Chapter1}
            section{Section 1}
            cite{CentralDogma}
            bibliographystyle{apacite}
            bibliography{main}
            end{document}


            or put the bibliography in back matter:



            documentclass[12pt,letterpaper,openany]{book}
            usepackage{apacite}
            begin{document}
            tableofcontents
            chapter{Chapter1}
            section{Section 1}
            cite{CentralDogma}
            backmatter% <- added
            bibliographystyle{apacite}
            bibliography{main}
            end{document}


            Result:



            enter image description here






            share|improve this answer
























            • Thank you so much! Loading apacite with [nosectionbib] did the trick and is so simple and elegant.

              – casimirlulu
              Mar 21 at 12:42
















            1














            Either load package apacite with option nosectionbib:



            documentclass[12pt,letterpaper,openany]{book}
            usepackage[nosectionbib]{apacite}% <- option nosectionbib
            begin{document}
            tableofcontents
            chapter{Chapter1}
            section{Section 1}
            cite{CentralDogma}
            bibliographystyle{apacite}
            bibliography{main}
            end{document}


            or put the bibliography in back matter:



            documentclass[12pt,letterpaper,openany]{book}
            usepackage{apacite}
            begin{document}
            tableofcontents
            chapter{Chapter1}
            section{Section 1}
            cite{CentralDogma}
            backmatter% <- added
            bibliographystyle{apacite}
            bibliography{main}
            end{document}


            Result:



            enter image description here






            share|improve this answer
























            • Thank you so much! Loading apacite with [nosectionbib] did the trick and is so simple and elegant.

              – casimirlulu
              Mar 21 at 12:42














            1












            1








            1







            Either load package apacite with option nosectionbib:



            documentclass[12pt,letterpaper,openany]{book}
            usepackage[nosectionbib]{apacite}% <- option nosectionbib
            begin{document}
            tableofcontents
            chapter{Chapter1}
            section{Section 1}
            cite{CentralDogma}
            bibliographystyle{apacite}
            bibliography{main}
            end{document}


            or put the bibliography in back matter:



            documentclass[12pt,letterpaper,openany]{book}
            usepackage{apacite}
            begin{document}
            tableofcontents
            chapter{Chapter1}
            section{Section 1}
            cite{CentralDogma}
            backmatter% <- added
            bibliographystyle{apacite}
            bibliography{main}
            end{document}


            Result:



            enter image description here






            share|improve this answer













            Either load package apacite with option nosectionbib:



            documentclass[12pt,letterpaper,openany]{book}
            usepackage[nosectionbib]{apacite}% <- option nosectionbib
            begin{document}
            tableofcontents
            chapter{Chapter1}
            section{Section 1}
            cite{CentralDogma}
            bibliographystyle{apacite}
            bibliography{main}
            end{document}


            or put the bibliography in back matter:



            documentclass[12pt,letterpaper,openany]{book}
            usepackage{apacite}
            begin{document}
            tableofcontents
            chapter{Chapter1}
            section{Section 1}
            cite{CentralDogma}
            backmatter% <- added
            bibliographystyle{apacite}
            bibliography{main}
            end{document}


            Result:



            enter image description here







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 21 at 7:41









            esddesdd

            59.8k34692




            59.8k34692













            • Thank you so much! Loading apacite with [nosectionbib] did the trick and is so simple and elegant.

              – casimirlulu
              Mar 21 at 12:42



















            • Thank you so much! Loading apacite with [nosectionbib] did the trick and is so simple and elegant.

              – casimirlulu
              Mar 21 at 12:42

















            Thank you so much! Loading apacite with [nosectionbib] did the trick and is so simple and elegant.

            – casimirlulu
            Mar 21 at 12:42





            Thank you so much! Loading apacite with [nosectionbib] did the trick and is so simple and elegant.

            – casimirlulu
            Mar 21 at 12:42











            1














            I reduced your given code to be more minimal:



            documentclass[12pt,letterpaper,openany]{book}

            usepackage[utf8]{inputenc}
            usepackage{url}
            usepackage[margin=1in]{geometry}

            usepackage{apacite}
            usepackage{etoolbox}

            makeatletter
            patchcmd{nocite}{ifx@onlypreambledocument}{iftrue}{}{}
            makeatother


            begin{document}

            tableofcontents

            chapter{Chapter1}
            section{Section 1}

            cite{CentralDogma}

            bibliographystyle{apacite}
            bibliography{main} % bibliography file without extention .bib!

            end{document}


            which results in:



            resulting pdf



            In class boob.cls the environment is defined. We can now redefine it with the code (see line two, where we use chapter* as you wish):



            renewenvironment{thebibliography}[1]
            {chapter*{bibname}% <============================================
            @mkboth{MakeUppercasebibname}{MakeUppercasebibname}%
            list{@biblabel{@arabicc@enumiv}}%
            {settowidthlabelwidth{@biblabel{#1}}%
            leftmarginlabelwidth
            advanceleftmarginlabelsep
            @openbib@code
            usecounter{enumiv}%
            letp@enumiv@empty
            renewcommandtheenumiv{@arabicc@enumiv}}%
            sloppy
            clubpenalty4000
            @clubpenalty clubpenalty
            widowpenalty4000%
            sfcode`.@m}
            {def@noitemerr
            {@latex@warning{Empty `thebibliography' environment}}%
            endlist}


            With the complete code



            documentclass[12pt,letterpaper,openany]{book}

            usepackage[utf8]{inputenc}
            usepackage{url}
            usepackage[margin=1in]{geometry}

            usepackage{apacite}
            usepackage{etoolbox}

            makeatletter
            patchcmd{nocite}{ifx@onlypreambledocument}{iftrue}{}{}
            renewenvironment{thebibliography}[1]
            {chapter*{bibname}% <==============================================
            @mkboth{MakeUppercasebibname}{MakeUppercasebibname}%
            list{@biblabel{@arabicc@enumiv}}%
            {settowidthlabelwidth{@biblabel{#1}}%
            leftmarginlabelwidth
            advanceleftmarginlabelsep
            @openbib@code
            usecounter{enumiv}%
            letp@enumiv@empty
            renewcommandtheenumiv{@arabicc@enumiv}}%
            sloppy
            clubpenalty4000
            @clubpenalty clubpenalty
            widowpenalty4000%
            sfcode`.@m}
            {def@noitemerr
            {@latex@warning{Empty `thebibliography' environment}}%
            endlist}
            makeatother


            begin{document}

            tableofcontents

            chapter{Chapter1}
            section{Section 1}

            cite{CentralDogma}

            bibliographystyle{apacite}
            bibliography{main} % bibliography file without extention .bib! <===========

            end{document}


            you get the result:



            new pdf






            share|improve this answer




























              1














              I reduced your given code to be more minimal:



              documentclass[12pt,letterpaper,openany]{book}

              usepackage[utf8]{inputenc}
              usepackage{url}
              usepackage[margin=1in]{geometry}

              usepackage{apacite}
              usepackage{etoolbox}

              makeatletter
              patchcmd{nocite}{ifx@onlypreambledocument}{iftrue}{}{}
              makeatother


              begin{document}

              tableofcontents

              chapter{Chapter1}
              section{Section 1}

              cite{CentralDogma}

              bibliographystyle{apacite}
              bibliography{main} % bibliography file without extention .bib!

              end{document}


              which results in:



              resulting pdf



              In class boob.cls the environment is defined. We can now redefine it with the code (see line two, where we use chapter* as you wish):



              renewenvironment{thebibliography}[1]
              {chapter*{bibname}% <============================================
              @mkboth{MakeUppercasebibname}{MakeUppercasebibname}%
              list{@biblabel{@arabicc@enumiv}}%
              {settowidthlabelwidth{@biblabel{#1}}%
              leftmarginlabelwidth
              advanceleftmarginlabelsep
              @openbib@code
              usecounter{enumiv}%
              letp@enumiv@empty
              renewcommandtheenumiv{@arabicc@enumiv}}%
              sloppy
              clubpenalty4000
              @clubpenalty clubpenalty
              widowpenalty4000%
              sfcode`.@m}
              {def@noitemerr
              {@latex@warning{Empty `thebibliography' environment}}%
              endlist}


              With the complete code



              documentclass[12pt,letterpaper,openany]{book}

              usepackage[utf8]{inputenc}
              usepackage{url}
              usepackage[margin=1in]{geometry}

              usepackage{apacite}
              usepackage{etoolbox}

              makeatletter
              patchcmd{nocite}{ifx@onlypreambledocument}{iftrue}{}{}
              renewenvironment{thebibliography}[1]
              {chapter*{bibname}% <==============================================
              @mkboth{MakeUppercasebibname}{MakeUppercasebibname}%
              list{@biblabel{@arabicc@enumiv}}%
              {settowidthlabelwidth{@biblabel{#1}}%
              leftmarginlabelwidth
              advanceleftmarginlabelsep
              @openbib@code
              usecounter{enumiv}%
              letp@enumiv@empty
              renewcommandtheenumiv{@arabicc@enumiv}}%
              sloppy
              clubpenalty4000
              @clubpenalty clubpenalty
              widowpenalty4000%
              sfcode`.@m}
              {def@noitemerr
              {@latex@warning{Empty `thebibliography' environment}}%
              endlist}
              makeatother


              begin{document}

              tableofcontents

              chapter{Chapter1}
              section{Section 1}

              cite{CentralDogma}

              bibliographystyle{apacite}
              bibliography{main} % bibliography file without extention .bib! <===========

              end{document}


              you get the result:



              new pdf






              share|improve this answer


























                1












                1








                1







                I reduced your given code to be more minimal:



                documentclass[12pt,letterpaper,openany]{book}

                usepackage[utf8]{inputenc}
                usepackage{url}
                usepackage[margin=1in]{geometry}

                usepackage{apacite}
                usepackage{etoolbox}

                makeatletter
                patchcmd{nocite}{ifx@onlypreambledocument}{iftrue}{}{}
                makeatother


                begin{document}

                tableofcontents

                chapter{Chapter1}
                section{Section 1}

                cite{CentralDogma}

                bibliographystyle{apacite}
                bibliography{main} % bibliography file without extention .bib!

                end{document}


                which results in:



                resulting pdf



                In class boob.cls the environment is defined. We can now redefine it with the code (see line two, where we use chapter* as you wish):



                renewenvironment{thebibliography}[1]
                {chapter*{bibname}% <============================================
                @mkboth{MakeUppercasebibname}{MakeUppercasebibname}%
                list{@biblabel{@arabicc@enumiv}}%
                {settowidthlabelwidth{@biblabel{#1}}%
                leftmarginlabelwidth
                advanceleftmarginlabelsep
                @openbib@code
                usecounter{enumiv}%
                letp@enumiv@empty
                renewcommandtheenumiv{@arabicc@enumiv}}%
                sloppy
                clubpenalty4000
                @clubpenalty clubpenalty
                widowpenalty4000%
                sfcode`.@m}
                {def@noitemerr
                {@latex@warning{Empty `thebibliography' environment}}%
                endlist}


                With the complete code



                documentclass[12pt,letterpaper,openany]{book}

                usepackage[utf8]{inputenc}
                usepackage{url}
                usepackage[margin=1in]{geometry}

                usepackage{apacite}
                usepackage{etoolbox}

                makeatletter
                patchcmd{nocite}{ifx@onlypreambledocument}{iftrue}{}{}
                renewenvironment{thebibliography}[1]
                {chapter*{bibname}% <==============================================
                @mkboth{MakeUppercasebibname}{MakeUppercasebibname}%
                list{@biblabel{@arabicc@enumiv}}%
                {settowidthlabelwidth{@biblabel{#1}}%
                leftmarginlabelwidth
                advanceleftmarginlabelsep
                @openbib@code
                usecounter{enumiv}%
                letp@enumiv@empty
                renewcommandtheenumiv{@arabicc@enumiv}}%
                sloppy
                clubpenalty4000
                @clubpenalty clubpenalty
                widowpenalty4000%
                sfcode`.@m}
                {def@noitemerr
                {@latex@warning{Empty `thebibliography' environment}}%
                endlist}
                makeatother


                begin{document}

                tableofcontents

                chapter{Chapter1}
                section{Section 1}

                cite{CentralDogma}

                bibliographystyle{apacite}
                bibliography{main} % bibliography file without extention .bib! <===========

                end{document}


                you get the result:



                new pdf






                share|improve this answer













                I reduced your given code to be more minimal:



                documentclass[12pt,letterpaper,openany]{book}

                usepackage[utf8]{inputenc}
                usepackage{url}
                usepackage[margin=1in]{geometry}

                usepackage{apacite}
                usepackage{etoolbox}

                makeatletter
                patchcmd{nocite}{ifx@onlypreambledocument}{iftrue}{}{}
                makeatother


                begin{document}

                tableofcontents

                chapter{Chapter1}
                section{Section 1}

                cite{CentralDogma}

                bibliographystyle{apacite}
                bibliography{main} % bibliography file without extention .bib!

                end{document}


                which results in:



                resulting pdf



                In class boob.cls the environment is defined. We can now redefine it with the code (see line two, where we use chapter* as you wish):



                renewenvironment{thebibliography}[1]
                {chapter*{bibname}% <============================================
                @mkboth{MakeUppercasebibname}{MakeUppercasebibname}%
                list{@biblabel{@arabicc@enumiv}}%
                {settowidthlabelwidth{@biblabel{#1}}%
                leftmarginlabelwidth
                advanceleftmarginlabelsep
                @openbib@code
                usecounter{enumiv}%
                letp@enumiv@empty
                renewcommandtheenumiv{@arabicc@enumiv}}%
                sloppy
                clubpenalty4000
                @clubpenalty clubpenalty
                widowpenalty4000%
                sfcode`.@m}
                {def@noitemerr
                {@latex@warning{Empty `thebibliography' environment}}%
                endlist}


                With the complete code



                documentclass[12pt,letterpaper,openany]{book}

                usepackage[utf8]{inputenc}
                usepackage{url}
                usepackage[margin=1in]{geometry}

                usepackage{apacite}
                usepackage{etoolbox}

                makeatletter
                patchcmd{nocite}{ifx@onlypreambledocument}{iftrue}{}{}
                renewenvironment{thebibliography}[1]
                {chapter*{bibname}% <==============================================
                @mkboth{MakeUppercasebibname}{MakeUppercasebibname}%
                list{@biblabel{@arabicc@enumiv}}%
                {settowidthlabelwidth{@biblabel{#1}}%
                leftmarginlabelwidth
                advanceleftmarginlabelsep
                @openbib@code
                usecounter{enumiv}%
                letp@enumiv@empty
                renewcommandtheenumiv{@arabicc@enumiv}}%
                sloppy
                clubpenalty4000
                @clubpenalty clubpenalty
                widowpenalty4000%
                sfcode`.@m}
                {def@noitemerr
                {@latex@warning{Empty `thebibliography' environment}}%
                endlist}
                makeatother


                begin{document}

                tableofcontents

                chapter{Chapter1}
                section{Section 1}

                cite{CentralDogma}

                bibliographystyle{apacite}
                bibliography{main} % bibliography file without extention .bib! <===========

                end{document}


                you get the result:



                new pdf







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 21 at 3:34









                KurtKurt

                40.2k850164




                40.2k850164






























                    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%2f480609%2fbibliography-as-chapter-in-toc-fancyhdr-in-book-document-class%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

                    How to send String Array data to Server using php in android

                    Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

                    Is anime1.com a legal site for watching anime?