#StackBounty: #chapters #tikz-styles Lines from Chapter Thumb using Tikz

Bounty: 50

in the code given below for placing a chapter thumb, I wanted to modify the simple rectangular box to give this as the new chapter thumb:

enter image description here

Here is the code that I have so far:

CODE

documentclass{book}
usepackage[T1]{fontenc}
usepackage{lmodern}
usepackage{tikz}
usepackage{lipsum}
usepackage{xcolor}
usepackage{geometry}
usepackage{atveryend}%%%% <--- !
usepackage{etoolbox,fancyhdr}
usepackage{fourier}

usetikzlibrary{calc}

definecolor{ultramarine}{RGB}{0,45,97}
definecolor{mybluei}{RGB}{0,173,239}
definecolor{line}{RGB}{70,160,216}
definecolor{fillh}{RGB}{225,233,251}

renewcommand{headrulewidth}{0pt}
newcommandhdheight{1in}

%======================================================================================
%   CHAPTER THUMB
%======================================================================================
defsubsectiontitle{}
renewcommand{sectionmark}[1]{markright{sffamilynormalsize#1}{}}
renewcommand{subsectionmark}[1]{defsubsectiontitle{#1}}


usetikzlibrary{tikzmark,calc,arrows,shapes,decorations.pathreplacing,pgfplots.groupplots, matrix}
tikzset{every picture/.style={remember picture}}
pagestyle{plain}

% auxiliary counter
newcounter{chapshift}
addtocounter{chapshift}{-1}

% the list of colors to be used (add more if needed)
newcommandBoxColor{%
  %ifcasethechapshift blue!30or red!30or olive!30or magenta!30else yellow!30fi}
  ultramarine}

pagestyle{fancy}
renewcommand{chaptermark}[1]{markboth{#1}{}}
fancyhf{}
fancyhead[E]{%
begin{tikzpicture}[overlay, remember picture]%
    fill[fillh] (current page.north west) rectangle ($(current page.north east)+(0,-hdheight)$);
    draw[line] ([yshift=-hdheight]current page.north west) -- ([yshift=-hdheight]current page.north east);
    node[anchor=south west, font=sffamily, text width=1cm] (evenpagenum) at ($(current page.north west)+(.5hdheight,-hdheight)$) {thepage};
    node[anchor=south west, text width=1.5cm, text=white, font=fontsize{2cm}{5.5cm}selectfont] (chapter) at (evenpagenum.south east) {thechapter};
    node[anchor=south west] at (chapter.south east) {leftmark};
    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[O]{%
begin{tikzpicture}[overlay, remember picture]%
    fill[fillh] (current page.north west) rectangle ($(current page.north east)+(0,-hdheight)$);
    draw[line] ([yshift=-hdheight]current page.north west) -- ([yshift=-hdheight]current page.north east);
    node[align=right, anchor=south east, font=sffamily, text width=1cm] (evenpagenum) at ($(current page.north east)+(-.5hdheight,-hdheight)$) {thepage};
    node[align=right, anchor=south east, text width=1.5cm, text=white, font=fontsize{2cm}{5.5cm}selectfont] (chapter) at (evenpagenum.south west) {thechapter};
    node[align=right, anchor=south east] at (chapter.south west) {leftmark};
      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}
}
fancyfoot[CE]{}
fancyfoot[CO]{}
setlength{headheight}{12pt}


usepackage[height={2cm},distance={2mm},topthumbmargin={auto},bottomthumbmargin={auto}]{thumbs}%%%% <--- !


begin{document}
pagenumbering{arabic}%%%% <--- !
chapter{Problems}
addthumb{thechapter}{Large{thechapter}}{white}{mybluei}%%%% <--- !
section{Problem 1}
subsection{Problem 1}
lipsum[1]
subsection{Solution 1}
lipsum[1-7]
cleardoublepage

appendix
chapter{Appendix thechapter}
addthumb{thechapter}{Large{thechapter}}{white}{mybluei}%%%% <--- !
lipsum[1-20]

end{document} 


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.