Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I wish to number equations in a table, like numbering them in

\begin{equation}.
    ...
\end{equation} 

Since all the equations are written as "inline" equations (for example, $a = b+c$) in tabular environment, I have no idea how to number them. Can you help me to find out a way?

share|improve this question
4  
are you sure you want a table rather than a numbered equation environment such as amsmath align? If you do want a table the simplest is to use \begin{equation} in a p column, or if you do want to number inline expressions just go \refstepcounter{equation}(\theequation) whereever you want the number. –  David Carlisle Jul 11 '12 at 16:02
1  
Welcome to TeX.SE. For future reference, please keep in mind that while code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. –  Peter Grill Jul 11 '12 at 17:06
add comment

1 Answer

I answered a similar question at the German community MrUnix:

Here the code:

\documentclass[11pt,a4paper]{scrreprt} 
\usepackage{amsmath, amssymb, tabularx}
\usepackage{lipsum}
\usepackage{hyperref}
\newcommand{\tagarray}{%
\mbox{}\refstepcounter{equation}%
$(\theequation)$%
}

\begin{document}
\begin{equation}
1+1=2\label{1}
\end{equation}

\noindent\begin{tabularx}{\linewidth}{@{}lrcl>{\raggedleft\arraybackslash}X@{}}
Anode: & $\frac{1}{2}O_{2}+2e^{-}$ & $\longrightarrow$ & $O^{2-}$ & \tagarray\label{2}\\
Kathode: & $H_{2}+O^{2-}$ & $\longrightarrow$ & $H_{2}O+2e^{-}$ &\tagarray\label{3}\\
Gesamtreaktion: & $H_{2}+\frac{1}{2}O_{2}$ & $\longrightarrow$ & $H_{2}O$ &\tagarray\label{4}
\end{tabularx}

\begin{equation}
1+1=2\label{5}
\end{equation}
\lipsum[1]
\ref{1}\qquad\ref{2}\qquad\ref{3}\qquad\ref{4}\qquad\ref{5}
\end{document}

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.