# How to get rid of & in cases environment but still get the same space in the surroundings

Recently I asked a question on chat but I was told that I have to ask it on the main site, so here I am.

I am using cases environment to create multiple system of equations separated by a symbol e.g. \equiv. Here is an example:

\documentclass{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}

\begin{document}

$\begin{cases} x+y=2,\\x=2 \end{cases} \equiv \begin{cases} 2+y=2,\\x=2 \end{cases}$

\end{document}


However, as you can see there is a huge space between the end of the first cases and the \equiv. This is due of the absence of & symbol in cases, but I do not want to add this symbol to fill the space. So a manual, inefficient and even incorrect solution that I found was to add negative space, let's say add 5/6 \!'s just before \equiv.

If I add 5 negative spaces then there is more space on one side than on the other:

If I add 6 negative spaces then the same thing happens as before:

More than 6 or less than 5 will cause a worse output.

I would like that, keeping the same format of system of equations, there would be a homogeneous space on both sides of each cases. Is it possible?

Thanks!!

P.S. I would also like to know if in a system of equations you would separate each equation by a , except in the last equation that appears, that is, in the one below (unless there is a text that continues with the reading or that ends the sentence). Does AMS Style Guide say something about this?

• If we use \left\{\begin{array}{l}...\end{array}\right. instead of cases then the space between the left brace and the system of equations should also be corrected, in addition to solve the problem of space between the environment and any consequent symbol. – manooooh Feb 22 '19 at 6:54

You could use aligned

\documentclass{article}
\usepackage{amsmath}

\newenvironment{system}
{\left\lbrace\aligned} {\endaligned\right.\ignorespacesafterend}

\begin{document}
Example:
\begin{system}
&x+y=2\\&x=2
\end{system}

\end{document}

• I end up with $\begin{system}&x+y=2\\&x=2\end{system}$ since I have more than one system in one line, but this is great and simple, thank you! – manooooh Feb 23 '19 at 22:44
• I am getting "Missing control sequence inserted" when I use ' and write all in one line: try $\begin{system}&a'=2\\&b'=2\end{system}$. To solve this, I have to insert a blank space between \begin{system} and \end{system}, so suppose that \\  represents a new line i.e. an "Enter", so I have to do $\begin{system}\\&a'=2\\&b'=2\\\end{system}$. I am writing a lot of these systems in my document, so I want to write it inline in my source code. How can we fix that? – manooooh Feb 23 '19 at 22:53
• @manooooh as requested the $ is inside the definition of system so of course you can not put \begin{system} in math, that would be \[\[\begin{ligned} with two \[ . – David Carlisle Feb 24 '19 at 0:42 • I need to write \begin{system}&a+b\\&-a-b\end{system}, but the minus sign is shifted to the right (because it is a binary operator, as expected). How could we fix this: using \!-a-b? – manooooh Mar 28 '19 at 22:25 • There is a problem when adding \usepackage{mathtools}. – manooooh Mar 28 '19 at 23:22 Remove the intercolumn space and also the null delimiter space. \documentclass{article} \usepackage{amsmath} \makeatletter \newenvironment{system} {% \let\@ifnextchar\new@ifnextchar \left\lbrace \def\arraystretch{1.2}% \array{@{}l@{}}% } {% \endarray \right.\kern-\nulldelimiterspace } \makeatother \begin{document} \[ \begin{system} x+y=2,\\x=2 \end{system} \equiv \begin{system} 2+y=2,\\x=2 \end{system}$

\end{document}


• This is just what I wanted, thank you!! Could you help me in deciding if a comma is OK to separate different equations inside a system environment (unless there is a text that continues with the reading or that ends the sentence) like I said on the P.S., please? – manooooh Feb 22 '19 at 20:17
• @manooooh I wouldn't use it – egreg Feb 22 '19 at 21:11
• Ok. If the system of equations ends the sentence, would you write a dot in the end of the last equation (from your answer, x=2.\end{system})? – manooooh Feb 22 '19 at 22:57
• @manooooh I'd avoid ending the sentence with a system. It's easier. – egreg Feb 22 '19 at 22:59
\documentclass{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage[usestackEOL]{stackengine}
\stackMath
\setstackgap{L}{16pt}
\begin{document}
$\biggl\{\Centerstack[l]{x+y=2,\\x=2} \equiv \biggl\{\Centerstack[l]{2+y=2,\\x=2}$
\end{document}


• This is good. However, I would not like to modify any format except the spacing. Thanks! – manooooh Feb 22 '19 at 20:18
• @manooooh I understand. I put it out there for others to consider as an alternative. – Steven B. Segletes Feb 22 '19 at 20:27

Consider using the systeme package.

The grouped equations in your example are really systems of equations and not cases. And, as egreg says, someone trying to grasp the meaning from your code may be confused by the misattribution.

• Yes... you are right, it can lead to confusion. I do not accept your answer as I value more saving to load a package than to load it, but thanks! – manooooh Feb 22 '19 at 20:19