I'm trying to make a header on every page with text above and below the header rule, so that it looks something like this:

                                  header text above line
--------------------------------------------------------

[body of page]


Is this possible with fancyhdr? Or is there another way to do this?

I realize this may not be aesthetically pleasing, but I'm trying to emulate another document (not made with LaTeX).

Try this, with fancyhdr:

\pagestyle{fancy}


If desired, switch left and right. You will need to play with the headheight and the line skips in the header, and related dimensions.

• This almost works. I end up with two horizontal lines, but I can remove the default one with \renewcommand{\headrulewidth}{0pt}, and then I get the desired result. Thanks! – Eric Sep 18 '16 at 22:29
• Right! You need to remove the default line. When I use fancyhdr, I start by zeroing or emptying everything and building up from there. – user103221 Sep 18 '16 at 23:12

You can set one header item using a tabular with a single paragraph column that is the width of \textwidth:

\documentclass{article}

\usepackage{fancyhdr,lipsum}

\pagestyle{fancy}
\begin{tabular}{ @{} p{\textwidth} @{} }
\hfill Header text above line \\
\hline
\end{tabular}}
\setlength{\headheight}{24.4pt}% Should be at least 24.4pt

\begin{document}

\lipsum

\end{document}


Here is a solution with titleps, a tabular environment and booktabs:

\documentclass[12pt,twoside, a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{titleps}
\usepackage{array, booktabs, graphicx}
\usepackage{lipsum}
\newpagestyle{mine}{\renewcommand\arraystretch{0.5}%