自定义样式中的页码行为异常

自定义样式中的页码行为异常

我正在写一本(类似)书,里面有几个章节。也许这不是正确的选择,但我使用 subfile 包创建一个 main.tex 文件,并使用 mystyle 包创建一个“自定义样式”。我对页码行为感到困惑。我想要的是:目录和简介部分没有任何标题或页码,所有其他章节都有“正常”页码。以下是我的文件:

主要.tex:

\documentclass[12pt, openright, twoside, a4paper]{report}
\usepackage{subfiles}
\usepackage{mystyle} %/Users/.../texmf/tex/latex/misc/mystyle.sty
\setcounter{tocdepth}{3}

\begin{document}
\subfile{./titre}
\tableofcontents
\subfile{./Introduction}
\subfile{./Ch1}
\subfile{./Ch2}
\subfile{./Ch3}
... other chapters
\clearpage
\addcontentsline{toc}{chapter}{Références}
\end{document}

mystyle.sty:

\ProvidesPackage{mystyle}
\usepackage[margin=3.5cm]{geometry}
... some stuffs
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{\thechapter. \ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection. \ #1}{}}
\fancyhf{}
\fancyfoot[RO,LE]{\thepage}
\fancyhead[RO,LE]{{\bfseries \leftmark}\\\rightmark}
\renewcommand{\headrulewidth}{0.5pt}% filet en haut de page
\addtolength{\headheight}{0.5pt}    % espace pour le filet
\renewcommand{\footrulewidth}{0.5pt}  % filet en bas
...other stuffs
\endinput

以及介绍文件:

\documentclass[./main.tex]{subfiles}
\begin{document}
\pagenumbering{gobble} % Remove page numbers (and reset to 1) (http://tex.stackexchange.com/questions/54333/no-page-numbering)
%\clearpage
\thispagestyle{empty}
\chapter*{Introduction} % Major section
... some text
\end{document}

但它不起作用。好吧,页眉和装饰都很好,但页码却无处可寻!我真的不明白这里发生了什么。我认为每次“调用”ChX 文件时,都会重新读取样式 mystyle 文件。是这样吗?有什么想法吗?谢谢!

相关内容