0

I am using the latex book classs with several chapter. Each chapter has a Reference list at end of them. Everything works fine. But the only thing I want to fix is the huge space before the References title. What I understood from searching similar answers is that the References list is generated by \chapter* command from the book class. I followed this question How to remove the huge space in the Bibliography title?, but was not able to modify the spaces. Note, since the spacing comes from the chapter command, each chapter title also has this spacing before them, but I want to keep them as it is.

So, how do I remove the spacing before the References list, without modifying any other part of the document.

EDIT
Okay, so from this question How to add some negative vertical space before a chapter title?, I got the following idea to remove the space. Instead of \bibliography{refs1.bib,refs2.bib,....}, I can have

\begingroup
\clearpage% Manually insert \clearpage
\let\clearpage\relax% Remove \clearpage functionality
\vspace*{-100pt}% Insert needed vertical retraction
\bibliography{refs1.bib,refs2.bib,...}
\endgroup

Now, is there any way to redefine the above block into a single command, so that I can just replace the \bibliography with the new command and it will execute the above block?

1 Answer 1

0

book.cls has

\newenvironment{thebibliography}[1]
     {\chapter*{\bibname}%
      \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}%
      \list{\@biblabel{\@arabic\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
            \@openbib@code
            \usecounter{enumiv}%
            \let\p@enumiv\@empty
            \renewcommand\theenumiv{\@arabic\c@enumiv}}%
      \sloppy
      \clubpenalty4000
      \@clubpenalty \clubpenalty
      \widowpenalty4000%
      \sfcode`\.\@m}
     {\def\@noitemerr
       {\@latex@warning{Empty `thebibliography' environment}}%
      \endlist}

so you can have

\makeatletter
\renewenvironment{thebibliography}[1]
     {\chapter*{\bibname}%
      \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}%
      \list{\@biblabel{\@arabic\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
            \@openbib@code
            \usecounter{enumiv}%
            \let\p@enumiv\@empty
            \renewcommand\theenumiv{\@arabic\c@enumiv}}%
      \sloppy
      \clubpenalty4000
      \@clubpenalty \clubpenalty
      \widowpenalty4000%
      \sfcode`\.\@m}
     {\def\@noitemerr
       {\@latex@warning{Empty `thebibliography' environment}}%
      \endlist}
\makeatother

and change whatever you want to change, perhaps change \chapter* to \section* is the simplest.

1
  • The spacing comes from the \chapter* so modifying the thebibliography that internally uses the chapter won't help. also I don't want to use section in this case.
    – Eular
    Commented Oct 25, 2023 at 13:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .