Also, how to control section/subsection font size. ...
Here is my preamble :
Code: Select all
\documentclass[12pt,a4paper,dvipdfm]{report}
\usepackage[left=3.5cm,right=2.5cm,top=2.5cm]{geometry}
\usepackage{enumerate}
\setlength{\textheight}{780pt}
\usepackage[dvipdfm]{hyperref}
\usepackage{amssymb,latexsym,amsmath,mathrsfs,array,epsfig,tikz}
\usepackage{color,amstext,amsbsy,amsopn,amsthm,amscd,amsxtra,amsfonts,setspace}
\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\contentsname}{List of Contents}
\renewcommand{\bibname}{References}
%------------------
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\sffamily\huge\bfseries\color{blue}}
{\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titleformat{\section}
{\normalfont\sffamily\Large\bfseries\color{cyan}}
{\thesection}{1em}{}
%-----------------------
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\chead{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\numberwithin{figure}{section}
\newcommand*\mycirc[1]{%
\begin{tikzpicture}[baseline=(C.base)]
\node[draw,circle,inner sep=1pt](C) {#1};
\end{tikzpicture}}
\setcounter{secnumdepth}{3}
%----------------------------------------------------------------------------------------------
%Change the place of chapter and decreasing lines
\makeatletter
\let\ps@plain\ps@fancy % This line for page number
\def\@makechapterhead#1{%
\vspace*{-50\p@}% default: 50pt
{\parindent \z@ \centering \normalfont% default: \raggedright
\ifnum \c@secnumdepth >\m@ne
\huge\bfseries\sc \@chapapp\space \thechapter
\par\nobreak
\vskip 0\p@% default: 20\p@
\fi
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 15\p@
}}
\def\@makeschapterhead#1{%
\vspace*{-50\p@}% default: 50pt
{\parindent \z@ \centering% default: \raggedright
\normalfont
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 15\p@
}}
\makeatother
%----------------------------------------------------------------------------------------------
\setlength{\headheight}{14pt} %To avoid error for page numbers
\begin{document}
\chapter{chapter title test}
\section{section title test}
\end{document}
I found a post in this forum and I tried the code :
Code: Select all
\usepackage{titlesec}
\titleformat{\chapter}[block]{\centering\fontsize{10pt}{16pt}\selectfont}{\chaptertitlename~\thechapter.}{12pt}{}
I think the problem in this code in my preamble :
Code: Select all
\makeatletter
\let\ps@plain\ps@fancy % This line for page number
\def\@makechapterhead#1{%
\vspace*{-50\p@}% default: 50pt
{\parindent \z@ \centering \normalfont% default: \raggedright
\ifnum \c@secnumdepth >\m@ne
\huge\bfseries\sc \@chapapp\space \thechapter
\par\nobreak
\vskip 0\p@% default: 20\p@
\fi
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 15\p@
}}
\def\@makeschapterhead#1{%
\vspace*{-50\p@}% default: 50pt
{\parindent \z@ \centering% default: \raggedright
\normalfont
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 15\p@
}}
\makeatother
Thanks