Re: Cross referencing a user defined counter.

Pétiard François <[email protected]>
Newsgroups gmane.comp.tex.miktex
Message-ID <[email protected]>
Le 09/03/2013 21:27, Gabor Urban a écrit :
> Hi guys,
>
> I am writing a LaTeX paper where I have a self defined counter:
>
> \newcounter {abra}
> \setcounter{abra}{0}
>
> \newcommand{\incabra}{\addtocounter{abra}{1}}
> \newcommand{\theabra}{\arabic{abra}}
>
> The paper uses the igo package
>
> I use the counter :
>
> \incabra
> .......
> \begin{center}
> \shortstack{\showfullgoban\\\theabra. \'abra}
> \end{center}
>
> (Non relevant parts are removed from the source.)
>
> \label{fig:atack}
>
> \ref{fig:atack}
>
> The problem is that this last reference gets the section number generated
> before the label command.
>
> So, what I have to do to have a cross reference to my own defined counter?

Put the label inside the center environement

François


------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.