章节页码居中

章节页码居中

我正在寻找页码问题的答案。文档是;

\documentclass[10pt, paper=6.125in:9.25in, twoside=true, pagesize=pdftex, BCOR=0.375in]{scrbook}

\areaset{4.625in}{7.625in} % in header.tex 1st brace {BCOR} not included as is included main file bookgrs.tex in \documentclass

\flushbottom % text length same at bottom of pages
\frontmatter % pagenumbering in lowercase roman located in header.tex

\mainmatter % pagenumbering in arabic located in initial.tex

页码出现在所有页面底部的中央,但每个章节的实际第一页除外,它们位于右边距。我正在使用fancyhdrfancy包。

% Fancyhdr commands

\setlength{\headheight}{15pt}

\fancyhf{}

\fancyhead[LE]{\slshape \leftmark}

\fancyhead[RO]{\slshape \rightmark}

%\fancyfoot[C]{\thepage}

\cfoot{\thepage}

\pagestyle{fancy}

有没有办法让章节页码居中?任何帮助都非常感谢。谢谢,Geoff。

答案1

章节页面使用 页面样式plain。因此,您必须相应地定义此页面样式:

\documentclass[10pt, paper=6.125in:9.25in, twoside=true, pagesize, BCOR=0.375in]{scrbook}
\areaset[current]{4.625in}{7.625in}

\usepackage{fancyhdr}
\fancyhf{}
\fancyhead[LE]{\slshape \leftmark}
\fancyhead[RO]{\slshape \rightmark}
\fancyfoot[C]{\thepage}

\fancypagestyle{plain}{%
  \fancyhf{}
  \fancyfoot[C]{\thepage}
  \renewcommand{\headrulewidth}{0pt}
  \renewcommand{\footrulewidth}{0pt}
}

\pagestyle{fancy}

\usepackage{blindtext}
\begin{document}
\blinddocument
\end{document}

您还可以使用scrlayer-scrpageKOMA-Script 包的一部分。

\documentclass[10pt, paper=6.125in:9.25in, twoside=true, pagesize, BCOR=0.375in]{scrbook}
\areaset[current]{4.625in}{7.625in}

\usepackage[automark,markcase=upper,headsepline]{scrlayer-scrpage}
\clearpairofpagestyles
\ohead{\headmark}
\cfoot*{\pagemark}
\renewcommand\chaptermarkformat{\ifnumbered{chapter}{\chapapp\ \thechapter. \ }{}}

\usepackage{blindtext}% dummy text
\begin{document}
\blinddocument
\end{document}

相关内容