减少目录中的空间

减少目录中的空间

我正在使用以下代码

\documentclass[12pt,a4paper]{report}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Useful Packages %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%---------------------math---------------------------------------
\usepackage{amssymb,amsmath,amsthm,latexsym,mathrsfs,amsfonts,dsfont}
\usepackage{mathtools, nccmath} % new extention de amsmath  
%---------------------divers---------------------------------------
\usepackage{pifont} %ding
\usepackage{fancybox} %pour faire l'encadrement
\usepackage{graphicx}
\usepackage{color}
\usepackage[final]{pdfpages}
\usepackage{url}
%\usepackage[notref,notcite]{showkeys}
\usepackage{fancyvrb}
\VerbatimFootnotes % allows verbatim text in footnotes
%-------------------------hyperref------------------------------

\usepackage{setspace}
%\usepackage[colorlinks=true,pagebackref=true]{hyperref}
%\usepackage[colorlinks=true]{hyperref}
%\hypersetup{urlcolor=blue, citecolor=red , linkcolor= blue}

%------------       
%--------------------------accent-------------------------          
 \usepackage[utf8]{inputenc}
 \usepackage[T1]{fontenc}
%---------------------------------------------------------
%-------réduire le mot reference----------
\usepackage{etoolbox}
\patchcmd{\thebibliography}{\section}{\subsection}{}{}
%------
%------minimiser l'espace entre les reference----
\makeatletter
\g@addto@macro\@openbib@code{\setlength{\itemsep}{0pt}}
\makeatother
%-----------------  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Style des titres%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%-------------------------------------------
\usepackage{sectsty}
\allsectionsfont{\sffamily}
%---- Dimensions des marges --------------------
\usepackage{geometry}
\geometry{left=3cm,right=2cm,top=2.5cm,bottom=2cm}
\usepackage{setspace}
\onehalfspacing
%---------------------écriture foncé-----------
%\usepackage{mathptmx} % pour avoir une écriture bien foncée
%\usepackage{helvet}
%----------------------------------------------
%-----------------------------------------------------------
\newtheorem{theorem}{Theorem}[section]
\newtheorem{definition}{Definition}[section]
\newtheorem{definitions}{Definitions}[section]
\newtheorem{notation}{Notation}[section]
\newtheorem{corollary}{Corollary}[section]
\newtheorem{proposition}{Proposition}[section]
\newtheorem{lemma}{Lemma}[section]
\newtheorem{remark}{Remark}[section]
\newtheorem{example}{Example}[section]
\newtheorem{examples}{Examples}[section]
\numberwithin{equation}{section}
%-----------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\qedsymbol}{$\blacksquare$}
\let\origproofname\proofname
\renewcommand{\proofname}{\upshape\bfseries\origproofname}

\newenvironment{dem}{{\noindent {\bf Sketch of Proof.}}}{\hfill {\rule{2mm}{2mm}}}

\newenvironment{pr}{{\noindent {\bf Second Proof of}}}{\hfill {\rule{3mm}{3mm}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%-----------------------------head and foot--------------------------------
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\fancyhf{} % supprime les en-têtes et pieds pr\'ed\'efinis
\fancyhead[L,R]{\bfseries\thepage}% Left Even, Right Odd
\fancyhead[L]{\bfseries\rightmark} % Left Odd
\fancyhead[R]{\bfseries\leftmark} % Right Even
\fancyfoot[LE,RO]{\textbf{ }} %ici ecrire cooperate

\renewcommand{\headrulewidth}{1.pt}% filet en haut de page
\renewcommand{\footrulewidth}{0.pt}% filet en bas de page

\newcommand{\clearemptydoublepage}{%
\newpage{\pagestyle{plain}\cleardoublepage}}
\rhead{\textbf{\thepage}} %{\textsl{\rightmark}}
\lhead{\textsl{\nouppercase{\leftmark}}}%{\textbf{\thepage}}
\lfoot{\footnotesize{\textbf{}}}  % titre de la these
\setlength{\headheight}{14.5pt}
%-------------------------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%-------Chapter style-------------------------------------------------
\usepackage{titlesec}
\usepackage{tabularx}
\titleformat{\chapter}[display]{\filcenter\Huge\scshape\bfseries}{\begin{tabularx}{\textwidth}{@{}XcX@{}}\titlerule[5pt]& \large\mdseries\raisebox{-1.05ex}{\chaptername\enspace\arabic{chapter}} & \titlerule[5pt]\end{tabularx}}{-1ex}{\hrule\vspace{1ex} }[\vspace{0.75ex}\endgraf\hrule]
\titlespacing*{\chapter}{0pt}{-8ex}{20ex}

\titleformat{name=\chapter, numberless}[display]{\filcenter\Huge\bfseries}%
{\titlerule[5pt]}{-2.2ex}{\hrule\vspace{1.5ex}}[\vspace{0.75ex}\endgraf\hrule]

%-----------This chapter contains--------------
\usepackage{etoc}
\usepackage{blindtext}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%-------------------------
%\pagestyle{plain} % les numérotations en pieds de page

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\begin{document}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\tableofcontents 
\chapter{one}
 Let consider
 \chapter{two}
 Let consider
\begin{thebibliography}{999} \addcontentsline{toc}{chapter}{Bibliography}
\footnotesize
\newpage
%%%%%%%%%%%-A-%%%%%%%%%%%%%
\bibitem{axlupol}{O. Axelsson, H. Lu, B. Polman,} {On the numerical radius of matrices and its application to iterative solution methods,} Linear Multilinear Algebra 37 (1994) 225-238. 

\end{thebibliography}

\end{document} 

我想减少目录中章节“目录”和第一章之间的空间。

在此处输入图片描述

答案1

关键的是\titlespacing*{\chapter}{0pt}{-8ex}{20ex}

将最终值更改为更小的值,例如10ex。输出:

减少空白

答案2

快速破解:添加一些负垂直空间\addtocontents{toc}{\vspace*{-3cm}}

\documentclass[12pt,a4paper]{report}


\usepackage{titlesec}
\usepackage{tabularx}
\titleformat{\chapter}[display]{\filcenter\Huge\scshape\bfseries}{\begin{tabularx}{\textwidth}{@{}XcX@{}}\titlerule[5pt]& \large\mdseries\raisebox{-1.05ex}{\chaptername\enspace\arabic{chapter}} & \titlerule[5pt]\end{tabularx}}{-1ex}{\hrule\vspace{1ex} }[\vspace{0.75ex}\endgraf\hrule]
\titlespacing*{\chapter}{0pt}{-8ex}{20ex}

\titleformat{name=\chapter, numberless}[display]{\filcenter\Huge\bfseries}%
{\titlerule[5pt]}{-2.2ex}{\hrule\vspace{1.5ex}}[\vspace{0.75ex}\endgraf\hrule]


\begin{document}

\tableofcontents 

\addtocontents{toc}{\vspace*{-3cm}}

\chapter{one}
 Let consider
 \chapter{two}
 Let consider


\end{document} 

在此处输入图片描述

相关内容