[Tex/LaTex] Vertical align text next to image in rhead without influencing the positioning of lhead

fancyhdrheader-footervertical alignment

I try to vertical align a text next to an image in a fancyhdr environment. This is my LaTeX code:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{graphicx}

\headheight=60pt
\lhead{Foo bar \\
    Baz lorem \\
    ipsum dolor}
\chead{}
\rhead{This should be vertically aligned (middle) \raisebox{-.5\height}{\includegraphics[scale=0.25]{wappen}}}

\pagestyle{fancy}
\fancypagestyle{titlestyle}
{
    \fancyhf{}
    \renewcommand{\headrulewidth}{0pt}
    \fancyfoot[C]{\Large \today}
}

\begin{document}
    Test
\end{document}

It somehow works (the text is vertically aligned), but the multi-lined text on the left is influenced: Its baseline is also shifted upwards.

How can I vertically align the text on the right without modifying the baseline of the left header?

Screenshot of PDF

Best Answer

You can do that easily with the \Centerstack command, from the stackengine package.

Here is how, with one of my own images since you didn't provide one. Also, centring text w. r. t. the image is better if you lower of 0.4\height, to take into account the height of the line of text (the exact value depend on the height of the image, of course):

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{stackengine}
\setstackEOL{\\}
\headheight=60pt
\lhead{%
\Centerstack[l]{Foo bar \\
    Baz lorem \\
    ipsum dolor}}
\chead{}
\rhead{This should be vertically aligned (middle) \raisebox{-.4\height}
{\includegraphics[scale=0.16]{Hedgehog-in-the-Fog}}}

\pagestyle{fancy}
\fancypagestyle{titlestyle}
{
    \fancyhf{}
    \renewcommand{\headrulewidth}{0pt}
    \fancyfoot[C]{\Large \today}
}

\begin{document}
    Test
\end{document} 

enter image description here

Related Question