页码格式

页码格式
\documentclass[12pt, a4paper]{article}
\usepackage[
top=3.5cm, 
bottom=2cm, 
left=3.5cm, 
right=2cm, 
headsep=1.5cm,
]{geometry}
\usepackage{fancyhdr}
\usepackage{sectsty}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}
\fancyhead[R]{\thepage}
\usepackage{mathptmx}
\usepackage{tocloft}
\renewcommand{\contentsname}{TABLE OF CONTENTS}
\begin{document}
    \tableofcontents 
    \newpage
\section{INTRODUCTION}
\subsection{Background}
LOREM IPSUM is a graphical bla bla bla and is a bla bla bla that starts with nothing but that.
\begin{itemize}
\item Coverage and Difficult to Interact: Wii wand is not interactive enough and works effectively only within the projected screen space which makes interacting with the screen difficult and not intuitive
\end{itemize}
\end{document}

在此处输入图片描述 在此处输入图片描述 在此处输入图片描述

页码应位于页面顶部和右侧边距两厘米处,且必须是 12 点。我已设法将页码置于右侧,我还有图表列表、图表列表和目录的第一页,其中,页码默认显示在页脚中心。

答案1

您的页码已经位于距右边距 2 厘米处。要将其向上移动,只需添加headsep=1.5cm,这样其底部将位于距页边距 2 厘米处。如果顶部应位于距页边距 2 厘米处,则使用

headsep=\dimexpr1.5cm-8.1pt\relax,

在下面的代码中,因为 8.1pt 是 12pt 字号的 Times 字体的数字高度。

\documentclass[12pt, a4paper]{article}
\usepackage[
  top=3.5cm,
  bottom=2cm,
  left=3.5cm,
  right=2cm,
  headheight=14.5pt,
  headsep=1.5cm,%%%%%% or headsep=\dimexpr1.5cm-8.1pt\relax
]{geometry} % must go before \pagestyle{fancy}

\usepackage{newtxtext,newtxmath}
%\usepackage{mathptmx}% better than times

\usepackage{fancyhdr}

\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt} % no rule
\fancyhf{}
\fancyhead[R]{\thepage}

\begin{document}
\section{INTRODUCTION}
\subsection{Background}
LOREM IPSUM is a graphical bla bla bla and is a bla bla bla that starts with nothing but that.
\begin{itemize}
\item Coverage and Difficult to Interact: Wii wand is not interactive enough and works effectively
only within the projected screen space which makes interacting with the screen difficult and not
intuitive
\end{itemize}

\end{document}

在此处输入图片描述

请注意,该times软件包已被弃用。请使用我添加的或mathptmx

相关内容