|
回复 14# kuing - \documentclass[12pt,a4paper]{report}
- % AMS的数学宏包
- \usepackage{amssymb}
- \usepackage{amsmath}
- \usepackage[inline]{enumitem}
- \usepackage{lipsum}
- % 插入图片
- \usepackage{graphicx}
- \usepackage{float}
- \usepackage{sectsty}
- % XeTeX相应宏包
- \ProvidesPackage{zhfontcfg}
- \usepackage{xltxtra,fontspec,xunicode}
- \defaultfontfeatures{Mapping=tex-text}
- % 允许斜体和粗体
- \usepackage[slantfont,boldfont]{xeCJK}
- % 页边距设置
- \usepackage[top=43mm,bottom=41mm,left=34mm,right=34mm]{geometry}
- % 表格颜色
- \usepackage{colortbl}
- % 交叉引用链接
- \usepackage[xetex,bookmarksnumbered,bookmarksopen,colorlinks,citecolor=black,linkcolor=blue]{hyperref}
- \usepackage{listings}
- \setCJKmainfont{SimSun}
- \setCJKfamilyfont{hei}{SimHei}
- \setCJKfamilyfont{kai}{KaiTi}
- \newcommand {\hei}{\CJKfamily{hei}}
- \newcommand {\kai}{\CJKfamily{kai}}
- % 英文衬线字体
- \setmainfont{DejaVu Serif}
- % 英文等宽字体
- \setmonofont{DejaVu Sans Mono}
- % 英文无衬线字体
- \setsansfont{DejaVu Sans}
- % 中文方式断行
- \XeTeXlinebreaklocale "zh"
- \XeTeXlinebreakskip = 0pt plus 1pt
- % 设置缩进量
- \usepackage{indentfirst}
- \setlength{\parindent}{2.0em}
- % 设置行距
- \linespread{1.5}
- % 目录字体、样式
- \usepackage{caption}
- \usepackage{subcaption}
- \usepackage{titletoc}
- \titlecontents{chapter}[0pt]
- {\normalfont\bf\fontsize{14pt}{\baselineskip}\selectfont}
- {第 \thecontentslabel 章\quad}{}
- {\titlerule*[10pt]{$\cdot$}\contentspage}
- \titlecontents{section}[0pt]
- {\fontsize{12pt}{\baselineskip}\selectfont}
- {\hspace*{3em}\contentslabel{2em}\ }{}
- {\titlerule*[0.5pc]{$\cdot$}\contentspage\
- }
- \titlecontents{subsection}[1cm]
- {\fontsize{12pt}{\baselineskip}\selectfont}
- {\hspace*{3em}\contentslabel{2em}\ }{}
- {\titlerule*[0.5pc]{$\cdot$}\contentspage
- }
- % 目录字体结束
- %章节、子章节的标题样式
- \usepackage[small,center,pagestyles]{titlesec}
- \titlespacing{\chapter}{0pt}{5pt}{10pt}
- \renewcommand{\chaptername}[1]{第 \thechapter 章 #1}
- \titleformat{\chapter}[hang]{\bfseries\centering\fontsize{20pt}{\baselineskip}\selectfont}{\chaptername}{20pt}{}
- \renewcommand{\contentsname}{\bfseries\fontsize{20pt}{\baselineskip}\selectfont \textbf{目 录}}
- \titleformat{\section}{\bfseries\hei\fontsize{15pt}{\baselineskip}\selectfont}{\thesection}{1em}{}
- \titleformat{\subsection}{\bfseries\hei\fontsize{15pt}{\baselineskip}\selectfont}{\thesubsection}{1em}{}
- % 图片样式
- \renewcommand{\figurename}{图}
- \renewcommand {\thefigure} {\thechapter{}-\arabic{figure}}
- \captionsetup{labelformat=default,labelsep=space}
- % 图片样式结束
- \usepackage[toc,page,titletoc,title]{appendix}% 附录
- % 修改目录标题和附录标题为中文
- \renewcommand{\appendixtocname}{附录}
- \renewcommand{\appendixpagename}{附录}
- % 页眉页脚
- \usepackage{fancyhdr}
- \makeatletter
- % 双线页眉
- \newcommand{\makeheadrule}{%
- \makebox[0pt][l]{\rule[0.55\baselineskip]{\headwidth}{0.4pt}}%
- \rule[0.7\baselineskip]{\headwidth}{0.4pt}}
- \renewcommand{\headrule}{%
- {\if@fancyplain\let\headrulewidth\plainheadrulewidth\fi
- \makeheadrule}
- }
- \makeatother
- \begin{document}
- % 目录页的页眉页脚设置
- \pagestyle{fancy}
- \fancyhf{}
- \fancyhead[C]{\kai\fontsize{10.5pt}{\baselineskip}\selectfont 目录}
- \cfoot{}
- % 生成目录
- \tableofcontents
- % 插入分页符
- \pagebreak
- % 正文的页眉页脚
- \pagestyle{fancy}
- \fancyhf{}
- \fancyhead[C]{\kai\fontsize{10.5pt}{\baselineskip}\selectfont\rightmark}
- \cfoot{~\thepage~}
- % 重置正文为第 1 页
- \setcounter{page}{1}
- \chapter{第一章}
- \section{第一节}
- \lipsum[1-11]
- \section{第二节}
- \subsection{第2.1子节}
- \lipsum[1-11]
- \subsection{第2.2子节}
- \lipsum[1-11]
- \chapter{第二章}
- \section{第一节}
- \section{第二节}
- \clearpage
- \fancyhead[C]{\kai\fontsize{10.5pt}{\baselineskip}\selectfont 附录}
- \newcommand\flsection[1]{
- \phantomsection%不加它链接定位会不准确,不知为什么
- \addcontentsline{toc}{section}{#1}\section*{#1}
- }
- \begin{appendices}
- \flsection{附录1}
- \pagebreak
- \flsection{附录2}
- \end{appendices}
- \clearpage
- \newpage
- \thispagestyle{empty}
- \pagestyle{fancy}
- \fancyhf{}
- \chead{}
- \cfoot{}
- \renewcommand{\headrulewidth}{0pt}
- \renewcommand{\footrulewidth}{0pt}
- \fontsize{10pt}{\baselineskip}\selectfont
- 追加页,无内容,无页眉页脚,无章节标题
- \end{document}
复制代码 目前的代码如上。现在想在附录页里清掉页眉和页脚,还没来得及试验。觉得最后一页的追加内容没有页眉之类的,是不是因为它没有chapter等等啊。 |
|