Newt Color Bo
Newt Color Bo
Newt Color Bo
\newcommand{\printmyminitoc}{\noindent\hspace{-2cm}\begin{tikzpicture}
\color{white}%
\begin{minipage}{8cm}%minipage trick
\printcontents[chapters]{}{1}{}
\end{minipage}};
\end{tikzpicture}}
\begin{document}
\tableofcontents
\chapter{A chapter}
\startcontents[chapters]
%print minitoc
\printmyminitoc
\section{Section}
\lipsum[1]
\section{Section 2}
\section{test}
\section{abc}
\lipsum
\chapter{Second chapter}
\end{document}
Here a quick demo with the book class. You might want to adjust the page borders. To color the page
numbers in the mini toc, I used the method described at
https://tex.stackexchange.com/a/186757/10117.
\documentclass[twoside]{book}
\usepackage{tikz}
\usetikzlibrary{shadows.blur}
\usepackage{titletoc}
\usepackage{lipsum}
\usepackage{calc}
\usepackage[]{titlesec}
\definecolor{yourcolor}{HTML}{008bb2}
\colorlet{chpnumbercolor}{black}
\makeatletter
\let\oldl@chapter\l@chapter
\def\l@chapter#1#2{\oldl@chapter{#1}{\textcolor{chpnumbercolor}{#2}}}
\let\old@dottedcontentsline\@dottedtocline
\def\@dottedtocline#1#2#3#4#5{%
\old@dottedcontentsline{#1}{#2}{#3}{#4}{{\textcolor{chpnumbercolor}{#5}}}}
\makeatother
\titleformat{\chapter}[display]
{\normalfont\color{yourcolor}}
{\filleft\Huge\sffamily\bfseries\chaptertitlename\hspace*{2mm}%
\node[fill=yourcolor,circle,text=white] {\thechapter};
\end{tikzpicture}}
{1ex}
{\titlerule[1.5pt]\vspace*{5ex}\huge\sffamily\itshape}
[]
\titleformat{name=\chapter,numberless}[display]
{\normalfont\color{yourcolor}}
{}
{1ex}
{\vspace*{5ex}\huge\sffamily\itshape}
[]
\newcommand{\printmyminitoc}{%
\noindent\hspace{-2cm}%
\colorlet{chpnumbercolor}{white}%
\begin{tikzpicture}
\color{white}%
\begin{minipage}{8cm}%minipage trick
\printcontents[chapters]{}{1}{}
\end{minipage}};
\end{tikzpicture}}
\begin{document}
\tableofcontents
\chapter{A chapter}
\startcontents[chapters]
%print minitoc
\printmyminitoc
\section{Section}
\lipsum[1]
\section{Section 2}
\section{test}
\section{abc}
\lipsum
\chapter{Second chapter}
\end{document}
_____
\newtcolorbox{mycolorbox}[1]{
enhanced,
breakable,
title=#1,
colback=white,
colbacktitle=green!20!white,
coltitle=black,
fonttitle=\bfseries,
boxrule=.5pt,
arc=0pt,
outer arc=0pt,
colframe=yellow!80!orange,
borderline west={2pt}{0pt}{red} }
\begin{document}
\begin{mycolorbox}{Remarque}
\lipsum[1]
\end{mycolorbox}
\end{document}
Mise en forme section
\documentclass{article}
\usepackage{lipsum}
\usepackage{xcolor}
\renewcommand*\thesection{\arabic{section}}
\usepackage[explicit]{titlesec}
\definecolor{myBlue}{HTML}{0088FF}
\titleformat{\section}[hang]{\Large\bfseries\sffamily}%
{\rlap{\color{myBlue}\rule[-6pt]{\textwidth}{1.2pt}}\colorbox{myBlue}{%
\fontfamily{phv}\selectfont\color{white}{\thesection}}
}}}%
{15pt}%
{ \color{myBlue}#1
\titlespacing*{\section}{0pt}{3mm}{5mm}
\begin{document}
\lipsum[1]
\end{document}
documentclass[a4paper]{scrartcl}
\usepackage[dvipsnames, table]{xcolor}
\colorlet{sectioncolor}{blue}
\makeatletter
\renewcommand\sectionlinesformat[4]{%
\colorbox{sectioncolor}{%
\parbox[t]{\dimexpr\linewidth-2\fboxsep\relax}{%
\raggedsection\color{white}\@hangfrom{#3}{#4}%
}}}
\makeatother
\begin{document}
\section{Hello}
\begin{itemize}
\subsection{Foo}
\end{itemize}
\subsection{FooFoo}
\end{document}
Or assuming all section levels formatted by sectionlevelsformat should use nodes:
\documentclass[10pt,
]{scrreprt}%scrartcl,scrreprt,scrbook
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\renewcommand*\thesection{\arabic{section}}
\renewcommand*\sectionformat{\thesection.\enskip}
\renewcommand*\thesubsubsection{(\alph{subsubsection})}
\setcounter{secnumdepth}{\subsubsectionnumdepth}
\RedeclareSectionCommands[font=\normalsize]{section,subsection,subsubsection}
\tikzset{
subsubsection/.style={}
\makeatletter
\renewcommand\sectionlinesformat[4]{%
\tikz\node[
rounded corners,
#1
]{\parbox{\dimexpr\textwidth-2em\relax}{\raggedsection\@hangfrom{\hspace*{#2}#3}{#4}}};
\makeatother
\begin{document}
\section{section}
\subsection{subsection}
\subsubsection{subsubsection}
\end{document}