I want to have section name + number on the left side in the header, and a predefined text on the right side. Also want to have subsection / subsubsection name + number, if the subsection is long enough. This is what I have.
\documentclass[11pt,norsk,a4paper]{article}
\usepackage{ucs,babel}
\usepackage[utf8x]{inputenc}
\usepackage{fancyhdr}
% title and so on
\begin{document}
\pagestyle{fancy}
\renewcommand{\sectionmark}[1]{\markright{#1}{}}
\fancyhf{}
\rhead{\fancyplain{}{Prosessrapport}} % predefined ()
\lhead{\fancyplain{}{\rightmark }} % 1. sectionname, 1.1 subsection name etc
\cfoot{\fancyplain{}{\thepage}}
What I get from this, is the subsection name without number. And the subsection name + number.
UPDATE:
\documentclass[11pt,norsk,a4paper]{article}
\usepackage{ucs,babel}
\usepackage[utf8x]{inputenc}
\usepackage{fancyhdr}
\title{sd}
\date{}
\begin{document}
\maketitle
\pagestyle{fancy}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\fancyhf{}
\rhead{\fancyplain{}{$<$Name of the report$>$}} % predefined ()
\lhead{\fancyplain{}{\rightmark }} % 1. sectionname, 1.1 subsection name etc
\cfoot{\fancyplain{}{\thepage}}
\newpage
\section{section}
\newpage
\subsection{subsection}
\newpage
\subsubsection{subsubsection}
\end{document}
On the last page (4), I have a subsubsection, but the header says subsection. Is there any way to make it say subsubsection?

\sectionmarkis only the title of the section. So if you want\markrightto store also the number you must add it yourself:\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}. For the rest of your questions: Sort out your problem description first. – Ulrike Fischer Apr 16 '12 at 9:35@Ulrikeso that I get notified. – Ulrike Fischer Apr 16 '12 at 13:55\renewcommand{\subsubsectionmark}[1]{\markright{\thesubsubsection\ #1}}so that also the\subsubsectionfills\rightmark.\rightmarkwill always show the first title of the page. – Ulrike Fischer Apr 17 '12 at 10:51