2

Consider the following tikz code

\begin{tikzcd}[column sep=20pt]
A \arrow{rr}\arrow{dr} && B && C \arrow{ll}\\
& D \arrow{dr}\arrow{ur}\\
&& E \arrow{urur}
\end{tikzcd}

The problem I am facing is that the arrows of D to B and E to C are not parallel (the arrow from B to C being too short). I think the problem comes from the fact the node C is not specified as belonging to a fourth column.

Hence, for example, A is in column 0 (no &), D is is column 1 (&), B and E are in column 2 (&&), but so is C. Yet, if I am trying to specify a column 3 (&&&), I am getting an error message. What am I doing wrong?

(Alternatively, if I could just manually change the length of the arrow from B to C, that will do too!)

2 Answers 2

1

If you set the column sep to be between origins it looks good I think.

enter image description here

\documentclass[border=5mm]{standalone}
\usepackage{tikz-cd}
\begin{document}

\begin{tikzcd}[column sep={35pt,between origins}]
A \arrow{rr}\arrow{dr} && B && C \arrow{ll}\\
& D \arrow{dr}\arrow{ur}\\
&& E \arrow{urur}
\end{tikzcd}

\end{document}
0

With TikZ:

enter image description here

\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\def\a{2}
\path
(0,0)     node (B) {$B$} 
+(0:\a)   node (C) {$C$}
+(180:\a) node (A) {$A$} 
+(-90:\a) node (E) {$E$}
(A)--(E)  node[pos=.5] (D) {$D$};

\draw[->] (A)--(B); \draw[->] (C)--(B);
\draw[->] (A)--(D); \draw[->] (D)--(E);
\draw[->] (E)--(C); \draw[->] (D)--(B);
\end{tikzpicture}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .