在你的代码中涉及@的内容前后加上\makeatletter和\makeatother,以处理@的catcode的问题
\documentclass[openany]{book}
\usepackage{geometry}
\geometry{
papersize={10.5cm,14.85cm},
%showframe,
margin=1cm,
}
\makeatletter
\renewcommand{\part}{%
\if@openright
\cleardoublepage
\else
\clearpage
\fi
\thispagestyle{empty}%
\if@twocolumn
\onecolumn
\@tempswatrue
\else
\@tempswafalse
\fi
\null\vfil
\secdef\@part\@spart}
\makeatother
\begin{document}
\setlength{\parindent}{2em}
\title{title}
\author{author}
\date{date}
\maketitle
\tableofcontents
\part{}
\chapter{}
Hello\TeX{}!
\part{}
\chapter{}
Hello\TeX{}!
\end{document}
另一种等价的更优雅的是使用\patchcmd:
\usepackage{etoolbox}%
\patchcmd{\part}{\thispagestyle{plain}}{\thispagestyle{empty}}{}{}



















问 如何设置book类part页页面风格为empty?