I am trying to define a custom chapter style like this one (\documentclass{book}
):
The closest I found is to use
\usepackage[Glenn]{fncychap}
which produces:
I have created the picture in an image editor, so ignore fonts.
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityOne option using titlesec
and TikZ
:
\documentclass{book}
\usepackage[explicit]{titlesec}
\usepackage{tikz}
\titleformat{\chapter}[display]
{\normalfont\Large\bfseries}
{}
{0pt}
{%
\begin{tikzpicture}
\node[draw,thick,rounded corners=15pt,,text width=\the\dimexpr\textwidth-12pt\relax,inner ysep=10pt]
(chaptitle)
{%
\\\parbox{3cm}{\centering\Huge \thechapter}%
\parbox{\dimexpr\linewidth-3cm\relax}{#1}%
};
\node[anchor=west,fill=white]
at ([xshift=15pt]chaptitle.north west) {\chaptertitlename};
\end{tikzpicture}%
}
\titleformat{name=\chapter,numberless}[display]
{\normalfont\Large\bfseries}
{}
{0pt}
{%
\begin{tikzpicture}
\node[draw,thick,rounded corners=15pt,,text width=\the\dimexpr\textwidth-12pt\relax,inner ysep=10pt]
(chaptitle)
{#1};
\end{tikzpicture}%
}
\begin{document}
\chapter*{Test unnumbered chapter}
\chapter{Test numbered chapter}
\end{document}
An image for an un numbered chapter:
An image for a numbered chapter:
titlesec
and TikZ.