如何避免在 Legrand Orange Book 中打印 \part 页面?

如何避免在 Legrand Orange Book 中打印 \part 页面?

我试图从输出中删除 \part pages,因为它是不必要的功能。
该类有一个自定义命令,用于生成和打印图形和页面,但如果我注释掉其中的部分或整个块,它会在其他地方破坏我的文档。

%Command to create and output the parts pages
\newcommand{\outputpartpage}[2]{
    \begin{tikzpicture}[remember picture, overlay]
        \node[anchor=center, rectangle, fill=ocre!20, inner sep=0pt, minimum height=\paperheight, minimum width=\paperwidth] at (current page.center) {}; % Background color
        \node[anchor=north west, inner sep=0pt, xshift=\Gm@lmargin, yshift=-\Gm@tmargin] at (current page.north west) {\fontsize{220pt}{220pt}\selectfont\sffamily\bfseries\textcolor{ocre!40}{#1}}; % Part number
        \node[anchor=north east, inner sep=0pt, xshift=-\Gm@rmargin, yshift=-\Gm@tmargin] at (current page.north east) {\fontsize{30pt}{30pt}\selectfont\sffamily\bfseries\textcolor{white}{\strut #2}}; % Part title
        \node[anchor=south east, inner sep=0pt, xshift=-\Gm@rmargin, yshift=\Gm@bmargin] at (current page.south east) { % Mini table of contents
            \parbox[t][][t]{8.5cm}{ % Width of box holding the mini ToC
                \printcontents[part]{l}{0}{\setcounter{tocdepth}{1}} % Display the mini table of contents showing chapters and sections, change tocdepth to 2 to also show %subsections or 0 to only show chapters
            }
        };
    \end{tikzpicture}
}
\renewcommand{\part}[1]{\addcontentsline{toc}{part}{#1}}

\titleformat
    {\part} % Section type being modified
    [block] % Shape type, can be: hang, block, display, runin, leftmargin, rightmargin, drop, wrap, frame
    {\startcontents[part]\outputpartpage{\thepart}{#1}} % Format of the whole section
    {} % Format of the section label
    {0em} % Space between the title and label
    {} % Code before the label
    [] % Code after the label

我也尝试过完全避免使用 \part 命令,而是使用

\addtocounter{part}{1}
\addcontentsline{toc}{part}{Guidance document}{\protect\numberline{\thepart}

但这会破坏目录中零件编号的显示,如下所示:

还有其他方法吗?

缺少零件编号的零件目录

\part 分隔页将被删除

答案1

更新要隐藏部分页面,同时保持目录样式,请在之前添加\begin{document}

\newcounter{partx}
\renewcommand{\thepartx}{\Roman{partx}}
\newcommand{\partx}[1]{%
\stepcounter{partx}
\addcontentsline{toc}{part}{\protect\numberline{\thepartx}#1}

并使用命令\partx{<part title>}代替\part

\partx{Guidance document}

X

相关内容