![如何创建此文档样式?](https://linux22.com/image/407876/%E5%A6%82%E4%BD%95%E5%88%9B%E5%BB%BA%E6%AD%A4%E6%96%87%E6%A1%A3%E6%A0%B7%E5%BC%8F%EF%BC%9F.png)
答案1
这是使用 TikZ 和 的一种方法eso-pic
。
\documentclass[12pt]{book}
\usepackage[margin=1in]{geometry}
\usepackage{tikzpagenodes}
\usepackage{eso-pic}
\usepackage{lipsum} % some fill text
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\setlength{\headheight}{15pt}
\fancyhead[LE]{Chapter~\thechapter}
\fancyhead[RE]{}
\fancyhead[LO]{}
\fancyhead[RO]{Section~\thesection}
\fancyfoot[LE]{Page~\thepage}
\fancyfoot[RO]{Page~\thepage}
\fancyfoot[C]{}
\AddToShipoutPictureBG{%
\begin{tikzpicture}[overlay,remember picture]
\fill[even odd rule,blue!20] (current page.south west)
rectangle (current page.north east)
[rounded corners=1em]
([xshift=-0.5em,yshift=-0.5em]current page text area.south west)
rectangle ([xshift=0.5em,yshift=0.5em]current page text area.north east);
\draw[blue,dash pattern=on 5pt off 0.5pt,line width=2pt,rounded corners=1em]
([xshift=-0.5em,yshift=-0.5em]current page text area.south west)
rectangle ([xshift=0.5em,yshift=0.5em]current page text area.north east);
\end{tikzpicture}}
\renewcommand{\familydefault}{\sfdefault}
\begin{document}
\chapter{pft}
\section{blub}
\lipsum[1-20]
\end{document}
或者带有灰色条纹,间距稍微宽裕一些,并且没有fancyhdr
页眉tikz
和页脚(以便于更精细地放置)。
\documentclass[12pt]{book}
\usepackage[margin=1.2in]{geometry}
\usepackage{tikzpagenodes}
\usepackage{eso-pic}
\usepackage{lipsum} % some fill text
\pagestyle{empty}
\AddToShipoutPictureBG{%
\begin{tikzpicture}[overlay,remember picture]
\ifodd\value{page}
\fill[gray!50] (current page.south west) rectangle ([xshift=1cm]current
page.north west);
\fill[even odd rule,blue!20] ([xshift=1cm]current page.south west)
rectangle (current page.north east)
[rounded corners=1em]
([xshift=-1.5em,yshift=-1.5em]current page text area.south west)
rectangle ([xshift=1.5em,yshift=1.5em]current page text area.north east);
\node[anchor=south east,text depth=0.25ex] at
([yshift=2em,xshift=1.5em]current page text area.north east){Section~\thesection};
\node[anchor=north east] at
([yshift=-2em,xshift=1.5em]current page text area.south east){Page~\thepage};
\else
\fill[gray!50] (current page.south east) rectangle ([xshift=-1cm]current
page.north east);
\fill[even odd rule,blue!20] ([xshift=-1cm]current page.south east)
rectangle (current page.north west)
[rounded corners=1em]
([xshift=-1.5em,yshift=-1.5em]current page text area.south west)
rectangle ([xshift=1.5em,yshift=1.5em]current page text area.north east);
\node[anchor=south west,text depth=0.25ex] at
([yshift=2em,xshift=-1.5em]current page text area.north west){Chapter~\thechapter};
\node[anchor=north west] at
([yshift=-2em,xshift=-1.5em]current page text area.south west){Page~\thepage};
\fi
\draw[blue,dash pattern=on 5pt off 1pt,line width=2pt,rounded corners=1em]
([xshift=-1.5em,yshift=-1.5em]current page text area.south west)
rectangle ([xshift=1.5em,yshift=1.5em]current page text area.north east);
\end{tikzpicture}}
\renewcommand{\familydefault}{\sfdefault}
\begin{document}
\chapter{pft}
\thispagestyle{empty}
\section{blub}
\lipsum[1-20]
\end{document}
(请注意,只需在顶部添加灰色条就可以获得看似更简单的代码,但我发现不要过度绘制东西会更干净。)