# Using subequations without amsmath

Following on from my previous question regarding the use of align and aligned without 'amsmath', I am currently working on a proceedings paper, and have realised after finishing it that only specific packages are permitted - one of which is not amsmath. As a result, many of the nice equations that I have written can now no longer be built. To save me switching back to \begin{cases} \end{cases} and giving up, I thought I would try asking on here to see if anyone could provide me with a solution? My issue is now with subequations, I will provide a working example below.

I cannot define any new commands before \begin{document}, so everything must be done after that point (these are as per the MWE). I thought about trying to grab the relevant components from the style file, but to be perfectly honest I am not a TeX-wizard and have no idea whether this would even work.Could anyone provide me with a work-around, so that I can still use subequations, but by doing so after \begin{document}?

An MWE is as follows:

\documentclass{svmult}
\usepackage{mathptmx}
\usepackage{helvet}
\usepackage{courier}
\usepackage{type1cm}

\usepackage{graphicx}

\usepackage[bottom]{footmisc}

\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amsbsy}
\usepackage{amscd}
\usepackage{amstext}
\usepackage{dsfont}
\usepackage[english]{babel}
\usepackage{color}
\usepackage{graphics}
\usepackage{epsfig}
\usepackage{subfigure}
\usepackage{wrapfig}
\usepackage{psfrag}
\usepackage{color}
\usepackage{url}
\usepackage{verbatim}
\usepackage{algorithm}
\usepackage{algorithmic}

\begin{document}

\begin{subequations}
\label{DD}
\begin{align}
&\begin{cases}
\begin{aligned}
-\Delta e_{i}^1 +  c_1 &= f_i  \quad & &\text{in} \,\, \Omega_i \\ e_{i}^1 &= 0 \quad & &\text{on} \,\, \partial\Omega_i \end{aligned}
\label{DD1}
\end{cases}
\\
&\begin{cases}
\label{DD2}
\begin{aligned}
\displaystyle\sum_{i=1}^N  \mathbf{n}_i \cdot r^1 &= - \displaystyle\sum_{i=1}^N\mathbf{n}_i \cdot r^2 \,\, & &\textrm{on} \,\, \Gamma \end{aligned}
\end{cases}
\\
&\begin{cases}
\label{DD3}
begin{aligned}
-\Delta e_{i}^2 + c_2 &= 0  \quad & &\text{in} \,\, \Omega_i \\
e_{i}^2 &= 0 \quad & &\text{on} \,\, \partial\Omega_i.  \end{aligned}
\end{cases}
\end{align}
\end{subequations}

\end{document}

-

Updated version adjusting spacing and labels, showing amsmath on the right and this code on the left

\documentclass{article}
\usepackage{mathptmx}
\usepackage{helvet}
\usepackage{courier}
\usepackage{type1cm}

\usepackage{graphicx}

\usepackage[bottom]{footmisc}
%\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amsbsy}
\usepackage{amscd}
\usepackage{amstext}
\usepackage{dsfont}
\usepackage[english]{babel}
\usepackage{color}
\usepackage{graphics}
\usepackage{epsfig}
\usepackage{subfigure}
\usepackage{wrapfig}
\usepackage{psfrag}
\usepackage{color}
\usepackage{url}
\usepackage{verbatim}
\usepackage{algorithm}
\usepackage{algorithmic}

\begin{document}

\ifx\aligned\undefined

\makeatletter
\def\aligned{{\ifnum0=}\fi\vcenter\bgroup\let\\\cr
\halign\bgroup&\hfil$\displaystyle{}##{}$&$\displaystyle{}##{}$\hfil\cr}
\def\endaligned{\crcr\egroup\egroup\ifnum0={\fi}}

\def\align{\par
\bigskip
{\ifnum0=}\fi
\let\\\cr
\halign to \textwidth\bgroup
\refstepcounter{equation}%
\global\let\@alignlab\@currentlabel
\vrule \@height \dimexpr\ht\strutbox+3pt\relax
\@depth  \dimexpr\dp\strutbox+1pt\relax
\@width \z@
\hbox to \textwidth{\hfill(\theequation)}\kern-\textwidth
\tabskip\fill
\hfil$\displaystyle{}##{}$&%
\let\@currentlabel\@alignlab$\displaystyle{}##{}$\hfil&%
\let\@currentlabel\@alignlab\hfil$\displaystyle{}##{}$&%
\let\@currentlabel\@alignlab$\displaystyle{}##{}$\hfil\cr}
\def\endalign{\crcr\egroup\ifnum0={\fi}\par\bigskip}

\newcounter{parentequation}
\newenvironment{subequations}{%
\refstepcounter{equation}%
\edef\theparentequation{\theequation}%
\setcounter{parentequation}{\value{equation}}%
\setcounter{equation}{0}%
\def\theequation{\theparentequation\alph{equation}}%
\ignorespaces
}{%
\setcounter{equation}{\value{parentequation}}%
\ignorespacesafterend
}

\def\cases{{\ifnum0=}\fi\left\{\array{lll}}
\def\endcases{\endarray\right.\ifnum0={\fi}}

\makeatother
\fi

\begin{subequations}
\label{DD}
\begin{align}
&\begin{cases}
\begin{aligned}
-\Delta e_{i}^1 +  c_1 &= f_i  \quad & &\text{in} \,\, \Omega_i \\ e_{i}^1 &= 0 \quad & &\text{on} \,\, \partial\Omega_i \end{aligned}
\label{DD1}
\end{cases}
\\
&\begin{cases}
\label{DD2}
\begin{aligned}
\displaystyle\sum_{i=1}^N  \mathbf{n}_i \cdot r^1 &= - \displaystyle\sum_{i=1}^N\mathbf{n}_i \cdot r^2 \,\, & &\textrm{on} \,\, \Gamma \end{aligned}
\end{cases}
\\
&\begin{cases}
\label{DD3}
\begin{aligned}
-\Delta e_{i}^2 + c_2 &= 0  \quad & &\text{in} \,\, \Omega_i \\
e_{i}^2 &= 0 \quad & &\text{on} \,\, \partial\Omega_i.  \end{aligned}
\end{cases}
\end{align}
\end{subequations}

\label{InitSystemNL} \left\{ \begin{aligned} \mathcal{R} \colon= -\Delta u &= f \quad & &\text{in} \,\, \Omega \\ u &= 0 \quad & &\text{on} \,\, \partial\Omega, \end{aligned} \right.

[\ref{DD}][\ref{DD3}]
\end{document}

-
Thanks for the help. Its almost fine in my document, however I find that it 'bunches' up to the text both at the top and bottom when I view the output. Also, I would like the equations to center if possible as per the subequations environment, but cannot use \centering as it has no effect. Do you have any possible workarounds? –  Chris Carrington Dec 8 '12 at 0:48
amsmath does a complicated double scan over each equation measuring stuff on the first pass and laying it out on the second, there are some compromises to make something that makes sense to define inline. actually you probably want \displaystyle in all the $...$ sections in the definitions so that the cells use display style, you could stick \bigskip (or \addvspace{some space you like} at the start of \align and end of \endalign, centering is harder, might look but not at this time:-) –  David Carlisle Dec 8 '12 at 0:53
No problem - thanks anyway for the help. If you make any progress, i'd certainly be happy to hear of it. It is strange that the proceedings does not have amsmath as a core package, but this is the last issue. The document now builds fine, just the centering and linespace issues, but i'll try what you mentioned in the first instance. –  Chris Carrington Dec 8 '12 at 0:56
To followup on my previous post (again, dont worry until you have sufficient time) - good point is that \bigskip or equivalent works a treat with the spacing. Unfortunately, I have found another bad point, in that the labelling I use for \subequations is now creating problems in the file. If I refer to DD2 for example in the above working example, I am given the same number as if I refer to either DD1, DD3 or DD - which is certainly very strange?!? –  Chris Carrington Dec 8 '12 at 1:05
code updated a bit –  David Carlisle Dec 8 '12 at 12:50