[Tex/LaTex] How to remove the huge space in the Bibliography title

bibliographiesspacing

Hello everyone and thank you for answering. I'm new in this.

The last part of my work is the bibliography and laTeX is leaving a HUGE white space before the title "References", like in chapters, when it first writes "Chapter N" and then the title below, but now there's no "chapter N" but a blank space instead.

What I want is to remove that huge white space, if it's possible, since it's stealing a space I would need.

I am using the command

\begin{thebibliography}{X}

and then elements are "\bibitem". Of course it is in the file itself (at the ending); it is not any file apart.

If needed, the heading is

\documentclass[12pt,a4paper, openany, final ]{book}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{epstopdf}
\usepackage{geometry}
\usepackage{enumerate}
\usepackage{ulem}
\usepackage{pgfplots}
\usepackage{tikz}
\usetikzlibrary{datavisualization}
\usetikzlibrary{datavisualization.formats.functions}
\usepackage{upgreek} 
\usepackage{cancel} 
\usepackage{mathdots}
\usepackage{mathrsfs} 
\usepackage{stackrel}
\usepackage{float}
\usepackage{multirow} 
\usepackage{textcomp} 
\usepackage{relsize}
\usepackage{comment}

Could anyone help me? Thank you so much in advance.

PS: I so hope that changing this doesn't re-arrange all the document.

Best Answer

The book document class uses the \chapter* command to generate the bibliography heading. Internally this uses the command \@makeschapterhead, which is defined as follows:

\def\@makeschapterhead#1{%                                                                                              
  \vspace*{50\p@}%                                                                                                      
  {\parindent \z@ \raggedright
    \normalfont
    \interlinepenalty\@M
    \Huge \bfseries  #1\par\nobreak                                                                                     
    \vskip 40\p@                                                                                                        
  }}

Here, \p@ means pt, so you can see there is a 50pt vertical space before the heading. You can use the etoolbox package to remove the space.

\documentclass{book}
\usepackage{etoolbox}
\begin{document}
\chapter{AAA}
abc

\makeatletter
\patchcmd{\@makeschapterhead}{\vspace*{50\p@}}{}{}{}
\makeatother

\begin{thebibliography}{X}
\bibitem def
\end{thebibliography}
\end{document}

Note that this will affect all subsequent instances of \chapter*.

Incidentally, I would recommend using bibtex or biber to construct your bibliography. Doing it manually is very inefficient, and usually leads to formatting errors.