I really need your help on some following problems. Any help is highly appreciated. Many thanks to you in advanced.
I created a report with Part, Chapter, Section,.... But there are some Titles, I want to include them into the Table of contents (Like Introduction, Annex,...) with the format as same as the Part (Font, color, dots connecting with the page number). Could you please show me how to do that?
I created also the header / footer. For some pages, I inserted the code. \thispagestyle{fancy} to force the page with the form of header/footer as defined in the code. It works for the page of Tables of contents, Chapter,... But for the page of Part, it doesn't. So how to apply the form header/footer for this page?
- There is some big marge (gap) between the header and the Content, the Chapter. How to reduce this gap as we want?
You can see the photos attached and the code.
Thank you to much.
\documentclass{report}
%%%%% Format font + page + langue
\usepackage[utf8x]{inputenc}
\usepackage[a4paper,top=2.5cm,bottom=2cm,left=2.5cm,right=2cm,marginparwidth=1.75cm,headheight=35pt]{geometry}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\setlength{\parindent}{0cm}
\setlength{\parskip}{1em}
\renewcommand{\baselinestretch}{1}
\usepackage[titletoc]{appendix}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
%%%%% Indentfirst
\usepackage{indentfirst}
\setlength{\parindent}{1cm}
\usepackage{libertine}
\usepackage{lmodern}
%%%%% Header + Footer
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\lfoot{Minh Tu \textsc{Pham} \copyright}
\cfoot{Rapport de stage}
\rfoot{\textbf{Page \thepage}}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0.5pt}
%%%%% Create image + photo
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}
%\usepackage[colorlinks=true, allcolors=blue]{hyperref}
\usepackage{amsmath,amssymb,amsthm,amsfonts,mathrsfs}
\usepackage{float}
\usepackage[export]{adjustbox} %% choose the position (left, right) of a image
\usepackage{subcaption} %% pour put many images in 1 figure
\usepackage{wrapfig} %% wrap text and image
\usepackage{babelbib}
\usepackage{caption}
%%%%% Table of contents
\setcounter{secnumdepth}{5} % seting level of numbering in the document
\setcounter{tocdepth}{5} % seting level of numbering in the ToC
\usepackage[colorlinks=true]{hyperref}
\usepackage{tocloft}
\newcommand{\Color}[1]{\hypersetup{linkcolor=#1}\color{#1}}
\renewcommand{\cftpartfont}{\Color{red}\large\bfseries}
\renewcommand{\cftchapfont}{\Color{red}\large\bfseries}
\renewcommand{\cftsecfont}{\Color{blue}}
\renewcommand{\cftsubsecfont}{\Color{green}}
\renewcommand{\cftsubsubsecfont}{\Color{black}}
\renewcommand{\cftpartpagefont}{\large\bfseries\Color{red}}
\renewcommand{\cftchappagefont}{\large\bfseries\Color{red}}
\renewcommand{\cftsecpagefont}{\Color{blue}}
\renewcommand{\cftsubsecpagefont}{\Color{green}}
\renewcommand{\cftsubsubsecpagefont}{\Color{black}}
\renewcommand{\cftpartleader}{\large\bfseries\color{red}\cftdotfill{\cftdotsep}}
\renewcommand{\cftchapleader}{\large\bfseries\color{red}\cftdotfill{\cftdotsep}}
\renewcommand{\cftsecleader}{\Color{blue}\cftdotfill{\cftsecdotsep}}
\renewcommand{\cftsubsecleader}{\Color{green}\cftdotfill{\cftsubsecdotsep}}
\renewcommand{\cftsubsubsecleader}{\Color{black}\cftdotfill{\cftsubsubsecdotsep}}
\begin{document}
\tableofcontents \thispagestyle{fancy}
\newpage
\begin{center}
\huge\bfseries{Remerciements}
\end{center}
benefits
\newpage
\begin{center}
\huge\bfseries{Introduction}
\end{center}
tion benefits
\newpage
\part{Aba asg asdf asdf asdf } \thispagestyle{fancy}
\chapter{AS asdfa sdfasdj h ert bc bcvb} \thispagestyle{fancy}
\section{adfas}
\section{asfasf asfd a}
\chapter{B asfd as asd fasdf asdf asdf}
\section{asdfasdf asdfasdfa}
\subsection{asdf asdfa sdfasdfa}
\newpage
\begin{center}
\huge\bfseries{References}
\end{center}
asdf a
benefits
\end{document}
\part*{Anexx}\addcontentsline{toc}{part}{Anexx}
should solve.\part{}
or like\chapter{}
. The*
removes the number, so you need to add that command to toc, choosingpart
orchapter
depending whic one you used.