3

In the following MWE, how can I enclose the boxed content inside an equation environment so that I can refer to it later by its equation number?

enter image description here

\documentclass{scrartcl}

\usepackage{mathtools,multicol,blindtext,enumitem}

\begin{document}
\begin{multicols}{2}
\blindtext
\begin{multicols}{2}
\begin{enumerate}[label=(\arabic*)]
    \item\label{itm:1} $a = b$,
    \item\label{itm:2} $c = d$,
    \item\label{itm:3} $e = f$,
    \item\label{itm:4} $g = h$.
\end{enumerate}
\end{multicols}
\blindtext
\blindtext
\end{multicols}
\end{document}
1
  • In order to leave room for the equation number, you would need to put the \multicols inside a minipage or use \llap. I would use an array instead of multicols. Commented Oct 26, 2017 at 14:40

2 Answers 2

2

This uses an array to display the 4 sub-equations.

\documentclass{scrartcl}

\usepackage{mathtools,multicol,blindtext,enumitem}

\begin{document}
\begin{multicols}{2}
\blindtext
\begin{equation}\label{name}
  \begin{array}{cc@{\qquad}cc}
    (1) & a=b & (3) & e=f\\
    (2) & c=d & (4) & g=h
  \end{array}
\end{equation}
\blindtext
\blindtext
\end{multicols}
\end{document}

demo


I took a few liberties with the subequation format, and introduced the command \subeq to simplify the code.

Interestingly, equation does not like have more than one \label inside, hence \extralabel.

\documentclass{scrartcl}

\usepackage{mathtools,multicol,blindtext,enumitem}

\newcounter{subequation}[equation]
\renewcommand{\thesubequation}{\theequation\text{\alph{subequation}}}

\let\extralabel=\label
\newcommand{\subeq}[1]% #1 = label
  {\bgroup\refstepcounter{subequation}\extralabel{#1}\egroup(\thesubequation)}

\begin{document}
\begin{multicols}{2}
\blindtext
\begin{equation}\label{name}
  \begin{array}{cc@{\qquad}cc}
    \subeq{itm:1} & a=b & \subeq{itm:2} & e=f\\
    \subeq{itm:3} & c=d & \subeq{itm:4} & g=h
  \end{array}
\end{equation}
\blindtext
\blindtext
\end{multicols}
\end{document}
6
  • Sorry, perhaps I should have stated more clearly that I need to reference the individual items as well, not just the equation as a whole (which is why they are labeled in my MWE). Is this possible in your implementation?
    – Janosh
    Commented Oct 26, 2017 at 18:06
  • Using a new counter is problematic as they would be number 1 2\\3 4 instead of 1 3\\2 4. OTOH, one can use \mylabel from tex.stackexchange.com/questions/236626/… and not use counters. Commented Oct 26, 2017 at 20:29
  • The numbering scheme is irrelevant as long as the individual items can be referenced.
    – Janosh
    Commented Oct 26, 2017 at 20:32
  • If I use the cleveref and setup \crefname{cond}{condition}{conditions}, is there any way I can pass the optional argument [cond] to extralabel? \let\condlabel=\label[cond] doesn't work.
    – Janosh
    Commented Oct 27, 2017 at 9:36
  • 1
    cleverref redefines \label to have a new optional argument. If the redefinition occurs BEFORE \let\extralabel=\label, no problem. If it uses \AtBeginDocument, you might need to do the same. Commented Oct 27, 2017 at 15:10
4

In my opinion, the subequations should be numbered in a different way (with letters, for instance) and referenced with a link to the global number.

\documentclass{scrartcl}

\usepackage{mathtools}
\usepackage{multicol}
\usepackage{array}
\usepackage{blindtext}

\makeatletter
\let\sublabel\ltx@label
\newcounter{subeq}
\renewcommand{\thesubeq}{\alph{subeq}}
\renewcommand{\p@subeq}{\theequation.}
\makeatother
\newcommand{\subeq}{\refstepcounter{subeq}\textnormal{(\thesubeq)}}

\begin{document}
\begin{multicols}{2}
\blindtext
\begin{equation}\label{foo}
\renewcommand{\arraystretch}{1.5}
\setcounter{subeq}{0}
\begin{array}{
  @{}
  >{$}c<{$}>{\displaystyle}l
  @{\qquad}
  >{$}c<{$}>{\displaystyle}l
  @{}
}
\subeq\sublabel{itm:1} & a = b, &
\subeq\sublabel{itm:2} & c = d, \\
\subeq\sublabel{itm:3} & e = f, &
\subeq\sublabel{itm:4} & g = h.
\end{array}
\end{equation}
\eqref{itm:1}, \eqref{itm:4}, \eqref{foo} and 
\blindtext
\blindtext
\end{multicols}
\end{document}

enter image description here

You must log in to answer this question.

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