lhf*_*lhf 27
使用\@title不起作用因为\maketitle清除\@title.这对我来说似乎很傻,但事实就是如此.一种解决方案是重新定义\title以将标题保存在其他位置.例如,
\def\title#1{\gdef\@title{#1}\gdef\THETITLE{#1}}
Run Code Online (Sandbox Code Playgroud)
然后用\THETITLE.
您可以采取相反的方式:\def\MYTITLE{...}然后\title{\MYTITLE}再使用\MYTITLE.
小智 16
我只是写了一个新命令就成功了.
\newcommand{\mytitle}{...}
\title{\mytitle}
Run Code Online (Sandbox Code Playgroud)
There is a package called authoraftertitle that does exactly this
\documentclass{article}
\usepackage{authoraftertitle}
\setlength\parindent{0 pt}
\begin{document}
\title{a good title}
\author{a better author}
\date{the best date}
\maketitle
the title is: \textbf{\MyTitle} \\
the author is: \textbf{\MyAuthor} \\
the data is: \textbf{\MyDate} \\
\end{document}
Run Code Online (Sandbox Code Playgroud)