Reputation: 3
I am trying to create a new environment for equations in LaTex. This is what I have tried
\newenvironment{myeq}
{
\begin{fleqn}[\parindent]
\begin{equation*}
\begin{split}
}
{
\end{split}
\end{equation*}
\end{fleqn}
}
However, when I try to run the code I get "LaTex Error: \begin{split} ended by \end{myeq}". Can someone please help me to understand what I am doing wrong? Thanks!
Upvotes: 0
Views: 735
Reputation: 1137
There is a little mistake in your code: the parenthesis in the \begin{split} and \end{split} are swapped.
Moreover, if you desire to use fleqn in just one equation you have to include the package \usepackage[fleqn]{nccmath}
. There was a similar question here, where the solution was given: use the package environ
and write your environment as
\NewEnviron{myeq}{%
\begin{fleqn}[\parindent]
\begin{equation*}
\begin{split}
% your equation here...
\end{split}
\end{equation*}
\end{fleqn}
}
As a further advice, I suggest to have a look at https://tex.stackexchange.com/ for LaTeX questions: you may find the answer more quickly than here.
Upvotes: -1