我正在制作自己的标题页。我希望 Latex 自动显示日期,\date{\today}
但这并不适用,因为我没有这样做\maketitle
那么,有没有办法让 Latex\date{\today}
在自己的标题页中使用呢?而不必自己手动设置日期并担心更新它。
平均能量损失
\documentclass[12pt,notitlepage]{article}%
%\usepackage{datetime} did not help
\newcommand*{\myTitle}{\begingroup
\centering
\vspace*{\baselineskip}
{\LARGE My Title}% Title
\vspace*{1\baselineskip}
\scshape % Small caps
My project
\vspace*{1\baselineskip}
University of Main Street\\[\baselineskip]
\vspace*{5\baselineskip}
Written by \\[\baselineskip]
{\Large John Due\par}
\vspace*{1\baselineskip}
\scshape
\date{\today}
%\date{\currenttime} does not work
\endgroup}
\begin{document}
\pagestyle{empty}
\myTitle
\clearpage
This is my report
\end{document}
我在 Google 上搜索了 15 分钟后就放弃了。
答案1
只需使用\today
:
\documentclass[12pt,notitlepage]{article}%
%\usepackage{datetime} did not help
\newcommand*{\myTitle}{\begingroup
\centering
\vspace*{\baselineskip}
{\LARGE My Title}% Title
\vspace*{1\baselineskip}
\scshape % Small caps
My prject
\vspace*{1\baselineskip}
University of Main Street\\[\baselineskip]
\vspace*{5\baselineskip}
Written by \\[\baselineskip]
{\Large John Due\par}
\vspace*{1\baselineskip}
\today
\endgroup\clearpage}
\begin{document}
\pagestyle{empty}
\myTitle
This is my report
\end{document}