如何编辑此代码以获得这两种变体?

如何编辑此代码以获得这两种变体?

我有以下代码

\documentclass[12pt]{article}
\usepackage{geometry}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,calligraphy}
\begin{document}

    \begin{tikzpicture}[yscale=1,
    brace/.style={thick,decorate,
        decoration={calligraphic brace, amplitude=7pt,raise=0.5ex}}]
    \draw (0,0) coordinate (O) rectangle (9,3)  coordinate (TR)
    (3,3) coordinate (T) -- (3,0) coordinate (B) -- (0,3) 
    coordinate (TL)
    (0.4,0.4) node[above right,font=\Huge]{$\mathbf{0}$};
    \draw[brace] (O)    -- node[left=1.5ex]{$I_n^2$} (TL);
    \draw[brace] (TL)   -- node[above=1.5ex]{$I_n^2$} (T);
    \draw[brace] (T)    -- node[above=1.5ex]{$I_n^1$} (TR);
    \end{tikzpicture}
\end{document}

及其输出

在此处输入图片描述

您能帮我编辑此代码以实现以下两种变体吗?这是我论文的最后一部分。非常感谢您的帮助!

在此处输入图片描述

在此处输入图片描述

答案1

这几乎是我之前回答的完全复制,这个网站上有很多类似的帖子。你可以用括号装饰一些路径,画一些矩形,并像以前一样组合坐标的 x 和 y 分量https://tex.stackexchange.com/a/401429

\documentclass[12pt]{article}
\usepackage{geometry}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,calligraphy}
\begin{document}

\begin{tikzpicture}[yscale=0.7,
    brace/.style={thick,decorate,
        decoration={calligraphic brace, amplitude=7pt,raise=0.5ex}}]
\draw (0,0) coordinate (TL) rectangle (6,-4.5)  coordinate (BR)
    (TL) rectangle (3,-3)  coordinate (br)
    (TL) -- (br)
    (0.4,0.4-3) node[above right,font=\Huge]{$\mathbf{0}$};
 \draw[brace] (BR-|TL)  -- node[left=1.5ex]{$K$} (br-|TL);
 \draw[brace] (br-|TL)  -- node[left=1.5ex]{$I$} (TL);
 \draw[brace] (TL)  -- node[above=1.5ex]{$I$} (br|-TL);
 \draw[brace] (br|-TL)  -- node[above=1.5ex]{$J$} (BR|-TL);
\end{tikzpicture}

\bigskip

\begin{tikzpicture}[yscale=0.7,
    brace/.style={thick,decorate,
        decoration={calligraphic brace, amplitude=7pt,raise=0.5ex}}]
\draw (0,0) coordinate (TL) rectangle (4.5,-4.5)  coordinate (BR)
    (TL) rectangle (3,-3)  coordinate (br)
    (TL-|BR) rectangle (7.5,-4.5)  coordinate (BRR)
    (TL) -- (br)
    (0.4,0.4-3) node[above right,font=\Huge]{$\mathbf{0}$};
 \draw[brace] (BR-|TL)  -- node[left=1.5ex]{$J$} (br-|TL);
 \draw[brace] (br-|TL)  -- node[left=1.5ex]{$I$} (TL);
 \draw[brace] (TL)  -- node[above=1.5ex]{$I$} (br|-TL);
 \draw[brace] (br|-TL)  -- node[above=1.5ex]{$J$} (BR|-TL);
 \draw[brace] (BR|-TL)  -- node[above=1.5ex]{$K$} (BRR|-TL);
\end{tikzpicture}

\end{document}

在此处输入图片描述

相关内容