I'm writing a (kind of) book, with several chapters. Maybe it's not the right choice, but I'm using the subfile package to create a main.tex file and a "custom style" using the mystyle package. I've trouble with the page number behavior. What I want is: TOC and introduction sections without any header nor page numbers, all the other chapters with "normal" page numbers. Here are my files:
main.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
and the introduction file:
\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}
And it doesn't work. Well, page headers and decorations are just fine, but page numbers appear nowhere! I really don't understand what happens here. I though that for each "call" of a ChX file, the style mystyle file was re-read. Is it the case? Any ideas? Thanks!
\pagenumbering{gobble} % Remove page numbers (and reset to 1)? – Ulrike Fischer Mar 06 '17 at 18:47...some stuffsin the package code ... it is not compilable and requires us to remove it – Mar 06 '17 at 18:49\pagenumbering{gobble}as well ... That makes them disappear. Then\pagenumbering{arabic}to make them appear ... – cfr Mar 07 '17 at 02:20\pagenumbering{gobble}makes then disappear, they can't reappear before\pagenumbering{arabic}. Are you sure you put these commands in just the right places? – cfr Mar 07 '17 at 17:32