0

I have a latex document in revtex 4-1. I have added the linenumbers option in the preamble, and everything (even the title) has line numbers except for the abstract. How do I add line numbers to the abstract?

Here's what I have:

\documentclass[
    pre,
    twocolumn,
    % twoside,
    byrevtex,
    superscriptaddress,
    floatfix,
    nofootinbib,
    longbibliography,
    linenumbers
]{revtex4-1}

\begin{document}

\title{\protect Sample title }

\begin{abstract} test

several

lines \end{abstract}

\maketitle

\section{Test} Line 1

Line 2

\clearpage

\end{document}

irene
  • 111

1 Answers1

0

Just found the answer thanks to https://tex.stackexchange.com/a/277545/168596:

\begin{abstract}
% add line numbers to the abstract
\begin{linenumbers}
test

several

lines \end{linenumbers} \end{abstract}

\nolinenumbers % removes line number from the title \maketitle

\linenumbers % insert rest of document here

irene
  • 111
  • Does this require the linenumbers class option to be used? If not is the \nolinenumbers necessary if the linenumbers class option is omitted? – Dai Bowen Feb 10 '23 at 15:41
  • I haven't checked. I do use linenumbers in the class option though. – irene Feb 13 '23 at 07:57