# [texhax] Equation counters in tables

Herbert Voss LaTeX at zedat.fu-berlin.de
Wed Jun 14 13:53:25 CEST 2006

Simmie, John wrote:

> I am trying to put cross-references to equations inset in a table ...
> Surprisingly $$\label{jms1}$$ is tolerated by LaTeX but is not
> translated properly when \ref{jms3}
> is used in the general text ...
> Do I have to step the equation counter or adopt a completely different
> approach?

use an own counter, makes live easier ...

Herbert

\listfiles
\documentclass[12pt]{article}
\newcounter{tabcounter}
\newcommand*\setTC[1]{\refstepcounter{tabcounter}\thetabcounter\label{#1}}
\begin{document}

\begin{tabular}{clrc} \hline
\# & working reaction                                 & $\Delta H_r$ &
$\Delta H_f$ \\ \hline
\setTC{jms1} & $\mathrm{CH_3CO\dot{C}H_2 + CH_3CH_3 = CH_3COCH_3 + CH_3\dot{C}H_2}$ & $5.5$ & $-8.4$ \\
\setTC{jms2}  & $\mathrm{CH_3CO\dot{C}H_2 + CH_3CHO = CH_3COCH_3 + \dot{C}H_2CHO}$  & $-0.9$ & $-7.6$\\
\end{tabular}

see entry~\ref{jms1} and also entry~\ref{jms2}

\end{document}