0

Here's what I've done:

\ovalbox{\colorbox{cyan!26}{ 
%   \begin{minipage}{15cm} 
%           \large
%               \centering
%               \vspace{0.1cm}
%       \textbf{INTRODUCTION GENERALE }
%   \end{minipage} 
%}}
%\end{center}

It works only for text, but not for sections, chapters and so on.

Markus G.
  • 2,735
kaldor
  • 9

1 Answers1

1

Like this, which is basically a combination of this: https://tex.stackexchange.com/a/568900/118712 and this: https://tex.stackexchange.com/a/389833/118712

I also added some modifications for your re-naming of the toc and bib chapter titles.

\documentclass[12pt,a4paper,listof=totocnumbered]{scrreprt}

\usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[french]{babel} \usepackage[width=17.00cm, height=23.00cm]{geometry} \usepackage{setspace} \renewcommand{\baselinestretch}{1.5} \usepackage{times} \usepackage{tikz}

\addto\captionsfrench{\renewcommand{\bibname}{Références bibliographiques}} \addto\captionsfrench{\renewcommand{\contentsname}{Sommaire}}

\usepackage[most]{tcolorbox}

\makeatletter \renewcommand*{\chapterlinesformat}[3]{% \tcbox[on line, boxsep=4pt,left=4pt,right=0pt,top=0pt,bottom=0pt,colframe=blue,colback=cyan!26,arc=5mm]{ \parbox{\dimexpr\linewidth-2\fboxsep}{\raggedchapter @hangfrom{\strut#2}{#3}% }% }% }

\renewcommand*{\sectionlinesformat}[4]{% \tcbox[on line, boxsep=4pt,left=4pt,right=0pt,top=0pt,bottom=0pt,colframe=green,colback=red,arc=5mm]{% \parbox{\dimexpr\linewidth-2\fboxsep-2\fboxrule}{\raggedsection @hangfrom{\strut\hskip #2#3}{#4}% }% }% } \makeatother

\begin{document} \tableofcontents \addchap[Introduction generale]{\scshape Introduction} \addsec{I -- contexte et justification } \addsec{objectifs} \chapter{début} \section{title} \end{document}

enter image description here

Markus G.
  • 2,735