4

I would like to achieve something like this:

enter image description here

or optionally with a sharp kink:

enter image description here

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.

6

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:

enter image description here

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:

enter image description here

  • 2
    Nice, but notice that there is a tikzmark package (which has the advantage of working even if the marks are defined after their usage...) – Rmano Feb 19 at 12:02
  • 1
    @Rmano Thanks for the remark. Till now, I did not knew its existence. I will take a note of it and go through it when I have some time. And, ensure it gets reflected in my future answers :-). – Raaja Feb 19 at 12:54

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.