tags:

views:

21

answers:

2

Hello

I've been given a LaTeX document to edit with the following code for using a single count for figures and tables.

 \makeatletter
 \newcounter{unisequence}
 \def\ucaption{
    \ifx\@captype\@undefined
        \@latex@error{\noexpand\ucaption outside float}\@ehd
        \expandafter\@gobble
    \else
        \refstepcounter{unisequence} 
        \expandafter\@firstofone
    \fi
    {\@dblarg{\@caption\@captype}}
  }
 \def\thetable{\@arabic\c@unisequence}
 \def\thefigure{\@arabic\c@unisequence}
 \makeatother

This works well to give a single counter for captions of tables and figures but, I find that if I click on any of the caption numbers in the .pdf this code generates, I am always returned to the first figure or table in the document rather than the one I want, e.g. clicking on in Table [3] will take me to Table 1 instead.

Does anyone know how to fix this? Or can anyone advise an alternative?

I am a LaTeX newbie.

Thanks

Mr Morgan.

A: 

Off the top of my head, this is a problem of the snippet you have there not generating the correct reference. See here, for instance: http://en.wikibooks.org/wiki/LaTeX/Hyperlinks

Dervin Thunk
A: 

If it's of use to anyone, use:

\makeatletter
\renewcommand*{\thetable}{\arabic{table}}
\renewcommand*{\thefigure}{\arabic{figure}}
\let\c@table\c@figure
\makeatother 

In the preamble of your document.

Martin O'Shea