Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
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 Answer 1

up vote 6 down vote accepted

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}
share|improve this answer

Your Answer

 
discard

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.