# How to add a two column header before the title on the first page?

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):

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.)

• Which class of document do you use? Do you make your own title page or the \maketitle command? – Bernard May 31 '14 at 22:20
• @Bernard: I'm using the article class. – Jeroen May 31 '14 at 22:33

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}

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

\begin{document}
\maketitle

\end{document}


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}

\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}


Here is an another solution using {tabular*} environment:

\documentclass[12pt]{article}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}

\begin{document}
\begin{titlepage}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}} % Defines a new command for the horizontal lines, change thickness here

\center % Center everything on the page

%----------------------------------------------------------------------------------------
%----------------------------------------------------------------------------------------
\textsc{\LARGE University Name}\\[1.5cm] % Name of your university/college
%----------------------------------------------------------------------------------------
%   TITLE SECTION
%----------------------------------------------------------------------------------------
\begin{center}
\begin{table}
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}lr}
Author's Institution & Academic Year YYYY--YYYY
\end{tabular*}
\end{table}
\end{center}
\HRule \\[0.4cm]
{ \huge \bfseries Title}\\[0.4cm] % Title of your document
\HRule \\[1.5cm]
\vfill % Fill the rest of the page with whitespace
\end{titlepage}
\end{document}


With the swiss army knife called tikz:

\documentclass[a4paper, 12pt]{article}
\usepackage{tikz}

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

\begin{document}
\maketitle
%% put this after \maketitle and this placement is important
\begin{tikzpicture}[remember picture,overlay]
\node[draw=red,thick,minimum width=\textwidth,text width=\textwidth] at ([yshift=-1in]current page.north) {Author's Institution \hfill Academic Year YYYY--YYYY};
\end{tikzpicture}

Here is some text...

\tableofcontents
\newpage

\end{document}


This needs at least 2 compilation runs.