{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

3
votes
1answer
105 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
159 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 ...
9
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
436 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
501 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
321 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
407 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
932 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
105 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
324 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
211 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 ...
7
votes
1answer
815 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
913 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
937 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
449 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 ...
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 ...
4
votes
1answer
817 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
326 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 ...
6
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
263 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
329 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
580 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
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 ...
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
739 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: ...
15
votes
1answer
12k 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
851 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 ...
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?
9
votes
2answers
2k 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} ...
1
vote
1answer
430 views

line numbering of minipages

I can't manage to add linenumbers left of the boxes. Can anybody help me? \documentclass{article} \begin{document} \fbox{\fbox{ \begin{minipage}{0.8\linewidth} \textbf{def} mapper (key, value): ...
7
votes
1answer
821 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. ...
16
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 ...