I have change the \chapter
section definition but in some chapters of the book I don't want to apply it. For example, in the code below I don't want to apply in \EjerPro
. How can I do it?
\documentclass[openany]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[spanish,es-lcroman]{babel}
\usepackage[hmargin=2cm,tmargin=4cm,bmargin=2.5cm,centering]{geometry}
\usepackage[demo]{graphicx}
\usepackage{kpfonts}
\usepackage[pagestyles,explicit]{titlesec}
\usepackage{xcolor}
\usepackage{polynom}
\usepackage{enumitem}
\usepackage[absolute]{textpos}
\usepackage{lipsum}
\definecolor{seccolor}{RGB}{255,204,102}% para las secciones
\definecolor{ssseccolor}{RGB}{255,233,190}% para las subsubsecciones
\definecolor{probcolor}{RGB}{159,209,139}% para los problemas
\definecolor{rptacolor}{RGB}{214,234,204}% para las respuestas
\newcommand\EjerPro{%
\chapter*{\colorbox{probcolor}{\parbox{\dimexpr\linewidth-6pt}{\hfil \LARGE\strut EJERCICIOS Y PROBLEMAS\hfil}}}
}
\usepackage{tikz}
\usepackage{kpfonts}
\usepackage[explicit]{titlesec}
\newcommand*\chapterlabel{}
\titleformat{\chapter}
{\gdef\chapterlabel{}
\normalfont\sffamily\Huge\bfseries\scshape}
{\gdef\chapterlabel{\thechapter\ }}{0pt}
{\begin{tikzpicture}[remember picture,overlay]
\node[yshift=-3cm] at (current page.north west)
{\begin{tikzpicture}[remember picture, overlay]
\draw[fill=seccolor] (0,0) %rectangle
(\paperwidth,3cm);
\node[anchor=east,xshift=.9\paperwidth,rectangle,
inner sep=11pt,
fill=seccolor]
{\color{black}\chapterlabel#1};
\end{tikzpicture}
};
\end{tikzpicture}
}
\titlespacing*{\chapter}{0pt}{50pt}{-60pt}
\begin{document}
\chapter{Expresiones algebraicas}
\lipsum[1-5]
\EjerPro
\lipsum[1-5]
\end{document}