如何创建此文档样式?

如何创建此文档样式?

如果您能帮助我创建这种风格的文档,我将不胜感激。非常感谢。

在此处输入图片描述

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

在此处输入图片描述

(请注意,只需在顶部添加灰色条就可以获得看似更简单的代码,但我发现不要过度绘制东西会更干净。)

相关内容