答案1
歡迎來到 TeX.se,請考慮給予 MWE。這將有助於我們準確地回答您的問題,也節省了我們去水晶球的時間;-)
。
一個起點
\documentclass{article}
\usepackage{tikz}
\newcommand{\tikzmark}[1]{\tikz[overlay, remember picture] \coordinate (#1);}
%https://tex.stackexchange.com/questions/40535/matrix-with-arrows-and-labels
\begin{document}
\[
X = \qquad \bordermatrix{~ & ~ & ~ & ~ & ~
& ~ \cr
\tikzmark{varrowtop} ~ & 0 & 0 & 0 & 1 & 1\tikzmark{harrowright} \cr
~ & 0 & 0 & 1 & 1 & 1 \cr
~ & 0 & 0 & 1 & 1 & 0 \cr
~ & 0 & 0 & 1 & 1 & 0 \cr
\tikzmark{varrowbottom}~ & 0 & 0 & 0 & 0 & 0 \cr
}
\]
\tikz[overlay,remember picture] {
\draw[->] (varrowbottom) -- ([yshift=3ex]varrowtop) -- ([yshift=3ex]harrowright)
node[midway,above] {};
}
\end{document}
要得到:
光滑的邊角:
\documentclass{article}
\usepackage{tikz}
\newcommand{\tikzmark}[1]{\tikz[overlay, remember picture] \coordinate (#1);}
\begin{document}
\[
X = \qquad \bordermatrix{~ & ~ & ~ & ~ & ~
& ~ \cr
\tikzmark{varrowtop} ~ & 0 & 0 & 0 & 1 & 1\tikzmark{harrowright} \cr
~ & 0 & 0 & 1 & 1 & 1 \cr
~ & 0 & 0 & 1 & 1 & 0 \cr
~ & 0 & 0 & 1 & 1 & 0 \cr
\tikzmark{varrowbottom}~ & 0 & 0 & 0 & 0 & 0 \cr
}
\]
\tikz[overlay,remember picture] {
\draw[->, rounded corners] (varrowbottom) -- ([yshift=3ex]varrowtop) -- ([yshift=3ex]harrowright)
node[midway,above] {};
}
\end{document}
要得到:
答案2
這是一個使用{pNiceMatrix}
ofnicematrix
和 TikZ 的解決方案,透過使用 建立的 TikZ 節點來繪製箭頭nicematrix
。
\documentclass{article}
\usepackage{nicematrix,tikz}
\begin{document}
\[X =
\quad
\begin{pNiceMatrix}
0 & 0 & 0 & 1 & 1 \\
0 & 0 & 1 & 1 & 1 \\
0 & 0 & 1 & 1 & 0 \\
0 & 0 & 1 & 1 & 0 \\
0 & 0 & 0 & 0 & 0 \\
\CodeAfter
\tikz [-> , rounded corners = 2mm ]
\draw ([xshift=-2mm]last-|1) |- ([yshift=2mm]1-|last) ;
\end{pNiceMatrix}
\]
\end{document}