How can I use latex tikz package to design the style that is seen in the picture?
1 Answer
Here is a solution using titlesec
, xcolor
, colortbl
, geometry
and lettrine
(this last one only for my pleasure…). I was unsure whether the light blue background was also required, so there's none in my code, but that can be changed:
\documentclass[12pt]{book}
\usepackage[utf8]{inputenc}
\usepackage{microtype}
\usepackage[garamond]{mathdesign}
\usepackage{garamondx}%%
\usepackage[x11names]{xcolor}
\usepackage{tabularx, colortbl}
\usepackage{geometry}
\usepackage{titlesec}%
\usepackage{lettrine}
\renewcommand\LettrineFontHook{\fontfamily{EBGaramondInitials-TLF}\color{titlecolour}}
\colorlet{titlecolour}{Cyan4!85!}
\newlength\labelframewd
\settowidth{\labelframewd}{\lsstyle\scshape\small\MakeLowercase{\chaptername}}
\newsavebox\chaplabelbox%
\newcommand\chaplabel{\color{titlecolour}%
\begin{tabularx}{\linewidth}{c@{\enspace}X}
\lsstyle\scshape\small\MakeLowercase{\chaptername}\\
\cellcolor{titlecolour}\raisebox{-1ex}[5ex][20ex]{\color{black}\bfseries\fontsize{36}{40}\selectfont\thechapter} & \titlerule[3pt]
\end{tabularx}
}%
\titleformat{\chapter}[display]{\centering}
{\setlength{\tabcolsep}{0pt} \smash{\chaplabel}}%
{2ex}
{\thispagestyle{empty}\vskip-10ex\hskip\labelframewd\fontsize{28}{32}\selectfont\bfseries}%
\titlespacing{\chapter}{0pt}{1.25\baselineskip}{10\baselineskip}
\renewcommand*\thechapter{\arabic{chapter}}
\begin{document}
\chapter{Tweedledee \& Tweedledum}
\lettrine{T}{ext} text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.
\end{document}
-
When I applied your code, the word "CHAPTER", that is above the chapter number, does not appear. would you please help in this?– MAabsiCommented Aug 31, 2014 at 9:38
-
??? I suppose you inserted my proposed code inside a code of yours. Could I have a minimal (non-)working example. Also, just to test, in the definition of the label, replace the line:
\lsstyle\scshape\small\MakeLowercase{\chaptername}\\
with the simpler\small\textsc{chapter}\\
.– BernardCommented Aug 31, 2014 at 9:49 -
No, really I run your code as it. The same problem when I modified your suggestion.– MAabsiCommented Aug 31, 2014 at 9:59
-
That seems to be tough! Would you test: 1) not loading the fonts (i.e. sticking to the default Computer Modern) and 2) adding something like
\color{red}
just beforechapter
(or\chaptername
). I suspect that, for some reason, the word ‘chapter’ could be inside the frame, and of the same colour.– BernardCommented Aug 31, 2014 at 10:09 -