솔리드 헤더를 만들려면 어떻게 해야 합니까?

솔리드 헤더를 만들려면 어떻게 해야 합니까?

특정 표준화된 테스트의 형식을 복제하려고 합니다. 다음과 같이 보입니다.

이것이 형태입니다.

오늘은 조금 해볼려고 하는데, 혹시 쉽게 할 수 있는 방법이 없을지 궁금 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}

홀수 페이지의 포스터에 대한 질문에는 정보가 제공되지 않았기 때문에 짝수 페이지와 동일하게 사용했지만 쉽게 변경할 수 있습니다.

관련 정보