Page LayoutAdding a BIG chapter number under the chapter title

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Adding a BIG chapter number under the chapter title

Post by Cham »

I would like to add something fancy to the chapter title (first page) : the chapter's number in very big, light gray, just under the chapter number or title, in the upper-left corner, and without removing the standard chapter number above the title. Here's the minimal working code example I would like to use :

Code: Select all

\documentclass[12pt,letterpaper,twoside]{book}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot]{geometry}
\usepackage{setspace}
\setstretch{1.1}
\usepackage[dvipsnames,table]{xcolor}
\usepackage[pagestyles,medium]{titlesec}

\begin{document}

\setcounter{chapter}{13}
\chapter{A chapter title}
\section{Some section title}

Bla bla bla blabla blablabla bla blabla Bla bla bla blabla blablabla bla blabla Bla bla bla blabla blablabla bla blabla Bla bla bla blabla blablabla bla blabla Bla bla bla blabla blablabla bla blabla.  Bla bla bla blabla blablabla bla blabla Bla bla bla blabla blablabla bla blabla Bla bla bla blabla blablabla bla blabla.

\end{document}
Here's a preview of what I would like to achieve (approximately) :
chapter.jpg
chapter.jpg (54.6 KiB) Viewed 8900 times
Any idea how to do this ?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Adding a BIG chapter number under the chapter title

Post by Stefan Kottwitz »

Hi Cham,

this should be possible with titlesec too. I have another idea: creating a chapter page style, which prints the chapter counter at a fixed position on the page, using TikZ and the background layer with the current page node.

Just as first thoughts, today I'm too busy to write the code down, but tomorrow or the following day should be possible.

Stefan
LaTeX.org admin
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

Adding a BIG chapter number under the chapter title

Post by rais »

here's an idea using titlesec's \titleformat:

Code: Select all

\documentclass[12pt,letterpaper,twoside]{book}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot]{geometry}
\usepackage{setspace}
\setstretch{1.1}
\usepackage[dvipsnames,table]{xcolor}
\usepackage[pagestyles,medium]{titlesec}
\titleformat{\chapter}[display]% shape
  {\huge\bfseries}% format
  {% label
    \makebox[0pt][l]{%
      \raisebox{-66pt}[0pt][0pt]{%
        \textcolor{black!30}{\fontsize{136pt}{136pt}\selectfont\thechapter}%
      }% /raisebox
    }% /makebox
    \chaptertitlename~\thechapter
  }% label
  {12pt}% sep
  {}% before-code
\begin{document}

\setcounter{chapter}{13}
\chapter{A chapter title}
\section{Some section title}

Bla bla bla blabla blablabla bla blabla Bla bla bla blabla blablabla bla blabla Bla bla bla blabla blablabla bla blabla Bla bla bla blabla blablabla bla blabla Bla bla bla blabla blablabla bla blabla.  Bla bla bla blabla blablabla bla blabla Bla bla bla blabla blablabla bla blabla Bla bla bla blabla blablabla bla blabla.

\end{document}
KR
Rainer
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Adding a BIG chapter number under the chapter title

Post by Cham »

This code is working, thanks ! :)

I'm using this line modification for a better looking font (not sure yet ?) :

Code: Select all

  \textcolor{gray!25}{\usefont{T1}{pnc}{b}{n}\fontsize{136pt}{136pt}\selectfont\thechapter}%
Is there another/better way of doing this chapter style ?

The code given above change the size of the "Chapter #", above the chapter's title. I prefer to keep the original size and disposition, with just the chapter's number below.
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Re: Adding a BIG chapter number under the chapter title

Post by Cham »

So what happens to the size of the first line ("Chapter 14"), which is bigger with the previous code than with the first one ? Just compare the overleaf previews from both codes.

I would like to have exactly the same sizes and disposition from the first code, and add the chapter's number under both lines.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Adding a BIG chapter number under the chapter title

Post by Johannes_B »

book.cls uses \huge and \Huge sizes for the chapter heads, which are exactly the same for a 12 pt base font size. Package titlesec uses \Large for the chaptertitlename and the number, at least i guess so, i haven't actually checked.

Code: Select all

\documentclass[12pt,letterpaper,twoside]{book}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot]{geometry}
\usepackage{setspace}
\usepackage{blindtext}
\setstretch{1.1}
\usepackage[dvipsnames,table]{xcolor}
\usepackage[pagestyles,medium]{titlesec}
\titleformat{\chapter}[display]% shape
{\Huge\bfseries}% format
{% label
	\makebox[0pt][l]{%
		\raisebox{-66pt}[0pt][0pt]{%
			\textcolor{gray!25}{\usefont{T1}{pnc}{b}{n}\fontsize{136pt}{136pt}\selectfont\thechapter}%
		}% /raisebox
	}% /makebox
	{\LARGE\chaptertitlename~\thechapter}%default would be huge
}% label
{12pt}% sep
{}% before-code
\begin{document}

\setcounter{chapter}{13}
\chapter{A chapter title}
\section{Some section title}

\blindtext

\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Re: Adding a BIG chapter number under the chapter title

Post by Cham »

Thanks a lot. :)

I'll try to play a bit with this.
Post Reply