3

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

\begin{system}
x + y &= 1\\
x - y &= 2
\end{system}
foo

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

\begin{equation}
\left \{
\begin{aligned}
x + y &= 1\\
x - y &= -1
\end{aligned}
\rigth .
\end{equation}
foo

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

\documentclass{article}
\usepackage{amsmath}
2
  • Welcome to TeX.SE.
    – Mico
    Jun 25, 2020 at 7:00
  • @Mico Thank you!
    – themaker
    Jun 25, 2020 at 7:20

1 Answer 1

2

use

\newenvironment{system}
  {\begin{equation} \left \{ \begin{aligned} }
  {\end{aligned} \right . \end{equation}\ignorespacesafterend}
1
  • 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 .