
で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}