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 cannot get \label{tname} \ref{tname} to generate any number.

I am new to xetex - used latex some 15 yrs back while at school. Any pointers?

My goal is to tag verse in \begin{verse} ... \end{verse} block.

\setromanfont{Linux Libertine}% Better Diacritics
\setsansfont{DejaVu Sans}%
\setmonofont{DejaVu Sans Mono}%
\title{Your Title}
\author{Your Name}




This is a snippet of what I am trying to add

sukha-duḥkhe same kṛtvā lābhālābhau jayājayau \\
tato yuddhāya yujyasva naivaḿ pāpam avāpsyasi \\

In the verse \ref{2.38} ...

I tried using \nameref. Interestingly nameref gives me the label name verbatim. However at the point the label is defined, there is no numbering.

I want verses to be explicitly numbered, ie I number them or tag them.

share|improve this question
Wait, you are trying to tag verse in a \begin{verse}...\end{verse} block? As far as I know (at least in LaTeX) the verse blocks have no attached counters. You probably need to define a new environment for that. –  Willie Wong Jan 21 '11 at 19:35

3 Answers 3

try \label{1.1.1} and \nameref{1.1.1} Also \lable{name} and \nameref{name} should work as well.

share|improve this answer
It does not work. Note when I used tname in my example it was a number 1.2.3. –  user3063 Jan 21 '11 at 18:50
in your example you say "\include{myfile}" it would be helpful if you can post an example where you used these tags. you include file could be big but you can post a small section of code that you are using to create what you desire. –  Aku Jan 21 '11 at 18:57
Aku, Thanks. From your example below, I see you set these counters. I'll give this a shot. I am trying to do old fashioned label and ref. I cannot get the combo to work, even outside the verse block. I will provide the actual sample in a followup to your post. –  user3063 Jan 22 '11 at 15:20
\begin{document} % End of preamble and beginning of text.

    Kabira So dhan sanchiye jo aage to hoye\\
    Seesh chadhavat kaath ki Jaat na d ekha koye.

    Kaal kare so Aaj kar, aaj kare so ab
    Pal me parlay hoyegi bahuri karega kab.

\end {verse}


I am not sure from your message what you are trying to do, but if you are trying to number verses automatically here is something that you can give a try.

share|improve this answer

You could create a theorem environment for numbered verses. This way you could number arbitrary environments. Here, for example:

sukha-duḥkhe same kṛtvā lābhālābhau jayājayau \\
tato yuddhāya yujyasva naivaḿ pāpam avāpsyasi \\
In the verse \ref{2.38} ...

Together with your preamble it gives:

alt text

share|improve this answer
Thanks Stefan. This works. Thanks to everyone who offered constructive suggestions. –  user3063 Jan 22 '11 at 21:02

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.