# How to make side label

How to make and control a side label similar like this? This example i made with code:

\multirow{1}{*}{\begin{sideways} {\small This is my very very very veryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryvery long message} \end{sideways}}


My method is ugly hack and works only for one page. And i want to control it similar like fancyhdr (example: turn on after title, and turn off in listoftables/listoffigures at the end)

You don't need fancyhdr for this. For example, you can use eso-pic to place content on the page arbitrarily. Below I've built an interface that places content on the left side of the page as needed:

\documentclass{report}
\usepackage{fancyhdr,lipsum,graphicx}
\usepackage{eso-pic}
\fancypagestyle{sidelabel}{% Not really needed
\fancyfoot[C]{--\thepage--}
}
\providecommand{\sidelabeltext}{}
\AddToShipoutPictureFG{% Place this content on the ForeGround of every page
\AtTextCenter{%
\hspace*{\dimexpr-.5\textwidth-\sidelabelsep}%
\rotatebox{90}{%
\makebox[0pt]{%
\sidelabeltext%
}%
}%
}%
}
\newlength{\sidelabelsep}
\setlength{\sidelabelsep}{\marginparsep}
\newcommand{\setsidelabelsep}[1]{\setlength{\sidelabelsep}{#1}}
\pagestyle{sidelabel}
\begin{document}
\setsidelabeltext{This is some side text}
\lipsum[1-6]
\setsidelabeltext{This is some very very very very very very very very very very very
very very very very very very very very very very very very very long side text}%
\setsidelabelsep{0.5in}
\lipsum[1-6]
\setsidelabeltext{}
\lipsum[1-6]
\setsidelabeltext{This is some side text}%
\setsidelabelsep{20pt}
\lipsum[1-6]
\end{document}


\setsidelabeltext{<stuff>} updates what is printed on the left of the page, while \setsidelabelsep{<len>} updates the length that <stuff> is printed from the text. Default is \marginparsep.

Here's a way to do it with fancyhdr. With \setsideheader you tell what text should be printed from the point on.

\documentclass[a4paper]{report}

\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{lipsum}

\pagestyle{fancy}
\fancyhf{} % clear all fields
\fancyfoot[C]{\thepage}

\hspace*{-3em}%
\smash{%
\rotatebox[origin=Br]{90}{%
}%
}%
}

\begin{document}

\chapter{A title}
\setsideheader{Some long text that goes in the side margin}

\lipsum[1-20]

\chapter{A title}
\setsideheader{Some long text that goes in the side margin for chapter 2}

\lipsum[1-20]

\clearpage
\pagestyle{plain}

\tableofcontents

\end{document}