# Malplaced minipage in fancy header

I have a rather complex layout for a letter. It needs to have a certain part of a header on every page while another part should only be shown on the first page. The whole thing can be found here: MWE

\documentclass[12pt,a4paper]{article}
\usepackage[
top=9cm,
bottom=3.5cm,
left=2cm,
right=2cm]{geometry}

\usepackage[table]{xcolor}
\usepackage{fancyhdr}
\usepackage{microtype}
\usepackage[german]{babel}
\usepackage{tabularx}
\usepackage{enumitem}
\usepackage{lastpage}
\usepackage{parskip}
\usepackage{eurosym}

%Color definition
\definecolor{light-gray}{gray}{0.6}

%Remove par indent
\setlength{\parindent}{0cm}

%----------- Defined Variables -------------------------
\def\aname{other company}
\def\astreet{Street 2}
\def\apostal{321 City}
\def\onr{2014001}
\def\cnr{10}
\def\subject{Some Subject}
%----------- End Defined Variables ---------------------

%Settings for fancy table
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}p{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}p{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}p{#1}}

\pagestyle{fancy}

\renewcommand{\footrulewidth}{0.4pt}% default is 0pt
\renewcommand{\footrule}{\color{light-gray}{\hrule} \vspace{10pt}}

\textbf{\textcolor{light-gray}{company}}
\color{light-gray}{\hrule}
\vspace{10pt}
}

\hfill
\begin{minipage}[b]{.49\textwidth}
\fontsize{10pt}{1em}\selectfont
\begin{flushright}
\textcolor{black}{
\begin{tabular}{lr}
\textbf{Some info:} & \\
Date: & \today \\
Some Number: & \onr \\
Other Number: & \cnr \\
Page: & \thepage\ of \pageref{LastPage} \\
\end{tabular}
}
\end{flushright}
\end{minipage}
}
\begin{minipage}[t]{.5\textwidth}
\begin{flushleft}
{
\fontsize{8pt}{1em}\selectfont
\color{light-gray}\underline{
}
\fontsize{12pt}{1em}\selectfont
\begin{itemize}[noitemsep,leftmargin=0pt,topsep=0px]
\item[] \aname
\item[] \astreet
\item[] \apostal
\end{itemize}
\end{flushleft}
\end{minipage}
\end{lrbox}

\fancypagestyle{firststyle}
{
\fancyhf{}
\vspace*{1.8cm}
}
}

\fancyhf{}
\vspace*{1.8cm}
}

\fancyfoot[L]{
\fontsize{10pt}{1em}\selectfont
Account Data:\\
Acountholder\\
IBAN: 123\\
BIC: YAYBIC\\
Bank: Some Bank
}
\fancyfoot[C]{
\begin{minipage}[t]{3cm}
\fontsize{10pt}{1em}\selectfont
\begin{flushleft}
Postal:\\
comp name\\
Street 1\\
123 City
\end{flushleft}
\end{minipage}
}
\fancyfoot[R]{
\begin{minipage}[t]{4.5cm}
\fontsize{10pt}{1em}\selectfont
\begin{flushleft}
Contact:\\
\href{http://www.comp.com/}{www.comp.com}\\
Phone: 987654321
\end{flushleft}
\end{minipage}
}
%End Actual Header and Footer Layout

\begin{document}
\thispagestyle{firststyle}
\textbf{\subject}
\par
\par

\newpage
\end{document}


There are several problems with my approach, it seems. The most pressing one for me is the misplaced minipage on the left. I just can't figure out how to make both parts of my header align. Any ideas?

• Welcome to TeX.SX! You should paste your MWE into your question, so it may be read by future visitors even when the external link no longer works. – Andrew Swann Nov 26 '14 at 13:00
• Will do. I just thought it was rather long for a MWE. – Nessuno Nov 26 '14 at 13:25
• Is this what you want: i.stack.imgur.com/i72X2.png – user11232 Nov 26 '14 at 13:27
• Welcome, out of curiosity, why don't you use a class that was designed for letters? scrlttr2 comes to mind. It is full of features. – Johannes_B Nov 26 '14 at 13:32
• Right now you are aligning a top with a bottom. – John Kormylo Nov 26 '14 at 14:01

It seems that it was a plain oversight on my side. As Harish Kumar and John Kormylo point out I just have to remove the [t] parameter in the minipage definition inside the lrbox.
[...]