![我怎样才能在矩阵旁边写描述/文本,如图所示?](https://linux22.com/image/351487/%E6%88%91%E6%80%8E%E6%A0%B7%E6%89%8D%E8%83%BD%E5%9C%A8%E7%9F%A9%E9%98%B5%E6%97%81%E8%BE%B9%E5%86%99%E6%8F%8F%E8%BF%B0%2F%E6%96%87%E6%9C%AC%EF%BC%8C%E5%A6%82%E5%9B%BE%E6%89%80%E7%A4%BA%EF%BC%9F.png)
答案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}