Text FormattingReduce space above header - fancyhdr

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
ringrring
Posts: 1
Joined: Thu Oct 20, 2022 3:29 pm

Reduce space above header - fancyhdr

Post by ringrring »

I am using TeXstudio to format an article in a fairly standard way. The article needs a header with three lines of reference text, so I am using the code below. I am very new to this so you may need to be patient. I want to reduce the free space above the header.

Code: Select all

\documentclass[10pt, a4paper]{article}


\usepackage{fancyhdr}

\newpage

\pagestyle{fancy}

\fancyfoot[L]{from: him}
\fancyfoot[R]{\thepage}


\fancyhf{}
\renewcommand{\headrulewidth}{0.5pt}


\fancyhead[OL]{
	\begin{tabular}[b]{l}
	    AA\\
		LTH\\
		Your ref:
	\end{tabular}
}




\begin{document}
	
	
	
	
	
some text
\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

Reduce space above header - fancyhdr

Post by rais »

A look into your log file should help:

Code: Select all

Package fancyhdr Warning: \headheight is too small (12.0pt): 
(fancyhdr)                Make it at least 36.0pt, for example:
(fancyhdr)                \setlength{\headheight}{36.0pt}.
(fancyhdr)                You might also make \topmargin smaller to compensate:
(fancyhdr)                \addtolength{\topmargin}{-24.0pt}.
KR
Rainer
Post Reply