我使用\pagestyle{fancy}
通常的设置。有时章节名称太大(在顶行上方),不知何故页码(在页脚)会随着每一页而下降,直到消失。第一页的页码和页尾之间大约有 2 厘米的距离,第 100 页有 1 毫米的距离,最后一页什么都没有,这太荒谬了。
%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}
% other settings
\pdfcompresslevel=9
\pdfobjcompresslevel=9
\hypersetup{
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
\tableofcontents
\mainmatter
\pagestyle{fancy}
\setcounter{chapter}{0}
\foreach \n in {1,...,36}{\include{chapters/chapter\n}}
\end{document}
并且不要责怪我在未来的数学书中使用有关 Eminem 的文字进行测试。:)
PS. 这里chapters/chapter\n
只有关于 Eminem 的文字,没有任何命令\chapter{}
答案1
有一个明确的警告,关于headheight
太小(参见.log
文件。)根据当前非常长的章节标题,建议将头部高度至少设置为约 35pt。
在我看来,footskip
这里的太小了,我将其值增加到1cm
。
现在页码位置保持固定。
%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}