タイトルページの後にページ番号を付けずに、章の間に \pagestyle{plain} を使用しますか?

タイトルページの後にページ番号を付けずに、章の間に \pagestyle{plain} を使用しますか?

章間の空白ページのヘッダー/フッターを削除する方法についての投稿を多数見つけましたが、1つの大きな例外を除いて問題なく機能します...\pagestyle{plain}ドキュメントの章が始まる前のすべての空白ページに(つまり、中央揃えの単一のページ番号)が必要ですを除外する\pagestyle{empty}このページには直後の私がこれまでに見たり試したりした方法\titlepageでは、ドキュメント全体または\pagestyle{plain}すべてのページが完全に空白のままになります。

私はbookドキュメント クラス[twosided,openright]、を使用しておりfancyhdr、次のように再定義するコードを含めました\cleardoublepage

\makeatletter
\def
\cleardoublepage{%
\clearpage
  \ifodd\c@page
  \else
    \hbox{}
    \thispagestyle{plain}
    \newpage      
  \fi
  }%
\makeatother

...さまざまな投稿で推奨されているように。残念ながら、これではページ番号の後に空白ページが残りますtitlepage(クライアントがイライラしています)。コードは、そのページを取得するためのインラインの試行をすべてオーバーライドしているようです{empty}

そのセクションだけをクリアし、残りの部分 ( )を中間の空白ページとして残すために使用できる、\if@titlepage同様の条件式はありますか? それを条件式としてキャプチャする方法はありますか?\if@mainmatter\frontmatter, \mainmatter, \appendix, \backmatter\pagestyle{plain}

(非常に)大まかな近似値 MWE:

\documentclass[12pt,letterpaper,final,openright]{book}

\usepackage{fancyhdr}
\usepackage{natbib}

\pagestyle{fancy}
  \setlength{\headheight}{15.2pt}
  \renewcommand{\headrulewidth}{0.4pt}
  \renewcommand{\footrulewidth}{0.2pt}

  \makeatletter
    \renewcommand{\chaptermark}[1]{%
      \if@mainmatter
        \markboth{\MakeUppercase{\chaptername\ \thechapter.\ #1}}{}
      \else
        \markboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}
      \fi
      }%
  \makeatother  

  \fancyhf{} 
  \fancyhead[LE,RO]{\small \thepage}
  \fancyhead[LO]{\small \leftmark}
  \fancyhead[RE]{\small \rightmark}

% Redefine \pagestyle{plain}
\fancypagestyle{plain}{%
  \fancyhf{} % clear all header and footer fields
  \fancyfoot[C]{\small \thepage} % except the center
  \renewcommand{\headrulewidth}{0pt}
  \renewcommand{\footrulewidth}{0pt}
  }%

% Code for creating plain on empty pages before new chapter
\makeatletter
\def
  \cleardoublepage{%
    \clearpage
      \ifodd\c@page
      \else
        \hbox{}
        \thispagestyle{plain}
        \newpage      
      \fi
    }%
\makeatother

\begin{document}
% TITLE PAGE
\pagestyle{empty}  %Clear hdr/ftr 
\titlepage
  \input{./Chapter_txt/titlepageV1} %Custom title page text/layout

\frontmatter
\pagestyle{fancy} % Resume hdr/ftr
%MANAGEMENT SUMMARY 
\include{Preface} %Intro/Preface chapter

%ToC and Lists  
\tableofcontents
\listoftables   
\listoffigures

\mainmatter
\part{PartI}
  \include{Chapter1}
  \include{Chapter2}
\part{PartII}
  \include{Chapter3}
  \include{Chapter4}

\appendix
  \include{app}

\backmatter  
    \bibliographystyle{humannat}
    \bibliography{mybib}\footnotesize
    \addcontentsline{toc}{chapter}{Bibliography}

\end{document}

全体としては複数巻の作品で、各セクションは ... によって描かれています。MWEを行うには良い方法ではありません (または\include{file}を含む MWE を行う方法がわかりません)。\input\include

答え1

解決策はここにあります編集: さらなる説明

plainpagestyle はファンシーで、章間のページは を再定義することによって に設定されます(この最後のコマンドはと\cleardoublepageによって使用されます)\part\chapter

パートページ後のページはplain再定義によって設定されます\@endpart

タイトルページの後のページは、環境emptyの直後にこのページスタイル{空}によって設定されますtitlepage

\documentclass{book}
\usepackage{lipsum}
\usepackage{fancyhdr}
\fancyhf{}  
\fancyhead[R]{\leftmark} 
\fancyfoot[R]{test} 
\fancyfoot[C]{\thepage}
\pagestyle{fancy}
\let\mtcleardoublepage\cleardoublepage
\renewcommand{\cleardoublepage}{\clearpage{\pagestyle{plain}\mtcleardoublepage}}
\makeatletter
\def\@endpart{\vfil\newpage
              \if@twoside
               \if@openright
                \null
                \thispagestyle{plain}%
                \newpage
               \fi
              \fi
              \if@tempswa
                \twocolumn
              \fi}
\makeatother
\title{Test}
\author{Me}
\begin{document}
\begin{titlepage}
\maketitle
\end{titlepage}
\thispagestyle{empty}
\lipsum[1-20]
\part{Deux}
\chapter{trois}
\lipsum[1-50]
\end{document}

編集: この特定のコード

\documentclass[12pt]{book}

\usepackage{fancyhdr}
\usepackage{natbib}

\pagestyle{fancy}
  \setlength{\headheight}{15.2pt}
  \renewcommand{\headrulewidth}{0.4pt}
  \renewcommand{\footrulewidth}{0.2pt}

  \makeatletter
    \renewcommand{\chaptermark}[1]{%
      \if@mainmatter
        \markboth{\MakeUppercase{\chaptername\ \thechapter.\ #1}}{}
      \else
        \markboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}
      \fi
      }%
  \makeatother  

  \fancyhf{} 
  \fancyhead[LE,RO]{\small \thepage}
  \fancyhead[LO]{\small \leftmark}
  \fancyhead[RE]{\small \rightmark}

% Redefine \pagestyle{plain}
\fancypagestyle{plain}{%
  \fancyhf{} % clear all header and footer fields
  \fancyfoot[C]{\small \thepage} % except the center
  \renewcommand{\headrulewidth}{0pt}
  \renewcommand{\footrulewidth}{0pt}
  }%

\let\mtcleardoublepage\cleardoublepage
\renewcommand{\cleardoublepage}{\clearpage{\pagestyle{plain}\mtcleardoublepage}}
\makeatletter
\def\@endpart{\vfil\newpage
              \if@twoside
               \if@openright
                \null
                \thispagestyle{plain}%
                \newpage
               \fi
              \fi
              \if@tempswa
                \twocolumn
              \fi}
\makeatother

\begin{document}

\begin{titlepage}
test
\end{titlepage}
\thispagestyle{empty}
\frontmatter

\include{Preface} %Intro/Preface chapter

%ToC and Lists  
\tableofcontents
\listoftables   
\listoffigures

\mainmatter
\part{PartI}
  \include{Chapter1}
  \include{Chapter2}
\part{PartII}
  \include{Chapter3}
  \include{Chapter4}

\appendix
  \include{app}

\backmatter 
\footnotesize 
    \bibliographystyle{humannat}
    \bibliography{mybib}
    \addcontentsline{toc}{chapter}{Bibliography}

\end{document}

答え2

おそらく、環境を再定義する必要がありますtitlepage。私の環境は次のようになっており、タイトルページ後の最初のページは空で、次のページは正しく番号付けされています。

\newenvironment{titlepage}
{%
  \if@openright
    \cleardoublepage
  \else
    \clearpage
  \fi%
  \newpage
  \thispagestyle{empty}%
  \setcounter{page}\@ne
}%
{\newpage
  \thispagestyle{empty}
}%%

さらに、コマンドを使用する場合は、コマンド定義の最後に を\maketitle追加する必要があります。\clearpage

\if@titlepage
\newcommand\maketitle{%
  \begin{titlepage}
...
  \end{titlepage}%
  \clearpage%
  \setcounter{footnote}{0}%
...
}%
\fi

お役に立てれば幸いです。

答え3

パッケージをロードできますscrextendオプションを使用しますcleardoublepage=plain。タイトルページの直後に空のページを取得するには、環境\cleardoubleoddemptypageの後に使用するtitlepageか、この環境内の最後のコマンドとして使用します。

\documentclass{book}
\usepackage[cleardoublepage=plain]{scrextend}
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{blindtext}% dummy text
\begin{document}
\begin{titlepage}
\Huge My Titlepage
\end{titlepage}
\cleardoubleoddemptypage
\frontmatter
\tableofcontents
\mainmatter
\blinddocument
\Blindtext
\blinddocument
\end{document}

もう一つの可能​​性は、etoolbox:

\documentclass{book}
%
\usepackage[cleardoublepage=plain]{scrextend}
\usepackage{etoolbox}
\AfterEndEnvironment{titlepage}{\cleardoubleoddemptypage}
%
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{blindtext}% dummy text
\begin{document}
\begin{titlepage}
\Huge My Titlepage
\end{titlepage}
\frontmatter
\tableofcontents
\mainmatter
\blinddocument
\Blindtext
\blinddocument
\end{document}

関連情報