0

I am trying to draw the commutative graph below in LaTeX. I have looked up and know the most effective way to do this is to load \usepackage{tikz-cd} but I can't figure how to write the code. I would greatly appreciate any help.

enter image description here

egreg
  • 1,121,712
Elise
  • 25
  • 1
    Isn't this just an adaptation of the example at the top if page 3 in the tikz-cd manual. Especially the bend left etc – daleif Dec 04 '20 at 11:57
  • Yeah, I have looked at that I am struggling to get the arrows x and y used in the example in the manual to go to different objects. – Elise Dec 04 '20 at 12:04
  • 1
    Note that you are more likely to get help if you provide the code you have so far (as a full but minimal example that others can try as is) – daleif Dec 04 '20 at 12:14
  • @Elise please see the answer below - I have not done the labeling -- hope you can complete that part – js bibra Dec 04 '20 at 13:20
  • @Elise would you like to accept the answer and /or upvote – js bibra Dec 04 '20 at 15:57

1 Answers1

0

enter image description here

\documentclass[10pt,a4paper]{article}

\usepackage{tikz-cd} \begin{document} \begin{tikzcd} & A \arrow[d,red,] \arrow[dl, bend right] \arrow[dr, bend left] & \ X & P \arrow[r, green]\arrow[l, green] & Y \end{tikzcd} \end{document}

edit for label

enter image description here

\documentclass[10pt,a4paper]{article}

\usepackage{tikz-cd} \begin{document} \begin{tikzcd} & A \arrow[d,red,] \arrow[dl, bend right] \arrow[dr, bend left] & \ X & P \arrow[r, green, "x1"']\arrow[l, green, "x2"] & Y \end{tikzcd} \end{document}

edit for scaling

enter image description here

\documentclass[10pt,a4paper]{article}

\usepackage{tikz-cd} \usepackage{adjustbox}

\begin{document} \adjustbox{scale=4, center}{ \begin{tikzcd}[sep=huge] & A \arrow[d,red,] \arrow[dl, bend right] \arrow[dr, bend left] & \ X & P \arrow[r, green, "x1"']\arrow[l, green, "x2"] & Y \end{tikzcd} } \end{document}

js bibra
  • 21,280
  • Hiya, Thank you for all your help. I was able to label the graph. I just have 2 questions if you don't mind answering them. Is there a command to get the labels on the axis on the same side of the arrow. For example when I labelled the x_1 and x_2 arrows I got one above the arrow and one below the arrow. I used the command "x_1" to label them. Secondly, is there any command I can use to make the diagram bigger? Thank you. – Elise Dec 04 '20 at 13:48
  • @Elise please see the edit above – js bibra Dec 04 '20 at 13:54
  • for the scaling part you can refer here -- https://tex.stackexchange.com/a/270285/197451 – js bibra Dec 04 '20 at 13:57
  • Got it, once again thank you very much for your help. – Elise Dec 04 '20 at 13:59
  • @Elise using adjustbox to scale as defined here -- https://tex.stackexchange.com/a/325309/197451 – js bibra Dec 04 '20 at 14:00