答案1
这里有一个使用report
类的方法,正如@JohnKormylo 提到的,更好的方法是替换\@part
,但我希望下面的代码足以满足你的情况。
该命令\topleft
指示垂直线与纸张左边缘的距离,您可以根据需要更改它。
\documentclass{report}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{lipsum}
\makeatletter
\@addtoreset{chapter}{part}
\makeatother
\renewcommand{\thepart}{\arabic{part}}
\def\topleft{4}
\newcommand{\cpart}[1]{
\clearpage
\stepcounter{part}
\pagestyle{empty}
\begin{tikzpicture}[overlay,remember picture]
\coordinate(ptopleft) at ($(current page.north west)+(\topleft,0)$);
\foreach \i in{0,.1,.2,.3,.5,.6,.9,1.1,1.2,1.3,1.5,1.6,1.8,1.9,2}
\draw[gray!70]($(ptopleft)+(\i,0)$)--+(0,-\paperheight);
\node[white,fill=black,minimum size=1.5cm](A) at ($(ptopleft)+(1,-2)$){\huge\thepart};
\node [anchor=south,ultra thick,yshift=-1mm]at(A.north){\Large PART};
\node [fill=white,anchor=north,very thick,right=-2mm,inner sep=5mm]at($(ptopleft)+(0,-0.5\paperheight)$){\Huge #1};
\end{tikzpicture}
\addcontentsline{toc}{part}{\thepart\hspace{1em}#1}
\clearpage
\pagestyle{plain}
}
\begin{document}
\pagestyle{empty}
\tableofcontents
\thispagestyle{empty}
\cpart{Part title title title}
\chapter{chapter one}
\lipsum[1-3]
\chapter{chapter two}
\lipsum[1-3]
\end{document}