我使用 更改了分页的字体大小,效果很好,但它也更改了文本本身中
\renewcommand{\thepage}{{\footnotesize\arabic{page}}}
此页面参考资料的字体大小( )。有没有什么方法可以防止这种情况发生?\pageref
最小示例:
\documentclass[12pt,a4paper,titlepage,oneside]{article}
\renewcommand{\thepage}{{\footnotesize\arabic{page}}}
\begin{document}
It is shown in the equation \pageref{A}.
\begin{equation}
A = B
\label{A}
\end{equation}
\end{document}
编辑:使用 fancyhdr 的解决方案:
\documentclass[12pt,a4paper,titlepage,oneside]{article}
\usepackage{fancyhdr} %%For headers/footers
\pagestyle{fancy} %%For fancy headers
\begin{document}
\fancyhf{} %clear header/footer
\fancyfoot[C]{{\footnotesize\thepage}} %set fontsize for pagination in footer
\renewcommand{\footrulewidth}{0pt} %remove footer rule
\renewcommand{\headrulewidth}{0pt} %remove header rule
It is shown in the equation \pageref{A}.
\begin{equation}
A = B
\label{A}
\end{equation}
\end{document}
答案1
使用包的替代方案scrlayer-scrpage
。
\documentclass[12pt,a4paper,titlepage,oneside]{article}
\setlength{\headheight}{14.5pt}
\usepackage{scrlayer-scrpage}
\clearpairofpagestyles
\cfoot*{\pagemark}
\addtokomafont{pagenumber}{\footnotesize}
\begin{document}
It is shown in the equation \pageref{A}.
\begin{equation}
A = B
\label{A}
\end{equation}
\end{document}
答案2
您可以定义自己的页面样式(mystyle
如下例中调用):
\documentclass[12pt,a4paper,titlepage,oneside]{article}
\makeatletter
\def\ps@mystyle{% definition of page style "mystyle"
\let\@mkboth\@gobbletwo
\let\@oddhead\@empty
\let\@evenhead\@empty
\def\@oddfoot{\reset@font\footnotesize\hfil\thepage\hfil}
\let\@evenfoot\@oddfoot
}
\makeatother
\pagestyle{mystyle} % use of page style "mystyle"
\begin{document}
It is shown in the equation \pageref{A}.
\begin{equation}
A = B
\label{A}
\end{equation}
\end{document}
答案3
使用 fancyhdr 为我提供的解决方案:
\documentclass[12pt,a4paper,titlepage,oneside]{article}
\usepackage{fancyhdr} %%For headers/footers
\pagestyle{fancy} %%For fancy headers
\begin{document}
\fancyhf{} %clear header/footer
\fancyfoot[C]{{\footnotesize\thepage}} %set fontsize for pagination in footer
\renewcommand{\footrulewidth}{0pt} %remove footer rule
\renewcommand{\headrulewidth}{0pt} %remove header rule
It is shown in the equation \pageref{A}.
\begin{equation}
A = B
\label{A}
\end{equation}
\end{document}