[Tex/LaTex] How to add a two column header before the title on the first page

header-footertitles

I'd like to add two columns at the top of my first page, before the title of my article. It should look like this (I only highlighted the top with a red rectangle to show what I want to achieve):

Two columns before the title

My current code looks like this:

\documentclass[a4paper, 12pt]{article}

\title{SPSS opdracht Kansrekening en Statistiek}
\author{Eerste zittijd}

\begin{document}
\maketitle

Here is some text...

\tableofcontents
\newpage

\end{document}

How can I work further with this?

(For those who understand Dutch: don't mind the meaning of the text. Of course "Eerste Zittijd" is not the author. I'm just adapting it to the screenshot.)

Best Answer

Next time, please remember that all questions should include a minimal working example (MWE) which illustrates the problem or demonstrates what you have already tried and your basic set up.

Here is a basic solution for the article class which you can adapt as appropriate for your own situation:

\documentclass{article}
\usepackage{titling}
\usepackage{calc}
\newcommand*{\myinstitution}{}
\newcommand*{\institution}[1]{%
  \renewcommand*{\myinstitution}{#1}}
\newcommand*{\myacyear}{}
\newcommand*{\acyear}[1]{%
  \renewcommand*{\myacyear}{#1}}

\title{The Title}
\author{The Author}
\institution{Author's Institution}
\acyear{Academic Year YYYY--YYYY}

\renewcommand{\maketitlehooka}{%
  \noindent\parbox{\linewidth}{\myinstitution\hfill\myacyear}}

\begin{document}
\maketitle

\end{document}

Additional headings

Use \institution{} and \acyear{} to set the contents in the left and right of the boxed material.

Here is a version which includes the red frame as I only just realised you don't actually want that (and it might be useful to somebody, at least in another colour):

\documentclass{article}
\usepackage{titling}
\usepackage{efbox,calc}
\newcommand*{\myinstitution}{}
\newcommand*{\institution}[1]{%
  \renewcommand*{\myinstitution}{#1}}
\newcommand*{\myacyear}{}
\newcommand*{\acyear}[1]{%
  \renewcommand*{\myacyear}{#1}}

\title{The Title}
\author{The Author}
\institution{Author's Institution}
\acyear{Academic Year YYYY--YYYY}

\newlength{\myboxwidth}
\setlength{\myboxwidth}{\linewidth-2\fboxrule-2\fboxsep}

\renewcommand{\maketitlehooka}{%
  \noindent\efbox[linecolor=red]{%
    \parbox{\myboxwidth}{\myinstitution\hfill\myacyear}}}

\begin{document}
\maketitle

\end{document}

Red box in title