2

I need to insert line numbers in elsarticle, so I added:

\usepackage{lineno} % add
\linenumbers

in the article preamble.

However, I noticed that part of abstract is not numbered:

part of abstract not numberred

Could you suggest what should I change, please?

My document looks as as follows:

\documentclass[review]{elsarticle} 
\usepackage[hyphens]{url}
\usepackage{lineno} % add
\linenumbers
\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}

  %%% Removing 'preprint sent to Elsevier' text, because it is causing troubles
      \makeatletter
    \def\ps@pprintTitle{%
       \let\@oddhead\@empty
       \let\@evenhead\@empty
       \def\@oddfoot{\reset@font\hfil\thepage\hfil}
       \let\@evenfoot\@oddfoot
    }
    \makeatother
    %%%%%%%%%%%%%%%%%%%

\bibliographystyle{elsarticle-harv}
\biboptions{sort&compress} % For natbib
\usepackage{graphicx}
\usepackage{booktabs} % book-quality tables

% A modified page layout
\textwidth 6.75in
\oddsidemargin -0.15in
\evensidemargin -0.15in
\textheight 9in
\topmargin -0.5in
%%%%%%%%%%%%%%%% end my additions to header

\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
% use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  \usepackage[utf8]{inputenc}
\else % if luatex or xelatex
  \usepackage{fontspec}
  \ifxetex
    \usepackage{xltxtra,xunicode}
  \fi
  \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
  \newcommand{\euro}{€}
\fi
% use microtype if available
\IfFileExists{microtype.sty}{\usepackage{microtype}}{}
\usepackage{longtable}
\ifxetex
  \usepackage[setpagesize=false, % page size defined by xetex
              unicode=false, % unicode breaks when used with xetex
              xetex]{hyperref}
\else
  \usepackage[unicode=true]{hyperref}
\fi
\hypersetup{breaklinks=true,
            bookmarks=true,
            pdfauthor={},
            pdftitle={SMOS data as a source of the agricultural drought information for the Vistula catchment},
            colorlinks=true,
            urlcolor=blue,
            linkcolor=magenta,
            pdfborder={0 0 0}}
\urlstyle{same}  % don't use monospace font for urls
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}
\setlength{\emergencystretch}{3em}  % prevent overfull lines
\setcounter{secnumdepth}{5}

\usepackage[markers]{endfloat}

\begin{document}
\begin{frontmatter}

  \title{Polish alphabet contains 9 additions: ą, ć, ę, ł, ń, ó, ś, ź, ż}
    \author[XYZ]{Mateusz Kędzior\corref{c1}}
   \ead{sample@sample.com} 


      \address[WUT]{Some Technical University}

  \begin{abstract}
  First
  line
  of
  abstract.
  This part of abstract is numberred as well as other sections. Only the second part of abstract is not numberred.

  The
  second
  part
  of
  abstract. As you can see this and only \textbf{this} part of text is not numbered. All other lines are numbered.
  \end{abstract}
   \begin{keyword} one \sep two \sep three \end{keyword}
 \end{frontmatter}

\section{Introduction}\label{introduction}

Some text

\section{Material and methods}\label{material-and-methods}

\subsection{Study area}\label{study-area}

Next line of text

\subsection{Data sources}\label{data-sources}


\begin{itemize}
\tightlist
\item
  First

  \begin{itemize}
  \tightlist
  \item
    First a
  \end{itemize}
\item
  Second

  \begin{itemize}
  \tightlist
  \item
    Second a
  \end{itemize}
\end{itemize}

\end{document}
3

From the lineno documentation:

\linenumbers takes effect only when a paragraph is finished. This is important if you use \linenumbers for a single paragraph only. This will not work

In order to get the correct line numbering you can either explicitly end the paragraph

\documentclass[review]{elsarticle} 

\usepackage{lineno}

\begin{document}

\linenumbers

\begin{frontmatter}
\title{Title}
\author{Me}
\address{Here}
\begin{abstract}
First line of abstract. This part of abstract is numbered as well
as other sections. Only the second part of abstract is not numbered.

The second part of the abstract. Lorem ipsum dolor sit et amet.
Some text.\par% or add an empty line after this one
\end{abstract}
\end{frontmatter}

\section{Introduction}\label{introduction}
Some text

\end{document}

or use the linenumbers environment

\documentclass[review]{elsarticle} 

\usepackage{lineno}

\begin{document}

\linenumbers

\begin{frontmatter}
\title{Title}
\author{Me}
\address{Here}
\begin{abstract}
\begin{linenumbers}
First line of abstract. This part of abstract is numbered as well
as other sections. Only the second part of abstract is not numbered.

The second part of the abstract. Lorem ipsum dolor sit et amet.
Some text.
\end{linenumbers}
\end{abstract}
\end{frontmatter}

\section{Introduction}\label{introduction}
Some text

\end{document}
  • 1
    Thank you, adding \par at the end of second paragraph resolved my issue. – matandked Feb 28 '17 at 16:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.