3

I drawn a commutative diagram with this code

    \documentclass{article}
    \usepackage{tikz-cd}
    \usepackage{etoolbox}
    
    \begin{document}
    \begin{equation}
        \begin{tikzcd}[arrows]
            \node(P0) at (90:2.6cm){V};
            \node(P1) at (90+72:2.5cm){X} ;
            \node(P2) at (90+2*72:4cm){Y};
            \node(P3) at (90+3*72:4cm){W};
            \node(P4) at (90+4*72:2.5cm){U};
            \node(P5) at (270+5*72:4.6cm){Z};
            
            \arrow[from=P1,to=P0,"f_{1}"']
            \arrow[from=P0,to=P4,"f_{2}"']
            \arrow[from=P1,to=P4,"f_{3}"']
            \arrow[from=P1,to=P3,"f_{4}"]
            \arrow[from=P1,to=P2,"f_{6}"]
            \arrow[from=P4,to=P3,"f_{5}"]
            \arrow[from=P2,to=P5,"f_{7}"]
            \arrow[from=P5,to=P3,"f_{8}"]
        \end{tikzcd}
    \end{equation}
    \end{document}

but this picture is very big and I want sth smaller than this, such that Y and W be nearer to X and U. How could I fix it? enter image description here

5

The trick is to add some vertical space between rows 2 and 3. Almost no explicit lengths are needed.

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

\begin{document}

\[
\begin{tikzcd}
& V \arrow[dr,"f_2"] \\
X \arrow[ur,"f_1"] \arrow[rr,"f_3"] \arrow[drr,"f_4"] \arrow[d,"f_6"']
&& U \arrow[d,"f_5"] \\[2em]
Y \arrow[dr,"f_7"'] && W \\
& Z \arrow[ur,"f_8"']
\end{tikzcd}
\]

\end{document}

enter image description here

I changed some label positions, fix them to your liking. Experiment with the 2em and shorten it a bit to get a more "hexagon-like” shape.

0
2

I like very much...how alternative to the classic tikz-cd also xy package. I add my MWE with the distance of the rows @R of 2.5pc. Peraphs it could be similar to an hexagon :-) like the code of @egreg :-); you can adjiust the hexagon with rows and columns changing the parameters of the dots \xymatrix@R=...pc@C=....pc.

\documentclass[a4paper,12pt]{article}
\usepackage[all,cmtip]{xy}

\begin{document}

\xymatrix@R=2.5pc{
& V \ar[dr]^{f_2}& \\
X \ar[rr]^{f_3} \ar[ur]^{f_1} \ar[d]_{f_6} \ar[drr]^{f_4} &  & U\ar[d]^{f_5} \\
Y \ar[dr]_{f_7}&  & W\\
& Z \ar[ur]_{f_8}& 
}
\end{document}

enter image description here

PS: You have the straight lines zooming in....It is an optical effect of the output.

enter image description here

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.