2

I'm trying to build a way to have an arbitrary number of equations (typically two, but sometimes three, and if they're particularly short definitions even four) on a single line, but tagged only once on the right, individually.

I've been trying with minipages, as answered many times previously (like here and here).

I have two problems (EDIT: The first was solved in the comments):

1) The minipages add a small amount of whitespace, so their combined widths is larger than \linewidth:

Here's a MWE to show that some space is added. So the label (2) is to the right of label (3).

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{cleveref}

\newenvironment{splits}[1][0.5]{
\noindent\minipage{#1\linewidth}\align}
{\endalign\endminipage}

\begin{document}

\begin{splits}
x=0
\end{splits}
\begin{splits}
y=1
\end{splits}

\begin{align}
z=2
\end{align}

\end{document}

2) I cannot achieve the labelling only on the right-hand side. Labelling each equation is cluttered and out of place, but doing a \notag means I can't later do a \ref. What I would like, is something like (in the document above):

\begin{splits}[.25] \notag\label{1}
x=0
\end{splits}
\begin{splits}[.25] \notag\label{2}
y=1
\end{splits}
\begin{splits}[.25] \notag\label{3}
z=2
\end{splits}
\begin{splits}[.25]
\tag*{\cref{1,2,3}}
\end{splits}

With the idea being output that has looks like:

x=1        y=2        z=3        (1-3)
x_1=1      x_2=2      z_3=3    (1 a-c)

The exact content of the label isn't so important, so it could be (1a-1c) or something similar.

1

Is it something like this you want? I redefined your splits environment with tabularx:

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{tabularx}
 \usepackage{cleveref}

\newenvironment{splits}[1][2]{
\vspace{\abovedisplayshortskip}\par\centering\tabularx{\linewidth}{*{#1}{>{\equation}X<{\endequation}}}}
{\endtabularx\vspace{\dimexpr\belowdisplayshortskip-\belowdisplayskip}\par}

\begin{document}
Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text.%

 \begin{splits}[3]
x=0 \label{eq-a} & y=1 \label{eq-b} & z=2 \label{eq-c}
 \end{splits}%
See \cref{eq-b,eq-s3}. Some more text. Some more text. Some more text.
\begin{subequations}
 \begin{splits}[3]
x=0 \label{eq-s1} & y=1 \label{eq-s2} & z=2 \label{eq-s3}
 \end{splits}%
 \end{subequations}

\end{document} 

enter image description here

|improve this answer|||||
  • Sorry, I must not have explained myself well. I am looking for the labels to be references, but appear only on the right-hand side. I'll update my question to be more clear. – bjorne Jan 17 '17 at 16:56
  • Do you mean all labels grouped on the right-hand side? – Bernard Jan 17 '17 at 17:10
  • Yes, that's what I mean. – bjorne Jan 17 '17 at 17:23

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.