Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I customized the chapter style like (book class):

enter image description here

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

enter image description here

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}]
share|improve this question
    
I get the thin rule above the thick one. What's \chaptNum? You should use \raggedleft, not \flushright. –  egreg Mar 30 at 14:13
    
Thanks for the advice. –  KOF Mar 30 at 14:43

1 Answer 1

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}%
]

enter image description here

enter image description here

enter image description here

enter image description here

To adjust the spacing further, put

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

in the preamble and adjust to your liking.

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}
share|improve this answer
    
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 at 14:55
    
@KOF I have added two lines. Those lines should do it. –  Harish Kumar Mar 30 at 15:07
    
Still not working :(, could you please give a MWE? –  KOF Mar 30 at 16:24
    
@KOF Added to the answer. :) –  Harish Kumar Mar 30 at 22:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.