14

I have created the following diagram using tikz-cd

\begin{tikzcd}
S_E \arrow[dddd, bend right, two heads] \arrow[ddrrr, bend left, two heads, tail] & & & \\ 
&   E \arrow[dd, dash,swap, "G"] \arrow[dr, dash, "\langle\sigma\rangle"]   &   & \\ 
&   &   L \arrow[dl, dash] &    S_L\arrow[d, phantom, "{\cap}"]^\prime \\ 
&   K   & & S_L \\
S_K &   &   &  
\end{tikzcd}

enter image description here

I would like the first and last columns and rows of the diagram to be narrower than the other columns and rows, so that, for example, the S_E appears directly above and to the left of E with only a small gap, but keeping the dimensions of the "inner" diagram unchanged.

Is there an easy way to do this with tikz-cd?

2 Answers 2

21

As I have just learned from Symbol 1, you may modify each column or row separator manually. Just do like the following:

% arara: pdflatex

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

\begin{document}
\begin{tikzcd}
    S_E \arrow[dddd, bend right, two heads] \arrow[ddrrr, bend left, two heads, tail] &[-25pt] & &[-25pt] \\[-15pt] 
     & E \arrow[dd, dash,swap, "G"] \arrow[dr, dash, "\langle\sigma\rangle"] & & \\ 
     & &   L \arrow[dl, dash] & S_L\arrow[d, phantom, "{\cap}"]^\prime \\ 
     & K   & & S_L \\[-15pt]
    S_K & & &  
\end{tikzcd}
\end{document}

enter image description here

5

You can use all the power and flexibility of TikZ directly, but with the style from tikz-cd:

\documentclass{article}
\usepackage{tikz-cd}
\usetikzlibrary{positioning,calc}
\usepackage{amsmath}

\begin{document}

With \texttt{tikz-cd}:
\[
\begin{tikzcd}
S_E
  \arrow[dddd, bend right, two heads] 
  \arrow[ddrrr, bend left, two heads, tail] & & & \\ 
 &  E \arrow[dd, dash,swap, "G"] \arrow[dr, dash, "\langle\sigma\rangle"]   &   & \\ 
&   &   L \arrow[dl, dash] &    S_L\arrow[d, phantom, "{\cap}"]^\prime \\ 
&   K   & & S_L \\
S_K &   &   &
\end{tikzcd}
\]
With \texttt{tikz} using the \texttt{tikz-cd} style:
\[
\begin{tikzpicture}[commutative diagrams/every diagram]
\matrix[
  matrix of math nodes,
  name=mat, 
  commutative diagrams/every cell
] 
{
E \\
& L \\
K \\
};
\path[commutative diagrams/.cd, every arrow, every label]
  (mat-1-1) edge[commutative diagrams/dash,swap,"$G$"] (mat-3-1)
  (mat-3-1) edge[commutative diagrams/dash] (mat-2-2)
  (mat-2-2) edge[commutative diagrams/dash,swap,"$\langle\sigma\rangle$"] (mat-1-1);
\node[above left= 5pt and 5pt of mat-1-1] 
  (se)
  {$S_E$};  
\node[below left= 5pt and 5pt of mat-3-1] 
  (sk)
  {$S_K$};  
\node[right= 5pt and 5pt of mat-2-2] 
  (spl)
  {$S'_L$};
\node
  (sl)
  at (spl|-mat-3-1)
  {$S_L$};
\path[commutative diagrams/.cd, every arrow, every label]
  (se) edge[bend right,commutative diagrams/two heads] (sk);    
\path[commutative diagrams/.cd, every arrow, every label]
  (se) edge[bend left,commutative diagrams/two heads,commutative diagrams/tail] (spl);
\node
  at ( $ (spl)!0.5!(sl) $ )
  {$\cap$};
\end{tikzpicture}
\]

\end{document}

enter image description here

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .