我把每个列表都放在一侧。有什么方法可以格式化页码(字体大小和对齐方式)吗?我使用包fancyhdr
和以下代码:
\fancyfootoffset[R]{1cm}
\setlength{\footskip}{0.8cm}
这不管用。我这里有一个小例子。页码“IV”和“1”格式正确,上面的页码格式不正确。
\documentclass[a4paper,12pt,listof=toc]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{geometry}
\usepackage{fancyhdr}
\usepackage{sectsty}
\usepackage{algpseudocode}
\usepackage{algorithm}
\usepackage{listings}
\usepackage{etoolbox}
\usepackage[nottoc]{tocbibind}
\usepackage{tocloft}
% adjust page numbers horizontally and vertically
\fancyfootoffset[R]{1cm}
\setlength{\footskip}{0.8cm}
\newcommand{\changefont}{%
\fontsize{10}{12}\selectfont
}
\pagestyle{fancy}
% clear all header and footers
\fancyhf{}
\renewcommand{\headrulewidth}{0pt} % remove the header rule
\renewcommand{\headrulewidth}{0pt} % remove the header rule
\rfoot{\changefont \thepage}
% font
\setkomafont{disposition}{\normalcolor\bfseries}
% space between two lines and margins of document
\renewcommand{\baselinestretch}{1.5}
\geometry{left=3cm,right=2.5cm,bottom=2cm,top=2cm}
\begin{document}
\thispagestyle{empty}
\pagenumbering{Roman}
\setcounter{page}{1}
\tableofcontents
\newpage
\listoffigures
\newpage
\listoftables
\newpage
\listofalgorithms
\newpage
\pagenumbering{arabic}
\setcounter{page}{1}
\section{Introduction}
\noindent
text
\end{document}
答案1
您只需重新定义plain
在类似部分的页面中使用的样式即可反映您的更改:
\fancypagestyle{plain}{}
完成 MWE:
\documentclass[a4paper,12pt,listof=toc]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{geometry}
\usepackage{fancyhdr}
\usepackage{sectsty}
\usepackage{algpseudocode}
\usepackage{algorithm}
\usepackage{listings}
\usepackage{etoolbox}
\usepackage[nottoc]{tocbibind}
\usepackage{tocloft}
% adjust page numbers horizontally and vertically
\fancyfootoffset[R]{1cm}
\setlength{\footskip}{0.8cm}
\newcommand{\changefont}{%
\fontsize{10}{12}\selectfont
}
\pagestyle{fancy}
% clear all header and footers
\fancyhf{}
\renewcommand{\headrulewidth}{0pt} % remove the header rule
\renewcommand{\headrulewidth}{0pt} % remove the header rule
\rfoot{\changefont \thepage}
\fancypagestyle{plain}{}
% font
\setkomafont{disposition}{\normalcolor\bfseries}
% space between two lines and margins of document
\renewcommand{\baselinestretch}{1.5}
\geometry{left=3cm,right=2.5cm,bottom=2cm,top=2cm}
\begin{document}
\thispagestyle{empty}
\pagenumbering{Roman}
\setcounter{page}{1}
\tableofcontents
\newpage
\listoffigures
\newpage
\listoftables
\newpage
\listofalgorithms
\newpage
\pagenumbering{arabic}
\setcounter{page}{1}
\section{Introduction}
\noindent
text
\end{document}
页面示例: