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?

  • 1
    The glossaries package can do something similar, but it would be laborious to do this way... – qubyte Nov 26 '11 at 12:31
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}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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