I would like to achieve something like this:
or optionally with a sharp kink:
Is that possible?
I stumbled across this post and some answers where tikz was used but wasn't able to adjust it to my need.
I would like to achieve something like this:
or optionally with a sharp kink:
Is that possible?
I stumbled across this post and some answers where tikz was used but wasn't able to adjust it to my need.
Welcome to TeX.se, please consider giving an MWE. This will help us a lot to answer your question accurately, also saves us time from going to our crystal balls ;-).
A starting point
\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}
to get:
Smooth corners:
\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}
to get:
Here is a solution with {pNiceMatrix} of nicematrix and TikZ to draw the arrow by using the TikZ nodes created by 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}
tikzmarkpackage (which has the advantage of working even if the marks are defined after their usage...) – Rmano Feb 19 '19 at 12:02:-). – Raaja_is_at_topanswers.xyz Feb 19 '19 at 12:54