Hi,
In my dissertation, I have to explain about lot of different cases. I want to give all a unique number and refer to them while discussing about these cases using figures or tables.
Now is there any way to label details of the cases in the beginning using \label command and then refer to them later where ever i want using \ref command. I want to do this, so that if I want to change the "case number" later on, I can do it without changing it everywhere manually.
Please suggest a way out.
Thanks and Regards,
Atul
General ⇒ Issue with \label and \ref
NEW: TikZ book now 40% off at Amazon.com for a short time.

Issue with \label and \ref
Hello,
the basic procedure is always as follows: You create a new counter, say case, and increase this for every case via the \refstepcase command. Then you can use \label and \ref as with any other sectioning command. Here is a small example:If you choose this way, you have to do all the formatting etc. by hand (and you have the greatest possible control). There are many packages that provide format templates, in most cases customizable. On example is the \newtheorem command from the LaTeX kernel, which is extended by the amsthm package.
the basic procedure is always as follows: You create a new counter, say case, and increase this for every case via the \refstepcase command. Then you can use \label and \ref as with any other sectioning command. Here is a small example:
Code: Select all
\documentclass{article}
\newcounter{case}
\newcommand*\case{%
\refstepcounter{case}%
Case \arabic{case}: %
}
\begin{document}
\section{ABC}
\case foo
\label{mycase1}
\case bar
\label{mycase2}
\section{DEF}
As discussed in case \ref{mycase2}\ldots
\end{document}
Re: Issue with \label and \ref
Hi, Thanks a lot for the information. This is what I was looking for.
Regards,
Atul
Regards,
Atul