4

I have \pagestyle{fancy} with usual settings. And names of my chapters sometimes are so huge (above the top line) that somehow the number of page (which is in foot of the page) is going down, down and down with each page until it'll dissappear. It is ridiculous to see at the first page approximately 2cm between number and end of the page and 1mm on the page 100 and nothing at the last page.

%document information
\documentclass[10pt,a4paper]{book}

% packages
\usepackage{cmap}
\usepackage[utf8]{inputenc}
\usepackage[T2A]{fontenc}
\usepackage[russian]{babel}
\usepackage{amsfonts,longtable} 
\usepackage{indentfirst}
\usepackage{amsmath,amsthm,amstext,amssymb,amscd} 
\usepackage{fancyhdr}                           
\usepackage{hyperref}
\usepackage[margin=2.3cm, footskip = 0.5 cm]{geometry}
\usepackage{epigraph}
\usepackage{tikz}                                   
\usepackage{cancel}
\usepackage{upgreek}
\usepackage{bm}                         
\usepackage{xcolor}
\definecolor{darkblue}{rgb}{0,0,.6}

% page settings
\frenchspacing 
\parindent=1cm
\sloppy
\fancyfoot[C]{\thepage}

% front page
\author{Андрей Диденко}
\title{Подготовка к ГОСу по МатАнализу
\date{16 Апреля 2016}.
\LaTeX}

% other settings
\pdfcompresslevel=9
\pdfobjcompresslevel=9

\hypersetup{
  pdftitle           = {GOS_MatAn},
  pdfauthor          = {Didenko Andre},
  pdfsubject         = {Matan},
  pdfstartview       = {FitH},
  pdfborder          = {0 0 0},
  bookmarksopen      = true,
  bookmarksnumbered  = true,
  bookmarksopenlevel = 2,
  colorlinks = true,     linkcolor  = darkblue,
}


%own commands

\begin{document}

\pagestyle{plain}
\frontmatter
\maketitle
\epigraph{Дорогой моей и любимой Настеньке посвящается}{Диденко А.А.}
\tableofcontents

\mainmatter
\pagestyle{fancy}

\setcounter{chapter}{0}
\foreach \n in {1,...,36}{\include{chapters/chapter\n}}

\end{document}

And don't blame me for using text about Eminem for test in future math book. :)

PS. In chapters/chapter\n there are just texts about Eminem with no commands expect \chapter{}

enter image description here enter image description here

  • 1
    Welcome to TeX.SE. I am sure not many will note the word EMINEM in a Cyrillic font text ;-) But your question is not quite unclear unless you provide a compilable version of your document that shows this issue – user31729 Feb 15 '16 at 17:40
  • Welcome, the title put a song into my head: The wheels on the bus go round and round... ;-) – Johannes_B Feb 15 '16 at 17:42
  • 1
    Try to prepare a minimal working example (<- simple method linked) and show it to us. Right now, we cannot have a clue. Check the log file for fancyhdr warnings concerning the headheight, though. – Johannes_B Feb 15 '16 at 17:44
  • Have I done your request? – Lust_For_Love Feb 15 '16 at 17:50
  • @Dida: Da, choroscho ;-) – user31729 Feb 15 '16 at 17:55
4

There's a clear warning about headheight being to small (see the .log file.) It's recommended, depending on the current very long chapter titles, that the headheight is set to about 35pt at least.

In my opinion, footskip is too small here, I increased its value to 1cm.

Now the page number position remains fixed.

%document information
\documentclass[10pt,a4paper]{book}

% packages
\usepackage{cmap}
\usepackage[utf8]{inputenc}
\usepackage[T2A]{fontenc}
\usepackage[russian]{babel}
\usepackage{amsfonts,longtable} 
\usepackage{indentfirst}
\usepackage{amsmath,amsthm,amstext,amssymb,amscd} 
\usepackage{fancyhdr}                           
\usepackage[includeheadfoot,margin=2.3cm, footskip = 1 cm,headheight=36pt]{geometry}
\usepackage{epigraph}
\usepackage{tikz}                                   
\usepackage{cancel}
\usepackage{upgreek}
\usepackage{bm}                         
\usepackage{xcolor}
\definecolor{darkblue}{rgb}{0,0,.6}

% page settings
\frenchspacing 
\parindent=1cm
\sloppy
\fancyfoot[C]{\thepage}

% front page
\author{Андрей Диденко}
\title{Подготовка к ГОСу по МатАнализу
\date{16 Апреля 2016}.
\LaTeX}
\usepackage{hyperref}    
% other settings
\pdfcompresslevel=9
\pdfobjcompresslevel=9

\hypersetup{
  pdftitle           = {GOS_MatAn},
  pdfauthor          = {Didenko Andre},
  pdfsubject         = {Matan},
  pdfstartview       = {FitH},
  pdfborder          = {0 0 0},
  bookmarksopen      = true,
  bookmarksnumbered  = true,
  bookmarksopenlevel = 2,
  colorlinks = true,     linkcolor  = darkblue,
}


%own commands

\usepackage{blindtext}

\begin{document}

\pagestyle{plain}
\frontmatter
\maketitle
\epigraph{Дорогой моей и любимой Настеньке посвящается}{Диденко А.А.}
\tableofcontents

\mainmatter
\pagestyle{fancy}

\setcounter{chapter}{0}
\foreach \n in {1,...,36}{\chapter{A long long long long long long long long long long long long long long long long long long long long chapter title which is totally boring}\blindtext[10]}

\end{document}
  • Yeap. Thanks. It works. I am so dissapointed that I wasted a lot of my time for this easiest problem. – Lust_For_Love Feb 15 '16 at 18:20
  • 3
    You may also want to provide the option includeheadfoot when loading the geometry package. – Mico Feb 15 '16 at 18:21
  • Can you answer me another little question? (I am not very good at LaTeX as you can see) I have a title page. But if you look at it more carefully - you will see, that cyrillic symbols are very wrong and crooked. But Main Part is Ok. – Lust_For_Love Feb 15 '16 at 19:12
  • @Dida: Actually, the rule is: One question -- one answer and if it's ok, accepting them, then asking a new question ;-) – user31729 Feb 15 '16 at 19:14
  • 3
    @Dida: Go ahead ... and don't forget the acceptance rule nevertheless ;-) – user31729 Feb 15 '16 at 19:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.