Is it possible to customize chapter style like below picture by using tcolorbox package? if not, can you show me which package could generate that such style? Thanks
[Tex/LaTex] chapter style with tcolorbox
tcolorbox
Related Solutions
Use two minipage
s and load the capt-of
package to write the caption through the command \captionof
\documentclass[demo]{report}
\usepackage{blindtext}
\usepackage{geometry}
\usepackage{float}
\usepackage[italian]{babel}
\usepackage[most]{tcolorbox}
\usepackage{tikz}
\usepackage{varwidth}
\usepackage{capt-of}
\tcbset{enhanced,colback=cyan!5!white,colframe=cyan!75!black,fonttitle=\bfseries}
\begin{document}
\begin{tcolorbox}[every float=\centering, drop shadow, title=Esempio: misura della carica elettrica]
\begin{minipage}[t]{0.5\linewidth}
\vspace*{0pt}
\blindtext
\end{minipage}\hfill%
\begin{minipage}[t]{0.4\linewidth}
\vspace*{0pt}
\includegraphics[height=0.6\textheight,width=\linewidth]{fig1}
\captionof{figure}{Misura della carica elettrica}\label{fig:fig1}
\end{minipage}
\end{tcolorbox}
\end{document}
I think it will be useful if I answer my own question. Here is a piece of code that does the job :
\begin{tcolorbox}[breakable,enhanced jigsaw,title={Table },fonttitle=\bfseries\Large,
colback=yellow!10!white,colframe=red!50!black,before=\par\bigskip\noindent,
interior style={fill overzoom image=goldshade.png,fill image opacity=0.25},
colbacktitle=red!50!yellow!75!black,
enlargepage flexible=\baselineskip,pad at break*=3mm,
height fixed for=first and middle,
watermark color=yellow!75!red!25!white,
watermark text={\bfseries\Large Contents},
attach boxed title to top center={yshift=-0.25mm-\tcboxedtitleheight/2,yshifttext=2mm-\tcboxedtitleheight/2},
boxed title style={enhanced,boxrule=0.5mm,
frame code={ \path[tcb fill frame] ([xshift=-4mm]frame.west) -- (frame.north west)
-- (frame.north east) -- ([xshift=4mm]frame.east)
-- (frame.south east) -- (frame.south west) -- cycle; },
interior code={ \path[tcb fill interior] ([xshift=-2mm]interior.west)
-- (interior.north west) -- (interior.north east)
-- ([xshift=2mm]interior.east) -- (interior.south east) -- (interior.south west)
-- cycle;} },
drop fuzzy shadow]
\makeatletter
\@starttoc{toc} % Replace it with \@starttoc{lot} for tables and \@starttoc{lof} for figures.
\makeatother
\end{tcolorbox}
Best Answer
Here's one possibility using
tcolorbox
andtitlesec
. An image for an unnumbered chapter:An image for a numbered chapter:
The code: