How can I display \section in a colored background that starts on one side of the page (odd pages = left and even pages = right) as in the image below.
Edit
From this code:
\documentclass{book}
\usepackage{xcolor}
\usepackage{titlesec}
\definecolor{mygreen}{RGB}{204,226,158}
\titleformat{\section}[hang]{\scshape\Large{\rlap{\color{mygreen}\rule[-2.3ex]{\linewidth}{6ex}\vspace{-4.5ex}}}}{\thesection}{1em}{}
\usepackage[a4paper,
inner=20mm,
outer=60mm,
top=25mm,
bottom=25mm,
marginparsep=5mm,
marginparwidth=50mm,
headsep =35pt,
]{geometry}
\usepackage{showframe}
\begin{document}
\section{Introduction}
\end{document}



\section? Or what else? Please show a minimal working example of what you've already tried. Currently we even do not know, which class you are using. There are different book doc classes, e.g., the standard document classbook, but alsomemoiris IMHO a book class,scrbookis a book class, and many more. – cabohah Jul 31 '23 at 08:54\titleformat? Part of your problem is that "stretching" suggests (to me) something like a rubber band, so that the content will also be distorted. I don't think you're looking for that. Just saying "look at the picture" doesn't really help. – Teepeemm Jul 31 '23 at 19:27