给documentclass article的文档加subtitle

% title
\makeatletter
% \newcommand{\subtitle}[1]{\def \@subtitle {#1}}
% \subtitle{}
\gdef\@subtitle{}
\def\subtitle#1{\gdef\@subtitle{#1}} 
\subtitle{}
\def \maketitle {%
%	\begin{titlepage}
%		~\vfill
		\begin{center}
			{\Large \@title} \\
			\ifx \@subtitle \@empty
				\relax
			\else
				\vspace{0.5em}
				{\large \@subtitle} \\
			\fi	
			\vspace{1em}
			\ifx @author \@empty
				\relax
			\else
				\@author \\
				\vspace{0.5in}
			\fi		
			\@date
		\end{center}
%		\vfill
%	\end{titlepage}
}
\makeatother

%opening
\title{this is the title}
\subtitle{this is the subtitle}
\author{john smith}
\date{ }

\begin{document}

\maketitle
the contents
\end{document}

你可能感兴趣的:(document)