[Tex/LaTex] How to set the baseline for headers with scrpage2

header-footerkoma-scriptscrpage2vertical alignment

I want the left and the right header to have the same baseline, regardless of the height of the content they yield. To demonstrate this, assume

\documentclass{scrartcl}

\usepackage{scrpage2}
\clearscrheadfoot
\renewcommand{\sectionmark}[1]{\markboth{#1}{#1}}
\ohead{\Huge\thesection -- \Large\leftmark}
\ihead{\small Report No. 11}
\ofoot{\small Page \thepage}
\pagestyle{scrheadings}

\begin{document}

\section{First section}

\end{document}

The output will be equivalent to

The header baselines don't match

I added red line to emphasize the difference in the baseline.

Question: How can I set them both to the same baseline?

Considered solutions:

  • Add to the smaller header something like \vphantom{\Huge A} to implicitly make it the same height.
  • Use fancyhdr as it aligns the baselines (Well, it brings other issues).

Best Answer

Tell LaTeX that you want \Large also in the inner heading by setting a strut and adding some to the \headheight. This will ensure that the elements of the heading will fit in the reserved area.

I can't recommend using three different font sizes in the heading; actually I advise to reconsider the choice of the big number; I removed the dash that's really horrible.

\documentclass{scrartcl}
\usepackage{showframe}
\usepackage{scrpage2}

\clearscrheadfoot
\renewcommand{\sectionmark}[1]{\markboth{#1}{#1}}
\ohead{\smash{\Huge\thesection}\ \ \Large\leftmark}
\ihead{\small Report No. 11\Large\strut}
\ofoot{\small Page \thepage}
\addtolength{\headheight}{4pt} % Better keeping the number in the reserved box
\pagestyle{scrheadings}


\begin{document}

\section{Start of report}

\end{document}

enter image description here