6

I want to draw the attached diagram of a modified cube for a tex document using tikz-cd package, but modifying from the command for a cube does not seem to work here.

want

Any suggestions appreciated.

The code I tried for a cube

\documentclass[12pt]{article}
\usepackage{tikz-cd}
\begin{document}
\[
    \begin{tikzcd}[row sep=1.5em, column sep = 1.5em]
    N \arrow[rr] \arrow[dr,dashed, swap,"f"] \arrow[dd,swap] &&
    N_s \arrow[dd] \arrow[dr,"f_1"] \\
    & M \arrow[rr] &&
    M_s \arrow[dd,"h"] \\
    N_{1+s} \arrow[rr,] \arrow[dr, "f_2"] && N_{s(1+s)} \arrow[dr] \\
    & M_{1+s} \arrow[rr] \arrow[uu]&& M_{s(1+s)}
    \end{tikzcd}
\]
\end{document}

which gave me

cube

The code I tried for my modified cube

\documentclass[12pt]{article}
\usepackage{tikz-cd}
\begin{document}
\[
\begin{tikzcd}[row sep=1.5em, column sep = 1.5em]
N \arrow[rr] \arrow[dr,dashed, swap,"f"] \arrow[dd,swap] &&
N_s \arrow[dd, "y"] \arrow[dr,"f_1"] \\
& M \arrow[rr] &&
M_s \arrow[dd,"h"] \\
N_{1+s} \arrow[rr,] \arrow[dr, "f_2"] && X \arrow[rr,"x"] && N_{s(1+s)} \arrow[dl] \\
& M_{1+s} \arrow[rr] \arrow[uu]&& M_{s(1+s)}
\end{tikzcd}
\]
\end{document}

Which is not producing the desired diagram

try

  • Welcome to TeX.SX. Questions about how to draw specific graphics that just post an image of the desired result are really not reasonable questions to ask on the site. Please post a minimal compilable document showing that you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document. – Stefan Pinnow Jun 1 '18 at 16:04
  • Apologies, I was unaware of the required format. Hope the edited version suffices. – mm_90 Jun 1 '18 at 16:28
  • You need to push some more of the nodes further over to the right with some more &s.. – Thruston Jun 1 '18 at 16:59
  • 1
    Thankyou @thruston. Your tip helped me – mm_90 Jun 1 '18 at 17:18
6

The following code worked for me

\documentclass[12pt]{article}
\usepackage{tikz-cd}
\begin{document}
    \[
   \begin{tikzcd}[row sep=1.5em, column sep = 1.5em]
   P \arrow[rrrr] \arrow[dr,dashed, swap,"f", two heads] \arrow[dd,swap] &&&&
   A_j[t]^n \arrow[dd] \arrow[dr,"f_1"] \\
   & I \arrow[rrrr] &&&&
   I_j \arrow[dd,"h"] \\
   (A_{1+j}[t])^n \arrow[rr] \arrow[dr, "f_2"] && (A_{j(1+j)}[t])^n        
   \arrow[rr,"\sim", dashed ] && A_{j(1+j)}[t]^n \arrow[dr] \\
   & I_{1+j} \arrow[rrrr] \arrow[uu]&&& &I_{j(1+j)}
  \end{tikzcd}
\] 
\end{document}

success

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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