答案1
您的问题可能重复于这个,但我想向您展示另一种解决方案tikzmark
。
\documentclass{article}
\usepackage{amsmath}
\usepackage{array}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{tikzmark, calc}
\newcommand{\mybrace}[3]{%
\draw[decorate,decoration={brace,mirror}]
($(pic cs:#1)+(-.3,.3)$) -- node[xshift=-1em, align=left, text width=4em]{#3} ($(pic cs:#2)+(-.3,-.1)$);}
\renewcommand*{\arraystretch}{1.25}
\begin{document}
\[
\begin{bmatrix}
\tikzmark{lp} P \\
\tikzmark{lq} Q \\
\tikzmark{gp} P \\
\tikzmark{gq} Q \\
\end{bmatrix}
\]
\begin{tikzpicture}[overlay,remember picture,baseline]
\mybrace{lp}{lq}{Load}
\mybrace{gp}{gq}{Gen}
\end{tikzpicture}
\end{document}