1. Sounds like a nice package. I’d love to use it. Unfortunately, my paragraphs containing align environments don’t get counted or numbered, that is neither the equations nor the text surrounding it.

    Any idea how to fix this?

    Best wishes,

    • Hi Almut!

      Fixing the text surrounding is easy, just add an empty line before the align environment or some of the solutions provided here.

      Adding line numbers to the equations is more tricky. I tried a fix posted by Ted some time ago. When I encapsulate align with linenomath:


      I get a funny double number on the last equation. He also mentioned double numbers, but only in his first fix.

      Does anyone know how to fix this?

      Thanks, Tom.

      • Thanks for the reply Tom!

        However, the line numbers aren’t necessary and would be just for my convenience while writing my thesis, so any changes in the text are overkill in my case. I’ll survive without them. 🙂

        Best wishes,

      • tedpavlic

        The double-line numbers are an artificate of TeX not setting text on a grid. Occassionally (but not always), you’re going to get an extra number between an equation and the surrounding text, especially if your equation is “tall.” Given the substrate on which TeX documents are constructed, preventing these problems is a significant challenge.

  2. Robert Paynter

    Are there any other methods? I think what I’m after is a page decoration rather than text markup as {lineno} package does – it puts numbers for each line of text. I would like numbering down the edge of the page so that someone can refer to a place on the page irrespective of whether it is a line of text, an equation or a figure (with labels).

    • tom

      Hi Robert,

      Below is some code which I adapted slightly from its source. It prints line numbers irrespective of the content. Obviously, these line numbers might not perfectly coincide with the actual content. A shift happens whenever the height of an object (such as a figure) is not a multiple of the ‘line height’.

      I hope this is what you were looking for.

      Best, Tom

           \advance\@tempcnta by \@ne\ifnum\@tempcnta<48\repeat}}
      \section*{Lorem Ipsum}
    • tom

      Hi there,

      That’s an interesting question. Use the following code to show line numbers on both sides of the text. I took the solution from here.

      HTH, Tom

        \linenumberfont\llap{\hb@xt@\linenumberwidth{\LineNumber\hss}\hskip\linenumbersep}% left line number
        \hskip\columnwidth% skip over column of text
        \rlap{\hskip\linenumbersep\hb@xt@\linenumberwidth{\hss\LineNumber}}\hss}% right line number
      \leftlinenumbers% Re-issue [left] option

Leave a Reply