\documentclass[a4paper]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amssymb}
\makeatletter
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
\hskip -\arraycolsep
\let\@ifnextchar\new@ifnextchar
\array{#1}}
\makeatother
\usepackage{mathtools}
\usepackage{amsfonts}
\usepackage{indentfirst}
\title{Test}
\author{Nguyen Van Manh \\ HE170552}
\date{}
\begin{document}
\maketitle
\section{Ex1}
\textbf{A1}
The augmented matrix of the system:
\[\left[\begin{alignat*}
1&2&-2&7\\
-2&1&-1&1\\
0&3&a&b
\end{alignat*}\right]\]
\[\displaystyle\begin{bmatrix}[cc|c]
1&2&3\\
2&-9&17
\end{bmatrix}\]
\end{document}
I get error: Package amsmath: Erroneous nesting of equation structures;\n(amsmath) trying to recover with `aligned'.
What is cause of it? How to fix it?
I was tried:
\[\left[\begin{alignedat}{4}
&1&&2&&-2&&7\\
&-2&&1&&-1&&1\\
&0&&3&&a&&b
\end{alignedat}\right]\tag{1}\]
I don't get the above error at the moment but it looks like it didn't align
aligned
environment rather thanalignat*
?