[Tex/LaTex] Customizing chapter’s title

chapterssectioning

How to make this in LaTex?

enter image description here

I'm already making the chapter title using this:

\def\@makechapterhead#1{%
\vspace*{10\p@}%
{\parindent \z@
{\reset@font
\usefont{OT1}{phv}{m}{n}
\LARGE Chapitre \thechapter\par\nobreak}%
\par\nobreak
\vspace*{30\p@}
\interlinepenalty\@M
\usefont{OT1}{ptm}{b}{n}
{\raggedright \Huge #1}%
\par\nobreak
\vskip 20\p@
\hrule height 1pt
\par\nobreak
\vskip 45\p@
}}

\def\@makeschapterhead#1{%
\vspace*{10\p@}%
{\parindent \z@
{\raggedleft \reset@font
\scshape \vphantom{\@chapapp{} \thechapter}
\par\nobreak}%
\par\nobreak
\vspace*{30\p@}
\interlinepenalty\@M
\usefont{OT1}{ptm}{b}{n}
{\raggedright \Huge #1}%
\par\nobreak
\par\nobreak
\vskip 45\p@
}}

Any brilliant idea, please?

Best Answer

This is an approach with »titlesec« where you perhaps need to incorporate your font settings.

\documentclass[11pt]{report}
\usepackage[T1]{fontenc}
\usepackage[explicit]{titlesec}
\usepackage{calc}
\usepackage{lmodern}
\usepackage{lipsum}

\titleformat{\chapter}[hang]
{\filcenter}
{\parbox{\widthof{\LARGE\sffamily\MakeUppercase{\chaptername}\enspace}}{%
  \filcenter\Large\sffamily\MakeUppercase{\chaptername}\enspace\\%
  \fontsize{48pt}{48pt}\selectfont\thechapter}\vrule width 2pt\quad%
}
{0pt}
{\Huge\bfseries\sffamily\parbox{\textwidth-\widthof{\LARGE\sffamily\MakeUppercase{\chaptername}\enspace}}{\filright #1}}

\begin{document}
  \chapter{A Very Long Title with Line Break}
    \lipsum[1]
\end{document}

enter image description here


Addendum

Correspondingly to the comments this is an adapted (and otherwise slightly enhanced) version with the complete heading in the Helvetica font.

\documentclass[11pt]{report}
\usepackage[T1]{fontenc}
\usepackage[explicit]{titlesec}
\usepackage{calc}
\usepackage{lmodern}
\usepackage{lipsum}

\titleformat{\chapter}[hang]
{\filcenter}
{\parbox{\widthof{\LARGE\sffamily\MakeUppercase{\chaptername}}}{%
   \filcenter\Large\usefont{T1}{phv}{m}{n}\MakeUppercase{\chaptername}\\%
   \fontsize{48pt}{48pt}\selectfont\thechapter%
 }\enspace%
}
{0pt}
{\Huge\usefont{T1}{phv}{b}{n}\vrule width 1pt \enspace%
 \parbox{\textwidth-\widthof{\LARGE\sffamily\MakeUppercase{\chaptername}\enspace}}{\filright #1}%
}

\begin{document}
  \setcounter{chapter}{9}
  \chapter{Chapter Title}
    \lipsum[1]
\end{document}

If you need some kind of subtitle for the chapter as shon in your picture, you will have to use the optional argument.

  \chapter[Hello, ATL Server]{Hello, ATL Server\\[6pt] \large A Modern C++ Web Platform}

The inclined reader may judge if this is useful or not.


enter image description here


And just for the case that you wonder what happens if the chapter title is (unnecessarily) long and goes over more than two lines, you can have a look at this.

enter image description here

But that should really be avoided. As you can see, the vertical rule adapts to the content of the actual heading whereas chapter name and chapter number stay in their positions.

Related Question