[texhax] LaTeX amsmath: two equations aligned left-right
Olivier Cailloux
olivier.cailloux at gmail.com
Thu Mar 24 23:40:42 CET 2011
Hello,
I can't find how to display properly some equations the way I would to.
It is a bit difficult to explain, please compile this and observe the
result. Or read below.
\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\begin{document}
\section{Two equations}
\begin{multline}
\label{eq:eq1}
\forall j \in J, a \in A, 1 \leq h \leq k-1 :\\
\frac{1}{M_j+ \delta_j} ((g_j(a) - g_j(b_h))+\delta_j)
\leq C_j(a, b_h).
\end{multline}
\begin{multline}
\label{eq:eq2}
\forall j \in J, a \in A, 1 \leq h \leq k-1 :\\
C_j(a,
b_h) \leq \frac{1}{M_j} (g_j(a) - g_j(b_h)) + 1.
\end{multline}
\section{Now better}
\begin{multline}
\forall j \in J, a \in A, 1 \leq h \leq k-1 :\\
\left\{\begin{gathered}
% \label{eq:eq1}
\frac{1}{M_j+ \delta_j} ((g_j(a) - g_j(b_h))+\delta_j)
\leq C_j(a, b_h);\\
C_j(a,
b_h) \leq \frac{1}{M_j} (g_j(a) - g_j(b_h)) + 1.
\label{eq:eq2}
\end{gathered}\right.
\end{multline}
\end{document}
In the first section I present the two equations I need. I need two
separate equation numbers to be able to refer to each of them independently.
I would like to display them all together as in the second section,
which would allow me to avoid repeating the first, common, part. In
order to do that, I need in total three lines. The first line holds the
common beginning; the second and third lines are enclosed in a left
bracket to make it clear that they both are the continuation of the
first part. The second and third line must be aligned on the right
margin while the first line is left aligned. All of this I get with the
"multline" and embedded "gathered", as in the sample code. However what
I don't get is two different equation numbers. I would like a number on
the second line, to refer to that equation specifically, and a different
(consecutive) number on the third line.
Any suggestion?
Olivier
More information about the texhax
mailing list