{line-numbering} is about numbering the text lines of documents or parts of them. Popular packages are `lineno` and {ledmac}.

learn more… | top users | synonyms

42
votes
7answers
10k views

Add page and line numbers to a pdf

Is there any quick script to add page and line numbers to each page of a pdf document? 1) I often enough get articles in pdf to review, with no page number. I end up writing them by hand to refer to ...
5
votes
1answer
118 views

Linenumbering per page with XePersian and the traditionalpoem environment

I’m editing an Arabic poem with XePersian and the traditionalpoem environment which works fine so far, but I have some questions regarding the line numbers and the paragraph footnotes. (1) I would ...
3
votes
2answers
47 views

Line numbering in a philological text

I am typesetting a text in the classics. A part of it consists of numbered verses. For each verse line I would like to show (1) a line number, (2) the verse text, and (3) an optional "clause". As ...
7
votes
2answers
123 views

highlight line numbers in listings

I would like to highlight the line numbers of the lines I refer to with lstlistings. I use escape characters to define labels in my Listing to which I refer later in my document (e.g. see Line X of ...
1
vote
1answer
81 views

Texstudio: modify size of line numbers

With more than 1000 lines the line numbering in Texstudio 2.7.0 takes up a sizeable chunk of my display. I already discovered that it's possible to disable the line numbers in Options -> Advanced ...
6
votes
1answer
41 views

Actual line numbers for listings: firstnumber=\inputlineno is off by one

I would like to have the actual line numbers next to my code listings but if I use firstnumber=\inputlineno, this gets evaluated one line too early: \documentclass{article} \usepackage{listings} ...
1
vote
1answer
32 views

Add additional page number, from original work, in margin

In this beautiful example from frabjous the original page numbers from the source is place in the margin (below is a screenshot of page 8, which is page 9 and 10, marked by a red marker in the text, ...
8
votes
2answers
2k views

Number every line of pages

When editing documents it is convenient to have all the lines on a page numbered (on the left margin) so that the reviewer can refer to them in his report. How can I achieve this with LaTeX?
3
votes
1answer
34 views

Append characters after line numbers when using the `listings` package?

Is it possible to add some characters, like colons, to the line numbers when these are displayed in the listings package? There is the numberstyle option, but that only seems to affect stuff before ...
2
votes
1answer
40 views

Can eledmac's xxref be used with non-arabic linenumbers?

I am using polyglossia and eledmac to typeset a Tibetan document. I'm running into problems when using eledmac's xxref. It seems the numbers it expects are not in the right format, since they are ...
3
votes
1answer
299 views

Algorithm2e - Disabling line numbers for specific lines

The Algorithm2e package has specific options for disabling/hiding line numbering for the whole document or algorithm, and then enabling/showing them for specific lines. I want to do the inverse. I ...
5
votes
2answers
62 views

eledmac package: \pausenumbering and \resumenumbering

I'm using the eledmac package to typeset a rather large work of theology. For simplicity and the sake of a MWE, I'm just using the two stanza poem below. Intended outcome: Between sections that are ...
2
votes
1answer
78 views

latex line number in algorithm starting with 9? [closed]

I feel confused why the line numbers in the algorithm I created all starting with 9? The code is as followed: \documentclass{sig-alternate-2013} \begin{algorithm} \caption{Generating Test Cases} ...
2
votes
1answer
33 views

Excluding reference list from line numbering

When the lineno package is included, all lines are numbered. But I don't want the bibliography to have linenumbers because it is ugly. So is this possible? [ps. I have used BibTex to create the ...
1
vote
1answer
49 views

Sometimes wrong math font in headers when using KOMA's \sectfont with lineno

I am using the KOMA-Script scrbook class, and I want to have bold math in my section titles (to match the title text). For this I redefine \sectfont, and it works nicely. ...
7
votes
1answer
3k views

How can I start the line numbering of my listing by an arbitrary number?

This is what I want: 15 <servlet> 16 <servlet-name>udpListener</servlet-name> 17 <servlet-class>oli.servlet.UdpServlet</servlet-class> 18 <!-- UDP Port fuer ...
61
votes
3answers
2k views

Is there a LaTeX trick to prevent a PDF viewer from copying the line number?

A PDF output is obtained by compiling the following code. \documentclass{article} \usepackage{xcolor} \usepackage{listings} \lstset { language={[LaTeX]TeX}, numbers=left, ...
20
votes
1answer
886 views

How to make text copy in PDF previewers ignore lineno line numbers?

I'm using lineno for a document. I have it configured to put line numbers in the margins of the document. I generate PDF using pdflatex. Here's the problem: when people copy a region of text in a ...
1
vote
0answers
75 views

How to add linenumbers to figure captions?

I'd like to add linenumbers to my TeX-file. I found the packe lineno which I'm using as follows: \usepackage{lineno} \linenumbers Unfortunately line numbers are not added to the figure captions and ...
4
votes
0answers
122 views

Follow up to underline subsections - incompatibility between lineno, sectsty, and ulem

In answering the question Underline subsections, I provided an answer which relied on the sectsty package (as compared to @GonzaloMedina's answer, which used the titlesec package). Ultimately, ...
4
votes
1answer
67 views

Changing side of line numbering in two columns documents part two

I have the same question as this one: tex.stackexchange.com/questions/9510/changing-side-of-line-numbering-in-two-columns-documents/ I'd like to use the listings package in a twocolumn document. An ...
3
votes
3answers
966 views

Changing side of line numbering in two columns documents

I'm trying to type some report and I have a small problem with the twocolums document class and the line numbering in listings. The document is on two columns : ...
9
votes
2answers
138 views

Environment for ancient Greek poem with comments

I want to write an ancient Greek poem and I am having problems in setting the right environmental parameters. My major difficulty is to make an effective use of footnotes. Instead of using a ...
3
votes
0answers
83 views

Minted PHP with line numbers

I've added minted and inserted PHP code. The result is that I must put < ?php and ?> tags to get the code colored, then if I want to display line numbers it starts from < ? php line like ...
11
votes
1answer
416 views

Using listings: “zebra effects” AND line numbers

I just made a code listing with a "zebra effect", just like here: Creating a zebra effect using listings But afterwards, the line numbers at the left side of the listing don't appear any more. This ...
3
votes
1answer
119 views

Properly indent comments with no line-numbering in algorithmicx

Writing comments in pseudocode, I wanted to insert comments to the right side of the line which is commented. This thread help me a lot. The algorithm is line-numbered, however I need the comments ...
1
vote
0answers
85 views

XeTeX: Line numbering in a book with Devanagari and polyglossia

I am typesetting a book in XeLaTeX with both Samskrita in Devanagari script and English. I am trying to include line numbers for proofreading purposes. I want to use the lineno package which works on ...
1
vote
1answer
40 views

Compatibility issue between svn-multi and lineno

There is an issue between svn-multi and lineno. Setting the svnid confuses lineno witch results in a unwanted outcome. Without \svnid{$Id: abc.tex 1 2013-06-25 15:30:32Z asb $} everything works as ...
1
vote
0answers
73 views

How to manually set a line number for end statement in algorithm2e?

I can manually set line numbers in an algorithm2e environment using the \nlset command (together with \LinesNotNumbered). However, I can't figure out how to make the same for lines with the end or ...
1
vote
0answers
115 views

Listings: spacing between linerange and numbering [closed]

This is a combination of hacks, and only of interest for those who want hacks down to the detail. It is actually a two part question. I was going through some listings setups and hacks: Firstly ...
6
votes
2answers
127 views

Exclude line numbers from margin width

I am using the lineno package to add linenumbers on my twosided document. However, I have a restriction to leave a margin of 2.5cm inner and 4cm outer margin. This has to be completely free space. ...
5
votes
1answer
93 views

Line numbers on different margins in two-sided document

I'm using the lineno package to print line numbers in my two-sided document, but they are always printed in the left margin. \documentclass[twoside]{book} \usepackage{lineno} \usepackage{lipsum} ...
6
votes
1answer
154 views

Disabling line numbers in section headers

I'm using the lineno package to number lines in a document. By default, lineno attempts to number everything, including section headers. I would like disable line numbering on section headers, ...
6
votes
2answers
771 views

How to see the Steps number in an algorithm

In below algorithm I have used the package \usepackage[linesnumbered,ruled,vlined]{algorithm2e} 1) How do I see steps number after step 2? 2) Is there any command apart from ...
2
votes
1answer
226 views

Linenumbers don’t reset with switch option

When I use the package lineno with option [switch], linenumbers don’t reset when asked to (my setup: up to date TL 2012). MWE: \documentclass{article} \usepackage[switch]{lineno} \usepackage{lipsum} ...
16
votes
5answers
842 views

How to create a lined page with line numbers?

I'd like to create a page in my LaTeX document that just consists of lines. It should look like this: Additionally, I want the lines numbered. I have no idea where to start. Are there any hints?
4
votes
2answers
849 views

How to avoid the number line for comments under algorithm2e

In the declaration of the input and output data, I would like to add a comment in order to explain the kind of data. I use: \usepackage[ruled,vlined]{algorithm2e} My code is: \begin{algorithm}[!ht] ...
4
votes
1answer
142 views

Incompatibility between 'flushend' and 'lineno' packages!

I have observed when using flushend package to balance the references at the last page, if at the same time the package linenois loaded, the last page of reference will not be displayed. I have ...
1
vote
0answers
46 views

Omitting white lines from line numbering using lineno

I am using the lineno package to number lines modulo 5 in a document that consists of several sections with lots of small paragraphs (typically 2-5 lines) and with white lines between every paragraph. ...
3
votes
1answer
139 views

Change lineno's number format for section headings (bold font)

This is a follow-up to the question Change from old style numbers to lining numbers in lineno's linenumbers environment I've discovered that the suggestion given there doesn't target the line ...
8
votes
1answer
106 views

Lineno splitting the document into hundreds of pages

I was trying to get all the lines numbered in my document, as explained in this question: Show the number of lines in margin However, when I added the lines: \usepackage{lineno} \linenumbers to ...
4
votes
1answer
112 views

How to use lineno with \intertext?

I would like to number all lines of a document to help its reviewing. The lineno package is working fine, except for the \intertext{...} paragraphs that I use between aligned equations. ...
2
votes
1answer
480 views

How can I change the font size of the number in minted environment?

How can I change the font size of the number in minted environment? The font can be modified with fontsize parameter, but the number on the left side is not affected with it. This is the code: ...
6
votes
1answer
131 views

loading lineno changes spacing in document

I loaded lineno to number the lines on my resume for critique by a professor. Doing so changed the spacing after the headers. I would like to number the lines and retain the original formatting, if ...
2
votes
0answers
85 views

line numbering including blank (empty lines)

I have a latex document and I would like to include line numbers in it, the tricky part is that I need to count the blank (empty) lines too (emulating what MSWord does :(. I know I could use the ...
1
vote
0answers
28 views

Is it possible to automatically set numbers=none for single-line lstlisting environments? [duplicate]

I apologise if the answer to my question can be found in the listings documentation and I missed it. Essentially I would like line numbers to be set only if the number of lines is greater than one.
1
vote
1answer
74 views

Refer to a particular line of a page

I am new to LaTeX, so I was probably quite naive to think that I will get a ready answer to this but to my surprise was not able to find an answer to this. I just want to refer to a particular line ...
4
votes
1answer
134 views

fancyvrb and multicols together

I am using fancyvrb to list code in a multicols situation. I number the code using: \begin{Verbatim}[numbers=left] When the code is in the left column, this is good, but not when it is in the right ...
2
votes
1answer
78 views

line numbering within proof

I'm trying to enumerate the lines within my proof, based on the section that I'm working in. For instance I would like something that: Thereom 2.2 My theorem Proof: Statement (2.11) equation for ...
4
votes
1answer
83 views

Hyperlinks and line-numbering

For the following MWE hyperref complains that it can not find a target for the link, and thus does not create a link. What can I do to make it work? \documentclass{article} ...