![公告/新闻通讯页面顶部和底部的 TikZ 页眉和页脚](https://linux22.com/image/271171/%E5%85%AC%E5%91%8A%2F%E6%96%B0%E9%97%BB%E9%80%9A%E8%AE%AF%E9%A1%B5%E9%9D%A2%E9%A1%B6%E9%83%A8%E5%92%8C%E5%BA%95%E9%83%A8%E7%9A%84%20TikZ%20%E9%A1%B5%E7%9C%89%E5%92%8C%E9%A1%B5%E8%84%9A.png)
答案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}