[Tex/LaTex] Make decrease the space between title of list of figures and list of tables on the same page

table of contentstitlesectitletoctocloft

I try to reduce the space between the title name of list of figure ("Liste des Figures" on the image below) and the list of figures.

I would like to do the same for the title name of list of tables ("Liste des Tables").

The particularity of my case is that I want to have the list of figures and the list of tables on the same page.

As you can see, decreasing the space betwwen the title ans lists would allow me to have all just on a single page.

lists too long : that takes 2 pages

The issue is also that I am using a special style for chapter, table of contents, list of figure … etc (the black rectangle with the horizontal line above titles).

I show you below the source that I use :

\documentclass[11pt,french,oneside]{report}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[francais]{babel}
\usepackage{indentfirst}
\usepackage{lastpage}
\usepackage{amsmath,amssymb}
\usepackage{fancyhdr}
\usepackage{url}
\usepackage{epsfig}
\usepackage{graphics}
\usepackage{multirow}
\usepackage{vmargin}
\usepackage{float}
\usepackage{psboxit,pstcol}
\usepackage{tabularx}

\usepackage[style=ext-authoryear, backend=biber]{biblatex}
\usepackage[hyperfootnotes=false,colorlinks,allcolors=blue]{hyperref}
\usepackage[nameinlink,noabbrev]{cleveref}
\Crefname{appendix}{l'Appendice}{les Appendices}
\usepackage{setspace}
\usepackage{needspace}
\usepackage{caption}

\usepackage[table,svgnames,dvipsnames]{xcolor}
\usepackage{calc}
\usepackage{geometry}

\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}

\DeclareCaptionFont{xbf}{\bfseries\boldmath}
\captionsetup{font=xbf}

\definecolor{jonquil}{rgb}{0.98, 0.85, 0.37}
\definecolor{lavender(web)}{rgb}{0.9, 0.9, 0.98}

\DeclareFixedFont{\ttb}{T1}{txtt}{bx}{n}{9} % for bold
\DeclareFixedFont{\ttm}{T1}{txtt}{m}{n}{9}  % for normal

\usepackage{color}
\definecolor{deepblue}{rgb}{0,0,0.5}
\definecolor{deepred}{rgb}{0.6,0,0}
\definecolor{deepgreen}{rgb}{0,0.5,0}

\usepackage{listings}

\newcommand\pythonstyle{\lstset{
language=Python,
basicstyle=\ttm,
otherkeywords={self},             % Add keywords here
keywordstyle=\ttb\color{deepblue},
emph={MyClass,__init__},          % Custom highlighting
emphstyle=\ttb\color{deepred},    % Custom highlighting style
stringstyle=\color{deepgreen},
frame=tb,                         % Any extra options here
showstringspaces=false,

commentstyle=\ttb\selectfont\itshape,columns=fullflexible], 
numbers=left,
stepnumber=1,
}}

\newcolumntype{C}{>{\centering\arraybackslash}X}

\usepackage{colortbl} % for \rowcolor macro
\usepackage{array}
\setlength\extrarowheight{1.5pt} % for a more open "look"
\usepackage[skip=0.5\baselineskip]{caption}

\renewcommand*{\nameyeardelim}{\addcomma\space}

\newcommand*{\x}{\mathsf{x}\mskip1mu}

\DeclareCiteCommand{\cite}[\mkbibparens]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \printtext[bibhyperref]{\usebibmacro{cite}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand*{\cite}[\mkbibparens]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \printtext[bibhyperref]{\usebibmacro{citeyear}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\newcommand{\emptysection}[1]{%
    \begingroup\renewcommand\addcontentsline[3]{}%
    \section{#1}\endgroup%
}

\makeatletter
\newlength{\chapter@number@width}
\def\@makechapterhead#1{%
  {\normalfont
  \setlength{\parindent}{0pt}%
  \vspace*{10pt}%
  \settowidth{\chapter@number@width}{%
    \hbox{\color{white}\LARGE\bfseries
          \hspace{\dimexpr 1mm+3pt}%
          \thechapter
          \hspace{\dimexpr 1mm+3pt}%
    }}
  \hbox{%
    \vtop{%
      \hsize=\dimexpr\chapter@number@width+\tabcolsep+2\fboxrule+\tabcolsep
      \begin{tabular}[t]{@{}c}
        \scshape\strut\makebox[0pt]{\hspace{0pt plus 1 fill minus 1 fill}\@chapapp\hspace{0pt plus 1 fill minus 1 fill}} \\
        \fboxsep=0pt
        \colorbox{black}{\vbox{%
           \hbox{\vbox to \dimexpr 1mm+3pt{}}
           \hbox{\color{white}\LARGE\bfseries
                 \hspace{\dimexpr 1mm+3pt}%
                 \thechapter
                 \hspace{\dimexpr 1mm+3pt}%
                }
           \hrule height 0.4pt depth 0pt width 0pt
           \hbox{\vbox to 6pt{}}
           \hbox{\parbox{0pt}{\Huge\bfseries\vphantom{E}}}
           }}%
      \end{tabular}%
      }%
    \vtop{%
      \advance\hsize by -\dimexpr\chapter@number@width+2\fboxrule+\tabcolsep
      \hspace*{-0.5cm}\begin{tabular}[t]{c}
        \scshape\strut\vphantom{\@chapapp} \\
        \fboxsep=0pt
        \colorbox{white}{\vbox{%
           \hbox{\vbox to \dimexpr 1mm+3pt{}}
           \hbox{\LARGE\bfseries
                 \hspace{\dimexpr 1mm+3pt}%
                 \phantom{\thechapter}
                 \hspace{\dimexpr 1mm+3pt}%
                }
           \hrule height 0.4pt depth 0pt width \hsize
           \hbox{\vbox to 6pt{}}
           \hbox{\hspace*{20pt}\parbox{\dimexpr\textwidth-2mm-6pt-\chapter@number@width-\tabcolsep-2\fboxrule-20pt}{\Huge\bfseries #1}}
           }}%
      \end{tabular}%
      }%
    }%
  \vspace{50pt}%
  }
}
\def\@makeschapterhead#1{%
  {\normalfont
  \setlength{\parindent}{0pt}%
  \vspace*{10pt}%
  \settowidth{\chapter@number@width}{%
    \hbox{\color{white}\LARGE\bfseries
          \hspace{\dimexpr 1mm+3pt}%
          \thechapter
          \hspace{\dimexpr 1mm+3pt}%
    }}
  \hbox{%
    \vtop{%
      \hsize=\dimexpr\chapter@number@width+\tabcolsep+2\fboxrule+\tabcolsep
      \begin{tabular}[t]{@{}c}
        \scshape\strut\makebox[0pt]{\hspace{0pt plus 1 fill minus 1 fill}\phantom{\@chapapp}\hspace{0pt plus 1 fill minus 1 fill}} \\
        \fboxsep=0pt
        \colorbox{black}{\vbox{%
           \hbox{\vbox to \dimexpr 1mm+3pt{}}
           \hbox{\color{white}\LARGE\bfseries
                 \hspace{\dimexpr 1mm+3pt}%
                 \phantom{\thechapter}%
                 \hspace{\dimexpr 1mm+3pt}%
                }
           \hrule height 0.4pt depth 0pt width 0pt
           \hbox{\vbox to 6pt{}}
           \hbox{\parbox{0pt}{\Huge\bfseries\vphantom{E}}}
           }}%
      \end{tabular}%
      }%
    \vtop{%
      \advance\hsize by -\dimexpr\chapter@number@width+2\fboxrule+\tabcolsep
      \hspace*{-0.5cm}\begin{tabular}[t]{c}
        \scshape\strut\vphantom{\@chapapp} \\
        \fboxsep=0pt
        \colorbox{white}{\vbox{%
           \hbox{\vbox to \dimexpr 1mm+3pt{}}
           \hbox{\LARGE\bfseries
                 \hspace{\dimexpr 1mm+3pt}%
                 \phantom{\thechapter}
                 \hspace{\dimexpr 1mm+3pt}%
                }
           \hrule height 0.4pt depth 0pt width \hsize
           \hbox{\vbox to 6pt{}}
           \hbox{\hspace*{20pt}\parbox{\dimexpr\textwidth-2mm-6pt-\chapter@number@width-\tabcolsep-2\fboxrule-20pt}{\Huge\bfseries #1}}
           }}%
      \end{tabular}%
      }%
    }%
  \vspace{50pt}%
  }
}

\setlength\parindent{0pt}


\newenvironment{changemargin}[2]{\begin{list}{}{%
\setlength{\topsep}{0pt}%
\setlength{\leftmargin}{0pt}%
\setlength{\rightmargin}{0pt}%
\setlength{\listparindent}{\parindent}%
\setlength{\itemindent}{\parindent}%
\setlength{\parsep}{0pt plus 1pt}%
\addtolength{\leftmargin}{#1}%
\addtolength{\rightmargin}{#2}%
}\item }{\end{list}}



\setmarginsrb{2.3cm}{0.0cm}{2.1cm}{1cm}{1.3cm}{0.5cm}{0.4cm}{1cm}
\pagestyle{fancy}
\renewcommand{\footrulewidth}{0.4pt}
\renewcommand{\headrulewidth}{0.4pt}
\chead{\hspace{-0.3cm}\textit{Rapport de stage M2 Astrophysique, Sciences de l\rq Espace, Plan\'etologie \hspace{-0.3cm}}}
\lhead{\epsfig{file=logo_small.jpg,height=0.8cm,width=2cm}}
\rhead{\epsfig{file=logo_ut3_small.png,height=0.8cm,width=2cm}}
\lfoot{\textit{lisssold riufi}}
\cfoot{\hspace{1.6cm} \textit{ - Performances}} 
\rfoot{\thepage/\pageref{LastPage}}

\makeatletter
\g@addto@macro\appendix{%
  \cleardoublepage
  \hypertarget{appendixstart}{}%
  \addtocontents{toc}{
    \protect\contentsline{chapter}{\protect\hyperlink{appendixstart}{Appendice}}{}{}%
  }%
}
\makeatother

\usepackage[nameinlink,noabbrev]{cleveref}
\renewcommand{\arraystretch}{1.25} 

\begin{document}

\renewcommand*\listfigurename{Liste des Figures}
\renewcommand*\listtablename{Liste des Tables}

\tableofcontents

%%%%%% CRITICAL PART TO GET list of figures and list of tables %%%%
%%%%%% ON THE SAME PAGE %%%%%
%%%%%% This is HERE where I would like to reduce space between title
%%%%%% list while keeping the special style of titles (like chapters)

\thispagestyle{plain}
\listoffigures
\begingroup
\let\clearpage\relax
\listoftables
\endgroup
\thispagestyle{plain}

\chapter*{Introduction}
\addcontentsline{toc}{chapter}{Introduction}

If I use only :

\setlength{\cftbeforeloftitleskip}{5pt} % LOF: Listing of Figures
\setlength{\cftbeforelottitleskip}{5pt} % LOT: Listing of Tables

this causes the removing of the special format of chapters and table of figures, table of tables and also this makes push up all to the table of contents, i.e the mess up …

If someone could help me to produce one single page while keeeping the special style for both titles, this would be nice to tell me how to do it.

Regards

Best Answer

Here is a simple fix. The basic idea is to change the vertical space that is added at the end of \@makechapterhead and \@makeschapterhead locally for the list of figures and tables. I therefore made the following changes:

  • Before the definition of \@makechapterhead I added a new length for this bottom space and set the default value to 50pt (the value in your example):

    \newlength{\chapter@bottom@space}
    \setlength{\chapter@bottom@space}{50pt}
    
  • In the \@make(s)chapterhead macros both last lines

    \vspace{50pt}%
    

    were replaced by

    \vspace{\chapter@bottom@space}%
    
  • In the "critical part" the new length is redefined locally to a smaller value. Adjust this value to an even smaller value if necessary:

    \thispagestyle{plain}
    \begingroup
      \makeatletter
      \setlength{\chapter@bottom@space}{15pt}
      \makeatother
      \listoffigures
      \let\clearpage\relax
      \listoftables
    \endgroup
    \thispagestyle{plain}
    
  • Another minor fix was to add a \strut inside of the \@make(s)chapterhead macros at the place where the parameter #1 is used. This is to make chapter titles have an equal bottom space, no matter if the text uses characters with descenders or not (otherwise the "g" in "Figures" would produce a slightly larger vertical space than in the list of tables).

    \hbox{\hspace*{20pt}\parbox{...}{\Huge\bfseries\strut #1}}
    
  • EDIT: I also did a bit of code refactoring for the \@make(s)chapterhead macros. As both macros used the almost identical code, I merged both into a single one. There were only two places in which the macros differed:

    % \scshape\strut\makebox[0pt]{\hspace{0pt plus 1 fill minus 1 fill}
                 \@chapapp
        \phantom{\@chapapp}
    %     \hspace{0pt plus 1 fill minus 1 fill}} \\
    

    and

    % \hbox{\color{white}\LARGE\bfseries
    %       \hspace{\dimexpr 1mm+3pt}%
                      \thechapter
             \phantom{\thechapter}%
    %       \hspace{\dimexpr 1mm+3pt}%
    %      }
    

    As you can see, the only difference was the addition of \phantom in \@makeschapterhead. The new macro \@makechapterhead@base uses #1 now as a placeholder for a macro to be used in \phantom's place, while #2 became the new chapter title text. The original macros can then be easily defined by

    \def\@makechapterhead{\@makechapterhead@base\@firstofone}
    \def\@makeschapterhead{\@makechapterhead@base\phantom}
    

I removed several package imports and definitions from your code to make it minimal, so you should apply the above-mentioned patches separately to your code.

\documentclass[11pt,french,oneside]{report}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{indentfirst}
\usepackage{lastpage}
\usepackage{fancyhdr}
\usepackage{vmargin}
\usepackage{lipsum}

\usepackage[hyperfootnotes=false,colorlinks,allcolors=blue,breaklinks]{hyperref}
\usepackage{setspace}
\usepackage{caption}

\usepackage[table,svgnames,dvipsnames]{xcolor}
\usepackage{calc}
\usepackage{geometry}

\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}

\usepackage[skip=0.5\baselineskip]{caption}

\makeatletter
\newlength{\chapter@number@width}
\newlength{\chapter@bottom@space}
\setlength{\chapter@bottom@space}{50pt}

\def\@makechapterhead{\@makechapterhead@base\@firstofone}
\def\@makeschapterhead{\@makechapterhead@base\phantom}
\def\@makechapterhead@base#1#2{%
  {\normalfont
  \setlength{\parindent}{0pt}%
  \vspace*{10pt}%
  \settowidth{\chapter@number@width}{%
    \hbox{\color{white}\LARGE\bfseries
          \hspace{\dimexpr 1mm+3pt}%
          \thechapter
          \hspace{\dimexpr 1mm+3pt}%
    }}
  \hbox{%
    \vtop{%
      \hsize=\dimexpr\chapter@number@width+\tabcolsep+2\fboxrule+\tabcolsep
      \begin{tabular}[t]{@{}c}
        \scshape\strut\makebox[0pt]{\hspace{0pt plus 1 fill minus 1 fill}#1{\@chapapp}\hspace{0pt plus 1 fill minus 1 fill}} \\
        \fboxsep=0pt
        \colorbox{black}{\vbox{%
           \hbox{\vbox to \dimexpr 1mm+3pt{}}
           \hbox{\color{white}\LARGE\bfseries
                 \hspace{\dimexpr 1mm+3pt}%
                 #1{\thechapter}%
                 \hspace{\dimexpr 1mm+3pt}%
                }
           \hrule height 0.4pt depth 0pt width 0pt
           \hbox{\vbox to 6pt{}}
           \hbox{\parbox{0pt}{\Huge\bfseries\vphantom{E}}}
           }}%
      \end{tabular}%
      }%
    \vtop{%
      \advance\hsize by -\dimexpr\chapter@number@width+2\fboxrule+\tabcolsep
      \hspace*{-0.5cm}\begin{tabular}[t]{c}
        \scshape\strut\vphantom{\@chapapp} \\
        \fboxsep=0pt
        \colorbox{white}{\vbox{%
           \hbox{\vbox to \dimexpr 1mm+3pt{}}
           \hbox{\LARGE\bfseries
                 \hspace{\dimexpr 1mm+3pt}%
                 \phantom{\thechapter}
                 \hspace{\dimexpr 1mm+3pt}%
                }
           \hrule height 0.4pt depth 0pt width \hsize
           \hbox{\vbox to 6pt{}}
           \hbox{\hspace*{20pt}\parbox{\dimexpr\textwidth-2mm-6pt-\chapter@number@width-\tabcolsep-2\fboxrule-20pt}{\Huge\bfseries\strut #2}}
           }}%
      \end{tabular}%
      }%
    }%
  \vspace{\chapter@bottom@space}%
  }
}
\makeatother

\setlength\parindent{0pt}

\setmarginsrb{2.3cm}{0.0cm}{2.1cm}{1cm}{1.3cm}{0.5cm}{0.4cm}{1cm}
\pagestyle{fancy}
\renewcommand{\footrulewidth}{0.4pt}
\renewcommand{\headrulewidth}{0.4pt}
\chead{\hspace{-0.3cm}\textit{Rapport de stage M2 Astrophysique, Sciences de l\rq Espace, Plan\'etologie \hspace{-0.3cm}}}
\lhead{XXX}
\rhead{YYY}
\lfoot{\textit{lisssold riufi}}
\cfoot{\hspace{1.6cm} \textit{ - Performances}} 
\rfoot{\thepage/\pageref{LastPage}}

\begin{document}

\renewcommand*\listfigurename{Liste des Figures}
\renewcommand*\listtablename{Liste des Tables}

\tableofcontents

%%%%%% CRITICAL PART TO GET list of figures and list of tables %%%%
%%%%%% ON THE SAME PAGE %%%%%
%%%%%% This is HERE where I would like to reduce space between title
%%%%%% list while keeping the special style of titles (like chapters)

\thispagestyle{plain}
\begingroup
  \makeatletter
  \setlength{\chapter@bottom@space}{15pt}
  \makeatother
  \listoffigures
  \let\clearpage\relax
  \listoftables
\endgroup
\thispagestyle{plain}

\chapter*{Introduction}
\addcontentsline{toc}{chapter}{Introduction}

\lipsum[1]

\def\fig{
    \begin{figure}
    Figure
    \caption{This is HERE where I would like to reduce space between title
        list while keeping the special style of titles (like chapters)}
    \end{figure}
}
\fig\fig\fig\fig\fig\fig\fig\fig\fig

\def\tab{
    \begin{table}
    Figure
    \caption{This is HERE where I would like to reduce space between title
        list while keeping the special style of titles (like chapters)}
    \end{table}
}
\tab\tab\tab\tab\tab\tab\tab\tab\tab

\end{document}

enter image description here

enter image description here

Related Question