[Tex/LaTex] Section title format

numberingsectioningtitlesec

Can someone explain to me, how one can make a section look like this enter image description here and this enter image description here
I'm really having trouble with doing this, and I'm not sure if I should even use titlesec or titleformat, especially not for the picture with a big 1 on the right. I would really like to know how to accomplish picture 2. Anyone that can help me? Would be much appreciated. This is of course in LaTeX.

Best Answer

Here are two example solutions, adapted from a code for \chapter. With this type of layout, I had to change the class of \section so that a new section starts a newpage, and begins at top of page:

\documentclass[11pt, a4paper]{article}% http://ctan.org/pkg/amsproc

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fourier, erewhon}
\usepackage[showframe]{geometry}
\usepackage[x11names]{xcolor}

\usepackage[]{titlesec}%

\titleclass{\section}{top}
\titleformat{\section}[display]
{\filleft\bfseries}
{\fontsize{72}{75}\selectfont\color{SlateGray3}\thesection}
{8ex}
{\LARGE}%
\titlespacing*{\section}{0pt}{-8ex}{12ex}

\begin{document}

\section {The History of the Seven Families}%

           In former days – that is to say, once upon a time, there lived in the Land of Gramblamble, Seven Families. They lived by the side of the great Lake Pipple-popple (one of the Seven Families, indeed, lived in the Lake), and on the outskirts of the City of Tosh, which, excepting when it was quite dark, they could see plainly. The names of all these places you have probably heard of, and you have only not to look in your Geography books to find out all about them.

\end{document} 

enter image description here

\documentclass[11pt, a4paper]{article}% http://ctan.org/pkg/amsproc

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fourier, erewhon}
\usepackage[showframe]{geometry}
\usepackage[x11names]{xcolor}

\usepackage[]{titlesec}%

\titleclass{\section}{top}

\titleformat{\section}[display]
{\filleft\bfseries}
{\Huge\color{SlateGray3}\raisebox{-0.5\height}{\thesection}\enspace \titlerule[1pt]}
{6ex}
{\LARGE}[\vspace{4.5ex}{\color{SlateGray3}\titlerule[1pt]}]%
\titlespacing*{\section}{0pt}{-6ex}{12ex}

\begin{document}

\section {The History of the Seven Families}%

           In former days – that is to say, once upon a time, there lived in the Land of Gramblamble, Seven Families. They lived by the side of the great Lake Pipple-popple (one of the Seven Families, indeed, lived in the Lake), and on the outskirts of the City of Tosh, which, excepting when it was quite dark, they could see plainly. The names of all these places you have probably heard of, and you have only not to look in your Geography books to find out all about them.

\end{document} 

enter image description here

Edit:

The formatting of the toc title can be different from the above using \titleformat, with the numberless key, since table of contents, references, &c., are implemented as unnumbered sections in the article class. Just add this code to your preamble:

\titleformat{name = \section, numberless}[block]
{\filright}
{}
{0pt}
{\huge\textbf}%
\titlespacing*{name = \section, numberless}{0pt}{-4ex}{12ex}

enter image description here

Related Question