Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Using tikz 3.0.0, I want to create the following diagram

commutative diagram1

which I have so far achieved by manually positioning the “G” in the last row:

\begin{center}
    \begin{tikzpicture}
        \node (A) {$(G×G)×G$};
        \node (B) [right=of A] {$G×(G×G)$};
        \node (C) [below left=of A] {$G×G$};
        \node (D) [below right=of B] {$G×G$};
        \node (E) at (1.5,-3) {$G$};
        \draw[double equal sign distance] (A) -- node[above]{$\sim$} (B);

        \draw[->] (A) -- node[above left]{\small $μ × \id$} (C);
        \draw[->] (B) -- node[above right]{\small $\id × μ$} (D);
        \draw[->] (C) -- node[above]{\small $μ$} (E);
        \draw[->] (D) -- node[above]{\small $μ$} (E);
    \end{tikzpicture}
\end{center}

Can I do this without maually setting “G” at (1.5,-3) using positioning?

On a related note, I tried to do the same with {tikz-cd} and got: commutative diagram2 using the following code:

\begin{displaymath}
    \begin{tikzcd}

        & (G × G) × G \ar[dl, "μ × \id"] \ar[rr, equal, "\sim"] & & G × (G × G) \ar[dr, "\id × μ"] & \\

        G × G \ar[drr, "μ"] & & & & G × G \ar[dll, "μ"] \\

         & & G & &

    \end{tikzcd}

\end{displaymath}

Can I somehow achieve a picture without an unnecessarily stretched equal sign, that is a picture more like the one above, but using {tikz-cd}?

I’m using TeXLive, version 2013.

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

This one possible solution. However, my tikz is not 3.0.0 so I need to change some of your math code \mu and times. Also this solution uses double for equal sign, not double equal sign distance as the OP used. IMHO, the principle applies if the related math quantities is changed to those applicable in tikz 3.0.0. The bottom G position is determined via the code below where given (A) and (B), their center is determined automatically. That is the (1.5,-3) is removed.

\node[yshift=-3cm] (E) at ($(A)!0.5!(B)$) {$G$};  %change yshift for one's need.

enter image description here

Code

\documentclass[]{article}
\usepackage[paper size={15cm,6cm}]{geometry}
\usepackage{amsmath,pgfplots,tikz}
\usetikzlibrary{arrows,calc,positioning}
%\usetikzlibrary{decorations.pathmorphing,patterns}

\begin{document}
\begin{center}
    \begin{tikzpicture}
        \node (A) {$(G\times G)\times G$};
        \node (B) [right=1cm of A] {$G\times (G\times G)$};
        \node (C) [below left=of A] {$G\times G$};
        \node (D) [below right=of B] {$G\times G$};
%        \node (E) at (1.5,-3) {$G$};
\node[yshift=-3cm] (E) at ($(A)!0.5!(B)$) {$G$};
        \draw[double] (A) -- node[above]{$\sim$} (B);

        \draw[->] (A) -- node[above left]{\small $\mu \times id$} (C);
        \draw[->] (B) -- node[above right]{\small $id \times \mu$} (D);
        \draw[->] (C) -- node[above]{\small $\mu$} (E);
        \draw[->] (D) -- node[above]{\small $\mu$} (E);
    \end{tikzpicture}
\end{center}

\end{document}
share|improve this answer
    
Many thanks for the solution! The matrix nature of {tikz-cd} makes such an approach impossible, right? –  k.stm Jun 8 at 10:38
1  
For tikzcd column sep=xx is a global setting for the entire matrix node. So, yes, tikz is flexible. –  Jesse Jun 8 at 11:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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