1

I am trying to create a footer in an article for the first page only, while the rest of the pages are supposed to contain a header and page number at the bottom of the page. Here's the code I use:

\documentclass[12pt,a4paper]{article}
\usepackage{cmap}                   % поиск в PDF
\usepackage{mathtext}               % русские буквы в фомулах
\usepackage[T2A]{fontenc}           % кодировка
\usepackage[utf8]{inputenc}         % кодировка исходного текста
\usepackage[english,russian]{babel} % локализация и переносы
\usepackage{indentfirst}
\frenchspacing

\setlength{\headheight}{15pt}
% Колонтитулы
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[R]{Д.В. Хизанишвили}
\fancyhead[L]{РАЦИО.ru 16(1)}
\fancyhead[C]{}

\fancyfoot[R]{}
\fancyfoot[L]{}
\fancyfoot[C]{\thepage}

\setlength{\footskip}{40pt} %отступ нижнего колонтитула

\fancypagestyle{firststyle} %новый стиль
{
   \fancyhf{}
   \fancyfootoffset[R]{-12cm} %так можно регулировать ширину колонтитула
   \fancyfoot[L]{РАЦИО.ru 16(1)  \linebreak Д.В. Хизанишвили}
}

\begin{document}

\thispagestyle{firststyle}
\maketitle

The result, however, doesn't meet my expectations: instead of the intended footer the first page contains the page number. Even if I am trying simply to delete page number using \thispagestyle{empty} it stays there anyway.

1
  • 1
    Swap the order. That is, use \maketitle \thispagestyle{firststyle}. It's possible that \maketitle issues \thispagestyle{plain} (or something similar) which overrides your setting it to firststyle.
    – Werner
    Mar 18, 2016 at 17:38

1 Answer 1

0

\maketitle is known for setting the page style using

\thispagestyle{plain}

and therefore overrides your setting which precedes it. Swap the order to restore peace:

\maketitle
\thispagestyle{firststyle}

Alternatively, you can adjust the plain page style and not have to worry about the first page:

\documentclass{article}
%...
\usepackage{fancyhdr}
\pagestyle{fancy}% Set all page styles to 'fancy'
%...
\fancypagestyle{plain}{% Overwrite 'plain' page style
  %...
}
%...
\begin{document}

\maketitle% This will override the `fancy` page style with `plain`

%...

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .