4

I am trying to get arrows to enter and leave different parts of a node in a particular diagram I'm writing in tikzcd. So far I have the following:

\begin{tikzcd} 
\makebox[1em][r]{$Long text 1$} \arrow[rr] \arrow[d] &    & 
\makebox[1em][l]{$Long text 2$} \arrow[d] \\
{A} \arrow[r] & {B} \arrow[r] & C
\end{tikzcd}

Which produces the following result: enter image description here

So essentially I would like the arrow from "Long text 1" to "A" to start at the L and the arrow from "Long text 2" to "C" to start at the 2, while not changing the arrow going from "Long text 1" to "Long text 2".

Any help would be massively appreciated. Thanks alot!

4

You can define start style that use to path to set the starting anchor.

\documentclass[tikz,border=7pt]{standalone}
\usepackage{mathtools}
\usetikzlibrary{cd}
\tikzstyle{start}=[to path={(\tikztostart.#1) -- (\tikztotarget)}]
\begin{document}
  \begin{tikzcd}[]
    \text{Long text 1} \arrow[rr] \arrow[d,start=205]
                  &               & \text{Long text 2} \arrow[d,start=335] \\
    {A} \arrow[r] & {B} \arrow[r] & C
  \end{tikzcd}
\end{document}

enter image description here

1
  • Thanks so much for your help, would there be any way to make the middle arrow shorter as well, so that it is still a nice rectangle?
    – silky
    Apr 14 '19 at 16:06
2

Welcome to TeX-SE! You can do that using this answer. I'm not sure, though, I personally would go for it.

\documentclass{article}
\usepackage{tikz-cd}
\usepackage{amsmath}
\begin{document}  
\[  \begin{tikzcd}[execute at end picture={
    \draw[->] ([xshift=-4em]\tikzcdmatrixname-1-1.south) -- (\tikzcdmatrixname-2-1);
    \draw[->] ([xshift=4em]\tikzcdmatrixname-1-3.south) -- (\tikzcdmatrixname-2-3);
      }]
\makebox[1em][r]{Long text 1} \arrow[rr]  &    & 
\makebox[1em][l]{Long text 2} \\
{A} \arrow[r] & {B} \arrow[r] & C
  \end{tikzcd}\]
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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