This is a continuation of this question Creating a box containing a picture. Where I now attempt at replicating the header and footer seen in the image below
I have attempted at replicating this style, but ran into two problems.
Even after I have defined a plainstyle for the frontpage, the double lined header will not go away.
Second problem which is probably related to the first, is that the header also overlaps with the text on the following pages.
I think these problems are caused by the bold extra line is defined below and not above the hrule in the header, however my attempts at fixing this was futile.
\documentclass[a4paper, norsk]{article}
\usepackage{tikz}
\usepackage[utf8]{inputenc}
\usepackage{fullpage}
\usepackage{lipsum}
\usepackage{lastpage} % number of last page
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\renewcommand\footrule{\begin{minipage}{1\textwidth}
\hrule width \hsize height 2pt \kern 1mm \hrule width \hsize
\end{minipage}\par}%
\renewcommand\headrule{\begin{minipage}{1\textwidth}
\hrule width \hsize height 2pt \kern 1mm \hrule width \hsize
\end{minipage}\par}%
\cfoot{\today}
\rfoot{Page \thepage\ of \pageref{LastPage}}
\lhead{MA1103 Flerdimensjonal analyse, vår 2018}
\fancypagestyle{plain}{% Redefine ``plain'' style for chapter boundaries
\fancyhf{} % clear all header and footer fields
\renewcommand\footrule{\begin{minipage}{1\textwidth}
\hrule width \hsize height 2pt \kern 1mm \hrule width \hsize
\end{minipage}\par}%
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[C]{\today} % except the center
\fancyfoot[R]{Side \thepage\ av \pageref{LastPage}} % except the center
}
\definecolor{mblue}{RGB}{0,72,161}
\newcommand{\ntnulogo}{%
\leavevmode
\vtop{
\hrule height 0pt
\hbox{%
\begin{tikzpicture}
\fill[mblue, rounded corners=5mm] (0,2) rectangle (2,4);
\fill[white] (0.5,2.5) rectangle (1.5,3.5);
\fill[mblue] (1,3) circle (4mm);
\end{tikzpicture}%
}
}
}
\newcommand{\course}{%
\leavevmode
\vtop{\LARGE
\hrule height 0pt
\ialign{\hfil##\cr
MA1103\cr
Flerdimensjonal analyse\cr
Vår 2018\cr
}%
}%
}
\newcommand{\titlebox}[2]{
\thispagestyle{plain}
\begin{center}
\setlength{\fboxsep}{0pt}
\fbox{%
\begin{minipage}{\dimexpr\textwidth-2\fboxrule}
\vspace{1pt}
\hrule height 1pt
\vspace{6pt}
\mbox{}\quad\ntnulogo\hfill\course\quad\mbox{}\\[3pt]
\mbox{}\quad
\begin{tabular}{@{}l@{}}
Norges teknisk-vitenskapelige\\
universitet\\
Insitutt for matematiske fag
\end{tabular}\hfill%
\textbf{\large #1. #2}\quad\mbox{}\\
\vspace{3pt}
\hrule height1pt
\vspace{1pt}
\end{minipage}%
}
\end{center}
}
\begin{document}
\titlebox{Øving 1}{Frist: Søndag 21. januar kl 23:59}
\lipsum
\end{document}