# How to add normal text to frontmatter of elsarticle

I'm using the elsarticle documentclass for my paper. Beneath title and author, number of figures, tables etc. is requested on the titlepage. How can I write extra text in the frontmatter area? For example:

"Number of pages: ; Number of figures: ; Number of tables: Number of words in the abstract: ; introduction: ; discussion: Total number of words in the text: Conflict of interest:"

\documentclass[preprint, authoryear]{elsarticle}

\bibliographystyle{annesstyle}

\begin{document}

\begin{frontmatter}

\title{title}

\begin{abstract}abstract\end{abstract}

\begin{keyword}keywords\end{keyword}

\end{frontmatter}

\section{References}
\bibliography{mybib}
\end{document}

• Welcome to TeX.SX! Who's requiring the information? – egreg Jan 15 '14 at 14:35

If you use the preprint style, here's a patch:

\documentclass[preprint, authoryear]{elsarticle}

\usepackage{etoolbox}
% patch \maketitle to accommodate the new information, printed after the keywords
\patchcmd{\pprintMaketitle}
{\fi\hrule}% the second rule
{\fi\ifvoid\extrainfobox\else\unvbox\extrainfobox\par\vskip10pt\fi\hrule}
{}{}

% an environment for the new information
\newenvironment{extrainfo}
{\global\setbox\extrainfobox=\vbox\bgroup\parindent=0pt }
{\egroup}
\newsavebox\extrainfobox

\bibliographystyle{annesstyle}

\begin{document}

\begin{frontmatter}

\title{title}

\begin{abstract}abstract\end{abstract}

\begin{keyword}keywords\end{keyword}

\begin{extrainfo}
Number of pages: ;\\
Number of figures: ;\\
Number of tables: ;\\
Number of words in the abstract: ;\\
Introduction: ;\\
discussion: ;\\
Total number of words in the text: ;\\
Conflict of interest:
\end{extrainfo}

\end{frontmatter}

\section{References}
\bibliography{mybib}
\end{document}


Here's the way to have the extra information before the abstract:

\documentclass[preprint, authoryear]{elsarticle}

\usepackage{etoolbox}
\patchcmd{\pprintMaketitle}
{\hrule\vskip12pt}% the second rule
{\hrule\vskip12pt\ifvoid\extrainfobox\else\unvbox\extrainfobox\par\vskip12pt\fi}
{}{}

\newenvironment{extrainfo}
{\global\setbox\extrainfobox=\vbox\bgroup\parindent=0pt }
{\egroup}
\newsavebox\extrainfobox

\bibliographystyle{annesstyle}

\begin{document}

\begin{frontmatter}

\title{title}

\begin{abstract}abstract\end{abstract}

\begin{keyword}keywords\end{keyword}

\begin{extrainfo}
Number of pages: ;\\
Number of figures: ;\\
Number of tables: ;\\
Number of words in the abstract: ;\\
Introduction: ;\\
discussion: ;\\
Total number of words in the text: ;\\
Conflict of interest:
\end{extrainfo}

\end{frontmatter}

\section{References}
\bibliography{mybib}
\end{document}


The text in the second arguments of \patchcmd is the code that we want to replace in the definition of \pprintMaketitle with the code contained in the third argument. It's easier than copying the entire definition and modifying it.

• Thanks for the patch, it works well. But what do I have to do, to get the abstract after the extrainformation? And what do the lines {\fi\hrule}% the second rule {\fi\ifvoid\extrainfobox\else\unvbox\extrainfobox\par\vskip10pt\fi\hrule} d0? – Anne Jan 15 '14 at 15:01
• @Anne I have added the alternative version – egreg Jan 15 '14 at 15:19
• doesn't work for me! apears before the abstract instead of after it. – Hamid Dec 30 '18 at 6:49
• @Hamid Difficult to say. Please, open a new question with details about your issue. – egreg Dec 30 '18 at 10:58