# Symmetric triangle inTikZ-cd

I would like to draw a commutative triangle with tikzcd where the entries have different sizes.

 $\begin{tikzcd}[column sep=15pt] \mathcal{C} \ar{rr} \ar{dr} & & S(\tau) \ar{dl} \\ & \mathsf{Set} & \end{tikzcd}$


This produces a slight asymmetry (the arrow on the right is more slanted, and the middle entry is not in the middle):

One solution is to use the following tikzcd-option:

 cells={nodes={align=center,text width=\widthof{$S(\tau)$}}}


The output looks as follows:

But now the arrow doesn't start at the left entry. How to make this happen?

• Off topic: in xy it is @! or @!0. Mar 20, 2015 at 1:43

## Update

This feature is mentioned in the TikZ manual, namely III.20.3.2.

\begin{tikzcd}[column sep={1cm,between origins}]
\mathcal{C}\ar{rr}\ar{dr} && S(\tau,..............)\ar{dl} \\
& \mathsf{Set}
\end{tikzcd}


The column-separating symbol & accepts an optional argument. Just like \6pt] does, &[6] adds the current col sep by 6...pt by default. \documentclass[tikz,border=9]{standalone} \usepackage{tikz-cd} \begin{document} \begin{tikzcd}[column sep=15pt] \mathcal{C}\ar{rr}\ar{dr} &[6]& S(\tau)\ar{dl} \\ & \mathsf{Set} \end{tikzcd} \end{document}  • Thank you! It works, but I don't understand why. Could you explain what you mean by "adds the current col sep by default" and why it gives the desired result? Mar 20, 2015 at 7:28 • @MartinBrandenburg Symbol 1 just changed the separation in between the columns for the two left columns. 6pt instead of the 15pt which are your default. The wider triangle looks more symmetric, but it isn't. Mar 20, 2015 at 7:32 • @LaRiFaRi I thought it is 6+15pt just like \\[6pt] add additional spaces. Any way, @Martin Brandenburg you can check out the matrix library of TikZ, on which tikz-cd bases. Mar 20, 2015 at 7:49 • @Symbol1 You are right. It does. Btw.: Thanks for that cool feature. I have seen a lot of posts here, where the answer was "change globally or use many many &&& in order to get different column seps in your graph". Is that feature new? First time I am seeing it. Mar 20, 2015 at 8:06 • @LaRiFaRi Not sure. Maybe I saw this feature from something about pgfplotstable. Mar 20, 2015 at 9:03 You can add [start anchor={[xshift=-5pt]}] to shift the starting point of your arrow. MWE \documentclass{article} \usepackage{tikz-cd} \begin{document} \[ \begin{tikzcd}[column sep=15pt,cells={nodes={align=center,text width=\widthof{S(\tau)}}}] \mathcal{C} \ar[start anchor={[xshift=-5pt]}]{rr} \ar{dr} & & S(\tau) \ar{dl} \\ & \mathsf{Set} & \end{tikzcd}
\end{document}


• I've added that possibility here, too... Mar 20, 2015 at 9:29

For a real symmetry speaking of the arrows, you will have to increase the width and the hight of the upper left node.

% arara: pdflatex

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

\begin{document}
$\begin{tikzcd}[column sep=15pt] \phantom{S(\tau)}\mathllap{\mathcal{C}}\ar{rr}\ar{dr} & & S(\tau)\ar{dl} \\ & \textsf{Set} \end{tikzcd}$
\end{document}


As you can see, the diagonal arrows are starting and ending in the very same place (but mirrored).

I propose a solution with the psmatrix environment:

\documentclass[pdf]{article}
\usepackage{pst-node}

\begin{document}

$\psset{arrows=->, arrowinset=0.25, linewidth=0.6pt, nodesep=2pt, rowsep=0.9cm, colsep=0.7cm} \begin{psmatrix} \ \mathcal C & & S(\tau) \\% & \mathsf {Set} %%% \ncline[nodesepB=1.5pt]{1,1}{1,3} \ncline{1,1}{2,2} \ncline[nodesepA=1pt]{1,3}{2,2} \end{psmatrix}$
\end{document}