I have a file with the following environment

\newenvironment{system}{\begin{equation} \left \{ \begin{aligned} }{\end{aligned} \right . \end{equation}}

Which produced the result that I'm looking for except from the fact that adds a little extra space on the new line after the environment so for instance, if I write

x + y &= 1\\
x - y &= 2

foo gets printed one space after the next line. On the other hand, if I have

\left \{
x + y &= 1\\
x - y &= -1
\rigth .

Then foo gets printed where it should. On the other hand if I write foo right after \end{system} with no spaces or newline I get the correct result but then the text file gets a little harder to read.

Am I doing something wrong in defining the environment? Or is there an easy way to solve it.

Edit: For context, this is the preamble I am testing it in

  • Welcome to TeX.SE.
    – Mico
    Jun 25, 2020 at 7:00
  • @Mico Thank you!
    – themaker
    Jun 25, 2020 at 7:20

1 Answer 1



  {\begin{equation} \left \{ \begin{aligned} }
  {\end{aligned} \right . \end{equation}\ignorespacesafterend}
  • Thank you, that worked!
    – themaker
    Jun 25, 2020 at 7:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .