# System of equations numbering and cref

I'm using the SIAM template, and I want numbering a system of equation 1a,1b,..., to label them and to be able to quote them thanks to the \cref command from the cleveref package.

I tried the different solutions proposed on this topic, which work for a minimal TeX example, but seem to crash with the SIAM template:

First solution

\usepackage{empheq}
\begin{subequations}
\label{Phi:def}
\begin{align}[left ={\phi A_n = \empheqlbrace}]
& \max \left [ L_n-A_n, 0 \right]\\
& \max \left [ L_n-A_n, K \right]\label{eq:PayoffStopLosses}\\
& \max \left [ L_n-A_n, K_1 \right] -\max \left [ A_n-L_n, K_2 \right]
\end{align}
\end{subequations}
Let's quote the second equation \cref{eq:PayoffStopLosses}


The quotation works, but the brace doesn't. If we add the package option overload, it works for a minimal example but not into the SIAM template:

/usr/local/texlive/2015/texmf-dist/tex/context/base/supp-pdf.mkii
\scratchcounter=\count150
\scratchdimen=\dimen147
\scratchbox=\box34
\nofMPsegments=\count151
\nofMParguments=\count152
\everyMPshowfont=\toks42
\MPscratchCnt=\count153
\MPscratchDim=\dimen148
\MPnumerator=\count154
\makeMPintoPDFobject=\count155
\everyMPtoPDFconversion=\toks43

LaTeX Info: Redefining $on input line 37. LaTeX Info: Redefining$ on input line 37.
LaTeX Font Info:    Try loading font information for U+msa on input line 40.
/usr/local/texlive/2015/texmf-dist/tex/latex/amsfonts/umsa.fd
File: umsa.fd 2013/01/14 v3.01 AMS symbols A

LaTeX Font Info:    Try loading font information for U+msb on input line 40.

/usr/local/texlive/2015/texm


Second solution

\usepackage{cases}
\begin{subnumcases}{f x=}
1 & $x\geq0$ \label{positive-subnum}
\\
0 & $x<0$ \label{negative-subnum}
\end{subnumcases}
Let's quote the second equation \cref{negative-subnum}


In this case, both "positive-subnum" and "negative-subnum" gives the same result "2" with the \cref command...

Have you any suggestion?

• The syntax should be \begin{empheq}[left ={\phi A_n = \empheqlbrace}]{align}...\end{empheq}. However, it turns out that empheq is not compatible with siamart0516.cls because of bad interaction with ntheorem. Oct 19, 2016 at 13:29

The following is an alteration of the first solution so the package option overload is no longer needed. It works in a minimal example, and also when I try it in the SIAM template.

\documentclass{article}
\usepackage{amsmath,empheq}
\usepackage[noabbrev]{cleveref}
\begin{document}
\begin{subequations}
\label{Phi:def}
\begin{empheq}[left ={\phi A_n = \empheqlbrace}]{align}
& \max [ L_n-A_n, 0 ]\\
& \max [ L_n-A_n, K ]\label{eq:PayoffStopLosses}\\
& \max [ L_n-A_n, K_1 ] -\max [ A_n-L_n, K_2 ]
\end{empheq}
\end{subequations}
Let's quote the second equation \cref{eq:PayoffStopLosses}
\end{document}


• It doesn't work for me... I get this error: ./example_minimal.tex:99 Undefined control sequence. \TagsPlusEndmarks …e \iftag@ \SetTagPlusEndMark \else \SetOnlyEndMark \fi … l.99 \end{empheq} Aug 14, 2016 at 15:28
• @infophile I also get this error, but the result does look fine (which is probably why I didn't notice that I got an error). I included an image of the produced pdf in my answer. Aug 20, 2016 at 10:51
• +1. I've taken the liberty of augmenting your code fragments into an MWE (minimum working example).
– Mico
Apr 25, 2017 at 19:26