Below code is working fine.
\begin{eqnarray*}
\begin{split}
(U\ket{v},U\ket{w}) & = (\ket{v},\ket{w}) \\
|| \ket{Uv} || & = || \ket{v} ||
\end{split}
\end{eqnarray*}
But if I define equation environment in macros, then it is giving error that "Split can't work in math mode".
In preamble,
\newcommand{\benn}{\begin{equation*}}
\newcommand{\eenn}{\end{equation*}}
Using it inside,
\benn
\begin{split}
(U\ket{v},U\ket{w}) & = (\ket{v},\ket{w}) \\
|| \ket{Uv} || & = || \ket{v} ||
\end{split}
\eenn
Edit: Minimal not working example
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{float}
\usepackage[margin=0.8in]{geometry}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{gensymb}
\usepackage{amsthm}
\usepackage{braket}
\newcommand{\beann}{\begin{eqnarray*}}
\newcommand{\eeann}{\end{eqnarray*}}
\begin{document}
\beann
\begin{split}
(U\ket{v},U\ket{w}) & = (\ket{v},\ket{w}) \\
|| \ket{Uv} || & = || \ket{v} ||
\end{split}
\eeann
\end{document}
&). As a matter of fact, the code you posted works perfectly fine for me. I have suspects about what you are doing wrong, but you should post a a full minimal working example which reproduces the issue, starting with\documentclass{...}and ending with\end{document}. – campa Aug 15 '18 at 10:57Package amsmath Warning: Cannot use 'split' here; (amsmath) trying to recover with 'aligned' on input line 25.(Which I agree with: your use case really seems better treated by eithergatheroralignoraligned, since the two displayed lines are two distinct equations, not one long equation split on multiple lines.) Can you post a screen cap of what you see on ShareLateX and also post the log file? – Willie Wong Aug 15 '18 at 13:10eqnarraywhen using amsmath? https://tex.stackexchange.com/questions/196/eqnarray-vs-align If I replace youreqnarray*in the definition ofbeannwithequation*, theamsmath warningin my previous comment goes away and everything still displays fine. – Willie Wong Aug 15 '18 at 13:17