I am looking for a pre-compiler to introduce a customized syntax into LaTeX.
Hope that an example will be worth a thousand words: I would like to compile this
\thm
The sum
$ 1+2+3
is equal to
$$[six] 6.
% this line will be skipped
\proof
$$ 1+2 &= 3
$$ 1+2+3 &= 6
to obtain this
\begin{theorem}
The sum
$ 1+2+3 $
is equal to
\begin{align}
\label{six}
6.
\end{align}
\end{theorem}
\begin{proof}
\begin{align*}
1+2 &= 3\\
1+2+3 &= 6
\end{align*}
\end{proof}
and then run the standard LaTeX compiler on the latter.
I was wondering if there is some fast/clever way to do this.