Newt Color Bo

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

\chapterstyle{mystyle}

%command to print the acutal minitoc

\newcommand{\printmyminitoc}{\noindent\hspace{-2cm}\begin{tikzpicture}

\node[rounded corners,align=left,fill=yourcolor, blur shadow={shadow blur steps=5}, inner sep=5mm]


{%

\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}%

\begin{tikzpicture}[baseline={([yshift=-.6ex]current bounding box.center)}]

\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}

[]

%command to print the acutal minitoc

\newcommand{\printmyminitoc}{%

\noindent\hspace{-2cm}%

\colorlet{chpnumbercolor}{white}%
\begin{tikzpicture}

\node[rounded corners,align=left,fill=yourcolor, blur shadow={shadow blur steps=5}, inner sep=5mm]


{%

\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}{%

\raisebox{0pt}[13pt][3pt]{ \makebox[60pt]{% height, width

\fontfamily{phv}\selectfont\color{white}{\thesection}}

}}}%

{15pt}%

{ \color{myBlue}#1

\titlespacing*{\section}{0pt}{3mm}{5mm}

\begin{document}

\section{heading on level 1 (section)}

\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}

\item Hello \colorlet{sectioncolor}{Lavender!60}

\subsection{Foo}

\end{itemize}

\subsection{FooFoo}

\end{document}
Or assuming all section levels formatted by sectionlevelsformat should use nodes:

\documentclass[10pt,

numbers=noenddot% <- added

]{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{

section/.style={text=red,left color=red!20,right color=white},

subsection/.style={text=blue,left color=blue!20, right color=white},

subsubsection/.style={}

\makeatletter
\renewcommand\sectionlinesformat[4]{%

\tikz\node[

inner xsep=1em,inner ysep=1ex,

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}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy