# Spacing problem with customized chapter style

I customized the chapter style like (book class):

More space between the Chapter title (1 row) and the Lines

Less space between the Chapter title (2 or more rows) and the Lines

How to solve this problem?

Code:

\usepackage{titlesec,microtype}

\newcommand{\thicktitlerule}{\titlerule[0.5 ex]}
\titleformat{\chapter}[display]
{ \vspace{ -1 em } \large } %\normalsize
{\flushright \sffamily {\chaptNum\thechapter \vspace{1 ex}} \\\thicktitlerule}
{-24 pt}
{\titlerule\vspace{1 ex} \flushright \huge \bfseries}
[\vspace{1ex}] %\vspace{.2 em} \titlerule \vspace{0.5 em}

\titleformat{name=\chapter,numberless}[display]
{\vspace{ -1 em } \bfseries \normalsize}
{\makebox[\textwidth]{\thicktitlerule}}
{-2 pt}
{\titlerule\vspace{1 ex}\flushright \huge}
[\vspace{1ex}]

-
I get the thin rule above the thick one. What's \chaptNum? You should use \raggedleft, not \flushright. – egreg Mar 30 '14 at 14:13
Thanks for the advice. – KOF Mar 30 '14 at 14:43

I think this is what you want.

\newcommand{\thicktitlerule}{\titlerule[0.5 ex]}

\titleformat{name=\chapter,numberless}[display]
{\bfseries\Large}
{}
{0ex}
{\thicktitlerule
\vspace{1pt}%
\titlerule
\vspace{2ex}%
\filleft\huge}
[\vspace{2ex}%
]

\titleformat{\chapter}[display]
{\bfseries\Large}
{\filleft\Huge\sffamily\thechapter }
{1ex}
{\thicktitlerule
\vspace{1pt}
\titlerule
\vspace{2ex}%
\filleft\huge}
[\vspace{2ex}%
]


To adjust the spacing further, put

\titlespacing{\chapter}{0pt}{0pt}{3cm}
\titlespacing{name=\chapter,numberless}{0pt}{22pt}{3cm}


Code:

\documentclass{book}
\usepackage{titlesec,microtype,showframe}

\newcommand{\thicktitlerule}{\titlerule[0.5 ex]}

\titleformat{name=\chapter,numberless}[display]
{\bfseries\Large}
{}
{0ex}
{\thicktitlerule
\vspace{1pt}%
\titlerule
\vspace{2ex}%
\filleft\huge}
[\vspace{2ex}%
]

\titlespacing{name=\chapter,numberless}{0pt}{22pt}{3cm}

\titleformat{\chapter}[display]
{\bfseries\Large}
{\filleft\Huge\sffamily\thechapter }
{1ex}
{\thicktitlerule
\vspace{1pt}
\titlerule
\vspace{2ex}%
\filleft\huge}
[\vspace{2ex}%
]
\titlespacing{\chapter}{0pt}{0pt}{3cm}
\begin{document}
\chapter{Introduction}
\chapter{Particles interaction with multiphase fluid and the applications}
\chapter*{Introduction}
\chapter*{Particles interaction with multiphase fluid and the applications}
\end{document}

-
thanks, the un-numbered chapter style is for Contents and Nomenclature etc, but the space above the lines is not the same as the chpaters. – KOF Mar 30 '14 at 14:55
@KOF I have added two lines. Those lines should do it. – Harish Kumar Mar 30 '14 at 15:07
Still not working :(, could you please give a MWE? – KOF Mar 30 '14 at 16:24
@KOF Added to the answer. :) – Harish Kumar Mar 30 '14 at 22:36