3

I'm trying to make a table containing 4 equations in which the two in the left column are labelled 1a and 1b, and the two in the right column are labelled 2a and 2b.

I've been able to construct such a table using the array environment, except my equations are labelled 1, 2, 3, 4:

\documentclass{article}
\usepackage{amsmath}
\usepackage{booktabs}
\newcommand{\dd}[2] {\frac{\partial #1}{\partial #2}}

\begin{document}

\begin{table}
\centering
$\begin{array}{ c l r l r }
  & \multicolumn{1}{c}{\text{Dynamic b.c.}} & & \multicolumn{1}{c}{\text{Kinematic b.c.}} & \\
  \addlinespace
  O(\epsilon) &
  \begin{aligned} \dd{\phi_1}{t} = 0 \end{aligned} & \quad \refstepcounter{equation}(\theequation)\label{dynamicEps} \quad &
  \begin{aligned} \dd{h_1}{t} = v_1 \end{aligned} & \quad \refstepcounter{equation}(\theequation)\label{kinematicEps} \\
  \addlinespace
  O(\epsilon^2) &
  \begin{aligned} \dd{\phi_2}{t} = -h_1 \dd{v_1}{t} - \frac{1}{2}(u_1^2 + v_1^2) \end{aligned} & \quad \refstepcounter{equation}(\theequation)\label{dynamicEpsSq} \quad &
  \begin{aligned} \dd{h_2}{t} = v_2 + h_1 \dd{v_1}{y} - u_1 \dd{h_1}{x} \end{aligned} & \quad \refstepcounter{equation}(\theequation)\label{kinematicEpsSq} \\
\end{array}$
\caption{Free surface boundary conditions at $y=\beta$ resulting from domain perturbation expansion.}
\label{bcTableFreeSurface}
\end{table}

\end{document}​

It seems that \tag doesn't work inside the array environment, so I'm not sure of the best way to get this subequation numbering.

  • 1
    Welcome to TeX.SX! – egreg Jan 15 '14 at 21:36
4

This is mostly a collection of hacks, but it seems to work with the standard textwidth.

\documentclass{article}
\usepackage{amsmath}
\usepackage{booktabs}
\newcommand{\dd}[2] {\frac{\partial #1}{\partial #2}}

\begin{document}

\begin{table}
\centering
\begin{minipage}[t]{0.53\textwidth}
\begin{subequations}
\centering
Dynamic b.c.
\begin{flalign}
&\rlap{$O(\epsilon)$}\hspace{1.5em} &
  \dd{\phi_1}{t} &= 0 \label{dynamicEps} &&\\
&\rlap{$O(\epsilon^2)$}&
 \dd{\phi_2}{t} &= -h_1 \dd{v_1}{t\vphantom{y}} - \frac{1}{2}(u_1^2 + 
  \rlap{$v_1^2)$} \label{dynamicEpsSq} &&
\end{flalign}
\end{subequations}
\end{minipage}\hfill
\begin{minipage}[t]{0.45\textwidth}
\begin{subequations}
\centering
Kinematic b.c.\vphantom{y}
\begin{align}
\dd{h_1\vphantom{\phi}}{t} &= v_1 \label{kinematicEps} \\
\dd{h_2}{t} &= v_2 + h_1 \dd{v_1}{y} - u_1 \dd{h_1}{x} \label{kinematicEpsSq}
\end{align}
\end{subequations}
\end{minipage}

\caption{Free surface boundary conditions at $y=\beta$ resulting 
  from domain perturbation expansion.}

\label{bcTableFreeSurface}
\end{table}

\end{document}​

The idea is to typeset two distinct side by side alignments, using the fact that the equations are pretty similar and so only small adjustments for the height are necessary (a couple of \vphantom's). The left hand alignment needs some tricks to fool amsmath into thinking it doesn't need other space for the equation numbers.

However, I don't think it's a pretty result anyway.

enter image description here

|improve this answer|||||
  • Thanks, that works great! It does look a little crowded in the standard text width, but with the paper format I'm using it's not as bad. I'd also never seen vphantom or flalign before, so it's good to know they exist. – Frecka Jan 17 '14 at 7:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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