3

Is there a neater way to place date on the front matter (elsarticle document class)?

\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}
7
  • \date{\today} does not work?
    – user31729
    Oct 16, 2014 at 16:12
  • I think elsarticle allows for maketitle. See tex.stackexchange.com/questions/84573/… Oct 16, 2014 at 16:12
  • @EthanBolker Just checked, frontmatter just calls maketitle.
    – Johannes_B
    Oct 16, 2014 at 16:13
  • Are you submitting to elsevier? They decide on what goes to the title.
    – Johannes_B
    Oct 16, 2014 at 16:14
  • @ChristianHupfer: it doesn't.
    – Ararat
    Oct 16, 2014 at 16:18

1 Answer 1

6

A bit subjective, but a "neater" way is to patch the \MaketitleBox and \pprintMaketitle commands to automatically add the date halfway between the address and abstract (keeping the default 36pt vertical space). This way you are not passing the date to the \address command (which is a bit hackish).

\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}}{}{}%

In your MWE (removing the superfluous packages):

\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}

Yields:

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .