公告/新闻通讯页面顶部和底部的 TikZ 页眉和页脚

公告/新闻通讯页面顶部和底部的 TikZ 页眉和页脚

我想要一个简单的 TikZ 彩色页眉和页脚,用于公告/新闻稿模板。我想到的是这样的:

在此处输入图片描述

请注意跨越第一页顶部和底部宽度的绿色带。

您能建议一种解决这个问题的方法吗?

答案1

一种可能性remember picture, overlay是,使用选项tikzpicture(根据您的需要进行必要的调整);该包atbegshi用于在每一页上放置页眉和页脚:

\documentclass{article}
\usepackage[hmargin=2cm,bmargin=3cm,tmargin=4.5cm,centering]{geometry}
\usepackage{tikzpagenodes}
\usetikzlibrary{calc}
\usepackage{lmodern}
\usepackage{multicol}
\usepackage{lipsum}
\usepackage{atbegshi}

\definecolor{mygreen}{RGB}{25,170,75}
\newcommand\Header{%
\begin{tikzpicture}[remember picture,overlay]
\fill[mygreen]
  (current page.north west) -- (current page.north east) --
  ([yshift=50pt]current page.north east|-current page text area.north east) --
  ([yshift=50pt,xshift=-3cm]current page.north|-current page text area.north) --
  ([yshift=10pt,xshift=-5cm]current page.north|-current page text area.north) --
  ([yshift=10pt]current page.north west|-current page text area.north west) -- cycle;
\node[font=\sffamily\bfseries\color{white},anchor=east,
  xshift=-1.5cm,yshift=-1.3cm] at (current page.north east)
  {\fontsize{50}{60}\selectfont d3pd Bulletin};
\end{tikzpicture}%
}
\newcommand\Footer{%
\begin{tikzpicture}[remember picture,overlay]
\fill[mygreen]
  (current page.south west) -- (current page.south east) --
  ([yshift=-40pt]current page.south east|-current page text area.south east) --
  ([yshift=-40pt,xshift=-3cm]current page.south|-current page text area.south) --
  ([xshift=-5cm,yshift=-10pt]current page.south|-current page text area.south) --
  ([yshift=-10pt]current page.south west|-current page text area.south west) -- cycle;
\node[yshift=0.75cm,font=\ttfamily\bfseries\color{white}] at (current page.south) {\fontsize{20}{24}\selectfont www.stackexchange.com};
\end{tikzpicture}%
}

\pagestyle{empty}
\AtBeginShipout{\Header\Footer}
\AtBeginShipoutFirst{\Header\Footer}

\begin{document}
\begin{multicols}{3}
\lipsum[1-15]
\end{multicols}
\end{document}

在此处输入图片描述

相关内容