[Tex/LaTex] Use displaymath shorthand \[ \] for align and other amsmath environments

alignamsmath

This question is closely related to this one: Using the displaymath shorthand \[ \] for equation or align instead. I use Multimarkdown (MMD) to generate my LaTeX documents. MMD uses the escape character set \\[ and \\] to create displaymath shorthand \[ and \] in LaTeX. I'd like to re-assign \[ and \] to \begin{align} and \end{align}. The previous question had a solution for other environments (e.g., equation), but I would like to use the align environment. According to the amsmath technical notes, it's impossible to create abbreviations for its math environments. Does anyone know a work-around? I have tried

\renewenvironment{displaymath}{\align}{\endalign}

but this doesn't seem to work.

Best Answer

You can use TeX's \def command for redefining \[...\]:

\def\[#1\]{\begin{align}#1\end{align}}

Minimal working example:

\documentclass{article}
\usepackage{amsmath}
\def\[#1\]{\begin{align}#1\end{align}}
\begin{document}
\[
   ax + b &= 0 \\
   ab &= 1
\]
\end{document}

align redefinition test output