我遇到了一个问题。当我使用此命令设置页码的字体大小 ( \renewcommand*{\thepage}{\footnotesize\arabic{page}}
) 时,目录中的所有页码也会变成脚注大小。我该如何解决这个问题?
[多普勒]这是主文件的序言:
\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{standalone}
\usepackage{wallpaper}
\usepackage{color}
\definecolor{darkblue}{RGB}{6,0,111}
\definecolor{red}{RGB}{255,0,0}
\definecolor{green}{RGB}{0,125,0}
\usepackage{indentfirst}
\setlength\parindent{1.25cm}
\usepackage{graphicx}
%\DeclareGraphicsExtensions{.jpg,.png}
\renewcommand*\contentsname{\centering ÍNDICE}
\usepackage{titletoc}
\setcounter{secnumdepth}{6}
\setcounter{tocdepth}{6}
\titlecontents{section}[0em]{\medskip\bfseries}
{\thecontentslabel.\enspace} %numbered
{} %numberless
{\titlerule*[1.5mm]{.}\contentspage}
\titlecontents{subsection}[0em]{\smallskip}
{\thecontentslabel.\enspace} %numbered
{} %numberless
{\normalfont\titlerule*[1.5mm]{.}\contentspage}
\titlecontents{subsubsection}[0em]{\smallskip\bfseries}
{\thecontentslabel.\enspace} %numbered
{} %numberless
{\normalfont\titlerule*[1.5mm]{.}\contentspage}
\titlecontents{paragraph}[0em]{\smallskip}
{\thecontentslabel.\enspace} %numbered
{} %numberless
{\normalfont\titlerule*[1.5mm]{.}\contentspage}
\titlecontents{subparagraph}[0em]{\smallskip\itshape}
{\thecontentslabel.\enspace} %numbered
{} %numberless
{\normalfont\titlerule*[1.5mm]{.}\contentspage}
\usepackage{enumitem}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{setspace}
\singlespacing
\usepackage{units}
\usepackage[fleqn]{amsmath}
\makeatletter
\g@addto@macro\normalsize{%
\setlength\abovedisplayskip{0mm}
\setlength\belowdisplayskip{5mm}
\setlength\abovedisplayshortskip{0mm}
\setlength\belowdisplayshortskip{0mm}
}
\makeatother
\usepackage{txfonts}
\renewcommand*{\thepage}{\footnotesize\arabic{page}}
\pagestyle{myheadings}
\usepackage[bottom=2cm,top=3cm,left=3cm,right=2cm]{geometry}
\usepackage{titling}
\usepackage{titlesec}
\titlelabel{\thetitle.\quad}
%\titlelabel{\theparagraph.\quad}
\titleformat*{\section}{\normalsize\bfseries\uppercase}
\titleformat*{\subsection}{\normalsize\uppercase}
\titleformat*{\subsubsection}{\normalsize\bfseries}
\titleformat{\paragraph}[hang]{\normalsize}{\theparagraph.}{1em}{}
\titleformat{\subparagraph}[hang]{\normalsize\itshape}{\thesubparagraph.}{1em}{}
\begin{document}
% TOC
\newpage
\thispagestyle{empty}
\tableofcontents
\thispagestyle{empty}
\newpage
% MISC
\section{Sec One}
\subsection{Subsec One}
\subsection{Subsec Two}
\subsection{Subsec Three}
\newpage
\section{Sec Two}
\subsection{Subsec One}
\subsection{Subsec Two}
\subsection{Subsec Three}
\newpage
\section{Sec Three}
\subsection{Subsec One}
\subsection{Subsec Two}
\subsection{Subsec Three}
\newpage
\section{Sec Four}
\subsection{Subsec One}
\subsection{Subsec Two}
\subsection{Subsec Three}
\end{document}
答案1
答案2
\ps@myheadings
以下是修改文档类定义的宏的解决方案article
。etoolbox
加载包是为了简化\ps@myheadings
宏的“修补”。
\documentclass{article}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\ps@myheadings}{\hfil\thepage}{\hfil\footnotesize\thepage}{}{}
\makeatother
\pagestyle{myheadings}
\begin{document}
\tableofcontents
\clearpage
\section{Hello World}
\end{document}