LaTeX および Friends の memoir クラスを使用したページ ヘッダー

LaTeX および Friends の memoir クラスを使用したページ ヘッダー

LaTeX とその仲間のページ ヘッダーパッケージfancyhdrは、LaTeX and Friends ブックのページ ヘッダーを作成するために使用されます。memoirクラスを使用して、章が始まる最初のページでこれを実行するにはどうすればよいですか?

MWE:

\documentclass[a4,twoside]{memoir}
\usepackage{lipsum}
\nouppercaseheads
\makepagestyle{mystyle} 
\setlength{\headwidth}{\dimexpr\marginparsep+\marginparwidth\relax}
\makerunningwidth{mystyle}{\headwidth}
\makeevenhead{mystyle}{\thepage\quad\smash{\rule[-0.2ex]{1pt}{4cm}}\quad\textsc{\chaptername~\thechapter}}{}{} 

\makeoddhead{mystyle}{}{}{\textsc{\leftmark}\quad\smash{\rule[-0.2ex]{1pt}{4cm}}\quad\thepage} 

\makeatletter
\makepsmarks{mystyle}{%
    \createmark{chapter}{left}{nonumber}{\@chapapp\ }{.\ }}
\makeatother

\makepagestyle{plain}
\makerunningwidth{plain}{\dimexpr\marginparsep+\marginparwidth\relax}
\makeevenfoot{plain}{\textsc{\leftmark}\quad\smash{\rule[-0.2ex]{1pt}{4cm}}\quad\thepage}{}{}

\pagestyle{mystyle}

\begin{document}
    \chapter{Test Chapter}
    \lipsum[1]
    \section{Test Section}
    \lipsum[1-20]
\end{document}

答え1

このmemoirクラスでchapterは、章の最初のページにページスタイルを使用します。

...
\pagestyle{mystyle}
\aliaspagestyle{chapter}{mystyle}

\begin{document}
...

plainページ スタイルを と同じに再定義した理由がわかりませんが、それでも必要な場合はmystyleに置き換えた方がよいでしょう。\aliaspagestyle{plain}{mystyle}

関連情報