有没有更简洁的方法将日期放在前言(elsarticle 文档类)上?
\documentclass[final,authoryear,1p,times,letterpaper,12pt]{elsarticle}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{indentfirst}
\usepackage{amscd}
\usepackage{mathrsfs}
\usepackage{ulem}
\usepackage{bbm}
\usepackage{hyperref}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{setspace}
\usepackage{color}
\usepackage{subfiles}
\usepackage[nameinlink]{cleveref}
\usepackage{lmodern}
\usepackage{kpfonts}
\usepackage{amsthm,amssymb}
\usepackage{thmtools}
\crefname{lem}{lemma}{lemmas}
\crefname{prop}{Proposition}{Propositions}
\crefname{thr}{Theorem}{Theorems}
\crefname{cor}{Corollary}{Corollaries}
\crefname{ass}{Assumption}{Assumptions}
\crefname{df}{Definiton}{Definitons}
\usepackage{enumitem}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{pifont}% for openstar in the title footnotes;
\usepackage{natbib}% for citation processing;
\usepackage{geometry}% for margin settings;
\usepackage{fleqn}% for left aligned equations;
\usepackage{graphicx}% for graphics inclusion;
\usepackage{txfonts}% optional font package, if the document is to be formatted with Times and compatible math fonts;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\let\oldFootnote\footnote
\newcommand\nextToken\relax
\renewcommand\footnote[1]{%
\oldFootnote{#1}\futurelet\nextToken\isFootnote}
\newcommand\isFootnote{%
\ifx\footnote\nextToken\textsuperscript{,}\fi}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{frontmatter}
\title{Random title\tnoteref{t1}}
\tnotetext[t1]{Very preliminary and incomplete. All errors remain our own.}
\author[jd]{John Doe}
\author[jnd]{Jane Doe}
\address[jd]{John Doe's University}
\address[jnd]{Jane Doe's University\vskip 18pt \textnormal{\today}}
\begin{abstract}
\end{abstract}
\end{frontmatter}
\end{document}
答案1
有点主观,但“更简洁”的方法是修补\MaketitleBox
和\pprintMaketitle
命令,以自动在地址和摘要中间添加日期(保持默认的 36pt 垂直空间)。这样您就不会将日期传递给命令\address
(这有点黑客行为)。
\usepackage{etoolbox}
\patchcmd{\MaketitleBox}{\footnotesize\itshape\elsaddress\par\vskip36pt}{\footnotesize\itshape\elsaddress\par\parbox[b][36pt]{\linewidth}{\vfill\hfill\textnormal{\today}\hfill\null\vfill}}{}{}%
\patchcmd{\pprintMaketitle}{\footnotesize\itshape\elsaddress\par\vskip36pt}{\footnotesize\itshape\elsaddress\par\parbox[b][36pt]{\linewidth}{\vfill\hfill\textnormal{\today}\hfill\null\vfill}}{}{}%
在您的 MWE 中(删除多余的包):
\documentclass[final,authoryear,1p,times,letterpaper,12pt]{elsarticle}
\usepackage{etoolbox}
\patchcmd{\MaketitleBox}{\footnotesize\itshape\elsaddress\par\vskip36pt}{\footnotesize\itshape\elsaddress\par\parbox[b][36pt]{\linewidth}{\vfill\hfill\textnormal{\today}\hfill\null\vfill}}{}{}%
\patchcmd{\pprintMaketitle}{\footnotesize\itshape\elsaddress\par\vskip36pt}{\footnotesize\itshape\elsaddress\par\parbox[b][36pt]{\linewidth}{\vfill\hfill\textnormal{\today}\hfill\null\vfill}}{}{}%
\begin{document}
\begin{frontmatter}
\title{Random title\tnoteref{t1}}
\tnotetext[t1]{Very preliminary and incomplete. All errors remain our own.}
\author[jd]{John Doe}
\author[jnd]{Jane Doe}
\address[jd]{John Doe's University}
\address[jnd]{Jane Doe's University}
\begin{abstract}
\end{abstract}
\end{frontmatter}
\end{document}
产量: