{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

4
votes
1answer
208 views

Running heads containing verse line numbers?

I'm typesetting a long poem using memoir and the verse environment. I would like to provide running heads showing the numbers of the first and last lines appearing on that page (like "lines 36--81"). ...
4
votes
1answer
778 views

Change line numbering in algorithmics package

I would like to start the line numbering of the following code not from 1 but from 12 (as it is cut out of a larger code). So it should be 12,13,14,15 instead of 1,2,3,4. \documentclass{article} ...
3
votes
2answers
231 views

breqn and lineno incompatibility

Journals often require line numbering for the review process. This is achieved using lineno package. Next, it seems like a good idea to use breqn package (dmath environment) to auto-break long ...
4
votes
1answer
632 views

Linenumbers with lineno (edtable) breaks inside threeparttable because of caption

I'm trying to show linenumbers for tables using lineno, i.e. edtable. The table is set using threeparttable and linenumbers work fine, but compilation fails when including a caption. The error message ...
3
votes
1answer
103 views

how to better control the number display of listings?

I'm using the listings package for my sourcecodes, and among other things to control the display of those, I'm using \lstset, obviously. Now, When setting numberstyle, I've set them to ...
2
votes
1answer
632 views

Remove line numbering from algorithmicx procedure/function

I would like the lines of "procedure" and "end procedure", "function", and "end function" etc to not be numbered. For example, the default behavior produces this: 1 procedure hasNext(v,V,s) 2 ...
7
votes
1answer
1k views

Line numbering in algorithmic

I want to change the first number of the line numbering in my algorithm, but how is it done? This is my example: \documentclass[12pt]{beamer} \usepackage{amsmath, amsfonts, amssymb, amsthm} ...
2
votes
1answer
1k views

Line numbers reset incorrectly using lineno package

Having a strange problem using lineno. The document I'm creating is a 24-page legal document. I'm numbering all the lines using lineno for easy reference. The line numbers need to be reset every page ...
11
votes
1answer
670 views

Line numbering using listings package starts at random number

I'm using the listings package to include code directly from a file. In the first instance my code is numbered as I want it 1 at the 1st line, 11 at the 11th, ... However, the second block of code it ...
7
votes
1answer
323 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 ...
0
votes
1answer
202 views

How to get Roman line numbering in algorithmicx? What is the counter name?

I try to get Roman numbering but couldn't find how to change it in the package documentation. After some research, I figured out how to do it using the algorithm2e package. (Use algonl as optional ...
3
votes
1answer
456 views

line numbers on flalign environment

Why is there an additional line being numbered in the following example? I would like to remove this so that the line numbers only correspond to the equations specified. I realize that this is due to ...
2
votes
1answer
177 views

How to put a reference into nlset command of algorithm2e package

I would like to provide an alternative version of only some part of already existing algorithm, using the algorithm2e package. My source looks like: \begin{algorithm}[t] \dots \; ...
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 ...
6
votes
1answer
287 views

How to introduce line numbers on specified lines

I'm trying to introduce line numbers in a hymn on specific lines. I'm using the lineno package but I'm having no luck with it. Ideally I'd like a macro that I can use to say place line number here. ...
3
votes
1answer
111 views

If I have a list of numbered questions, how can I align my questions to the right of the number?

I'm editing a paper with a bunch of questions numbered from 1 to 10. In the example that my professor gave me, he had it formatted so that the number of the question would be listed, and then the ...
3
votes
2answers
1k views

Listings line numbers and figure

I'm using listings to typeset some C inside a figure environment next to a diagram, and I have the numbers on the left. My problem is in two-column mode the line numbers appear in what should be the ...
6
votes
1answer
185 views

Is it possible to change the font of line numbers in a code listing?

Using LyX I can add line numbers to my code listing. However, these are in the document (serif/Roman) font and look strange next to code blocks (Typewriter font). Is it possible to change the font of ...
11
votes
3answers
2k views

Why doesn't lineno number a paragraph when it is followed by an “align” equation environment without a space?

lineno skips the line numbering in this case: \documentclass[12pt]{article} \usepackage{amsmath} \usepackage{lineno} \linenumbers \begin{document} Lorem ipsum dolor sit amet, consectetur adipiscing ...
4
votes
2answers
482 views

Line numbers in traditionalpoem environment?

So I've been trying to get satisfactory results typesetting Persian and Arabic poems, in the traditional format, with XeLaTeX. It works just about fine – see the sample document below – but I would ...
5
votes
1answer
564 views

Shared line counter with \lstinputlisting

Using the listings package, you can name your listings to make them share a line counter: On the other hand you can use firstnumber=auto and name your listings. Listings with identical names ...
9
votes
2answers
345 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 ...
3
votes
1answer
481 views

Numbering not every line with lineno

How it is possible to number not every line with lineno? For example only every fifth line. There are no hints in the manual.
4
votes
1answer
1k views

Code over two Pages and continue counting Lines

I'm using Minted to show my Javascript Code. It seems not possible to spread a code with Minted over two pages. So i do it like shown in Algorithm over two pages, with itemized lists. But the Code ...
4
votes
3answers
1k views

adding captions outside of a figure or table?

For my thesis, I have written a computer program that reads in a parameter file. I want to show the parameter file in my thesis but am not sure what the best way to go about this is. Ultimately, I ...
2
votes
1answer
107 views

Resetting line count in dtx files

I'm writing a dtx file containing several source files. Is there a way to reset the line counter when commenting the code of a different file? My dtx file looks something like this: .... %\iffalse ...
3
votes
2answers
332 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} ...
4
votes
1answer
221 views

SLatex and line numbering?

I'm using SLaTeX to typeset some Racket source code. I would like to have line numbers along the left edge, so that I can refer to them in my document. However, I haven't yet discovered the option ...
8
votes
1answer
884 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} ...
4
votes
1answer
1k 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; ...
10
votes
1answer
1k 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 ...
5
votes
2answers
458 views

lineno and syntax package incompatibilities

I'm using the syntax package from the mdwtools version 1996/05/17 1.07. I successfully set the properties to show a grammar definition properly but then when I try to combine it with the lineno ...
18
votes
1answer
6k 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 ...
5
votes
1answer
914 views

Suppress line numbering for specific lines in listings package

I would like to suppress the line numbering for specific lines in listings package by identifying the specific lines using some kind of command.
6
votes
2answers
2k 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?
3
votes
2answers
349 views

Wrong numbering of lines in lstlistings when using escaped commands

I'm using the listings package to format some Java code in my document. I want it to number lines (1 number every 5 lines), and I need to highlight some keywords inside the code with the following ...
9
votes
1answer
3k views

Algorithm spanning more than one page

I have an algorithm which is too long to fit on one page. Someone suggested splitting the algortithm manually and then altering the second algorithm's line numbers to follow on the first. I know ...
7
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
2answers
270 views

Why is the ledmac line number misaligned with the final item?

Here's a minimal document showing the problem: \documentclass{article} \usepackage{ledmac} \begin{document} \firstlinenum{1} \linenumincrement{1} \beginnumbering \pstart \begin{itemize} \item This ...
3
votes
1answer
354 views

Lineno \internallinenumbers - how to make a line number label within a figure?

This concerns the "lineno" package. The \linelabel directive works within the ordinary linenumbers environment. How to create a line number label within a internallinenumbers environment to be able to ...
6
votes
1answer
604 views

verselinenumbersleft with twocolumn

Situation: a poem in the verse environment of the verse package, while the entire page is set with the twocolumn option. Line numbering is enabled via \poemlines{1} and set to the left by ...
6
votes
1answer
5k 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 ...
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 ...
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 ...
2
votes
4answers
757 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 ...
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
2k views

Listing with line numbers inside a table

I typeset a lot of listings (using the listings package) inside (array-based) tabular environments. This works like a charm, however, breaks when I pass the numbers= option to the listing: ...
17
votes
1answer
14k views

How to put a line number every line of algorithmic

I am looking for a way to have a number for every line in algorithmic: \documentclass{article} \usepackage{algorithm} \usepackage{algorithmic} \begin{document} \begin{algorithm} ...
6
votes
1answer
910 views

Line numbers in pseudocode in figures - using lineno in figures

can someone show an example how to obtain line numbers in the alltt environment in figures, possibly using the lineno package? I've tried: \begin{figure}[h] \begin{alltt} {\linenumbers def insert(k, ...
12
votes
1answer
2k 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 ...