如何制作实心标题?

如何制作实心标题?

我正在尝试复制某个标准化测试的格式。它看起来有点像这样:

这是表格。

我今天要尝试memoir一下tikz,但我想知道是否有简单的方法可以做到这一点。

答案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}

由于问题中没有提供有关奇数页上的脚注的信息,因此我使用了与偶数页相同的脚注,但您可以轻松更改这一点。

相关内容