TransWikia.com

How can I get something like this in the book class?

TeX - LaTeX Asked by BrazilianAeronautics on June 4, 2021

enter image description here

Hello, I want something like the represented in the picture (using the book class), i.e., for the title of the chapter, I want "Chapter X" above and "Chapter Title" below, with a small font (in the book class the default font size is HUGE, and I want it small like in the picture) and with a space between; for the subsection, something a bit smaller than the title, with the pattern
"1. Subsection Title" (in the book class the default is "1.1. Subsection Title" and the size is also HUGE).
Don’t know if I was clear enough, because I found it hard to explain, since this design is simple (but effective), and I can’t replicate it using the titlesec package.
Any help is appreciated!

One Answer

Without knowing what sizes and spaces you want exactly, I could only guess, but using this as a starting point, you should be able to adjust the design to your liking:

documentclass{book}
usepackage[T1]{fontenc}
usepackage{titlesec,blindtext}

% For the chapter format
titleformat{chapter}[display]%
    {centeringLargebfseries}% format of chapter
    {normalsizenormalfontMakeUppercase{chaptertitlename}enskipthechapter}% format of the label
    {.5baselineskip}{} % space between the two
titlespacing*{chapter}{0pt}{25pt}{baselineskip} % spaces around chapter{}, {left}{before}{after}

% For the section format
renewcommand{thesection}{arabic{section}}% to get rid of the chapter number
titleformat{section}%
    {centeringlargebfseries}% format of section
    {thesection.}{.5em}{}
%titlespacing*{section}{0pt}{beforesep}{aftersep} % If you want to change the spacing around section{} too

begin{document}
    chapter{Some Chapter}
    section{Some Section}
    blindtext
end{document}

enter image description here

Correct answer by schoekling on June 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP