[Tugindia] Cross-referencing

Nina Mazumdar nina.mazumdar at gmail.com
Fri Aug 8 16:20:37 CEST 2008


On Fri, Aug 8, 2008 at 6:02 PM, Ajay Shah <ajayshah at mayin.org> wrote:
> On Fri, Aug 08, 2008 at 05:38:48PM +0530, Manjusha Joshi wrote:
>> Hi Shruti,
>>
>> On Fri, Aug 8, 2008 at 5:21 PM, Shruthi Jayaram <
>> shruthi.jayaram.85 at gmail.com> wrote:
>>
>> > Hi,
>> > I have redefined the enumerate environment to generate specific styles
>> > of numbering. But when I use cross-referencing to point to a nested
>> > item in the enumerate environment, it reflects the default enumeration
>> > and not my re-defined enumeration. Is there any way I can fix this? I
>> > have attached a self-explanatory TeX code to illustrate this better.
>> > Thanks!
>> > Shruthi
>> >
>>
>> We can not see the attachment, may be due to  mailing list policy.
>> Can you please paste the code in the mail?

Here is a modified version of your code to suit enumitem package which
is used here. This should provide your desired output. By the way,
enumitem is much useful in manipulating lists in a variety of ways.

\documentclass[11pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath,enumitem}
\usepackage{amsfonts}
\usepackage{amssymb}

\begin{document}
This is a working example of the issue I have with cross referencing. I
have redefined the enumerate environment in the preamble to reflect
enumi as \textbf{arabic.}, enumii as (arabic), enumiii as
(alphabetical) and enumiv as (roman). \\

I will begin my creating a nested table
\begin{enumerate}[label=\textbf{\arabic*}.,ref=\textbf{\arabic*}.]
 \item This is the first line\label{one}
 \item This is the second line
   \begin{enumerate}[label=(\arabic*),ref=\textbf{\arabic{enumi}}.(\arabic*)]
     \item This is the first nested line\label{two}
     \item This is the second nested line
       \begin{enumerate}[label=(\alph*),%
          ref=\textbf{\arabic{enumi}}.%
          (\arabic{enumii})(\arabic{enumiii})]
        \item This is what I want to reference, let me call it A\label{A}.
       \end{enumerate}
   \end{enumerate}
\end{enumerate}
When I call this reference at this point - ``\ref{A}", I do not see the
labelling \textbf{2.}(2)(a), but I see \ref{A}. I'd be very grateful
for any help on fixing this!
One=\ref{one}\quad Two=\ref{two}.

\end{document}

Happy TeXing and best regards

-- 
Nina


More information about the tugindia mailing list