3

I have a series of long equations, 12 of them, that I'm trying to format into a table. The table is something like:

\begin{tabular}{L{1.7cm} | L{1.8cm} | C{12.2cm} R{1cm}}
\toprule
\textbf{Label 1} & \textbf{Label 2} & \textbf{Equations} \\
\midrule
.....
.....
\end{tabular}

Initially I was using \begin{equation} \end{equation} and in some cases \begin{gather} \end{gather} for each equation. This gave me numbering for each and an \eqref{equation_label} which was handy for in text referencing. Since I can't use these wrappers inside of a table I switched them each to $equation$, however I've lost the ability to cross reference. I can be horrible and add a fourth column and manually add the numbers but I don't want to as keeping track of all the equation numbers is a pain in a large document.

Does anyone have a semi-easy way to number each equation for cross referencing within a table?

edit:

Here's a better (more complete) example of what I'm doing with two shorter equations:

\documentclass[a4paper]{article}

\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}

\usepackage{booktabs}

\usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

\title{Your Paper}
\author{You}

\begin{document}

\begin{table}
\begin{tabular}{L{1.7cm} | L{1.8cm} | C{9cm}}
\toprule
\textbf{Label 1} & \textbf{Label 2} & \textbf{Equations} \\
\midrule
Col1Lbl1 & Col2Lbl1 &
$\rho_{X,Y}= \frac{cov(X,Y)}{\sigma_X\sigma_Y}= \frac{E[(X-\mu_X)(Y-\mu_Y)]}{\sigma_X\sigma_Y}$\\
~ & ~ & ~ \\
Col1Lbl12 & Col2Lbl2 &
$H(X) = - \sum_{i=1}^n p(x_i) log_b p(x_i)$
\end{tabular}
\end{table}

\end{document}

I would like the equation reference numbers added to right of each equations and be able to use \ref{} or \eqref{} in the text to reference a particular equation.

5
  • Looks like it will be difficult to answer unless you actually show a few more example rows of what you have tried.
    – Masroor
    Commented Jan 6, 2014 at 4:46
  • 1
    Using a table doesn't seem very helpful to hear you tell it. What is the advantage, exactly? Is it (merely) aesthetic?
    – jon
    Commented Jan 6, 2014 at 4:52
  • @MMA, here's what I've got that works, I've added a complete example giving two equations as examples.
    – secumind
    Commented Jan 6, 2014 at 5:10
  • @jon, it's a matter of needing all equations to be on a single page and not being able to put them inline with the referencing text. In addition there need to be labels for each that reference a corresponding image on the next page. It's more of an ease for the reader sort of thing.
    – secumind
    Commented Jan 6, 2014 at 5:13
  • 1
    @secumind For the advantage you have pointed out above, what is wrong with using a minipage or a vbox? You seem to be going through too much hassle for putting something in the same page.
    – Masroor
    Commented Jan 6, 2014 at 5:26

2 Answers 2

1

I must confess I'm not at all clear as to what the first two columns of your "table of equations" are supposed to contain. Your text seems to refer to them as "labels", but these labels must be somehow different from "regular" equation numbers, right?

If your main objective is to have all twelve equations in question placed on a page by themselves, starting at the top of the page, while still being able to cross-reference them using LaTeX's "normal" equation numbering system, you could try something like this, which relies on the afterpage package and its eponymous command \afterpage:

\usepackage{afterpage} % execute this command in the preamble
...
% later on, in the body of the document...
\afterpage{% defer execution of argument of `\afterpage to start of next page
% the following "dummy" table environment is optional
\begin{table}[t!] 
\caption{My twelve beautiful equations} % I'm sure you can come up with a better name
\label{tab:twelve-equations}
\end{table}
\begin{equation}\label{eq:firstoftwelve}
...
\end{equation} 
...
...
\begin{equation}\label{eq:lastoftwelve}
...
\end{equation} % end of final equation
%\clearpage %% optional, needed if you want no other material on this page
} % end of scope of \afterpage command

Note that this "works" even if the twelve equations end up taking more space than is available on a single page. If they don't fit on a single page, LaTeX's regular page breaking algorithm will be invoked.

0

I'm going to go ahead and answer my own question. However I'm going to upvote @Mico(s) answer as it's what led me to a solution.

The issue is that, for one reason or another, I can not format my equations as follows within the table:

    Col1Lbl1 & Col2Lbl1 &
    \begin{equation}\label{eq:firstoftwelve}
    \rho_{X,Y}= \frac{cov(X,Y)}{\sigma_X\sigma_Y}= \frac{E[(X-\mu_X)(Y-\mu_Y)]}{\sigma_X\sigma_Y}
    \end{equation}\\

instead I must:

    Col1Lbl1 & Col2Lbl1 &
    \begin{equation}\label{eq:firstoftwelve}\rho_{X,Y}= \frac{cov(X,Y)}{\sigma_X\sigma_Y}= \frac{E[(X-\mu_X)(Y-\mu_Y)]}{\sigma_X\sigma_Y}\end{equation}\\
~ & ~ & ~ \\

Note the lack of no newline after the \begin{equation}, I don't know why the formatting makes a difference within the table but it does.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .