열 항목의 가로 정렬을 변경하지 않고 다음 유형의 행렬을 어떻게 그릴 수 있습니까?
| c11 c12 c13 c14 c15 c16 c17 | c18 c19 | |
| c21 c22 c23 c24 | c25 c26 | c27 c28 c29 |
| c31 c32 c33 c34 | c35 c36 | c37 c38 c39 |
| | c41 c42 c43 | c44 c45 c46 c47 c48 c49 |
참고: 기본 행렬에는 세 가지 하위 행렬이 있습니다.
부분행렬 1: c18 ~ c19
부분행렬 2: c25 ~ c36
부분행렬 3: c41 ~ c43
여기서는 |
큰 괄호로 표시 되고 (
.)
이 문제는 다음과 다릅니다. 행렬 안의 행렬.
답변1
비고
당신의 설명이 맞기를 바랍니다.
Andrew Stacey의 특정 라이브러리 \tikzmark
와 calligraphy
TikZ 라이브러리를 사용하면 다음과 같은 결과를 얻을 수 있습니다. latex
올바른 위치를 얻으려면 여러 번 다시 실행해야 합니다 .
구현
\documentclass{standalone}
\usepackage{amsmath,tikz}
\usetikzlibrary{decorations,calligraphy}
\newcommand\tikzmark[2]{\tikz[remember picture,baseline=(#1.base)]{\node[inner sep=0pt] (#1) {#2};}}
\begin{document}
$
\begin{pmatrix}
c11 & c12 & c13 & c14 & c15 & c16 & c17 & (c18 & c19) \\
c12 & c22 & c23 & c24 & \tikzmark{c25}{$c25$} & \tikzmark{c26}{$c26$} & c27 & c28 & c29 \\
c13 & c32 & c33 & c34 & \tikzmark{c35}{$c35$} & \tikzmark{c36}{$c36$} & c37 & c38 & c39 \\
(c14 & c42 & c43) & c44 & c45 & c46 & c47 & c48 & c49 \\
\end{pmatrix}
$
\begin{tikzpicture}[remember picture,overlay]
\draw[thick,decorate,decoration={calligraphic straight parenthesis}] (c35.south west) -- (c25.north west);
\draw[thick,decorate,decoration={calligraphic straight parenthesis}] (c26.north east) -- (c36.south east);
\end{tikzpicture}
\end{document}
산출
라이브러리를 사용하면 다음과 같이 calc
오프셋을 추가하여 TikZ 버팀대에 대한 잘못된 간격을 보상할 수 있습니다..2em
\begin{tikzpicture}[remember picture,overlay]
\draw[thick,decorate,decoration={calligraphic straight parenthesis}] ($(c35.south west)+(-.2em,0)$) -- ($(c25.north west)+(-.2em,0)$);
\draw[thick,decorate,decoration={calligraphic straight parenthesis}] ($(c26.north east)+(.2em,0)$) -- ($(c36.south east)+(.2em,0)$);
\end{tikzpicture}
생산하는
Christopher Creutzig의 의견을 대신하여 tikzmark
행렬 내부에 괄호를 입력하지 않는 또 다른 솔루션(여전히 사용 중)이 있습니다.
\documentclass{standalone}
\usepackage{amsmath,tikz}
\usetikzlibrary{calc,decorations,calligraphy}
\newcommand\tikzmark[2]{\tikz[remember picture,baseline=(#1.base)]{\node[inner sep=0pt] (#1) {#2};}}
\begin{document}
$
\begin{pmatrix}
c11 & c12 & c13 & c14 & c15 & c16 & c17 & \tikzmark{c18}{$c18$} & \tikzmark{c19}{$c19$} \\
c12 & c22 & c23 & c24 & \tikzmark{c25}{$c25$} & \tikzmark{c26}{$c26$} & c27 & c28 & c29 \\
c13 & c32 & c33 & c34 & \tikzmark{c35}{$c35$} & \tikzmark{c36}{$c36$} & c37 & c38 & c39 \\
\tikzmark{c14}{$c14$} & c42 & \tikzmark{c43}{$c43$} & c44 & c45 & c46 & c47 & c48 & c49 \\
\end{pmatrix}
$
\begin{tikzpicture}[remember picture,overlay]
\draw[thick,decorate,decoration={calligraphic straight parenthesis}] ($(c35.south west)+(-.2em,0)$) -- ($(c25.north west)+(-.2em,0)$);
\draw[thick,decorate,decoration={calligraphic straight parenthesis}] ($(c26.north east)+(.2em,0)$) -- ($(c36.south east)+(.2em,0)$);
\node[left=.2em] at (c14) {$($};
\node[left=.2em] at (c18) {$($};
\node[right=.2em] at (c19) {$)$};
\node[right=.2em] at (c43) {$)$};
\end{tikzpicture}
\end{document}
답변2
다음 MWE는 적절한 크기로 대괄호(..)를 삽입합니다.
\documentclass{article}
\begin{document}
\[
\left(\begin{array}{@{\hspace*{1ex}}*{9}{c}@{\hspace*{1ex}}}
c_{11} & c_{12} & c_{13} & c_{14} & c_{15} & c_{16} & c_{17} & \llap{$\bigl($}c_{18} & c_{19}\rlap{$\bigr)$} \\
c_{21} & c_{22} & c_{23} & c_{24} & \llap{\raisebox{\dimexpr\ht\strutbox-\height}[0pt][0pt]{$\biggl($}}c_{25} &
c_{26}\rlap{\raisebox{\dimexpr\ht\strutbox-\height}[0pt][0pt]{$\biggr)$}} & c_{27} & c_{28} & c_{29} \\
c_{31} & c_{32} & c_{33} & c_{34} & c_{35} & c_{36} & c_{37} & c_{38} & c_{39} \\
\llap{$\bigl($}c_{41} & c_{42} & c_{43}\rlap{$\bigr)$} & c_{44} & c_{45} & c_{46} & c_{47} & c_{48} & c_{49}
\end{array}\right)
\]
\end{document}
겹침을 사용하면 가로 간격을 유지할 수 있으며, 괄호는 \big
* 해당 항목을 사용하여 크기가 조정됩니다.
답변3
{pNiceMatrix}
of nicematrix
및 해당 내장 명령을 사용 합니다 \SubMatrix
.
\documentclass{article}
\usepackage{nicematrix}
\begin{document}
$\begin{pNiceMatrix}[margin]
c11 & c12 & c13 & c14 & c15 & c16 & c17 & c18 & c19 \\
c12 & c22 & c23 & c24 & c25 & c26 & c27 & c28 & c29 \\
c13 & c32 & c33 & c34 & c35 & c36 & c37 & c38 & c39 \\
c14 & c42 & c44 & c45 & c46 & c47 & c48 & c48 & c49
\CodeAfter
\SubMatrix({1-7}{1-8})
\SubMatrix({2-5}{3-6})
\SubMatrix({4-1}{4-3})
\end{pNiceMatrix}$
\end{document}