To use large round parentheses and large curly braces provided by the MathTime Pro 2 font, I’m using the code from this answer by @BrunoLeFloch to redefine pmatrix, Bmatrix and cases. However, this implementation does not work when the matrices (or cases) are inside the align (and friends) environment.
\documentclass{article}
\usepackage{amsmath}
\usepackage{newtxtext}
\usepackage[lite]{mtpro2}
% in case you don't have mtpro2, use the following
%\usepackage{newtxmath}
%\providecommand*\PARENS[1]{\left(#1\right)}
%\providecommand*\LEFTRIGHT[3]{\left#1#3\right#2}
\usepackage{environ}
% from https://tex.stackexchange.com/a/9785/164314
\newcommand{\OverwriteEnviron}[1]{%
\expandafter\let\csname #1\endcsname\relax%
\expandafter\let\csname end#1\endcsname\relax%
\expandafter\let\csname env@#1@parse\endcsname\relax%
\expandafter\let\csname env@#1@save@env\endcsname\relax%
\expandafter\let\csname env@#1@process\endcsname\relax%
\NewEnviron{#1}%
}
\OverwriteEnviron{pmatrix}{\PARENS{%
\begin{matrix}\BODY\end{matrix}}}
\OverwriteEnviron{Bmatrix}{\LEFTRIGHT\{\}{%
\begin{matrix}\BODY\end{matrix}}}
\OverwriteEnviron{cases}{\LEFTRIGHT\lbrace.{\def\arraystretch{1.2}%
\begin{array}{@{\,}l@{\quad}l@{}}\BODY\end{array}}}
\begin{document}
\section{Works!}
\[
\begin{pmatrix}
a & b \\
c & d \\
\end{pmatrix} \quad
\begin{Bmatrix}
a & b \\
c & d \\
\end{Bmatrix} \quad
\begin{cases}
a & b \\
c & d \\
\end{cases}
\]
\section{Do not work}
\begin{align*}
%\begin{pmatrix}
%a & b \\
%c & d \\
%\end{pmatrix} \quad
%\begin{Bmatrix}
%a & b \\
%c & d \\
%\end{Bmatrix} \quad
%\begin{cases}
%a & b \\
%c & d \\
%\end{cases}
\end{align*}
\end{document}
A very similar question has been asked before, but no answers have been provided. I think the problem lies in the nested tabulars where TeX gets confused by the alignment tab &. I am also aware of the “dirty tricks” of \ifnum`{=0\fi and \ifnum`}=0\fi. But I have no clue how to implement these tricks. Any ideas?



\NewEnviron{xx}{\PARENS{\begin{matrix}\BODY\end{matrix}}}. Putting the result inside a group inside the align,{\begin{xx}a&b\end{xx}}, makes it compilable again. – Andrew Swann Aug 17 '18 at 16:24\RenewEnviron{pmatrix}instead of the tricky code that was written before a new version ofenvironwas issued. – egreg Aug 17 '18 at 16:46