
答案1
一種選擇是使用 TikZ 和tikzpagenodes
包(根據您的需求調整設定)。根據評論,每章的首頁也應該有新的頁面樣式,所以
\aliaspagestyle{chapter}{solid}
被使用:
代碼:
\documentclass{memoir}
\usepackage[hmargin=3cm]{geometry}
\usepackage{xcolor}
\usepackage{lmodern}
\usepackage{tikzpagenodes}
\usepackage{lipsum}
\usetikzlibrary{calc,shapes.arrows}
\newlength\GrayBarHt
\newlength\BlackBarWd
\setlength\GrayBarHt{1.5cm}
\setlength\BlackBarWd{10pt}
\newcommand\ChapterNumberFont{\fontsize{30}{36}\selectfont\bfseries\sffamily}
\newcommand\SolidHeader{%
\begin{tikzpicture}[remember picture,overlay]
\path
node[fill=gray!20,inner sep=0pt,text width=\textwidth,anchor=south west,minimum height=\GrayBarHt]
at (current page header area.west)
(box)
{}
node[fill=black,inner sep=0pt,minimum height=\GrayBarHt,text width=\BlackBarWd,anchor=west]
at (box.west)
(bboxl)
{}
node[fill=black,inner sep=0pt,minimum height=\GrayBarHt,text width=\BlackBarWd,anchor=east]
at (box.east)
(bboxr)
{}
node[font=\ChapterNumberFont,anchor=west]
at (bboxl.east)
{\thechapter}
node[font=\ChapterNumberFont,anchor=east]
at (bboxr.west)
{\thechapter};
\end{tikzpicture}%
}
\newcommand\SolidFooter{%
\begin{tikzpicture}[remember picture,overlay]
\path
node[anchor=north west,align=left,font=\sffamily\bfseries]
at (current page footer area.west)
{Unathorized copying or reuse of any part of this page is illegal\\[5ex]\thepage}
node[fill=black,single arrow,text=white,anchor=north west]
at (current page footer area.east)
{\enspace CONTINUE\enspace};
\end{tikzpicture}%
}
\makepagestyle{solid}
\makeevenhead{solid}{\SolidHeader}{}{}
\makeoddhead{solid}{\SolidHeader}{}{}
\makeevenfoot{solid}{\SolidFooter}{}{}
\makeoddfoot{solid}{\SolidFooter}{}{}
% First page of chapters will also have the style
\aliaspagestyle{chapter}{solid}
\pagestyle{solid}
\begin{document}
\chapter{A test chapter}
\lipsum[1-20]
\end{document}
由於問題中沒有提供有關奇數頁上的字體的信息,因此我使用了與偶數頁相同的信息,但您可以輕鬆更改它。