# [texhax] Problem with using the list command with cross-referencing

Shubho Roy shubho.roy85 at gmail.com
Sat Aug 11 14:46:44 CEST 2012

Dear All,
I am facing a problem with the use of list command. I need to generate
lists with specific numbering systems and then cross-reference them in
different parts.
By using the list command I am able to create lists with the correct system
of numbering. However when I use the \ref command to refer back to them it
only prints the Arabic numeral equivalent of the entry instead of the
numbering system I have used. Is there any way I could resolve this so that
I could get the correct cross-reference inserted.

To illustrate my problem I have written a short code for this which states
my problem too.

---------------------------------------------

\documentclass[12pts,a4paper]{report}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{color}

\newcounter{sections}
\newcounter{sub-section}
\newcounter{clause}
\newcounter{sub-clause}
%this is the counter command

\title{Problem with cross-referencing using list command}

\author{Shubho Roy}

\begin{document}
\maketitle

\begin{list}{(\arabic{sub-section})}{\usecounter{sub-section}}
\item This is some text in sub-section which is using Arabic
numerals. \label{sub-sec:arabic_numerals}
\begin{list}{(\alph{clause})}{\usecounter{clause}}
\item This is a clause which is using alphabetical numbering
\label{clause:alphabetical}
\begin{list}{(\roman{sub-clause})}{\usecounter{sub-clause}}
\item This is a sub-clause using roman numbering.
\label{sub-clause:roman_numerals}
\end{list}

\end{list}

\end{list}

The problem arising when I use label to reference to different parts
of the document.

\begin{itemize}
\item If I refer to the sub-section using the ref command I get a correct
reference like this: \ref{sub-sec:arabic_numerals}

\item However when I refer to the clause list which is a nested list and
uses alphabetical numbering I still get Arabic numbering as reference:
\ref{clause:alphabetical}. I would like this to be (a)

\item The same problem is available in the case of sub-clause list where I
should get roman numerals but I still get the Arabic numeral:
\ref{sub-clause:roman_numerals}. I would like this to be (i)

\end{itemize}

The hyperref command sends it to the correct link but the numbering
printed is always in Arabic while I have  used other numbering systems
for this.
Any help!!

\end{document}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texhax/attachments/20120811/b7f64db8/attachment.html>