# Commutative function diagrams in LaTeX

• LaTeX
• topsquark
In summary, this person downloaded and used a free editor to write the code, and then took a screenshot and edited it in another program.
topsquark
Gold Member
MHB
TL;DR Summary
How can I make this diagram a bit nicer? And is there any way to do a triangular diagram?
I know that TikZ is probably the best way to do this but most Forums don't use it. I can make a rectangular diagram, but it's a bit clunky:
Say I have the commutative function diagram:
##\begin{array}{ccccc} ~ & ~ & f & ~ & ~ \\ ~ & A & \longrightarrow & B & ~ \\ g & \downarrow & ~ & \downarrow & h \\ ~ & C & \longrightarrow & D & ~ \\ ~ & ~ & k & ~ & ~ \end{array}##

It isn't bad but is there a way to do this without using an array? And is there any way to do a triangular diagram? ie. A to B, A to C, and B to C?

Thanks!

-Dan

I managed to get this, but it was certainly not the best solution.

\begin{aligned}
\downarrow{\chi}&&\downarrow{\chi}\\
\end{aligned}

\begin{aligned}
\downarrow{\chi}&&\downarrow{\chi}\\
\end{aligned}

topsquark
fresh_42 said:
I managed to get this, but it was certainly not the best solution.

\begin{aligned}
\downarrow{\chi}&&\downarrow{\chi}\\
\end{aligned}

\begin{aligned}
\downarrow{\chi}&&\downarrow{\chi}\\
\end{aligned}
\downarrow{\chi} helps. I didn't know you could do that. Thanks!

Is there a way to put a ##\chi## to the right of the arrow, too?

-Dan

topsquark said:
Is there a way to put a χ to the right of the arrow, too?
Isn't it already to the right?
But ##{\chi}\downarrow ## ##{\chi} \downarrow ## works, too.

topsquark
Ever since I taught in High School I've gotten my left and right screwed up!

Thanks!

-Dan

fresh_42
topsquark said:
I know that TikZ is probably the best way to do this
Then do it in TikZ in a WYSIWYG ## TeX ## editor and paste an image: if you don't have a ## TeX ## editor installed then use the online editor Overleaf: https://www.overleaf.com/

topsquark
pbuk said:
Then do it in TikZ in a WYSIWYG ## TeX ## editor and paste an image: if you don't have a ## TeX ## editor installed then use the online editor Overleaf: https://www.overleaf.com/
Well, as it happens, I have no money. But anyways, there are free editors out there. Actually, once I got the feel of the code it was easier to simply type it out rather than use the editor.

Thanks!

-Dan

topsquark said:
Well, as it happens, I have no money. But anyways, there are free editors out there. Actually, once I got the feel of the code it was easier to simply type it out rather than use the editor.
View attachment 314144

Thanks!

-Dan

To get an image, I take a screenshot and edit it with mspaint.exe.

This is really a low-budget scenario. I wrote a lot in this set-up.

Last edited:
topsquark

## 1. What are commutative function diagrams in LaTeX?

Commutative function diagrams in LaTeX are graphical representations of mathematical functions that show the relationships between input and output values. They are useful for illustrating concepts in algebra, category theory, and other areas of mathematics.

## 2. How do I create a commutative function diagram in LaTeX?

To create a commutative function diagram in LaTeX, you can use the tikz-cd package. This package provides a simple and intuitive syntax for drawing diagrams, including commutative function diagrams. You can also use the amscd package, which offers similar functionality.

## 3. What is the syntax for drawing a commutative function diagram in LaTeX?

The syntax for drawing a commutative function diagram in LaTeX depends on the package you are using. With tikz-cd, you can define the elements of your diagram using ampersands (&) and arrows (->). With amscd, you can use the \begin{CD} and \end{CD} commands, along with arrows and labels.

## 4. Can I customize the appearance of my commutative function diagram in LaTeX?

Yes, both tikz-cd and amscd offer options for customizing the appearance of your commutative function diagram. You can change the size, color, and style of the arrows, labels, and nodes in your diagram to suit your needs.

## 5. Are there any other packages for creating commutative function diagrams in LaTeX?

Yes, there are other packages such as xypic and xy that can also be used to create commutative function diagrams in LaTeX. However, tikz-cd and amscd are the most commonly used and provide the most user-friendly syntax for creating these diagrams.

Replies
4
Views
1K
Replies
7
Views
2K
Replies
1
Views
2K
Replies
1
Views
3K
Replies
9
Views
2K
Replies
3
Views
535
Replies
1
Views
5K
Replies
1
Views
2K
Replies
3
Views
2K
Replies
6
Views
1K