# Strange error defining a macro with arguments for math mode

When I delete the second \item, it compiles fine. However, with the second \item, I get ERROR: Missing $inserted and the math renders incorrectly: \documentclass[12pt]{article} \newcommand \frob[2] {\langle #1,#2 \rangle_F} \begin{document} \begin{itemize} \item What I want:$
\langle A,B \rangle_F
\geq
\langle C,D \rangle_F
$. \item What I get:$
\frob{A,B}
\geq
\frob{A,B}
\langle A,B \rangle_F
\geq
\langle C,D \rangle_F
$. \item What I get:$
\frob{A,B}
\geq
\frob{A,B}
\$.
\end{itemize}

\end{document}


If you really want to pass two arguments, then your definition should be

\newcommand{\frob}[2]{\langle #1, #2 \rangle_F}


and you'll use it via \frob{A}{B}.

• Ah, obviously! I've used \frac that way, but somehow had a brain fart when defining my own function. Thanks! – Elliot Gorokhovsky Feb 2 at 22:13