I am trying to make header and footer using fancyhdr
.
Following the manuals available in other question I have defined header and footer in my class file but they are not shown in output file. Could you please advice what am I doing wrong?
My class file looks like this:
% Definicja klasy
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{KPSEClass}[2016/3/19 KPSE LaTeX class]
% Polskie formatowanie
\usepackage[T1]{fontenc}
\usepackage[polish]{babel}
\usepackage[utf8]{inputenc}
\frenchspacing
\usepackage{indentfirst}
% Nagłówek
\usepackage[a4paper,width=150mm,top=25mm,bottom=25mm]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\rhead{Share\LaTeX}
\lhead{Guides and tutorials}
\rfoot{Page \thepage}
% Domyślny TPL
\LoadClass[twocolumn]{article}
\RequirePackage{xcolor} % Kolory
\usepackage{mdframed} % Boxy
% Formatowanie tytułu
\renewcommand\@maketitle{%
\hfill
\begin{minipage}{0.95\textwidth}
\vskip 2em
\rule{\linewidth}{0.4pt}
{\LARGE \centering \textbf \@title \par }
\rule{\linewidth}{0.4pt}
\vskip 1 em
{\large \centering \@author \par}
\end{minipage}
\vskip 1em \par
}
and document:
\documentclass{KPSEClass}
\author{Autor}
\title{Testowy artykuł}
\begin{document}
\maketitle
\section{Małe}
Małe\footnote{Nie większe niż bardzo małe} jest piekne.
\end{document}
Output:
Best Answer
Here's a small fix of the
.cls
file by patching\maketitle
to use a\titlepagestyle
which is itself some wrapper command which can be redefined to use some other pagestyle. It usesfancy
by default.Now the header and footer settings are applied for the title page (if this is really needed at all...)
Document
.tex