我正在尝试将 $E_1$ 和 $E_2$ 上的过度支撑稍微向左移动。你能帮我吗?
\documentclass{amsart}
\usepackage{mathtools}
\usepackage{multirow}
\usepackage{amsthm}
\newcommand\coolover[2]{\mathrlap{\smash{\overbrace{\phantom{%
\begin{matrix} #2 \end{matrix}}}^{\mbox{$#1$}}}}#2}
\newcommand\coolunder[2]{\mathrlap{\smash{\underbrace{\phantom{%
\begin{matrix} #2 \end{matrix}}}_{\mbox{$#1$}}}}#2}
\newcommand\coolleftbrace[2]{%
#1\left\{\vphantom{\begin{matrix} #2 \end{matrix}}\right.}
\newcommand\coolrightbrace[2]{%
\left.\vphantom{\begin{matrix} #1 \end{matrix}}\right\}#2}
\begin{document}
\[
E=
\begin{matrix}
\coolleftbrace{R_1}{\multirow{2}{*}{$E_1$}}\\
\coolleftbrace{r}{}\\
\coolleftbrace{R_2}{0}
\end{matrix}%
\left[\begin{array}{c|c}
\coolover{C_1}{\multirow{2}{*}{$E_1$}} & \coolover{C_2}{0} \\ \cline{2-2}
& \multirow{2}{*}{$E_2$} \\ \cline{1-1}
0 & \\
\end{array}\right]
\]
\end{document}
答案1
包括nicematrix
(需要两次编译):
\documentclass{amsart}
\usepackage{nicematrix}
\usetikzlibrary{decorations.pathreplacing,
calligraphy,
quotes}
\tikzset{
B/.style = {decorate,
decoration={calligraphic brace, amplitude=2pt,
pre =moveto, pre length=1pt,
post=moveto, post length=1pt,
raise=#1},
thick,
pen colour=black},
B/.default=7pt
}
\begin{document}
\[
\begin{bNiceArray}{>{\strut}C|C}%
[create-extra-nodes, margin, extra-margin=1pt ,
code-after = {\begin{tikzpicture}[name suffix = -large]
\draw[B={3pt}] (1-1.north west) -- node[above=5pt] {$C_1$} (1-1.north east);
\draw[B={3pt}] (1-2.north west) -- node[above=5pt] {$C_2$} (1-2.north east);
\draw[B] (1-1.south west) -- node[left=8pt] {$R_1$} (1-1.north west);
\draw[B] (2-1.south west) -- node[left=8pt] {$E=\quad r$} (2-1.north west);
\draw[B] (3-1.south west) -- node[left=8pt] {$R_3$} (3-1.north west);
\end{tikzpicture}
}
]
\Block{2-1}{E_1} & 0 \\
\cline {2-2}
& \Block{2-1}{E_2} \\
\cline {1-1}
0 & \\
\end{bNiceArray}
\]
\end{document}
附录: 您可能更喜欢将行的描述放在右侧:
\documentclass{amsart}
\usepackage{nicematrix}
\usetikzlibrary{decorations.pathreplacing,
calligraphy,
quotes}
\tikzset{
B/.style = {decorate,
decoration={calligraphic brace, amplitude=2pt,
pre =moveto, pre length=1pt,
post=moveto, post length=1pt,
raise=#1},
thick,
pen colour=black},
B/.default=7pt
}
\begin{document}
\[ E =
\begin{bNiceArray}{>{\strut}C|C}%
[create-extra-nodes, margin, extra-margin=1pt ,
code-after = {\begin{tikzpicture}[name suffix = -large]
\draw[B={3pt}] (1-1.north west) -- node[above=5pt] {$C_1$} (1-1.north east);
\draw[B={3pt}] (1-2.north west) -- node[above=5pt] {$C_2$} (1-2.north east);
\draw[B] (1-2.north east) -- node[right=8pt] {$R_1$} (1-2.south east);
\draw[B] (2-2.north east) -- node[right=8pt] {$r$} (2-2.south east);
\draw[B] (3-2.north east) -- node[right=8pt] {$R_3$} (3-2.south east);
\end{tikzpicture}
}
]
\Block{2-1}{E_1} & 0 \\
\cline {2-2}
& \Block{2-1}{E_2} \\
\cline {1-1}
0 & \\
\end{bNiceArray}
\]
\end{document}
答案2
你可以使用 4 列进行构造:
- 左行索引(1号,r和R2) 和左括号 [;
- 矩阵的第一列和中心分隔线;
- 矩阵中的第二列和中心分隔线(与第一列重叠);以及
- 右括号]。
\documentclass{article}
\usepackage{array}
\begin{document}
\[
E = \left.\begin{array}{@{} r<{\bigl\{} @{}}
R_1 \\ r \\ R_2
\end{array}\right[
\overbrace{
\begin{array}{c |}
\strut \\ \strut\raisebox{.5\normalbaselineskip}[0pt][0pt]{$E_1$} \\
\hline
\strut 0
\end{array}
}^{C_1}
\!% Join two math elements
\hspace{-.4pt}% Overlap left column rule with previous column's right column rule
\overbrace{
\begin{array}{| c}
\strut 0 \\
\hline
\strut \\ \strut\raisebox{.5\normalbaselineskip}[0pt][0pt]{$E_2$}
\end{array}
}^{C_2}
\!
\left.\kern-\nulldelimiterspace\begin{array}{ @{}c@{} }
\strut \\ \strut \\ \strut
\end{array}\right]
\]
\end{document}