
ページ番号をパッケージとで色分けするとfancyhdr
、パッケージxcolor
内で「footskip」として定義されているスペースからページ番号が取得されますgeometry
。
\color{customcolor}
ページ番号が で色付けされている場合、ページ番号が間違った位置に置かれる ( で描かれた線の下に配置されるgeometry
)ことがわかる MWE を同封します。
\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}
どうすれば回避できますか?
(私はこれを LuaTeX でコンパイルしています)
答え1
\fancyfoot[CO]{\textcolor{customcolor}{\thepage}}` を使用すると問題は解決します。
ただし、titleps
の代わりに使用されるパッケージにはfncyhdr
この欠点がなく、\renewpagestyle{plain}{...}
コマンドの構文がより単純になります。
\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}