# Explanation of code using \titleformat [closed]

I am writing a project in latex and to make my output pdf look more fancy i am using a "Fancy chapter headings with TikZ" code found here http://texblog.net/latex-archive/layout/fancy-chapter-tikz/ (thx to author). But the thing is I don't want to just use it, I also want to understand it. I have never used titlesec package before so that's why i need your help. Can you give some short explanation to every line or at least answer some additional questions i have put in comments?Those are more imporatnt :) I will really appreciate your help and effort.

THANK YOU

Here's the code from that page:

\documentclass[svgnames]{report}
\usepackage{tikz}
\usepackage{kpfonts}
\usepackage[explicit]{titlesec}

%EXPLANATION FROM HERE
\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) % why is here used current page.north west?
{\begin{tikzpicture}[remember picture, overlay]
\draw[fill=LightSkyBlue] (0,0) rectangle
(\paperwidth,3cm);
\node[anchor=east,xshift=.9\paperwidth,rectangle,
rounded corners=20pt,inner sep=11pt,
fill=MidnightBlue]
{\color{white}\chapterlabel#1}; %why is here used argument by \chapterlabel?
\end{tikzpicture}
};
\end{tikzpicture}
}
\titlespacing*{\chapter}{0pt}{50pt}{-60pt}

%TO HERE

\begin{document}
\tableofcontents
\chapter{Introduction}
Text
\chapter{Main}
\section{Section}
Text
\begin{thebibliography}{99}
\bibitem{Test} test reference
\end{thebibliography}
\end{document}

-
Did you red the titlesec manual (e.g. via texdoc titlesec in your terminal / command line)? It should tell you more about the right usage. I think it’s not sense of this site to rephrase manuals ;-) –  Tobi Apr 24 '12 at 10:18
@Jake - thx for the \newcommand* @ Tobi i am not asking for a complete explanation from manuals just short one for quick understanding cuz i really have no time to study manuals. But thank you anyway ;) –  KvJohn Apr 24 '12 at 12:23
Thank you very much. And can you pls tell me how is this last argument by \chapterlabel used?What preferences is this arg. calling? –  KvJohn May 7 '12 at 8:39
show 1 more comment

## closed as not a real question by Marco Daniel, lockstep, egreg, Joseph Wright♦Jun 3 '12 at 12:59

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.