I came across a website where i found this attractive design for chapter titles and sections.
https://webusers.imj-prg.fr/~leonardo.zapponi/leo_divers/Agreg/Matrices_normales.pdf
Here's my attempt at reproducing it
\documentclass[12pt,a4paper]{report}
\usepackage{tikz}
\tikzstyle{a} = [text width=\textwidth-1cm,rectangle,draw=orange,rounded corners=2mm,line width=1pt,fill=orange!5,minimum width=\textwidth,align=left,inner sep=5mm]
\tikzstyle{b} = [rectangle,draw,rounded corners=2mm,line width=.5pt,fill=orange!25,minimum height=0mm,align=left,inner sep=2mm,font=\bfseries]
\def\titlebox#1#2{%
\begin{tikzpicture}
\node[a](a){#2};
\node[b,right=3mm](b) at (a.north west){#1};
\node[b,left=3mm](b) at (a.south east){2015-2016};
\end{tikzpicture}
}
\def\lembox#1#2{%
\begin{tikzpicture}
\node[a](a){#2};
\node[b,right=3mm](b) at (a.north west){#1};
\end{tikzpicture}
}
\parindent=0mm
\begin{document}
\titlebox{title}{
text
}
\lembox{title}{text}
\end{document}
which produce:
How can I improve my code to produce the same images
Best Answer
Some code to start working. It mixes
tcolorbox
for lemmas and chapter title andtikzpictures
for sections. Some comments before adopting it. I don't know how to pass parameters totitleformat
then title box additions are fixed inside chapter style. These additions are made one withtitle
option and date with aoverlayed
node. They have different format which you should correct. I didn't adjusted lines between tikz and tcolorbox, therefore, section's lines and lemmas and chapter frames are different. You should also adjust them.I've taken some ideas from Gonzalo's answers to chapter style with tcolorbox? and Symbol or image behind heading