Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.11 KB | None | 0 0
  1. documentclass[11pt]{book}
  2. usepackage[top=3cm,bottom=3cm,left=3.2cm,right=3.2cm,headsep=10pt,letterpaper]{geometry}
  3. usepackage[demo]{graphicx}
  4. usepackage{lipsum}
  5. usepackage{xcolor}
  6. definecolor{mybluei}{RGB}{52,177,201}
  7. definecolor{myblueii}{RGB}{63,200,244}
  8. definecolor{myblueiii}{RGB}{199,234,253}
  9. definecolor{ultramarine}{RGB}{0,45,97}
  10. usepackage{tikz}
  11. usetikzlibrary{shadows.blur}
  12. usetikzlibrary{shapes.symbols}
  13. usepackage{etoolbox,fancyhdr}
  14.  
  15. %======================================================================================
  16. % CHAPTER HEADINGS
  17. %======================================================================================
  18. usepackage[explicit,calcwidth]{titlesec}
  19.  
  20. makeatletter
  21. newcommand{thechapterimage}{}%
  22. newcommand{chapterimage}[1]{renewcommand{thechapterimage}{#1}}%
  23. def@makechapterhead#1{%
  24. {parindent z@ raggedright normalfont
  25. ifnum c@secnumdepth >m@ne
  26. if@mainmatter
  27. begin{tikzpicture}[remember picture,overlay]
  28. node at (current page.north west)
  29. {begin{tikzpicture}[remember picture,overlay]
  30. node[anchor=north west,inner sep=0pt] at (.2,0) {includegraphics[width=paperwidth]{thechapterimage}};
  31. draw[anchor=west] (Gm@lmargin+2.5cm,-4.79cm) node { %
  32. {begin{tikzpicture}
  33. node[draw=none,shade,
  34. top color=mybluei,
  35. bottom color=mybluei,
  36. rounded corners=6pt,
  37. blur shadow={shadow blur steps=6}
  38. ]{color{white}fontsize{50}{120}itshapermfamilychaptertitlenamehspace{2pt} selectfontthechapter};
  39. end{tikzpicture}}
  40. };
  41. end{tikzpicture}};
  42. end{tikzpicture}
  43. else
  44. begin{tikzpicture}[remember picture,overlay]
  45. node at (current page.north west)
  46. {begin{tikzpicture}[remember picture,overlay]
  47. node[anchor=north west,inner sep=0pt] at (.2,0) {includegraphics[width=paperwidth]{thechapterimage}};
  48. draw[anchor=west] (Gm@lmargin+1cm,-4.62cm) node { %
  49. parbox[b]{70pt}{colorbox{mybluei}{%
  50. parbox[b][60pt][t]{44pt}{centering%
  51. color{white}%
  52. {itshapermfamilysmallchaptertitlename}%
  53. vfill{fontsize{50}{120}selectfontthechapter}%
  54. }%
  55. }%
  56. }hspace{15pt}%
  57. parbox[b]{dimexprtextwidth-150pt}{%
  58. raggedrightscshape#1vskip6pt%
  59. }%
  60. };
  61. end{tikzpicture}};
  62. end{tikzpicture}
  63. fifiparvspace*{120p@}stepcounter{chapshift}}}
  64. makeatother
  65.  
  66. newcommandChapterFont{usefont{T1}{qhv}{b}{n}selectfonthuge}
  67. newcommandSectionFont{usefont{T1}{qhv}{b}{n}selectfont}
  68. titleformat{section}
  69. {normalfontSectionFontcolor{myblueii}}
  70. {colorbox{mybluei}{%
  71. parbox[c][16pt][c]{40pt}{%
  72. centeringtextcolor{white}{SectionFontLargethesection}%
  73. }%
  74. }%
  75. }
  76. {1em}
  77. {#1}
  78. [vspace{-1.2baselineskip}%
  79. color{myblueii}hspace*{dimexpr40pt+2fboxseprelax}%
  80. rule{dimexprtextwidth-40pt-2fboxseprelax}{1pt}%
  81. ]
  82.  
  83. %======================================================================================
  84. % CHAPTER THUMB
  85. %======================================================================================
  86. usetikzlibrary{calc}
  87. pagestyle{plain}
  88. newcounter{chapshift}
  89. addtocounter{chapshift}{-1}
  90. newcommandBoxColor{%
  91. ultramarine}
  92.  
  93. %======================================================================================
  94. % PAGE HEADERS
  95. %======================================================================================
  96. defsubsectiontitle{}
  97. renewcommand{sectionmark}[1]{markright{sffamilynormalsize#1}{}}
  98. renewcommand{subsectionmark}[1]{defsubsectiontitle{#1}}
  99. pagestyle{fancy}
  100. renewcommand{headrule}{{color{myblueii}%
  101. hrule widthheadwidth heightheadrulewidth depthheadrulewidth}}
  102. renewcommand{chaptermark}[1]{markboth{normalsizebfseries #1}{}}
  103. renewcommand{sectionmark}[1]{markright{sffamilynormalsize#1}{}}
  104. fancyhf{} fancyhead[LE,RO]{normalsizecolorbox{myblueii}{color{white}sffamilybfseriesstrutquadthepagequad}}
  105. fancyhead[LO]{textcolor{mybluei} rightmark%
  106. begin{tikzpicture}[overlay,remember picture]
  107. node[fill=BoxColor,inner sep=0pt,rectangle,text width=1cm,
  108. text height=4cm,align=center,anchor=north east]
  109. at ($ (current page.north east) + (-0cm,-2*thechapshift cm) $)
  110. {rotatebox{90}{parbox{4cm}{%
  111. centeringtextcolor{white}{bfseriesscshaperightmark \ sffamilysubsectiontitle}}}};
  112. end{tikzpicture}}
  113. fancyhead[RE]{Testing Book%
  114. begin{tikzpicture}[overlay,remember picture]
  115. node[fill=BoxColor,inner sep=0pt,rectangle,text width=1cm,
  116. text height=4cm,align=center,anchor=north west]
  117. at ($ (current page.north west) + (-0cm,-2*thechapshift cm) $)
  118. {rotatebox{90}{parbox{4cm}{%
  119. centeringtextcolor{white}{bfseriesscshaperightmark \ sffamilysubsectiontitle}}}};
  120. end{tikzpicture}}
  121. renewcommand{headrulewidth}{.5pt}
  122. addtolength{headheight}{2.5pt}
  123. newcommand{footrulecolor}[1]{patchcmd{footrule}{hrule}{color{#1}hrule}{}{}}
  124. renewcommand{headrulewidth}{.5pt}
  125. addtolength{headheight}{2.5pt}
  126. renewcommand{footrulewidth}{.5pt}
  127.  
  128. fancypagestyle{plain}{%
  129. fancyhf{}
  130. renewcommand{headrulewidth}{0pt}
  131. renewcommand{footrulewidth}{0pt}
  132. }
  133.  
  134. makeatletter
  135. renewcommand{cleardoublepage}{
  136. clearpageifoddc@pageelse
  137. hbox{}
  138. vspace*{fill}
  139. thispagestyle{empty}
  140. newpage
  141. fi}
  142. makeatother
  143.  
  144. begin{document}
  145. chapterimage{bishade}
  146. chapter{Testing}
  147. section{Test One}
  148. lipsum[1-2]
  149. section{Test Two}
  150. lipsum[1-2]
  151. chapter{Testing Three}
  152. section{Test Four}
  153. lipsum[1-2]
  154. section{Test Two}
  155. lipsum[1]
  156. newpage
  157. section{Test Two}
  158. lipsum[1]
  159.  
  160. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement