1

If I color the page number with the packages fancyhdr and xcolor, I get the page number out of the space defined as "footskip" in the geometry package.

I am enclosing a MWE where you can see that if the page number is colored with \color{customcolor}, it gets misplaced (it is below the line drawn by geometry):

\documentclass{book}
\usepackage{fancyhdr}
\usepackage{geometry}
\usepackage{xcolor}

\geometry{bottom=30pt,includeheadfoot, showframe}

\definecolor{customcolor}{RGB}{112,112,112}

\fancypagestyle{plain}{
\fancyhf{}
\fancyfoot[CO]{\color{customcolor}\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}}

\begin{document}

\pagestyle{plain}

Hello!  

\end{document}

How can I avoid it?

(I am compiling this on LuaTeX)

oibaFox
  • 163

1 Answers1

1

Using \fancyfoot[CO]{\textcolor{customcolor}{\thepage}}` solves the problem.

However, the titleps package, used in the place of fncyhdr doesn't have this drawback, and has a simpler syntax, with the \renewpagestyle{plain}{...} command:

\documentclass{book}

\usepackage{xcolor}
\definecolor{customcolor}{RGB}{112,112,112}

 \usepackage{titleps}
 \renewpagestyle{plain}{%
 \setfoot{}{\color{customcolor}{\thepage}}{}
 }%
\usepackage{geometry}
\geometry{bottom=30pt,includeheadfoot, showframe}

\begin{document}

\pagestyle{plain}

Hello!

\end{document} 

enter image description here

Bernard
  • 271,350