title: Using a single count for figures and tables in LaTeX
body: <p>I've been given a LaTeX document to edit with the following code for using a single count for figures and tables.</p>
  
  <pre><code> \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
  </code></pre>
  
  <p>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.</p>
  
  <p>Does anyone know how to fix this? Or can anyone advise an alternative?</p>
  
  <p>I am a LaTeX newbie.</p>
  
  <p>Thanks</p>
  
  <p>Mr Morgan.</p>