Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass[11pt]{book}
- usepackage[top=3cm,bottom=3cm,left=3.2cm,right=3.2cm,headsep=10pt,letterpaper]{geometry}
- usepackage[demo]{graphicx}
- usepackage{lipsum}
- usepackage{xcolor}
- definecolor{mybluei}{RGB}{52,177,201}
- definecolor{myblueii}{RGB}{63,200,244}
- definecolor{myblueiii}{RGB}{199,234,253}
- definecolor{ultramarine}{RGB}{0,45,97}
- usepackage{tikz}
- usetikzlibrary{shadows.blur}
- usetikzlibrary{shapes.symbols}
- usepackage{etoolbox,fancyhdr}
- %======================================================================================
- % CHAPTER HEADINGS
- %======================================================================================
- usepackage[explicit,calcwidth]{titlesec}
- makeatletter
- newcommand{thechapterimage}{}%
- newcommand{chapterimage}[1]{renewcommand{thechapterimage}{#1}}%
- def@makechapterhead#1{%
- {parindent z@ raggedright normalfont
- ifnum c@secnumdepth >m@ne
- if@mainmatter
- begin{tikzpicture}[remember picture,overlay]
- node at (current page.north west)
- {begin{tikzpicture}[remember picture,overlay]
- node[anchor=north west,inner sep=0pt] at (.2,0) {includegraphics[width=paperwidth]{thechapterimage}};
- draw[anchor=west] (Gm@lmargin+2.5cm,-4.79cm) node { %
- {begin{tikzpicture}
- node[draw=none,shade,
- top color=mybluei,
- bottom color=mybluei,
- rounded corners=6pt,
- blur shadow={shadow blur steps=6}
- ]{color{white}fontsize{50}{120}itshapermfamilychaptertitlenamehspace{2pt} selectfontthechapter};
- end{tikzpicture}}
- };
- end{tikzpicture}};
- end{tikzpicture}
- else
- begin{tikzpicture}[remember picture,overlay]
- node at (current page.north west)
- {begin{tikzpicture}[remember picture,overlay]
- node[anchor=north west,inner sep=0pt] at (.2,0) {includegraphics[width=paperwidth]{thechapterimage}};
- draw[anchor=west] (Gm@lmargin+1cm,-4.62cm) node { %
- parbox[b]{70pt}{colorbox{mybluei}{%
- parbox[b][60pt][t]{44pt}{centering%
- color{white}%
- {itshapermfamilysmallchaptertitlename}%
- vfill{fontsize{50}{120}selectfontthechapter}%
- }%
- }%
- }hspace{15pt}%
- parbox[b]{dimexprtextwidth-150pt}{%
- raggedrightscshape#1vskip6pt%
- }%
- };
- end{tikzpicture}};
- end{tikzpicture}
- fifiparvspace*{120p@}stepcounter{chapshift}}}
- makeatother
- newcommandChapterFont{usefont{T1}{qhv}{b}{n}selectfonthuge}
- newcommandSectionFont{usefont{T1}{qhv}{b}{n}selectfont}
- titleformat{section}
- {normalfontSectionFontcolor{myblueii}}
- {colorbox{mybluei}{%
- parbox[c][16pt][c]{40pt}{%
- centeringtextcolor{white}{SectionFontLargethesection}%
- }%
- }%
- }
- {1em}
- {#1}
- [vspace{-1.2baselineskip}%
- color{myblueii}hspace*{dimexpr40pt+2fboxseprelax}%
- rule{dimexprtextwidth-40pt-2fboxseprelax}{1pt}%
- ]
- %======================================================================================
- % CHAPTER THUMB
- %======================================================================================
- usetikzlibrary{calc}
- pagestyle{plain}
- newcounter{chapshift}
- addtocounter{chapshift}{-1}
- newcommandBoxColor{%
- ultramarine}
- %======================================================================================
- % PAGE HEADERS
- %======================================================================================
- defsubsectiontitle{}
- renewcommand{sectionmark}[1]{markright{sffamilynormalsize#1}{}}
- renewcommand{subsectionmark}[1]{defsubsectiontitle{#1}}
- pagestyle{fancy}
- renewcommand{headrule}{{color{myblueii}%
- hrule widthheadwidth heightheadrulewidth depthheadrulewidth}}
- renewcommand{chaptermark}[1]{markboth{normalsizebfseries #1}{}}
- renewcommand{sectionmark}[1]{markright{sffamilynormalsize#1}{}}
- fancyhf{} fancyhead[LE,RO]{normalsizecolorbox{myblueii}{color{white}sffamilybfseriesstrutquadthepagequad}}
- fancyhead[LO]{textcolor{mybluei} rightmark%
- begin{tikzpicture}[overlay,remember picture]
- node[fill=BoxColor,inner sep=0pt,rectangle,text width=1cm,
- text height=4cm,align=center,anchor=north east]
- at ($ (current page.north east) + (-0cm,-2*thechapshift cm) $)
- {rotatebox{90}{parbox{4cm}{%
- centeringtextcolor{white}{bfseriesscshaperightmark \ sffamilysubsectiontitle}}}};
- end{tikzpicture}}
- fancyhead[RE]{Testing Book%
- begin{tikzpicture}[overlay,remember picture]
- node[fill=BoxColor,inner sep=0pt,rectangle,text width=1cm,
- text height=4cm,align=center,anchor=north west]
- at ($ (current page.north west) + (-0cm,-2*thechapshift cm) $)
- {rotatebox{90}{parbox{4cm}{%
- centeringtextcolor{white}{bfseriesscshaperightmark \ sffamilysubsectiontitle}}}};
- end{tikzpicture}}
- renewcommand{headrulewidth}{.5pt}
- addtolength{headheight}{2.5pt}
- newcommand{footrulecolor}[1]{patchcmd{footrule}{hrule}{color{#1}hrule}{}{}}
- renewcommand{headrulewidth}{.5pt}
- addtolength{headheight}{2.5pt}
- renewcommand{footrulewidth}{.5pt}
- fancypagestyle{plain}{%
- fancyhf{}
- renewcommand{headrulewidth}{0pt}
- renewcommand{footrulewidth}{0pt}
- }
- makeatletter
- renewcommand{cleardoublepage}{
- clearpageifoddc@pageelse
- hbox{}
- vspace*{fill}
- thispagestyle{empty}
- newpage
- fi}
- makeatother
- begin{document}
- chapterimage{bishade}
- chapter{Testing}
- section{Test One}
- lipsum[1-2]
- section{Test Two}
- lipsum[1-2]
- chapter{Testing Three}
- section{Test Four}
- lipsum[1-2]
- section{Test Two}
- lipsum[1]
- newpage
- section{Test Two}
- lipsum[1]
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement