我想给出\part{title}
一个单独页面的标题。我希望它位于页面的中央,垂直和水平方向均如此。文档类文章。
PART I
TITLE TEXT
答案1
以下是article
和report
类\part
宏的代码的混合和修改。
% partprob.tex SE 592540
\documentclass{article}
\makeatletter
\renewcommand{\part}{% % rejig of report/book \part
\clearpage
\thispagestyle{plain}
\if@twocolumn
\onecolumn
\@tempswatrue
\else
\@tempswafalse
\fi
\null\vfil
\secdef\@part\@spart}
\def\@part[#1]#2{% % mixture of article and report/book code
\ifnum \c@secnumdepth >\m@ne
\refstepcounter{part}%
\addcontentsline{toc}{part}{\thepart\hspace{1em}#1}
\else
\addcontentsline{toc}{part}{#1}%
\fi
\markboth{}{}%
\vfil
{\centering
\interlinepenalty \@M
\normalfont
\ifnum \c@secnumdepth >-1\relax
\huge\bfseries \partname\nobreakspace\thepart
\par
\vskip 20\p@
\fi
\Huge \bfseries #2\par}%
\@endpart}
\def\@spart#1{%
{\centering
\interlinepenalty \@M
\normalfont
\Huge \bfseries #1\par}%
\@endpart}
\def\@endpart{\vfil\newpage
\if@twoside
\fi
\if@tempswa
\twocolumn
\fi}
\makeatother
\begin{document}
\part{First Part}
\section{A section}
Some text.
\end{document}