# Use displaymath shorthand  for align and other amsmath environments

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.

-
Hi Noam, welcome to TeX.sx. I've formatted the link to the other question: You can just insert the full link in your question, it will automatically be formatted to use the question title as the link text. No need for URL shorteners. Also, I've formatted your code snippets by enclosing them in backticks (you could also just select them and press the {} key), and I've removed the "Thanks!", because that's just the custom here =) –  Jake Oct 24 '11 at 3:56
Strictly speaking, it's impossible. However, you can do \def$#1${\begin{align}#1\end{align}}. A better route may be to configure MMD to directly produce the \begin{align} and \end{align}, if that's possible. –  Bruno Le Floch Oct 24 '11 at 5:08
\renewenvironment{displaymath}{\align}{\endalign} does work for me. Did you load amsmath? Please provide a minimal working example. –  Leo Liu Oct 24 '11 at 5:53

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}


-