1

Consider the following array of three equations.

\begin{align}
a & =b\label{eq:eq1}\\
c & =d\label{eq:eq2}\\
e & =f\label{eq:eq3}
\end{align}

I would like to compact this by putting all three equations on the same line. However, I don't know how (or if it is even possible) to do this in such a way where the equations are labelled by say (1a-c), and where I can refer to the equations individually from outside the text (for example, by then calling equation (1a)). Having tried to put several labels on the same line in an align environment, LaTeX throws an error.

Does anyone know how to remedy this?

UPDATE: I would also like to achieve this, but where I have several lists of equations within align environments that I want to line up with each other. When I try:

\begin{subequations}
\begin{minipage}{0.5\textwidth}
\begin{align}
a & =b\label{eq:eq1}\\
c & =d\label{eq:eq2}
\end{align}
\end{minipage}
\begin{minipage}{0.5\textwidth}
\begin{align}
e & =f\label{eq:eq1-1}\\
g & =h\label{eq:eq2-1}
\end{align}
\end{minipage}
\end{subequations}

all the equations end up being concentrated in the left side of the document. If I try using multicols instead of minipage, then I do get the two-column layout that I am after, but the equations do not line up vertically.

1 Answer 1

3

You may achieve your formatting objective by (1) loading the amsmath package and making use of its subequations environment, (2) placing the three equations in equation environments and placing the equation environments in separate minipage environments of width 0.333\textwidth, (3) placing the side by side minipages in a subequations environment, and (4) placing the subequations environment in a center environment. The purpose of Step 4 (the center environment) is to provide some vertical whitespace separation above and below the equations; this is advisable because the minipage environment clobber the vertical whitespace that's inserted by the equation environments.

To create cross-references to these equations, just use LaTeX's \label-\ref (or \eqref) mechanism.

enter image description here

The framelines in the screenshot are generated by the showframe package and show the left- and right-hand edges of the textblock.

\documentclass{article} % or some other suitable document class
\usepackage{amsmath} % for 'subequations' environment and '\eqref' macro
\usepackage[colorlinks,allcolors=blue]{hyperref} % optional
\usepackage{showframe} % optional: draw framelines around text block

\begin{document}
\null

\begin{center}
\begin{subequations}
\begin{minipage}{0.333\textwidth}
  \begin{equation} \label{eq:1a}
  a=b
  \end{equation}
\end{minipage}%
\begin{minipage}{0.333\textwidth}
  \begin{equation} \label{eq:1b}
  c=d
  \end{equation}
\end{minipage}%
\begin{minipage}{0.333\textwidth}
  \begin{equation} \label{eq:1c}
  e=f
  \end{equation}
\end{minipage}
\end{subequations}
\end{center}

\noindent
Cross-references to equations \eqref{eq:1b} and \eqref{eq:1c}.

\end{document}

Addendum to address the OP's follow-up code: I suggest you insert \noindent before the first minipage environment and affix % (the comment symbol) to the end of the first \end{minipage} line.

\begin{subequations}
\noindent % <-- new
\begin{minipage}{0.5\textwidth}
\begin{align}
a &= b \label{eq:eq1}\\
c &= d \label{eq:eq2}
\end{align}
\end{minipage}% % <-- terminate the line with "%"
\begin{minipage}{0.5\textwidth}
\begin{align}
e &= f \label{eq:eq1-1}\\
g &= h \label{eq:eq2-1}
\end{align}
\end{minipage}
\end{subequations}
6
  • Thanks, this is really helpful. Now what if I instead want to make each equation a list of equations (e.g. within an align environment)? I would like to have a 2-by-2 array of equations with their own references and all lined up with each other - but having tried a multicol environment, it doesn't seem to work particularly well.
    – OGBond
    Dec 31, 2022 at 11:52
  • To give you an idea of what I want to achieve, please check the update on the main question.
    – OGBond
    Dec 31, 2022 at 12:01
  • @OGBond - Please see the addendum I posted just now.
    – Mico
    Dec 31, 2022 at 12:57
  • Many thanks. To go one further, is there a way to make sure the equations in each minipage share the same vertical alignment? I am using a more complicated example involving fractions, and the vertical alignment of the equations in the second column are (very slightly) off from the first one.
    – OGBond
    Dec 31, 2022 at 16:08
  • @OGBond - The answer to your fairly abstract question, "is there a way", is a simple yes. Please post a new query, in which you might show the actual equations you're looking to align vertically. That'll make it much easier to provide specific advice.
    – Mico
    Dec 31, 2022 at 17:46

You must log in to answer this question.

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