6

I am trying to create a table with two columns of independently labelled equations (1-6). Unfortunately, everything I have found so far either has not worked or would number them as sub-equations (1a, 1b, etc).

My current attempt is:

\documentclass{article}
\usepackage{graphicx, verbatim, tabularx}
\usepackage{amsfonts}
\usepackage{amsmath, amssymb}
 \newcommand{\grad}{\vec{\nabla}}     
 \newcommand{\prtl}[2]{\frac{\partial #1}{\partial #2}}
 \newcommand{\curl}{\grad\times}
\begin{document}
 \begin{tabular}{p{5cm}p{5cm}}
 $\curl\vec{E} = -i\omega\mu\vec{H}$ & 
 $\curl\vec{H} = i\omega\mu\vec{E}$ \\
 \begin{equation}
 \label{eq:curlHx} 
 \prtl{E_z}{y} +\gamma E_y= -i\omega\mu H_x
 \end{equation}
 &
 \begin{equation}
 \label{eq:curlEx} 
  \prtl{H_z}{y} +\gamma H_y= i\omega\mu E_x
 \end{equation}\\
 \begin{equation}
 \label{eq:curlHy} 
  -\prtl{E_z}{x} -\gamma E_x= -i\omega\mu H_y
 \end{equation}
 &
 \begin{equation}
 \label{eq:curlEy} 
  -\prtl{H_z}{x} -\gamma H_x= -i\omega\mu E_y
 \end{equation}
 \\
 \begin{equation}
 \label{eq:curlHz} 
 \prtl{E_y}{x}-\prtl{E_x}{y} = -i\omega\mu H_z
 \end{equation}
 &
 \begin{equation}
 \label{eq:curlEz} 
  \prtl{H_y}{x}-\prtl{H_x}{y} = -i\omega\mu E_z
 \end{equation}
 \end{tabular}

\end{document}

Is there an environment other than tabular that would make this work? Tabularx came close (got the numbering correct), but the formatting/spacing was horrific.

7
  • equations are vertical display environments so need to be in vertical (par) mode not horizontal (LR) mode. So you columntypes need to be p{3cm}p{3cm} not cc Commented Mar 21, 2014 at 21:06
  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem.
    – jub0bs
    Commented Mar 21, 2014 at 21:11
  • Thank you, @Jujobs. This version is not compilable, but I do believe it has all the other pieces. Is there anything else I should do to be more helpful to those helping me? Commented Mar 21, 2014 at 21:34
  • @user48407 providing the definitions (or packages containing them) for \curl and \prtl would be helpful. I had to made some faked definitions in my answer. Commented Mar 21, 2014 at 21:36
  • @GonzaloMedina Added! Commented Mar 21, 2014 at 21:38

1 Answer 1

4

Your code won't work since c columns expect material in horizontal mode and displayed math needs vertical mode.

Below I present three options; the first two using a tabular approach and the third one using minipages and align, thus allowing alignment points at the equal signs. In my opinion, the third option is the one that produces a more pleasing result.

One option would be to use p{...} columns (I used the maximum available width for both columns and provided some faked definitions for \curl and \prtl):

\documentclass{article}
\usepackage{amsmath}

\DeclareMathOperator{\curl}{Curl}
\newcommand\prtl[2]{\dfrac{\partial#1}{\partial#2}}

\begin{document}

\noindent\begin{tabular}{@{}*{2}{p{\dimexpr.5\textwidth-\tabcolsep\relax}}@{}}
 $\curl\vec{E} = -i\omega\mu\vec{H}$ & 
 $\curl\vec{H} = i\omega\mu\vec{E}$ \\
 \begin{equation}
 \label{eq:curlHx} 
 \prtl{E_z}{y} +\gamma E_y= -i\omega\mu H_x
 \end{equation}
 &
 \begin{equation}
 \label{eq:curlEx} 
  \prtl{H_z}{y} +\gamma H_y= i\omega\mu E_x
 \end{equation} \\
 \begin{equation}
 \label{eq:curlHy} 
  -\prtl{E_z}{x} -\gamma E_x= -i\omega\mu H_y
 \end{equation}
 &
 \begin{equation}
 \label{eq:curlEy} 
  -\prtl{H_z}{x} -\gamma H_x= -i\omega\mu E_y
 \end{equation}
 \\
 \begin{equation}
 \label{eq:curlHz} 
 \prtl{E_y}{x}-\prtl{E_x}{y} = -i\omega\mu H_z
 \end{equation}
 &
 \begin{equation}
 \label{eq:curlEz} 
  \prtl{H_y}{x}-\prtl{H_x}{y} = -i\omega\mu E_z
 \end{equation}
 \end{tabular}

\end{document}

enter image description here

If the unnumbered equations in the first row should be centered, one could load array in the preaamble:

\usepackage{array}

and then use

\begin{tabular}{
  @{}
  *{2}{>{\centering\arraybackslash}%
    p{\dimexpr.5\textwidth-\tabcolsep\relax}}
  @{}
  }
...
\end{tabular}

for the table format specification. Extra vertical spacing can be avoided using the optional argument for \\:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{array}

\newcommand{\curl}{\grad\times}
\newcommand\prtl[2]{\frac{\partial#1}{\partial#2}}
\newcommand{\grad}{\vec{\nabla}}

\begin{document}

\noindent\begin{tabular}{
  @{}*{2}%
    {>{\centering\arraybackslash}p{\dimexpr.5\textwidth-\tabcolsep\relax}}
    @{}
  }
 $\curl\vec{E} = -i\omega\mu\vec{H}$ & 
 $\curl\vec{H} = i\omega\mu\vec{E}$ 
 \\[-3ex]
 \begin{equation}
 \label{eq:curlHx} 
 \prtl{E_z}{y} +\gamma E_y= -i\omega\mu H_x
 \end{equation}
 &
 \begin{equation}
 \label{eq:curlEx} 
  \prtl{H_z}{y} +\gamma H_y= i\omega\mu E_x
 \end{equation} 
 \\[-6ex]
 \begin{equation}
 \label{eq:curlHy} 
  -\prtl{E_z}{x} -\gamma E_x= -i\omega\mu H_y
 \end{equation}
 &
 \begin{equation}
 \label{eq:curlEy} 
  -\prtl{H_z}{x} -\gamma H_x= -i\omega\mu E_y
 \end{equation}
 \\[-6ex]
 \begin{equation}
 \label{eq:curlHz} 
 \prtl{E_y}{x}-\prtl{E_x}{y} = -i\omega\mu H_z
 \end{equation}
 &
 \begin{equation}
 \label{eq:curlEz} 
  \prtl{H_y}{x}-\prtl{H_x}{y} = -i\omega\mu E_z
 \end{equation}
 \end{tabular}

\end{document}

enter image description here

A different approach using two side-by side minipages and align to produce alignment for each column; in this case, \tag was used to retain the numbering schema of the previous solutions:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{array}

\newcommand{\curl}{\grad\times}
\newcommand\prtl[2]{\frac{\partial#1}{\partial#2}}
\newcommand{\grad}{\vec{\nabla}}

\begin{document}

\noindent
\begin{minipage}[t]{.5\textwidth}
 \begin{align}
 \curl\vec{E} &= -i\omega\mu\vec{H} \notag \\
 \label{eq:curlHx} 
 \prtl{E_z}{y} +\gamma E_y &= -i\omega\mu H_x \\
 \label{eq:curlHy} 
  -\prtl{E_z}{x} -\gamma E_x &= -i\omega\mu H_y\tag{3} \\
 \label{eq:curlHz} 
 \prtl{E_y}{x}-\prtl{E_x}{y} &= -i\omega\mu H_z\tag{5}
 \end{align}
\end{minipage}%
\begin{minipage}[t]{.5\textwidth}
 \begin{align}
 \curl\vec{H} &= i\omega\mu\vec{E} \notag \\
 \label{eq:curlEx} 
  \prtl{H_z}{y} +\gamma H_y &= i\omega\mu E_x\tag{2} \\
 \label{eq:curlEy} 
  -\prtl{H_z}{x} -\gamma H_x &= -i\omega\mu E_y\tag{4} \\
 \label{eq:curlEz} 
  \prtl{H_y}{x}-\prtl{H_x}{y} &= -i\omega\mu E_z\tag{6}
 \end{align}
\end{minipage}

\end{document}

enter image description here

7
  • I found \curl in package mandi. Also I would add >{\centering} and >{\centering\arraybackslash} to the column specifications to center the first unnumbered equations. Commented Mar 21, 2014 at 21:29
  • @HeikoOberdiek Thanks. I decided to keep my "faqed" \curl definition since I am not sure if the OP is using a package or a customized definition that might then conflict with the one in the package. I added a remark about the column specifications. Commented Mar 21, 2014 at 21:38
  • Thank you! @GonzaloMedina, is there a way I could alter the spacing between the rows? On my machine there is nearly an inch of spacing between the equations in the table. Commented Mar 21, 2014 at 21:42
  • @user48407 Please see the second code in my updated answer. Commented Mar 21, 2014 at 21:57
  • @user48407 I added another option to my answer that might be of interest for you. Commented Mar 21, 2014 at 22:07

You must log in to answer this question.

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