[Tuglist] Variable Assignments in LaTeX

Radhakrishnan CV tuglist@tug.org.in
Thu, 9 May 2002 20:46:15 +0530 (IST)


On Thu, 9 May 2002 at 20:14, Manoj K N wrote:

   How does one assign the value of a counter to a variable? I want
   \s@vefignum to take the value of \c@figure, change \c@figure to a
   new value, and later to re-assign the value \s@vefignum of
   \c@figure. I tried the following piece of LaTeX code:
   
   \makeatletter\newcount\s@vefignum\s@vefignum\c@figure
   .....
   \c@figure\s@vefignum\makeatother
   
Try this code (I changed your \s@vefignum to \c@savefignum):

  \mathchardef\c@savefignum\c@figure
  \protected@edef\thesavefignum{\thefigure}
  ....
  ....
  \global\c@figure\c@savefignum   
  
This should work. I guess, you need figure numbers modified to 1a,
1b, 1c, ...  within an environment and 2, 3, 4, etc outside that
environment. You can try subfigures.sty.

-- 
Radhakrishnan