首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >latex取消目录页的页眉和页角?

latex取消目录页的页眉和页角?

提问于 2026-05-19 14:10:38
回答 1关注 0查看 2

\def\usewhat{xelatex}

\documentclass[12pt]{ctexart}

% 仅保留必需宏包

\usepackage[leqno]{amsmath}

\usepackage{amssymb}

\usepackage{float}

\usepackage{subcaption}

\usepackage{geometry}

\usepackage{tocloft}

\usepackage{setspace}

\usepackage{fontspec}

\usepackage{fancyhdr}

\usepackage{titlesec}

% 编号与目录深度

\setcounter{secnumdepth}{3}

\setcounter{tocdepth}{3}

% 编号样式

\renewcommand{\thesection}{\arabic{section}}

\renewcommand{\thesubsection}{\thesection.\arabic{subsection}}

\renewcommand{\thesubsubsection}{\thesubsection.\arabic{subsubsection}}

% 目录点线

\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}

\setlength{\cftsecnumwidth}{2em}

\setlength{\cftsubsecnumwidth}{3em}

\setlength{\cftsubsubsecnumwidth}{4em}

\renewcommand{\cftdotsep}{1.5}

% 全局格式

\setstretch{1.25}

\setlength{\parindent}{2em}

% 字体

\setCJKmainfont[AutoFakeBold]{SimSun}

\setmainfont{Times New Roman}

% 章节标题

\titleformat{\section}{\normalfont\large\bfseries}{\thesection}{1em}{}

\titlespacing{\section}{0pt}{*2}{*1}

% 页边距

\geometry{left=3cm, right=2.5cm, top=2.5cm, bottom=2.5cm}

% 目录格式

\renewcommand{\contentsname}{\centerline{\songti\zihao{3}\bfseries 目录}}

\renewcommand{\cftsecfont}{\songti\fontsize{12pt}{14pt}\selectfont}

\renewcommand{\cftsubsecfont}{\songti\fontsize{12pt}{14pt}\selectfont}

\renewcommand{\cftsubsubsecfont}{\songti\fontsize{12pt}{14pt}\selectfont}

\renewcommand{\cftsecpagefont}{\fontsize{12pt}{14pt}\selectfont}

\renewcommand{\cftsubsecpagefont}{\fontsize{12pt}{14pt}\selectfont}

\renewcommand{\cftsubsubsecpagefont}{\fontsize{12pt}{14pt}\selectfont}

\cftsetindents{section}{0em}{2em}

\cftsetindents{subsection}{2em}{3em}

\cftsetindents{subsubsection}{5em}{4em}

% 自定义加粗

\newsavebox\faketextbfbox

\newcommand{\faketextbf}[1]{%

\sbox\faketextbfbox{#1}%

\rlap{\usebox\faketextbfbox}\hspace{0.02em}%

\rlap{\usebox\faketextbfbox}\hspace{0.02em}%

\usebox\faketextbfbox%

}

% 页眉页脚

\pagestyle{empty}

\fancypagestyle{mainstyle}{%

\fancyhf{}

\renewcommand{\headrulewidth}{0.4pt}

\renewcommand{\footrulewidth}{0pt}

\fancyhead[C]{\songti\zihao{5}

\ifodd\value{page}

弹性接触问题互补模型求解

\else

本科毕业设计(论文)

\fi

}

\fancyfoot[C]{\thepage}

}

\fancypagestyle{plain}{\pagestyle{mainstyle}}

\begin{document}

\begin{center}

\zihao{3}\textbf{摘要}

\end{center}

弹性接触问题普遍存在于机械装配、土木结构、工程构件连接等实际场景中,该类问题同时受

\begin{center}

\fontsize{16pt}{1.25\baselineskip}\selectfont\bfseries Abstract

\end{center}

Elastic contact problems widely exist in practical scenarios such as

\newpage

\pagestyle{empty}

\tableofcontents

\newpage

\pagestyle{mainstyle}

\pagenumbering{arabic}

\setcounter{page}{1}

\section{绪论}

弹性接触问题是固体力学与接触力学领域的典型非线性非光滑问题,广泛存在于机械装备装配

\end{document}

回答

和开发者交流更多问题细节吧,去 写回答
相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档