# Double tagged equations?

In the following example

the inequality (2.26) is obtained in the environment equation, but the equations (2.27) and (2.28) by dirty tricks, destroying the structure of the document. This is because additional tags (i) and (ii) are needed on the left-hand side of lines. (This is, in fact, some kind of an enumeration).

How to obtain such additional tags in equations or even more: produce a list with equations of its elements?

I am trying to find better solutions then How to number equations with a list environment

Remark. According to some wishes a (very ugly) code snippet. I hope that it would be enough instead of MWE and I know, that one should not use LaTeX in the presented way.

Indukcja matematyczna pozwala przenieść nierówność \eqref{(2.25)} na dowolną liczbę składników:
$$\label{(2.26)} J(X_1+\ldots +X_n)\leqslant \alpha_1^2J(X_1)+\ldots +\alpha_n^2J(X_n),% \hfill (2.26)$$

\vspace{2mm}
\noindent gdzie $X_1,\ldots ,X_n$ są niezależne oraz $\alpha_i\in[0,1],\; \sum_{i=1}^n\alpha_i=1$. Nierówność (2.26) udowodnili Stam (1959) oraz Blachman (1965), nie korzystając z lematu 2.2. Nierówność (2.26) można zapisać w kilku
równoważnych postaciach:

\vspace{2mm}
\noindent$\;\;${\it (i) $\;\;\;J(\sqrt{\alpha_1}X_1+\ldots +\sqrt{\alpha_n}X_n)\leqslant \alpha_1J(X_1)+\ldots +\alpha_nJ(X_n)$;\hfill {\rm (2.27)}

\vspace{2mm}
\noindent$\;\;$(ii) $\;\;\displaystyle \frac{1}{J(X_1+\ldots +X_n)}\geqslant \frac{1}{J(X_1)}+\ldots +\frac{1}{J(X_n)}$;\hfill
{\rm (2.28)}

-
Can you please add a minimal working example so that people can see what packages etc you need to get your code to work (but don't add code that is not needed). This makes it much easier for people to help you. –  Andrew Sep 2 at 5:40
One common reason for using an enumerate environment is that one wants to be able to cross-reference the various items somewhere else in the text. However, given that the itemized material consists of already-enumerated equations (inequalities, actually), is it necessary to provide a second form of enumeration? Would the flow of the presentation suffer (or be enhanced?) if you placed the two last inequalities in an align environment (with alignment on the inequality symbol)? –  Mico Sep 2 at 5:41
@Andrew It is not a problem of errors, hence packages are rather meaningless (amsmath is obviously used). The code used for the fragment in the picture is really dirty, against LaTeX rules, so it is not included intentionally. –  Przemysław Scherwentke Sep 2 at 5:49
I gather that "Nierówność" means either "equation" or "inequality". :-) –  Mico Sep 2 at 7:20
I can't understand what the labels on the left are for. If the two equations are to be considered as a set, then subequations should be used, which would label them as 2.27a and 2.27b, with the possibility to refer to “Equations 2.27” by setting a \label after \begin{subequations}. –  egreg Sep 2 at 13:46

EDIT

I decided that I didn't really like my first solution (see below) because it requires all of this "extra clutter" in order for it to work. So, I have written a custom enumitem environment equationate (=equation+enumerate) that does the same thing except that it hides the clutter inside the environment.

The output is given above, which is exactly the same as for my first solution, but the input now only requires some equations inside an enumerate-like environment. These equations are automatically typeset as mathematics in \displaystyle. Even though it doesn't look like it above (I shrunk the image), the equation numbers are flush with the righthand margin.

Here is the new MWE:

\documentclass{article}
\usepackage{enumitem}
\usepackage[width=80mm]{geometry}

\renewcommand\theequation{(\arabic{section}.\arabic{equation})}

\let\realItem=\item
\newcommand\EquationItem[1][\relax]{%
\ifmmode\EndEquationItem\fi% close off math-mode from last item
\ifx\relax#1\relax\realItem\else\realItem[#1]\fi%
\refstepcounter{equation}$\displaystyle% } \newcommand\EndEquationItem{$\hfill\theequation}
\newlist{equationate}{enumerate}{1}
\setlist[equationate]{label=\roman*), before=\global\let\item\EquationItem,
after=\EndEquationItem\global\let\item\realItem}

\begin{document}
\section{Some equations}

\begin{equationate}
\item \sum_{k=1}^nk=\frac12 n(n+1)
\item \sum_{k=1}^nk^2=\frac16n(n+1)(2n+1)
\end{equationate}

\end{document}


Notice that because equationate is an enumitem environment you can customise it on the fly in the usual way. For example,

  \begin{equationate}[label=\alph*)]
\item \sum_{k=1}^nk=\frac12 n(n+1)
\item \sum_{k=1}^nk^2=\frac16n(n+1)(2n+1)
\end{equationate}


will print the item numbers as a), b), .... Of course, if you change the values of before or after then everything will break. If you're keen it shouldn't be hard to add an option so that \item* suppresses the equation label for an item.

Original solution

I would use the following (using the enumitem package):

\documentclass{article}
\usepackage{enumitem}
\usepackage[width=80mm]{geometry}
\begin{document}
\section{Some equations}
\renewcommand\theequation{(\arabic{section}.\arabic{equation})}

\begin{enumerate}[label=\roman*)]
\item $\displaystyle \sum_{k=1}^nk=\frac12 n(n+1)$
\refstepcounter{equation}\hfill\theequation
\item $\displaystyle \sum_{k=1}^nk^2=\frac16n(n+1)(2n+1)$
\refstepcounter{equation}\hfill\theequation
\end{enumerate}

\end{document}


This is not much of hack and it produces the image above.

-
@Mico I will try to reform:) –  Andrew Sep 2 at 6:22
@Andrew +1. Nice trick, preserving the structure of a document. –  Przemysław Scherwentke Sep 2 at 6:37
@barbarabeeton Thanks, you're right it was an old image. I've updated it. –  Andrew Sep 2 at 13:55

Wouldn't it be the easiest way to use an align or alignat here? I replaced the \ldots by \dots in between the binary operators as they are looking wrong.

% arara: pdflatex

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathtools}
\usepackage{amssymb}
\renewcommand\theequation{\arabic{section}.\arabic{equation}}

\begin{document}
\setcounter{section}{2}
\setcounter{equation}{25}
Indukcja matematyczna pozwala przenieść nierówność (2.25) na dowolną liczbę składników:
$$\label{(2.26)} J(X_1 + \dots + X_n) \leqslant \alpha_1^2J(X_1) + \dots + \alpha_n^2J(X_n),$$
gdzie $X_1, \dots, X_n$ są niezależne oraz $\alpha_i\in[0,1],\; \sum_{i=1}^n\alpha_i=1$. Nierówność (2.26) udowodnili Stam (1959) oraz Blachman (1965), nie korzystając z lematu 2.2. Nierówność (2.26) można zapisać w kilku
równoważnych postaciach:
\begin{alignat}{2}
&(i)\qquad &&J(\sqrt{\alpha_1}X_1+ \dots +\sqrt{\alpha_n}X_n)\leqslant \alpha_1J(X_1)+ \dots +\alpha_nJ(X_n);\\
&(ii)\qquad &&\displaystyle \frac{1}{J(X_1+ \dots +X_n)}\geqslant \frac{1}{J(X_1)}+ \dots + \frac{1}{J(X_n)};
\end{alignat}
\end{document}


If you need the left labels flush left, you should go with a table I guess.

-
Between binary operators, one can use \dotsb, where the "b" stands for "binary". See: tex.stackexchange.com/a/122493/6376 –  Tyson Williams Sep 2 at 14:26