我需要在中插入行号elsarticle
,因此我添加了:
\usepackage{lineno} % add
\linenumbers
在文章序言中。
然而,我注意到摘要的一部分没有编号:
您能建议我应该改变什么吗?
我的文档如下所示:
\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{[email protected]}
\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}
答案1
来自lineno
文档:
\linenumbers
仅在段落结束时才生效。如果您\linenumbers
只用于单个段落,这一点很重要。这将不起作用
为了获得正确的行号,你可以明确结束段落
\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}
或使用linenumbers
环境
\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}