% !Mode:: "TeX:UTF-8"
% !TEX program = xelatex
\def\usewhat{xelatex}
\documentclass[twoside,openany,UTF8]{ctexbook}
% 引入信息中枢
\input{metadata}
% 引入原本科的设置
\input{setup/package}
\input{setup/format}
\begin{document}
% ============================================================
% 1. 绝对无页码区 (封面、声明、摘要)
% ============================================================
% 【核武器】将 plain 样式彻底清空
% 这样即使 \chapter 强制切换到 plain,也是无页眉无页码的
\fancypagestyle{plain}{
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
}
\pagestyle{empty}
% 临时禁用空白页
\let\oldcleardoublepage\cleardoublepage
\renewcommand{\cleardoublepage}{\clearpage}
\input{preface/cover}
\input{preface/titlepage}
\input{preface/declaration}
\input{preface/abstract_cn}
\input{preface/abstract_en}
% ============================================================
% 2. 目录区 (恢复页码 I, II...)
% ============================================================
% 恢复双面打印逻辑 (如果需要)
\let\cleardoublepage\oldcleardoublepage
\cleardoublepage
\frontmatter % 开启页码计数 (i, ii...)
\pagenumbering{Roman} % 强制大写罗马数字
% 【复活】将 plain 样式恢复为“无页眉、有页脚”
\fancypagestyle{plain}{
\fancyhf{}
\fancyfoot[C]{\rmfamily\zihao{-5} \thepage} % 目录页脚显示页码
\renewcommand{\headrulewidth}{0pt}
}
\pagestyle{plain}
\tableofcontents
% ============================================================
% 3. 正文部分 (恢复正常)
% ============================================================
\mainmatter
\pagenumbering{arabic}
% 【关键】重新定义正文样式,确保万无一失
% 1. 定义 fancy (普通页):有页眉 + 有页脚
\pagestyle{fancy}
\fancyhf{}
\fancyhead[CO]{\songti\zihao{-5} 天津科技大学硕士学位论文}
\fancyhead[CE]{\songti\zihao{-5} \leftmark}
\fancyfoot[C]{\rmfamily\zihao{-5} \thepage}
\renewcommand{\headrulewidth}{0.5pt}
% 2. 定义 plain (章首页):有页眉 + 有页脚 (与 fancy 保持一致)
\fancypagestyle{plain}{
\fancyhf{}
\fancyhead[CO]{\songti\zihao{-5} 天津科技大学硕士学位论文}
\fancyhead[CE]{\songti\zihao{-5} \leftmark}
\fancyfoot[C]{\rmfamily\zihao{-5} \thepage}
\renewcommand{\headrulewidth}{0.5pt}
}
\defaultfont
\include{body/chapter1} % 第一章
\include{body/chapter2} % 第二章
% ============================================================
% 4. 结尾部分
% ============================================================
% 结论
\include{body/conclusion} % 建议将“结论”独立于章节
% 参考文献 (format.tex里已经改成了\chapter,会自动变成第7章)
\cleardoublepage
\nocite{*}
\bibliographystyle{references/ref.buk}
\bibliography{references/reference}
% 成果 (会自动编号)
\include{appendix/publications}
% 致谢 (会自动编号)
\include{appendix/acknowledgments}
% 附录 (不编号)
\include{appendix/appendix}
\end{document}