I am using blocks on the side of the page to show the chapter number. I am using the example described on this forum (here). However, I would like to turn the chapter numbers by 90 degrees. I tried the angle option at several places, but nothing worked. Here is my MWE:
\documentclass[twoside,openright,numbers=endperiod,titlepage,headinclude,
footinclude=false,cleardoublepage=empty,abstractoff,
BCOR=5mm,b5paper,fontsize=11pt, american,
]{scrreprt}
\usepackage{tikzpagenodes}
\usepackage{totcount}
%makes blocks with chapter number on the side of the page
\newif\ifMaterial
\newlength\LabelSize
\setlength\LabelSize{2.5cm}
\AtBeginDocument{%
\regtotcounter{chapter}
\setlength\LabelSize{\dimexpr\textheight/\totvalue{chapter}\relax}
\ifdim\LabelSize>2.5cm\relax
\global\setlength\LabelSize{2.5cm}
\fi
}
\newcommand\AddLabels{%
\Materialtrue%
\AddEverypageHook{%
\ifMaterial%
\ifodd\value{page} %
\backgroundsetup{
angle=90,
position={current page.east|-current page text area.north east},
vshift= 10pt,
hshift=-\thechapter*\LabelSize,
contents={%
\tikz\node[fill=gray!50,anchor=west,text width=\LabelSize,
align=center,text height=15pt,text depth=10pt,font=\large\sffamily] {\thechapter};
}%
}
\else
\backgroundsetup{
angle=90,
position={current page.west|-current page text area.north west},
vshift=-10pt,
hshift=-\thechapter*\LabelSize,
contents={%
\tikz\node[fill=gray!50,anchor=west,text width=\LabelSize,
align=center,text height=15pt,text depth=10pt,font=\large\sffamily] {\thechapter};
}%
}
\fi
\BgMaterial%
\else\relax\fi}%
}
\newcommand\RemoveLabels{\Materialfalse}
\begin{document}
\include{Chapters/Introduction}
\cleardoublepage
\end{document}