# How to create specific section style using titlesec?

I would like to create section style like in the attached picture, but I didn't find any way how to do it. Usually I'm using titlesec package for section style customizing.

Is there any way how to move the section number to the right edge and make it larger than 'Huge'?

Jane

• Hi and welcome, what documentclass are you using? Why do you want to make it with titlesec, and not something that might be more suited for the class you are using (which i don't know, hence the questin above)? Feb 17 '15 at 17:41
• Hi, I thought I would use 'article', therefore I asked about section style. But then I decided to use 'book'. I'm not much skilled in LaTeX and titlesec is the only package I used in the past for these changes.
– Jaja
Feb 18 '15 at 18:29

Here's one possibility using the titlesec package; adjust the settings according to your needs:

\documentclass{book}
\usepackage[explicit]{titlesec}
\usepackage{fix-cm}
\usepackage{lipsum}

% numbered
\titleformat{\chapter}
{\normalfont\LARGE\bfseries\filleft}
{}
{0em}
{%
\parbox[b]{\dimexpr\linewidth-2.5cm\relax}{#1}\hfill%
\parbox[b]{2cm}{\hfill{\fontsize{80}{96}\selectfont\thechapter}}%
}
% unnumbered
\titleformat{name=\chapter,numberless}
{\normalfont\LARGE\bfseries\filleft}
{}
{0em}
{\parbox[b]{\dimexpr\linewidth-2.5cm\relax}{#1}}
% spacing
\titlespacing*{\chapter}
{0pt}{50pt}{40pt}

\begin{document}

\chapter{Introduction}
\lipsum[4]
\chapter*{Unnumbered chapter}
\lipsum[4]

\end{document}


## Remarks

• The question mentions sections, but the image suggests chapters; in any case, to have the formatting for sections, change chapter to section everywhere in my code.

• To have larger font sizes, you need an scalable font, and then you can use

  \fontsize{<size>}{<baselineskip>}\selectfont

• Two side-by-side \parboxes were used for numbered chapter titles; the first one for the title (accessed through #1 with the explicit option for titlesec) and the second one for the number. The boxes are bottom aligned so, for longer titles, the baseline of the number will be aligned with the baseline of the last line of the title.

• Thank you very much for your help, this does exactly what I need.
– Jaja
Feb 17 '15 at 18:27