The package lineno.sty is not numbering my abstract's lines. Any suggestions? Thanks.







\title{Lineno in the Abstract}
We do this, do that, ...



  • 3
    Your example is not entirely a minimal one (e.g., the packages indentfirst, hyperref and showkeys aren't needed), but it does show the problem. I'm out of votes for today, but will upvote your question tomorrow. – lockstep Feb 17 '11 at 23:42

Seems to be an incompatibility between lineno and the amsart class. If I change the document class in your minimal example to article, the abstract's lines are numbered.

EDIT: See this answer for an in-depth explanation.

If you really need linenumbers and the amsart class (I would rather ditch amsart), here's a quick fix: Delete the abstract environment in your example. Instead, add the following immediately after \maketitle:


\textsc{Abstract.} We do this, do that, ...

|improve this answer|||||
  • Hum, but that's quite bad... Any alternative? – Florian Pei Feb 17 '11 at 23:41
  • @Florian: Hard to say ... I have no experience with amsart and don't know what to look for in its code. After you have verified my answer, delve into the documentations of both lineno and amsart for a suggested fix. Or wait some time if someone familiar with amsart drops by. – lockstep Feb 17 '11 at 23:48
  • @lockstep: I'm a very beginner in TeX, so we better wait. Thanks anyway! – Florian Pei Feb 18 '11 at 2:06
  • Not contrary to me at all! I was simply assuming that amsart was the sine qua non in this case. – Andrew Stacey Feb 18 '11 at 12:19
  • @lockstep: no need to fix that! By the way, I've gone for a slightly deeper hack, but I think that yours is the simplest way and given that line numbering surely isn't going to be in the final version (is it?) of whatever document, then the simplest hack is probably the best. – Andrew Stacey Feb 18 '11 at 13:06

Page 1, lines 11-12 of the lineno states:

lineno.sty can only number lines in the main text. Lines in any kind of boxes cannot be numbered. But see section 7.4 below.

The AMS class file typesets the abstract as part of the title page, but the abstract is specified using an environment. So it has to slurp in the text and save it for reuse. It does that by using a box, precisely the situation that lineno.sty warns us against.

Section 7.4 may help but it is not a true numbering: it describes an extension of lineno.sty that simply typesets a list of numbers down the left in the vague hope that they will line up correctly with the lines in the box.

So to answer your question: No, I have no suggestions! Other than to ask, do you really need your abstract to have line numbers?

Okay, I do have a suggestion.



      \leftmargin3pc \rightmargin\leftmargin
      \listparindent\normalparindent \itemindent\z@
      \parsep\z@ \@plus\p@
    \skip@20\p@ \advance\skip@-\lastskip
    \advance\skip@-\baselineskip \vskip\skip@
    \prevdepth\z@ % because \abstractbox is a vtop

\title{Line numbering and amsart}





I don't particularly recommend it, and it needs a little adjusting to get the spacing right above and below. Basically, it reimplements the amsart abstract handling without using a box. It's ugly, it's hacky, and it probably just sent a coded signal to the AMS which will get me on their naughty list for years to come. But it does number the lines of the abstract and, apart from the spacing, it looks right.

amsart with lineno

|improve this answer|||||
  • 1
    nah, not on the ams naughty list. the ams document classes are designed for specific purposes, and we don't promise to be compatible with all other packages. the reason the abstract is included as part of the top matter is to make it easier to segregate and pull out for use in the on-line contents list for ams journals. automated processes put tight restrictions on what is allowable. if an article were submitted with your coding, yes, we'd scream, but if it's just for your own use, what's the problem? – barbara beeton Mar 23 '11 at 19:31
  • @barbara: Phew! I was worried there. I still have hopes of - one day! - getting an article accepted by one of the AMS journals so I'm pleased to hear that I haven't prejudiced my case. – Andrew Stacey Mar 23 '11 at 20:21
  • @barbara (actually, I'm misremembering. My first published article was in an AMS series. So I've already gotten one in. I now want to show that it wasn't a fluke!) – Andrew Stacey Mar 23 '11 at 21:15

I find a simple solution for working with lineno package and elsarticle class: just write these scripts in your code:


your abstract text...

|improve this answer|||||
  • 2
    The question specifically deals with the amsart document class, for which your suggested solution still doesn't solve the problem. – Werner Nov 10 '15 at 6:28

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.