4

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?

1 Answer 1

9

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.

3
  • how about custom lists like starlist(*) or bulletlist? Feb 9, 2012 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, 2012 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, 2012 at 18:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .