{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

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 ...
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, ...
4
votes
2answers
1k views

How to add paragraph line number in right margin

In passages, the line numbers are given on the right side of the paragraph. Like this: How could this be implemented in LaTeX?
12
votes
3answers
3k views

Lineno for 2 column

How to add line number to a 2 column document where the line number must appear on the left for the left column and on the right for the right column. The lineno package does not seem to provide this ...
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 ...
8
votes
2answers
299 views

How do I prevent conflicts between accsupp and hyperref?

This question is related to the answer to the question Is there a LaTeX trick to prevent a PDF viewer from copying the line number? Unless you turn hyperref off, the following MWE ...
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?
5
votes
1answer
2k views

In listings, how to show referenced linenumbers instead of standard ascending linenumbers

I'm just writing on my master thesis and have a (specific) problem with lstlisting package in LaTeX. I'm referring to the Random.class-file in Java and only want to print some specific line-ranges, ...
2
votes
4answers
731 views

How to place a program and a text side by side?

My first question is how you write a program in LaTeX, with and without a line number for each line. The second question is, because often my program is not too large, I want to save some space for ...
9
votes
1answer
2k views

Why doesn't lineno number a paragraph when it is followed by an indented equation?

While searching for the source of missing line numbers, I realized that paragraphs followed immediately by an equation have no line number, but this is fixed when a space is included, e.g. the ...
8
votes
1answer
5k views

How to add unnumbered lines in an algorithm?

I am typesetting algorithms with the algorithm package, and I would like to add unnumbered lines in them. Is there a way to create a \State* command, the same way there is an equation* environment? ...
9
votes
2answers
1k views

Lineno - numbering abstract's lines.

The package lineno.sty is not numbering my abstract's lines. Any suggestions? Thanks. \documentclass[a4paper,12pt]{amsart} \usepackage{indentfirst} \usepackage{hyperref} \usepackage{showkeys} ...
7
votes
1answer
786 views

mdframed with tikz method: putting line numbers outside of frame

I want to number the lines in a mdframed environment with the line numbers appearing on the left of the frame, outside of it. \documentclass{article} \usepackage[framemethod=latex]{mdframed} ...
6
votes
1answer
379 views

Listings line numbers that match the linerange specification

This is a follow-up question to First line number in lstinputlisting environment. Consider the MWE: \documentclass{article} %\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox ...
4
votes
1answer
359 views

Line numbering with Lineno within Minipage

I am trying to add line numbers to a reading passage. The issue is that I can't get them to display when I try to number lines within a minipage environment. Can anyone answer what seems to be a ...
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 : ...
12
votes
1answer
1k views

How to number all lines in a draft?

I want to have a draft of a document I am writing, with the line numbers aside. I looked at some options like lineno, but this way it skips some lines. Is there a simple workaround or another package ...
16
votes
1answer
5k views

Show the number of lines in margin

How to show the number of lines in a short passage like that: (EVEN PAGE STYLE) margin ...
6
votes
1answer
4k views

First line number in lstinputlisting environment

I use the following code to display line 23-45 of sort.cpp: \lstinputlisting[language=C++,linerange=23-45]{sort.cpp} However, the line numbering starts with 1 while I want it start at 23. I found ...
4
votes
1answer
848 views

Custom line numbers in lstlisting environment

I am using the lstlisting environment to display code and it works great, however for my current application I need something like: line 1; 3.1: line 2; line 3; 3.1.5: line 4; ...
15
votes
1answer
8k views

Adding line numbers to latex and respecting equations

It's often convenient to add line numbers to a page automatically and the lineno package generally does the trick. But I've had two problems with it It doesn't seem to align the line numbers with ...
7
votes
1answer
293 views

Shipout line like Shipout page

In lineno package guide, I found: Attaching line numbers after TeX has broken the paragraph into lines is already quite a difficult job for TeX. Why? Because TeX does not normally give you any ...
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 ...
6
votes
2answers
1k views

Suppress line numbering for empty lines in listings package

The listings package quite nicely formats my pseudo code listings. Is there a way that one can specify that line numbering should be suppressed for empty lines?
4
votes
1answer
190 views

Line numbering the whole mainmatter in memoir

Ok, now I am panicking, since lineo cannot be used with memoir (using \RequirePackage{lineno}). The specifications for the paper I am writing are numbering the mainmatter, footnotes included 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} ...
4
votes
1answer
2k views

Unnumbered lines in algorithm

My question is similar to this one, I need to skip number for some lines of the algorithm. However the solution from that question does not work for me. How can I disable numbers for some lines using ...
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 ...
3
votes
2answers
319 views

algorithmic + babel with Hebrew conflict: Numbering missing

If I use algorithmic with babel, having both Hebrew and English, the line numbers go missing. Using MikTeX 2.9. \documentclass{article} \usepackage[hebrew,english]{babel} \usepackage{algorithm} ...
10
votes
1answer
892 views

How to count number of lines in PDF document?

I'm using the lineno package to print line numbers (each page starts with number one) in the draft of my document: \usepackage[switch*, pagewise]{lineno} Is there a way to read out the number of ...
7
votes
2answers
325 views

Change from old style numbers to lining numbers in lineno's linenumbers environment

I am using old style numbers in my document, but I prefer lining numbers in my line numbering environments (lineno's \linenumbers environment). How can I enforce this (without changing to another ...
7
votes
1answer
1k views

LaTeX minted package: numbering lines does not work [closed]

I'm having a problem with the minted package. When I try to add line numbering to the minted command, I get the following error: ! Package keyval Error: stepnumber undefined. See the keyval package ...
7
votes
1answer
810 views

Line length in fancyvrb

What I'm doing: Typsetting source code using pygments. What is happening: the code typsets fine, but because pygments puts the code into a Verbatim environment, some of the lines are far too long. ...
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} ...
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. ...
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
187 views

Headline-ignoring, pagewise line numbers

Despite the easy-sounding task, it appears to be hard to find a suitable package to print line numbers that ignore the automatically generated section/subsection etc. headlines in their counter. The ...
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 ...
2
votes
1answer
170 views

Hyperref and lineno: always jumping to first page

I have a document where lines are numbered. I want to reference some special lines, for which the correct line numbers are generated. But using hyperref does not give the expected result: clicking on ...
2
votes
1answer
625 views

Disable line numbering of specific lines

Is there way how to turn off numbering of lines for specific line in algorithm2e? I need bold : after keyword. So I tried redefine these macros: \renewcommand{\KwIn}[1]{\textbf{Input:} #1} ...
2
votes
0answers
156 views

Source code line numbers in PDF [duplicate]

Possible Duplicate: Extended draft mode which includes source information for manual print-out to source synchronisation I am writing a document in LaTeX which I compile to PDF, which I ...
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, ...