The following block of code doesn't seem to do anything when I define it in a custom class. But when I use the class but put this block in my preamble, it works as expected.
\titleformat{\chapter}
{\normalfont\sffamily\Huge\scshape}
{}{0pt}
{\begin{tikzpicture}[remember picture,overlay]
\node[yshift=-3cm] at (current page.north west)
{\begin{tikzpicture}[remember picture, overlay]
\draw[fill=cyan] (0,-1) rectangle
(\paperwidth,3cm);
\node[anchor=west,xshift=.21\paperwidth,yshift=-.01\paperheight,rectangle]
{\color{white}\LARGE CHAPTER \Huge\thechapter};
\node[anchor=west,xshift=.21\paperwidth,yshift=-.065\paperheight,rectangle]
{\color{cyan}\Huge\MakeUppercase{#1}};
\end{tikzpicture}
};
\end{tikzpicture}
}
Here's my class file:
\LoadClass[10pt,letterpaper,oneside]{book}
\let\cleardoublepage\clearpage
\RequirePackage[left=2.25in,right=0.75in,top=1.5in,bottom=1.5in]{geometry}
\RequirePackage{graphicx}
\RequirePackage[hidelinks]{hyperref}
\RequirePackage{amsthm, amsfonts, amsmath}
\RequirePackage{thmtools}
\RequirePackage{paralist}
\RequirePackage{tikz}
\RequirePackage[explicit]{titlesec}
\RequirePackage{blindtext, xcolor}
\RequirePackage[T1]{fontenc}
\RequirePackage{mdframed}
\RequirePackage{DejaVuSansCondensed}
\RequirePackage[normalem]{ulem}
\titleformat{\chapter}
{\normalfont\sffamily\Huge\scshape}
{}{0pt}
{\begin{tikzpicture}[remember picture,overlay]
\node[yshift=-3cm] at (current page.north west)
{\begin{tikzpicture}[remember picture, overlay]
\draw[fill=cyan] (0,-1) rectangle
(\paperwidth,3cm);
\node[anchor=west,xshift=.21\paperwidth,yshift=-.01\paperheight,rectangle]
{\color{white}\LARGE CHAPTER \Huge\thechapter};
\node[anchor=west,xshift=.21\paperwidth,yshift=-.065\paperheight,rectangle]
{\color{cyan}\Huge\MakeUppercase{#1}};
\end{tikzpicture}
};
\end{tikzpicture}
}
\titlespacing*{\chapter}{0pt}{50pt}{0pt}{}
\titleformat{\section}{\color{cyan}\itshape\LARGE}{\llap{\thesection} #1}{1em}{}
\titleformat{\subsection}{\color{cyan}\normalfont\Large}{\; #1}{1em}{}
\renewcommand*\familydefault{\sfdefault}
% Custom Theorem - Example
\declaretheoremstyle[%
within=section,%
spaceabove=5mm,%
spacebelow=0mm%,
headfont=\bfseries,%
headpunct={},%
postheadspace=\newline,%
notefont=\normalfont\itshape,%
notebraces={--~}{},% punctuation before and after the note
]{examplestyle}
\declaretheorem[style=examplestyle,name=Example]{myex}
% Alter spacing after chapter title
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{\chaptertitlename~\thechapter}{20pt}{\Huge}
\titlespacing*{\chapter}{0pt}{50pt}{40pt}
\titlespacing*{name=\chapter,numberless}{0pt}{50pt}{40pt}
\declaretheoremstyle[
within=section,
spaceabove=10mm,
spacebelow=3mm,
headfont=\color{cyan}\normalfont,
notefont=\normalfont,
bodyfont=\itshape,
headpunct=\newline\newline,
%postheadspace={10pt},
notebraces={}{},
headformat={%
\makebox[-15pt][r]{\normalfont\large\NAME\ \NUMBER\;\;\;\;}\setbox0\hbox{\ }\hspace{-\the\wd0}\large\NOTE%
},
]{theorem}
\declaretheorem[style=theorem]{theorem}
\declaretheorem[style=theorem]{definition}
\declaretheorem[style=theorem]{example}
\declaretheoremstyle[
within=section,
spaceabove=10mm,
spacebelow=3mm,
headfont=\color{cyan}\normalfont,
notefont=\normalfont,
bodyfont=\itshape,
headpunct=\newline\newline,
%postheadspace={10pt},
notebraces={}{},
headformat={%
\makebox[-10pt][r]{}\setbox0\hbox{\ }\hspace{-\the\wd0}\large\NAME%
},
]{proof}
\let\proof\relax
\declaretheorem[style=proof,qed=\qedsymbol,name=Proof]{proof}
\declaretheorem[style=proof,qed=\qedsymbol,name=Solution]{solution}
\AtBeginDocument{...}. – Werner Jan 30 at 4:40