# Chapter Title in box at the margin with different rounded corners

The title combines two discussion threads on this board.

I have adapted the first solution in post 29 of (1) to a report template (with some alterations: constant box placement and altered text). This works as shown in (1) but to me rounded corners on the inner side of the margin boxes would look much better.

No (2) has some solutions to specify corners separately.

I tried a lot to bring (1) and (2) together but as a tikz beginner I failed. I could either control the colors or have rounded corners on the inner side, but not both.

Is there any solution to the following? In a twoside report: Display the chapter title (or some other text)

• in a rotated box at the margin
• with constant placement and size (or moving as in (1) )
• with rounded corners on the inner side of the box
• with predefined box fill colors changing in every chapter.

Best wishes

Stefan Gawrich

• Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. That is, show us what you have tried since that provides a basis for an answer. Merely telling us you haven't succeeded doesn't really give people much of a beginning. – cfr Nov 4 '14 at 1:09
• Is this the answer you referred to as 'post 29'? (It has 29 votes but that may change ;).) – cfr Nov 4 '14 at 1:12

I think it is easier to cheat and just amend the definition of \ChapFrame from Gonzalo Medina's answer as follows:

\newcommand\ChapFrame{%
\ifodd\value{page}
\backgroundsetup{contents={%
\begin{tikzpicture}[overlay,remember picture]
\node[
fill=\BoxColor,
inner sep=0pt,
rectangle,
text width=.5cm,
text height=4cm,
align=center,
anchor=north east,
]
at ($(current page.north east) + (-0cm,-2*\thechapshift cm)$) {};
\node[
fill=\BoxColor,
inner sep=0pt,
rectangle,
text width=2cm,
text height=4cm,
align=center,
rounded corners,
anchor=north east
]
at ($(current page.north east) + (-0cm,-2*\thechapshift cm)$)
{\rotatebox{90}{\hspace*{.3cm}\parbox[c][1.5cm][t]{3.4cm}{%
\raggedright\textcolor{black}{\scshape\leftmark}}}};
\end{tikzpicture}%
}%
}
\else
\backgroundsetup{contents={%
\begin{tikzpicture}[overlay,remember picture]
\node[
fill=\BoxColor,
inner sep=0pt,
rectangle,
text width=.5cm,
text height=4cm,
align=center,
anchor=north west,
]
at ($(current page.north west) + (-0cm,-2*\thechapshift cm)$) {};
\node[
fill=\BoxColor,
inner sep=0pt,
rectangle,
rounded corners,
text width=2cm,
text height=4cm,
align=center,
anchor=north west
]
at ($(current page.north west) + (-0cm,-2*\thechapshift cm)$)
{\rotatebox{90}{\hspace*{.3cm}\parbox[c][1.5cm][t]{3.4cm}{%
\raggedright\textcolor{black}{\scshape\leftmark}}}};
\end{tikzpicture}%
}%
}
\fi
\BgMaterial}%
\stepcounter{chapshift}%
}