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}



chapnumboxuses all the layers of pagestylescrheadings. So you can still use\oheadetc. to put contents in the header or footer. Or do you load a different package for header and footer? If you add your settings to your MWE, I can show how this can be done by packagescrlayer-scrpage. – esdd Feb 08 '17 at 16:05\fancyheadand\fancyfootand pagestylefancythen packagefancyhdris used by your code probably. Maybe you can replace this package byscrlayer-scrpageand its commands. But if you want to keepfancyhdrthen you can not use my suggestion. – esdd Feb 10 '17 at 12:45