# "Triangular" layout in tikz-cd

With the following snippet:

\begin{tikzcd}[row sep=1.5cm, every arrow/.append style = {dash}]
&  H_5 = S_3 & \\
H_1 \arrow[ur] & H_2 \arrow[u] & H_3 \arrow[ul] & H_4 \arrow[ull] \\
& \arrow[ul] \arrow[u] \arrow[ur] \arrow[urr] H_0 &
\end{tikzcd}


I get:

I'd like the top and bottom entries (i.e. $H_0$ and $H_5 = S_3$) to be positioned so that they are equidistant to $H_2$ and $H_3$ below them, rather than being shifted over to the left. I thought that using one fewer column in the top and bottom row would do the trick, but evidently not.

What is the right way to achieve this?

• Maybe adding more columns and put H5=S3 between H2 and H3? Jun 20 at 20:40
• I changed 2.5em to 3em, which seems slightly better. Jun 20 at 20:56

## 1 Answer

Add a column, but make some space between columns smaller to cover your tracks.

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}

\begin{document}

$\begin{tikzcd}[row sep=1.5cm, arrows=dash] &&[-3em] H_5 = S_3 &[-3em] \\ H_1 \arrow[urr] & H_2 \arrow[ur] && H_3 \arrow[ul] & H_4 \arrow[ull] \\ && H_0 \arrow[ull] \arrow[ul] \arrow[ur] \arrow[urr] \end{tikzcd}$

\end{document}


Note the simpler way to get all arrows to be dashes.

• Do you have a reference, why ur and Co. are allowed as optional arguments in \arrow[ur]? I was not able to locate the specific case of direction options in the manual (ftp.rrzn.uni-hannover.de/pub/mirror/tex-archive/graphics/pgf/…), only the general \arrow[options]{<arrow end tip>}. In particular, I am interested whether the degree of the edge is dependent on the target node position. Jun 20 at 22:18
• @user7427029 The manual of tikz-cd texdoc.org/serve/tikz-cd/0 Jun 20 at 22:23
• Ouch. Thanks!!! Jun 20 at 23:44