TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 reference a line number? I need this to be able to refer to a line in the pseudocode in a figure.

Or, alternatively - is there an environment like figure in which the ordinary linenumbers and \linelabel work?

share|improve this question

The package fancyvrb provides a line numbering facility (on p. 15 of its documentation is an example for labeling a line number for reference).

More powerful for displaying code is the listings package, which comes with an extensive documentation. It provides line numbering and labeling; its environments can go into a floating environment.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.