8

I would like to cross-reference the line number in which a word occurred for the first time in some texts. For example, a text is given:

LESSON I
In the traffic court of a large mid-western city, a young
lady was brought before the judge to answer a ticket given
her for driving through a red light. She explained to his
honor that she was a school teacher and requested an imme-
diate disposal of her case in order that she might hasten
on to her classes. A wild gleam came into the judge's eye.
"You are a school teacher, eh?" said he. "Madam, I shall
realize my lifelong ambition. Sit down at that table and
write 'I went through a red light' five hundred times." 

In it, the new word "disposal" occurred in line 5, so the NEW WORDS LIST is given as below:

----------------------------------------------------
1. disposal (L.5)
2. hasten   (L.5)
3. gleam    (L.6)
...
----------------------------------------------------

How to cross-reference such a number?

Mico
  • 506,678
Tau spit
  • 917
  • 1
    The glossaries package can do something similar, but it would be laborious to do this way... – qubyte Nov 26 '11 at 12:31

1 Answers1

7

The lineno package provides this feature:

\documentclass[a4paper]{article}
\usepackage{lineno}

\begin{document}
\begin{linenumbers}
In the traffic court of a large mid-western city, a young
lady was brought before the judge to answer a ticket given
her for driving through a red light. She explained to his
honor that she was a school teacher and requested an immediate
disposal\linelabel{disposal} of her case in order that she might hasten
on to her classes. A wild gleam came into the judge's eye.
"You are a school teacher, eh?" said he. "Madam, I shall
realize my lifelong ambition. Sit down at that table and
write 'I went through a red light' five hundred times."
\end{linenumbers}

\ref{disposal}
\end{document}
egreg
  • 1,121,712