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 want to cross reference sections as well as some items in the list in my document. for ex: \label helps us to cross reference the sections. If we renew the command to provide the cross reference for any item in an item, then its not available for section reference. But how can we do both in a single document?

share|improve this question

1 Answer 1

There is no difference in using \label-\ref when it comes to sectioning commands or enumerated lists. Here is an example showing how to properly use it:

enter image description here

\documentclass{article}
\begin{document}
\section{A section}\label{sec:label}
Here is some text.
\begin{enumerate}
  \item An item
  \item Another item \label{enum:label}
\end{enumerate}
Reference to section~\ref{sec:label} and item~\ref{enum:label}.
\end{document}​​​

For more advanced (even automated) enumerated list labelling/referencing, you can use the label and ref options to enumerate provided by the enumitem package.

share|improve this answer
    
how about custom lists like starlist(*) or bulletlist? –  volatNumbers Feb 9 '12 at 18:33
2  
@volatNumbers: For "custom lists" you would need to include a minimal working example (MWE), since there may be many variables at play. Note that referencing requires a counter. If you have no counter, for the reference, you have to do something different. –  Werner Feb 9 '12 at 18:38
1  
@Werner: It would be possible to refer to the page where the label is placed, p.~\pageref{customlist:label} (with \phantomsection before the \label{customlist:label}, if hyperref is used) - depends on the wishes of the OP (you named it: MWE!). –  Stephen Feb 9 '12 at 18:59

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.