Text FormattingTitle Chapter in box

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
nacholore
Posts: 2
Joined: Mon Feb 08, 2010 3:08 pm

Title Chapter in box

Post by nacholore »

Hi,
Does anyone know if you can make the image?
I have tried to do with tikz.

Anyone can help me?
Attachments
ejemplo.png
ejemplo.png (3.97 KiB) Viewed 1964 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Title Chapter in box

Post by gmedina »

Hi,

you can use the titlesec package. If I have time, I can post a complete example in a few hours.

Edit: I had some free time, so here's the example:

Code: Select all

\documentclass{book}
\usepackage[spanish]{babel}
\usepackage[explicit]{titlesec}
\usepackage[svgnames]{xcolor}

\titleformat{\chapter}[block]
  {\color{white}\normalfont\huge\sffamily}
  {\colorbox{DodgerBlue}{\parbox[c][2.3\height][c]{\textwidth}{%
      \centering\chaptertitlename\ \thechapter.\  #1}}}
  {0pt}{\huge}
\titlespacing*{\chapter}
  {0pt}{20pt}{20pt}

\begin{document}

\chapter{Nombre del cap\'itulo}

\end{document}
Feel free to adapt my example according to your needs.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
nacholore
Posts: 2
Joined: Mon Feb 08, 2010 3:08 pm

Re: Title Chapter in box

Post by nacholore »

Hi,
It's work.

Thank you.
Post Reply