Drawing 3D Diagrams of Field Extensions

diagrams

Is there a package that do the same as xymatrix, but 3D? I'm asking that because it's the one I have the most experience with, but I'm open to learn others as well.

My objective is to do a drawing of field extensions, so I have to indicate each vertex with an extension of the rationals. I'll leave a image below to exemplify better what I'm trying to do.

Example of Diagram

Thanks in advance!

Best Answer

enter image description here

This is fairly easy to do using tikzcd.

\documentclass[border=20]{standalone}
\usepackage{tikz-cd}
\begin{document}
    \begin{tikzcd}
        X_1\arrow[rr, "f_{12}"]\arrow[dr, "f_{13}"]\arrow[dd, "h_1", swap] & & X_2 \arrow[dr, "f_{24}"]\arrow[dd, "h_2", near end] & \\
        & X_3 \arrow[rr, "f_{34}", crossing over, near start] & & X_4 \arrow[dd, "h_4"] \\
        Y_1 \arrow[rr, "g_{12}", near end]\arrow[dr, "g_{13}"] & & Y_2\arrow[dr, "g_{24}"] & \\
        & Y_3\arrow[rr, "g_{34}"] \arrow[from=uu, "h_3", crossing over, near start, swap] & & Y_4.
    \end{tikzcd}
\end{document}

Essentially this is a matrix of nodes (some of which are empty given by & & with nothing between). You then add arrows using the \arrow command. This has many optional arguments, the ones used here are

  • rr, dd, dr etc. which stand for 'right right', 'down down', 'down right' etc. Notice that two directions are needed as there is a blank node between each labelled node.
  • Some label in ""
  • swap put the label on the other side of the arrow
  • near start or near end put the label near the start or end of the arrow (default is the middle)
  • crossing over this arrow crosses on top of another, note that the order the arrows are drawn is important for this one, which is why we need the next command
  • from= the default draws the arrow from the current node in the given direction. This draws the arrow from the direction to the current node (i.e. in reverse). This is useful as it allows you to delay/move forward the drawing of arrows when the order is important.