# How to set the baseline for headers with scrpage2?

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}
\renewcommand{\sectionmark}[1]{\markboth{#1}{#1}}
\ofoot{\small Page \thepage}

\begin{document}

\section{First section}

\end{document}


The output will be equivalent to

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

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}

\renewcommand{\sectionmark}[1]{\markboth{#1}{#1}}
\ofoot{\small Page \thepage}

\begin{document}

\section{Start of report}

\end{document}


-
THe command \smash ignores descenders. Does it? ;-) –  Marco Daniel Apr 19 '13 at 21:51
@MarcoDaniel Yes; but they will fall too deep in the right part (the section title). –  egreg Apr 19 '13 at 22:03

Here's a quick solution: use a box of zero height to achieve the alignment:

\documentclass[headlines=1.5]{scrartcl}
\usepackage{scrpage2}
\renewcommand{\sectionmark}[1]{\markboth{#1}{#1}}
\ofoot{\small Page \thepage}

\usepackage{tikz}

\begin{document}

\section{First section p}

\begin{tikzpicture}[remember picture,overlay]
\draw[red] ([yshift=-60pt]current page.north west) -- +(\paperwidth,0);
\end{tikzpicture}

\end{document}


I used TikZ just to draw a visual guideline.

-
There’s a sneaky issue: According to KOMA-Script documentation the default is headlines=1.25, so you actually made the head tighter. –  Speravir Apr 20 '13 at 1:06
@Speravir true. Fixed. Thank you. –  Gonzalo Medina Apr 20 '13 at 1:16

You can use the command \smash. The trick is explained here: Get a box with zero depth including some text

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

\renewcommand{\sectionmark}[1]{\markboth{#1}{#1}}