# tikzcd: how to position a node in the center of two other nodes

I'm trying to draw a commutative diagram that looks similar to the following:

...except that I want the two arrows $1 \times \tilde{I}$ and $\tilde{m}$ to be on the same line and the node $\tilde{G} \times \tilde{G}$ to be in the middle position. Here's my code (although it probably doesn't help):

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz-cd}
\begin{document}

\begin{tikzcd}
& & & \tilde{G} \arrow{dd}{p}\\
& & \tilde{G} \times \tilde{G} \arrow{ru}{\tilde{m}} & \\
\tilde{G} \arrow{rru}{1 \times \tilde{I}} \arrow[swap]{r}{p} & G
\arrow[swap]{r}{1_{G}\times I} & G \times G \arrow[swap]{r}{m} & G
\end{tikzcd}

\end{document}


Any suggestion? Thanks!

Similar to Zarko’s solution, but with a different approach; the main trick is again using a dummy row. Specifying between origins ensures a grid like disposition.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz-cd}
\begin{document}

\begin{tikzcd}[column sep={6em,between origins},row sep={2.5em,between origins}]
& & & \tilde{G} \arrow[ddd,"p"] \\
& & \tilde{G} \times \tilde{G} \arrow[ru,"\tilde{m}"] & \\
\\
\tilde{G} \arrow[rruu,"1\times\tilde{I}"] \arrow[r,swap,"p"] & G
\arrow[r,swap,"1_{G}\times I"] & G \times G \arrow[r,swap,"m"] & G
\end{tikzcd}

\end{document}


A different version, with the entry between the diagonal arrows in the middle. Here the trick is to use one column more, but backing up at its sides by half the width of columns.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz-cd}
\begin{document}

\begin{tikzcd}[column sep={6em,between origins},row sep={2.5em,between origins},nodes in empty cells]
& &[-3em] &[-3em] & \tilde{G} \arrow[dd,"p"] \\
& & \tilde{G} \times \tilde{G} \arrow[rru,"\tilde{m}"] \\
\tilde{G} \arrow[rru,"1\times\tilde{I}"] \arrow[r,swap,"p"] &
G \arrow[rr,swap,"1_{G}\times I"] & & G \times G \arrow[r,swap,"m"] & G
\end{tikzcd}

\end{document}


• Didn't the OP also want the \tilde G \times \tilde G midway between the two \tilde G entries? Probably need to be done manually since it will be outside the grid. Apr 19 '17 at 8:04
• Nice, I was trying to do it manually using the method in section 3.3 in the manual. It works, but this is easier. Apr 19 '17 at 8:33

try:

\documentclass[12pt]{standalone}
\usepackage{tikz-cd}

\begin{document}
\begin{tikzcd}[nodes in empty cells,
cells={nodes={minimum height=1.5em}}]
& & & \tilde{G} \arrow{ddd}{p}\\
& & \tilde{G} \times \tilde{G} \arrow{ru}{\tilde{m}} & \\%[5ex]
& & &  \\
\tilde{G} \arrow{rruu}{1 \times \tilde{I}} \arrow[swap]{r}{p} & G
\arrow[swap]{r}{1_{G}\times I} & G \times G \arrow[swap]{r}{m} & G
\end{tikzcd}
\end{document}


Addendum: less steep slope is obtained by reducing the row sep and inner sep of node:

\documentclass[12pt]{standalone}
\usepackage{tikz-cd}

\begin{document}
\begin{tikzcd}[nodes in empty cells,
row sep=-1ex,
cells={nodes={minimum height=1.5em, inner sep=2pt}}]
& & & \tilde{G} \arrow{ddd}{p}\\
& & \tilde{G} \times \tilde{G} \arrow{ru}{\tilde{m}} & \\%[5ex]
& & &  \\
\tilde{G} \arrow{rruu}{1 \times \tilde{I}} \arrow[swap]{r}{p} & G
\arrow[swap]{r}{1_{G}\times I} & G \times G \arrow[swap]{r}{m} & G
\end{tikzcd}
\end{document}